Vodafone Test Suite
Dependencies: mbed-rtos mbed HTTPClient VodafoneUSBModem
Tests/Test16.h@28:c630a04a7198, 2012-09-10 (annotated)
- Committer:
- nherriot
- Date:
- Mon Sep 10 04:59:11 2012 +0000
- Revision:
- 28:c630a04a7198
- Child:
- 29:c0e6f198db84
Adding details to test case 16 and 13 where each test depends on one to send and one to receive. Also removing constants to VodafoneTestCase.h to have them in one place for all tests. Created several const char strings for all test cases.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nherriot | 28:c630a04a7198 | 1 | #pragma once |
nherriot | 28:c630a04a7198 | 2 | #include "VodafoneTestCase.h" |
nherriot | 28:c630a04a7198 | 3 | //#define __DEBUG__ 1 |
nherriot | 28:c630a04a7198 | 4 | |
nherriot | 28:c630a04a7198 | 5 | // this test case will wait to send an SMS from the modem. |
nherriot | 28:c630a04a7198 | 6 | // if the method that sends a message returns an error it will fail. |
nherriot | 28:c630a04a7198 | 7 | // it will report the test as failed if any of the above happens. |
nherriot | 28:c630a04a7198 | 8 | // it does not wait after it has succesfully sent an SMS. |
nherriot | 28:c630a04a7198 | 9 | |
nherriot | 28:c630a04a7198 | 10 | |
nherriot | 28:c630a04a7198 | 11 | class Test16 : public VodafoneTestCase { |
nherriot | 28:c630a04a7198 | 12 | public: |
nherriot | 28:c630a04a7198 | 13 | |
nherriot | 28:c630a04a7198 | 14 | |
nherriot | 28:c630a04a7198 | 15 | Test16(VodafoneUSBModem *m, int tcNumber) : VodafoneTestCase(m, tcNumber) { |
nherriot | 28:c630a04a7198 | 16 | } |
nherriot | 28:c630a04a7198 | 17 | |
nherriot | 28:c630a04a7198 | 18 | virtual bool runTest() { |
nherriot | 28:c630a04a7198 | 19 | LOG("Creating GSM test buffer"); |
nherriot | 28:c630a04a7198 | 20 | LOG("Test %d sending an SMS message...", _testCaseNumber); |
nherriot | 28:c630a04a7198 | 21 | LOG("Sending SMS:' %s ' to test phone: %s , waiting for response.", testMessage, testPhoneNumber); |
nherriot | 28:c630a04a7198 | 22 | |
nherriot | 28:c630a04a7198 | 23 | int ret = _modem->sendSM(testPhoneNumber, testMessage); |
nherriot | 28:c630a04a7198 | 24 | |
nherriot | 28:c630a04a7198 | 25 | if (ret) |
nherriot | 28:c630a04a7198 | 26 | { |
nherriot | 28:c630a04a7198 | 27 | LOG("Error in sending the SMS message. The return values is: %d", ret); |
nherriot | 28:c630a04a7198 | 28 | |
nherriot | 28:c630a04a7198 | 29 | switch(ret){ |
nherriot | 28:c630a04a7198 | 30 | case(NET_INVALID): LOG("Error message is: 'phone number is invalid size, must be less than 16 digits'.");break; |
nherriot | 28:c630a04a7198 | 31 | case(NET_PROTOCOL): LOG("Error message is: 'protocol error from the modem'.");break; |
nherriot | 28:c630a04a7198 | 32 | default: LOG("Undefined error message."); |
nherriot | 28:c630a04a7198 | 33 | |
nherriot | 28:c630a04a7198 | 34 | } |
nherriot | 28:c630a04a7198 | 35 | return false; |
nherriot | 28:c630a04a7198 | 36 | } |
nherriot | 28:c630a04a7198 | 37 | LOG("Test %d passed...", _testCaseNumber); |
nherriot | 28:c630a04a7198 | 38 | return true; |
nherriot | 28:c630a04a7198 | 39 | |
nherriot | 28:c630a04a7198 | 40 | } |
nherriot | 28:c630a04a7198 | 41 | |
nherriot | 28:c630a04a7198 | 42 | private: |
nherriot | 28:c630a04a7198 | 43 | char gsm03dot38CharacterSet[127]; |
nherriot | 28:c630a04a7198 | 44 | |
nherriot | 28:c630a04a7198 | 45 | |
nherriot | 28:c630a04a7198 | 46 | }; |