Vodafone Test Suite
Dependencies: mbed-rtos mbed HTTPClient VodafoneUSBModem
VodafoneTestCase.h.orig@54:30062a67e8bb, 2012-09-14 (annotated)
- Committer:
- nherriot
- Date:
- Fri Sep 14 13:23:29 2012 +0000
- Revision:
- 54:30062a67e8bb
type name changes to follow with coding convention
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nherriot | 54:30062a67e8bb | 1 | #pragma once |
nherriot | 54:30062a67e8bb | 2 | #include "VodafoneUSBModem.h" |
nherriot | 54:30062a67e8bb | 3 | #include "LogHeader.h" |
nherriot | 54:30062a67e8bb | 4 | |
nherriot | 54:30062a67e8bb | 5 | const char myMessage[] = "myMessage is golden"; |
nherriot | 54:30062a67e8bb | 6 | //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 | 7 | 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 | 8 | const char gTestMessage[] = "this is a test message !"; |
nherriot | 54:30062a67e8bb | 9 | const char gAlphabetNumbersMessage[] = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ"; |
nherriot | 54:30062a67e8bb | 10 | const char gAallCharsMessage[] = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()!£$%&*,.':;"; |
nherriot | 54:30062a67e8bb | 11 | const char gIrregularMessage[] = "/:[]{}()!£$%&*,.';"; |
nherriot | 54:30062a67e8bb | 12 | |
nherriot | 54:30062a67e8bb | 13 | |
nherriot | 54:30062a67e8bb | 14 | class VodafoneTestCase { |
nherriot | 54:30062a67e8bb | 15 | public: |
nherriot | 54:30062a67e8bb | 16 | VodafoneTestCase(VodafoneUSBModem *m) : _modem(m) , _lastRunTime(0), _lastRunOutcome(false) { |
nherriot | 54:30062a67e8bb | 17 | } |
nherriot | 54:30062a67e8bb | 18 | |
nherriot | 54:30062a67e8bb | 19 | bool run() { |
nherriot | 54:30062a67e8bb | 20 | _lastRunTime = time(NULL); |
nherriot | 54:30062a67e8bb | 21 | setupTest(); |
nherriot | 54:30062a67e8bb | 22 | _lastRunOutcome = execute(); |
nherriot | 54:30062a67e8bb | 23 | endTest(); |
nherriot | 54:30062a67e8bb | 24 | return _lastRunOutcome; |
nherriot | 54:30062a67e8bb | 25 | } |
nherriot | 54:30062a67e8bb | 26 | |
nherriot | 54:30062a67e8bb | 27 | virtual void setupTest() { |
nherriot | 54:30062a67e8bb | 28 | } |
nherriot | 54:30062a67e8bb | 29 | |
nherriot | 54:30062a67e8bb | 30 | virtual bool execute() { |
nherriot | 54:30062a67e8bb | 31 | LOG("Base class runTest called!"); |
nherriot | 54:30062a67e8bb | 32 | return true; |
nherriot | 54:30062a67e8bb | 33 | } |
nherriot | 54:30062a67e8bb | 34 | |
nherriot | 54:30062a67e8bb | 35 | virtual void endTest() { |
nherriot | 54:30062a67e8bb | 36 | |
nherriot | 54:30062a67e8bb | 37 | } |
nherriot | 54:30062a67e8bb | 38 | |
nherriot | 54:30062a67e8bb | 39 | protected: |
nherriot | 54:30062a67e8bb | 40 | VodafoneUSBModem *_modem; |
nherriot | 54:30062a67e8bb | 41 | |
nherriot | 54:30062a67e8bb | 42 | public: |
nherriot | 54:30062a67e8bb | 43 | time_t _lastRunTime; |
nherriot | 54:30062a67e8bb | 44 | bool _lastRunOutcome; |
nherriot | 54:30062a67e8bb | 45 | int _testCaseNumber; |
nherriot | 54:30062a67e8bb | 46 | const char* _description; |
nherriot | 54:30062a67e8bb | 47 | }; |