Vodafone Test Suite
Dependencies: mbed-rtos mbed HTTPClient VodafoneUSBModem
VodafoneTestCase.h@34:d9e45aad85f2, 2012-09-13 (annotated)
- Committer:
- ashleymills
- Date:
- Thu Sep 13 10:14:49 2012 +0000
- Revision:
- 34:d9e45aad85f2
- Parent:
- 33:16126e029d58
- Child:
- 36:dd730ff4962e
Refactoring.
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" |
nherriot | 28:c630a04a7198 | 4 | |
nherriot | 28:c630a04a7198 | 5 | const char myMessage[] = "myMessage is golden"; |
nherriot | 31:9231acdde9ff | 6 | //const char testPhoneNumber[] = "+447717275049"; |
nherriot | 28:c630a04a7198 | 7 | const char testPhoneNumber[] = "+447785666088"; |
nherriot | 28:c630a04a7198 | 8 | const char testMessage[] = "this is a test message !"; |
nherriot | 31:9231acdde9ff | 9 | const char alphabetNumbersMessage[] = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ"; |
nherriot | 28:c630a04a7198 | 10 | const char allCharsMessage[] = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()!£$%&*,.':;"; |
nherriot | 31:9231acdde9ff | 11 | const char irregularMessage[] = "/:[]{}()!£$%&*,.';"; |
nherriot | 28:c630a04a7198 | 12 | |
nherriot | 28:c630a04a7198 | 13 | |
ashleymills | 2:ea883307d02f | 14 | class VodafoneTestCase { |
ashleymills | 2:ea883307d02f | 15 | public: |
ashleymills | 33:16126e029d58 | 16 | VodafoneTestCase(VodafoneUSBModem *m) : _modem(m) , _lastRunTime(0), _lastRunOutcome(false) { |
ashleymills | 2:ea883307d02f | 17 | } |
ashleymills | 2:ea883307d02f | 18 | |
ashleymills | 4:1f8e079924ba | 19 | bool run() { |
ashleymills | 8:6c30647f75d7 | 20 | _lastRunTime = time(NULL); |
ashleymills | 4:1f8e079924ba | 21 | setupTest(); |
ashleymills | 34:d9e45aad85f2 | 22 | _lastRunOutcome = execute(); |
ashleymills | 8:6c30647f75d7 | 23 | endTest(); |
ashleymills | 8:6c30647f75d7 | 24 | return _lastRunOutcome; |
ashleymills | 4:1f8e079924ba | 25 | } |
ashleymills | 4:1f8e079924ba | 26 | |
ashleymills | 4:1f8e079924ba | 27 | virtual void setupTest() { |
ashleymills | 4:1f8e079924ba | 28 | } |
ashleymills | 4:1f8e079924ba | 29 | |
ashleymills | 34:d9e45aad85f2 | 30 | virtual bool execute() { |
ashleymills | 4:1f8e079924ba | 31 | LOG("Base class runTest called!"); |
ashleymills | 4:1f8e079924ba | 32 | return true; |
ashleymills | 4:1f8e079924ba | 33 | } |
ashleymills | 4:1f8e079924ba | 34 | |
ashleymills | 8:6c30647f75d7 | 35 | virtual void endTest() { |
ashleymills | 8:6c30647f75d7 | 36 | |
ashleymills | 4:1f8e079924ba | 37 | } |
ashleymills | 2:ea883307d02f | 38 | |
ashleymills | 2:ea883307d02f | 39 | protected: |
ashleymills | 2:ea883307d02f | 40 | VodafoneUSBModem *_modem; |
ashleymills | 32:8ff0b67bb58c | 41 | |
ashleymills | 27:0297dbc3252b | 42 | public: |
ashleymills | 3:28336c2e94e4 | 43 | time_t _lastRunTime; |
ashleymills | 3:28336c2e94e4 | 44 | bool _lastRunOutcome; |
ashleymills | 33:16126e029d58 | 45 | int _testCaseNumber; |
ashleymills | 33:16126e029d58 | 46 | const char* _description; |
ashleymills | 1:0d63e4db8503 | 47 | }; |