Vodafone Test Suite
Dependencies: mbed-rtos mbed HTTPClient VodafoneUSBModem
VodafoneTestCase.h@54:30062a67e8bb, 2012-09-14 (annotated)
- Committer:
- nherriot
- Date:
- Fri Sep 14 13:23:29 2012 +0000
- Revision:
- 54:30062a67e8bb
- Parent:
- 36:dd730ff4962e
type name changes to follow with coding convention
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 | 54:30062a67e8bb | 6 | |
nherriot | 54:30062a67e8bb | 7 | //const char testPhoneNumber[] = "+447717275049"; // this is my number - change to this to get all the 'send' tests to send to my number |
nherriot | 54:30062a67e8bb | 8 | const char gTestPhoneNumber[] = "+447785666088"; // this is my test contract sim - change to this to get all the 'send' tests to send to it's self - making tests automatic! :-) |
nherriot | 54:30062a67e8bb | 9 | const char gTestMessage[] = "this is a test message !"; |
nherriot | 54:30062a67e8bb | 10 | const char gAlphabetNumbersMessage[] = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ"; |
nherriot | 54:30062a67e8bb | 11 | const char gAallCharsMessage[] = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()!£$%&*,.':;"; |
nherriot | 54:30062a67e8bb | 12 | const char gIrregularMessage[] = "/:[]{}()!£$%&*,.';"; |
nherriot | 28:c630a04a7198 | 13 | |
nherriot | 28:c630a04a7198 | 14 | |
ashleymills | 2:ea883307d02f | 15 | class VodafoneTestCase { |
ashleymills | 2:ea883307d02f | 16 | public: |
ashleymills | 33:16126e029d58 | 17 | VodafoneTestCase(VodafoneUSBModem *m) : _modem(m) , _lastRunTime(0), _lastRunOutcome(false) { |
ashleymills | 2:ea883307d02f | 18 | } |
ashleymills | 2:ea883307d02f | 19 | |
ashleymills | 4:1f8e079924ba | 20 | bool run() { |
ashleymills | 8:6c30647f75d7 | 21 | _lastRunTime = time(NULL); |
ashleymills | 4:1f8e079924ba | 22 | setupTest(); |
ashleymills | 34:d9e45aad85f2 | 23 | _lastRunOutcome = execute(); |
ashleymills | 8:6c30647f75d7 | 24 | endTest(); |
ashleymills | 8:6c30647f75d7 | 25 | return _lastRunOutcome; |
ashleymills | 4:1f8e079924ba | 26 | } |
ashleymills | 4:1f8e079924ba | 27 | |
ashleymills | 4:1f8e079924ba | 28 | virtual void setupTest() { |
ashleymills | 4:1f8e079924ba | 29 | } |
ashleymills | 4:1f8e079924ba | 30 | |
ashleymills | 34:d9e45aad85f2 | 31 | virtual bool execute() { |
ashleymills | 4:1f8e079924ba | 32 | LOG("Base class runTest called!"); |
ashleymills | 4:1f8e079924ba | 33 | return true; |
ashleymills | 4:1f8e079924ba | 34 | } |
ashleymills | 4:1f8e079924ba | 35 | |
ashleymills | 8:6c30647f75d7 | 36 | virtual void endTest() { |
ashleymills | 8:6c30647f75d7 | 37 | |
ashleymills | 4:1f8e079924ba | 38 | } |
ashleymills | 2:ea883307d02f | 39 | |
ashleymills | 2:ea883307d02f | 40 | protected: |
ashleymills | 2:ea883307d02f | 41 | VodafoneUSBModem *_modem; |
ashleymills | 32:8ff0b67bb58c | 42 | |
ashleymills | 27:0297dbc3252b | 43 | public: |
ashleymills | 3:28336c2e94e4 | 44 | time_t _lastRunTime; |
ashleymills | 3:28336c2e94e4 | 45 | bool _lastRunOutcome; |
ashleymills | 33:16126e029d58 | 46 | int _testCaseNumber; |
ashleymills | 33:16126e029d58 | 47 | const char* _description; |
ashleymills | 1:0d63e4db8503 | 48 | }; |