Vodafone Test Suite

Dependencies:   mbed-rtos mbed HTTPClient VodafoneUSBModem

Revision:
40:32b0558320ea
Parent:
38:83085bfd1018
Child:
42:e423e7204e5c
--- a/TestManager.cpp	Thu Sep 13 15:46:50 2012 +0000
+++ b/TestManager.cpp	Fri Sep 14 12:16:09 2012 +0000
@@ -68,11 +68,20 @@
       case 57: break;
       case 58: break;
       case 59: break;
+      default: return NULL;
    };
+   return NULL; //< For compiler warning
 }
 
 TestManager::TestManager(VodafoneUSBModem *m) : _modem(m) {
-   
+   //_testOutcomes = (bool*)malloc(NUMBER_OF_TESTS*sizeof(bool));
+   //resetTestOutcomes();
+}
+
+void TestManager::resetTestOutcomes() {
+   for(int i=0; i<NUMBER_OF_TESTS; i++) {
+      _testOutcomes[i] = false;
+   }
 }
 
 int TestManager::getTestProfileLength(TestProfile profile) {
@@ -85,6 +94,7 @@
 }
 
 int TestManager::executeTestProfile(TestProfile profile) {
+   //resetTestOutcomes();
    int numPassed = 0;
    if(profile<TESTS_END) { // no test for >= 0 since TestProfile is unsigned
       numPassed = executeTestList(gTestProfiles[profile], gTestProfileLengths[profile]);
@@ -102,19 +112,15 @@
 void TestManager::listFailures(const int *list, const int listLen) {
    for(int i=0; i<listLen; i++) {
       int testIndex = list[i];
-      VodafoneTestCase* test = getTest(testIndex);
-      if(test==NULL) {
-         LOG("ERROR: Test %d is not in test list!.",testIndex);
-         continue;
-      }
       
-      if(test->_lastRunOutcome==false) {
-         LOG("Test %d:",test->_testCaseNumber);
-         LOG(test->_description);
+      if(_testOutcomes[testIndex]==false) {
+         LOG("Test %d:",testIndex);
+         //LOG(gTestDescriptions[testIndex]);
       }
    }
 }
 
+/*
 VodafoneTestCase* TestManager::getTest(int index) {
    for(int i=0; i<_tests.size(); i++) {
       if(index==_tests[i]->_testCaseNumber)
@@ -122,6 +128,7 @@
    }
    return NULL;
 }
+*/
 
 int TestManager::executeTestList(const int *list, const int listLen) {
    int successfullTests = 0;