Vodafone Test Suite

Dependencies:   mbed-rtos mbed HTTPClient VodafoneUSBModem

Tests/Test22.h

Committer:
ashleymills
Date:
2012-09-06
Revision:
26:9eefab9e28df
Parent:
25:55b865c41f21
Child:
27:0297dbc3252b

File content as of revision 26:9eefab9e28df:

#pragma once
#include "VodafoneTestCase.h"
static const char* gTest22Description = "Sending BAD USSD string \".2890\"\0";
const int gTest22Depends[] = {};

class Test22 : public VodafoneTestCase {
   public: 
      Test22(VodafoneUSBModem *m, int tcNumber) : VodafoneTestCase(m, tcNumber) {
      }
      
      virtual void setupTest() {
         _ussdResponse = (char*)malloc(16*sizeof(char));
      }
   
      virtual bool runTest() {
         LOG(gTest22Description);
         
         if(_modem->sendUSSD(".2890",_ussdResponse,16)!=0) {
            LOG("Error sending USSD");
            return false;
         }
         
         LOG("Expecting \"Unknown command\". Received USSD response: \"%s\"",_ussdResponse);
         return (strcmp(_ussdResponse,"Unknown command")==0);
      }
      
      virtual void endTest() {
         free(_ussdResponse);
      }
      
   private:
      char *_ussdResponse;
};