Vodafone Test Suite
Dependencies: mbed-rtos mbed HTTPClient VodafoneUSBModem
VodafoneTestCase.h@4:1f8e079924ba, 2012-08-23 (annotated)
- Committer:
- ashleymills
- Date:
- Thu Aug 23 15:41:20 2012 +0000
- Revision:
- 4:1f8e079924ba
- Parent:
- 3:28336c2e94e4
- Child:
- 8:6c30647f75d7
Added setup and teardown code
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ashleymills | 2:ea883307d02f | 1 | #pragma once |
ashleymills | 2:ea883307d02f | 2 | #include "VodafoneUSBModem.h" |
ashleymills | 2:ea883307d02f | 3 | #include "LogHeader.h" |
ashleymills | 2:ea883307d02f | 4 | class VodafoneTestCase { |
ashleymills | 2:ea883307d02f | 5 | public: |
ashleymills | 2:ea883307d02f | 6 | VodafoneTestCase(VodafoneUSBModem *m) : _modem(m) { |
ashleymills | 4:1f8e079924ba | 7 | _lastRunTime = 0; |
ashleymills | 3:28336c2e94e4 | 8 | _lastRunOutcome = false; |
ashleymills | 2:ea883307d02f | 9 | } |
ashleymills | 2:ea883307d02f | 10 | |
ashleymills | 4:1f8e079924ba | 11 | bool run() { |
ashleymills | 4:1f8e079924ba | 12 | setupTest(); |
ashleymills | 4:1f8e079924ba | 13 | return endTest(runTest()); |
ashleymills | 4:1f8e079924ba | 14 | } |
ashleymills | 4:1f8e079924ba | 15 | |
ashleymills | 4:1f8e079924ba | 16 | virtual void setupTest() { |
ashleymills | 4:1f8e079924ba | 17 | } |
ashleymills | 4:1f8e079924ba | 18 | |
ashleymills | 4:1f8e079924ba | 19 | virtual bool runTest() { |
ashleymills | 4:1f8e079924ba | 20 | LOG("Base class runTest called!"); |
ashleymills | 4:1f8e079924ba | 21 | return true; |
ashleymills | 4:1f8e079924ba | 22 | } |
ashleymills | 4:1f8e079924ba | 23 | |
ashleymills | 4:1f8e079924ba | 24 | virtual bool endTest(bool status) { |
ashleymills | 4:1f8e079924ba | 25 | _lastRunOutcome = status; |
ashleymills | 4:1f8e079924ba | 26 | return status; |
ashleymills | 4:1f8e079924ba | 27 | } |
ashleymills | 2:ea883307d02f | 28 | |
ashleymills | 2:ea883307d02f | 29 | protected: |
ashleymills | 2:ea883307d02f | 30 | VodafoneUSBModem *_modem; |
ashleymills | 3:28336c2e94e4 | 31 | time_t _lastRunTime; |
ashleymills | 3:28336c2e94e4 | 32 | bool _lastRunOutcome; |
ashleymills | 1:0d63e4db8503 | 33 | }; |