Vodafone Test Suite

Dependencies:   mbed-rtos mbed HTTPClient VodafoneUSBModem

Files at this revision

API Documentation at this revision

Comitter:
ashleymills
Date:
Tue Aug 28 15:40:07 2012 +0000
Parent:
11:a286d8112b45
Child:
13:8b69853966f8
Commit message:
Added timeout for receiving sent SMS

Changed in this revision

Tests/Test50.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Tests/Test50.h	Fri Aug 24 10:47:29 2012 +0000
+++ b/Tests/Test50.h	Tue Aug 28 15:40:07 2012 +0000
@@ -23,12 +23,14 @@
          LOG("Got  MSISDN %s",_ownNumber);
          for(int i=0; i<numIterations; i++) {
             createRandomString(_smsOut,_smsLen);
-            LOG("Created: %s",_smsOut);
             if(_modem->sendSM(_ownNumber,_smsOut)!=0) {
                LOG("Error sending short message");
             }
+            LOG("Created: %s",_smsOut);
             bool gotMessage = false;
-            while(!gotMessage) {
+            Timer t;
+            t.start();
+            while(!gotMessage && t.read_ms()<25000) {
                if(_modem->getSMCount(&smCount)!=0) {
                   LOG("Faiure getting SM count");
                   return false;
@@ -48,6 +50,10 @@
                }
                Thread::wait(50);
             }
+            if(!gotMessage) {
+               LOG("FAIL: timeout on waiting for SMS");
+               return false;
+            }
          }
          
          return true;
--- a/main.cpp	Fri Aug 24 10:47:29 2012 +0000
+++ b/main.cpp	Tue Aug 28 15:40:07 2012 +0000
@@ -25,7 +25,8 @@
   LOG("Constructing TestManager");
   TestManager *m = new TestManager(&modem);
   int numPassed = m->runAll();
-  LOG("Tests complete: %d passes and %d failures.",numPassed,m->getNumTests()-numPassed);
+  int numTests = m->getNumTests();
+  LOG("%d tests complete: %d passes and %d failures.",numTests,numPassed,numTests-numPassed);
   
   while(1) {
      Thread::wait(1000);