Vodafone Test Suite

Dependencies:   mbed-rtos mbed HTTPClient VodafoneUSBModem

Revision:
31:9231acdde9ff
Parent:
27:0297dbc3252b
Child:
33:16126e029d58
--- a/Tests/Test12.h	Wed Sep 12 10:18:28 2012 +0000
+++ b/Tests/Test12.h	Wed Sep 12 16:55:00 2012 +0000
@@ -1,7 +1,7 @@
 #pragma once
 #include "VodafoneTestCase.h"
 
-#define TEST_PHONE_NUMBER "+447717275049"
+
 
 // this test case will wait to receive an SMS from the modem.
 // if the method that reports a message waiting returns an error it will fail.
@@ -10,14 +10,14 @@
 // it waits forever for an SMS.
 // TODO: this should wait for a set time before failing.
 
-static const char *gTest12Description = "Waiting for an SMS message...";
-//const int gTest12Depends[] = {};
+static const char *gTest12Description = "Waiting for an SMS message with basic characters and numbers...";
+
 
 class Test12 : public VodafoneTestCase {
    public: 
 
       char num[17];
-      char msg[64];
+      char msg[160];
       size_t count;
 
       Test12(VodafoneUSBModem *m, int tcNumber) : VodafoneTestCase(m, tcNumber) {
@@ -43,16 +43,22 @@
                 {
                     LOG("%d SMS to read", count);
                     ret = _modem->getSM(num, msg, 64);
-                if(ret)
-                    {
-                        LOG("Error receiving sms. The method getSMS  returned %d", ret);
-                        return false;
-                    }
-                LOG("The message is from number: %s and the message is: \"%s\"", num, msg);
-                return true;
+                    if(ret)
+                        {
+                            LOG("Error receiving sms. The method getSMS  returned %d", ret);
+                            return false;
+                        }
+                    LOG("The message is from number: %s and the message is: \"%s\"", num, msg);
+                    if (strcmp (msg, alphabetNumbersMessage) ==0)
+                        {
+                            LOG("Success receiving alphabet message matches the sent message");
+                            return true;
+                        }
+                    
+                    return false;
                 }
                 Thread::wait(500);
             }
                   
       }
-};
\ No newline at end of file
+};