Vodafone Test Suite
Dependencies: mbed-rtos mbed HTTPClient VodafoneUSBModem
Revision 45:f68fea0831d7, committed 2012-09-18
- Comitter:
- ashleymills
- Date:
- Tue Sep 18 15:38:54 2012 +0000
- Parent:
- 44:6d0ac4747f5b
- Child:
- 46:d2c22206031a
- Commit message:
- Framework now prints out description of failed tests. Put in placeholders for all test descriptions. Started working on Test08.
Changed in this revision
--- a/TestManager.cpp Mon Sep 17 13:28:39 2012 +0000 +++ b/TestManager.cpp Tue Sep 18 15:38:54 2012 +0000 @@ -8,16 +8,16 @@ VodafoneTestCase* TestManager::constructTest(int testID) { switch(testID) { - case 0: break; - case 1: break; - case 2: break; - case 3: break; - case 4: break; - case 5: break; - case 6: break; - case 7: break; - case 8: break; - case 9: break; + case 0: break; + case 1: break; + case 2: break; + case 3: break; + case 4: break; + case 5: break; + case 6: break; + case 7: break; + case 8: return (VodafoneTestCase*) new Test08(_modem); + case 9: break; case 10: return (VodafoneTestCase*) new Test10(_modem); case 11: break; case 12: return (VodafoneTestCase*) new Test12(_modem); @@ -115,7 +115,7 @@ if(_testOutcomes[testIndex]==false) { LOG("Test %d:",testIndex); - //LOG(gTestDescriptions[testIndex]); + LOG(gTestDescriptions[testIndex]); } } } @@ -127,6 +127,7 @@ int testIndex = list[i]; if(runTest(testIndex)) { successfullTests++; + _testOutcomes[testIndex] = true; } } return successfullTests;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Tests/Test08.cpp Tue Sep 18 15:38:54 2012 +0000 @@ -0,0 +1,27 @@ +#include "Test08.h" + +Test08::Test08(VodafoneUSBModem *m) : VodafoneTestCase(m) { + _description = gTest08Description; + _testCaseNumber = 8; +} + +void Test08::setupTest() {} + +bool Test08::executeTest() { + bool outcome = true; + LOG("Description: %s",gTest08Description); + LOG("Connecting to internet"); + if(_modem->connect("internet","web","web")==0) { + LOG("Connected to internet"); + } else { + LOG("Failed to connect to internet"); + outcome = false; + } + + LOG("Doing DNS lookup for X"); + + _modem->disconnect(); + return outcome; +} + +void Test08::endTest() { } \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Tests/Test08.h Tue Sep 18 15:38:54 2012 +0000 @@ -0,0 +1,14 @@ +#pragma once +#include "VodafoneTestCase.h" +#include "HTTPClient.h" +extern const char *gTest08Description; + +class Test08 : public VodafoneTestCase { + public: + Test08(VodafoneUSBModem *m); + + private: + virtual void setupTest(); + virtual bool executeTest(); + virtual void endTest(); +}; \ No newline at end of file
--- a/Tests/Tests.cpp Mon Sep 17 13:28:39 2012 +0000 +++ b/Tests/Tests.cpp Tue Sep 18 15:38:54 2012 +0000 @@ -1,17 +1,83 @@ #include "Tests.h" // put all of the descriptions on one place for easy reference +const char* gTest00Description = "Test 0"; +const char* gTest01Description = "Test 1"; +const char* gTest02Description = "Test 2"; +const char* gTest03Description = "Test 3"; +const char* gTest04Description = "Test 4"; +const char* gTest05Description = "Test 5"; +const char* gTest06Description = "Test 6"; +const char* gTest07Description = "Test 7"; +const char* gTest08Description = "Test 8"; +const char* gTest09Description = "Test 9"; const char* gTest10Description = "Connects to internet and downloads 100 byte file."; +const char* gTest11Description = "Test 11"; const char* gTest12Description = "Sends and SMS and then does something."; const char* gTest13Description = "Waiting for an SMS message with irregular characters and numbers"; const char* gTest14Description = "Send an SMS message with irregular characters and numbers..."; +const char* gTest15Description = "Test 15"; const char* gTest16Description = "Send an SMS message with basic characters and numbers..."; +const char* gTest17Description = "Test 17"; +const char* gTest18Description = "Test 18"; +const char* gTest19Description = "Test 19"; +const char* gTest20Description = "Test 20"; const char* gTest21Description = "Trying out USSD communication sending *#100#"; const char* gTest22Description = "Sending BAD USSD string \".2890\""; -const char *gTest23Description = "Sending USSD over 150 chars \"0(0)00 ... 000(160)\""; +const char* gTest23Description = "Sending USSD over 150 chars \"0(0)00 ... 000(160)\""; +const char* gTest24Description = "Test 24"; const char* gTest25Description = "Retrieve signal strength and print it."; const char* gTest26Description = "x30 -> Retrieve signal strength and print it."; +const char* gTest27Description = "Test 27"; +const char* gTest28Description = "Test 28"; +const char* gTest29Description = "Test 29"; +const char* gTest30Description = "Test 30"; +const char* gTest31Description = "Test 31"; +const char* gTest32Description = "Test 32"; +const char* gTest33Description = "Test 33"; +const char* gTest34Description = "Test 34"; +const char* gTest35Description = "Test 35"; +const char* gTest36Description = "Test 36"; +const char* gTest37Description = "Test 37"; +const char* gTest38Description = "Test 38"; +const char* gTest39Description = "Test 39"; +const char* gTest40Description = "Test 40"; +const char* gTest41Description = "Test 41"; +const char* gTest42Description = "Test 42"; +const char* gTest43Description = "Test 43"; +const char* gTest44Description = "Test 44"; +const char* gTest45Description = "Test 45"; +const char* gTest46Description = "Test 46"; +const char* gTest47Description = "Test 47"; +const char* gTest48Description = "Test 48"; +const char* gTest49Description = "Test 49"; const char* gTest50Description = "x10 -> Retreive MSISDN and send SMS to self"; +const char* gTest51Description = "Test 51"; +const char* gTest52Description = "Test 52"; +const char* gTest53Description = "Test 53"; +const char* gTest54Description = "Test 54"; +const char* gTest55Description = "Test 55"; const char* gTest56Description = "Wait for SMS. Send a response."; +const char* gTest57Description = "Test 57"; +const char* gTest58Description = "Test 58"; +const char* gTest59Description = "Test 59"; +const char* gTest60Description = "Test 60"; + +const char* gTestDescriptions[] = { + gTest00Description, gTest01Description, gTest02Description, gTest03Description, gTest04Description, + gTest05Description, gTest06Description, gTest07Description, gTest08Description, gTest09Description, + gTest10Description, gTest11Description, gTest12Description, gTest13Description, gTest14Description, + gTest15Description, gTest16Description, gTest17Description, gTest18Description, gTest19Description, + gTest20Description, gTest21Description, gTest22Description, gTest23Description, gTest24Description, + gTest25Description, gTest26Description, gTest27Description, gTest28Description, gTest29Description, + gTest30Description, gTest31Description, gTest32Description, gTest33Description, gTest34Description, + gTest35Description, gTest36Description, gTest37Description, gTest38Description, gTest39Description, + gTest40Description, gTest41Description, gTest42Description, gTest43Description, gTest44Description, + gTest45Description, gTest46Description, gTest47Description, gTest48Description, gTest49Description, + gTest50Description, gTest51Description, gTest52Description, gTest53Description, gTest54Description, + gTest55Description, gTest56Description, gTest57Description, gTest58Description, gTest59Description, + gTest60Description, +}; + // globals used for tests
--- a/Tests/Tests.h Mon Sep 17 13:28:39 2012 +0000 +++ b/Tests/Tests.h Tue Sep 18 15:38:54 2012 +0000 @@ -1,4 +1,5 @@ #pragma once +#include "Test08.h" #include "Test10.h" #include "Test12.h" #include "Test13.h" @@ -14,8 +15,8 @@ const int gAllTests[] = {10,16,12,13,21,22,23,25,26,50}; const int gNumAllTests = 10; -const int gAutomatedTests[] = {21,22,23,25,26,10}; -const int gNumAutomatedTests = 6; +const int gAutomatedTests[] = {8,10,21,22,23,25,26}; +const int gNumAutomatedTests = 7; const int gInteractiveTests[] = {16,12,14,13}; const int gNumInteractiveTests = 4; const int gSoakTests[] = {50}; @@ -43,6 +44,8 @@ gNumSoakTests }; +extern const char* gTestDescriptions[]; + /* static const char* gTestDescriptions[] = { gTest10Description