Vodafone Test Suite
Dependencies: mbed-rtos mbed HTTPClient VodafoneUSBModem
Tests/Test23.cpp@27:0297dbc3252b, 2012-09-06 (annotated)
- Committer:
- ashleymills
- Date:
- Thu Sep 06 15:13:38 2012 +0000
- Revision:
- 27:0297dbc3252b
- Parent:
- 25:55b865c41f21
- Child:
- 33:16126e029d58
Commended out dependency stuff. TestManager now prints numbers and descriptions of failed tests.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ashleymills | 25:55b865c41f21 | 1 | #pragma once |
ashleymills | 25:55b865c41f21 | 2 | #include "Test23.h" |
ashleymills | 25:55b865c41f21 | 3 | |
ashleymills | 27:0297dbc3252b | 4 | const char gTest23USSDMessage[161] = "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; |
ashleymills | 25:55b865c41f21 | 5 | Test23::Test23(VodafoneUSBModem *m, int tcNumber) : VodafoneTestCase(m, tcNumber) { } |
ashleymills | 25:55b865c41f21 | 6 | |
ashleymills | 25:55b865c41f21 | 7 | // virtual |
ashleymills | 25:55b865c41f21 | 8 | void Test23::setupTest() { |
ashleymills | 25:55b865c41f21 | 9 | _ussdResponse = (char*)malloc(16*sizeof(char)); |
ashleymills | 25:55b865c41f21 | 10 | } |
ashleymills | 25:55b865c41f21 | 11 | |
ashleymills | 25:55b865c41f21 | 12 | // virtual |
ashleymills | 25:55b865c41f21 | 13 | bool Test23::runTest() { |
ashleymills | 25:55b865c41f21 | 14 | |
ashleymills | 25:55b865c41f21 | 15 | LOG(gTest23Description); |
ashleymills | 25:55b865c41f21 | 16 | |
ashleymills | 25:55b865c41f21 | 17 | if(_modem->sendUSSD(gTest23USSDMessage,_ussdResponse,16)!=0) { |
ashleymills | 25:55b865c41f21 | 18 | LOG("Error sending USSD"); |
ashleymills | 25:55b865c41f21 | 19 | return false; |
ashleymills | 25:55b865c41f21 | 20 | } |
ashleymills | 25:55b865c41f21 | 21 | |
ashleymills | 25:55b865c41f21 | 22 | LOG("Expecting \"Unknown Command\". Received USSD response: \"%s\"",_ussdResponse); |
ashleymills | 25:55b865c41f21 | 23 | return (strcmp(_ussdResponse,"Unknown command")==0); |
ashleymills | 25:55b865c41f21 | 24 | } |
ashleymills | 25:55b865c41f21 | 25 | |
ashleymills | 25:55b865c41f21 | 26 | // virtual |
ashleymills | 25:55b865c41f21 | 27 | void Test23::endTest() { |
ashleymills | 25:55b865c41f21 | 28 | free(_ussdResponse); |
ashleymills | 20:18373fb68ad7 | 29 | } |