phoneengine/phoneservices/tsrc/ut_dtmfservice/unit_tests.cpp
changeset 30 ebdbd102c78a
parent 21 92ab7f8d0eab
child 51 f39ed5e045e0
equal deleted inserted replaced
27:2f8f8080a020 30:ebdbd102c78a
    42     TInt HandleEndDTMF();
    42     TInt HandleEndDTMF();
    43     void SetContactId2( const TInt aContactId );
    43     void SetContactId2( const TInt aContactId );
    44     void SetServiceIdCommand( TUint32 aServiceId );
    44     void SetServiceIdCommand( TUint32 aServiceId );
    45     
    45     
    46 private slots:
    46 private slots:
    47     void testExecuteKeySequence ();
       
    48     void testPlayDTMFTone ();
    47     void testPlayDTMFTone ();
    49     void testStopDTMFPlay ();
    48     void testStopDTMFPlay ();
    50 
    49 
    51 private:
    50 private:
    52     DTMFService *m_dtmfService; // class under test
    51     DTMFService *m_dtmfService; // class under test
   140     m_contactId = aContactId;	
   139     m_contactId = aContactId;	
   141 }
   140 }
   142 
   141 
   143 void TestDTMFService::SetServiceIdCommand( TUint32 aServiceId )
   142 void TestDTMFService::SetServiceIdCommand( TUint32 aServiceId )
   144 {
   143 {
   145 
   144     Q_UNUSED(aServiceId)
   146 }
   145 }
   147 
   146 
   148 TInt TestDTMFService::HandleDialServiceCall( const TBool aClientCall )
   147 TInt TestDTMFService::HandleDialServiceCall( const TBool aClientCall )
   149 {
   148 {
   150     m_handleDialCallCalled = true;
   149     m_handleDialCallCalled = true;
   151     m_clientCall = aClientCall;
   150     m_clientCall = aClientCall;
   152     return KErrNone;
   151     return KErrNone;
   153 }
       
   154 
       
   155 void TestDTMFService::testExecuteKeySequence()
       
   156 {
       
   157     m_dtmfService->executeKeySequence(QString("*#0000#"));
       
   158     QString keySequence((QChar*)m_phoneNumber.Ptr(), m_phoneNumber.Length());
       
   159     QVERIFY (m_setPhoneNumberCalled == true);
       
   160     QCOMPARE (keySequence, QString("*#0000#"));
       
   161 }
   152 }
   162 
   153 
   163 void TestDTMFService::testPlayDTMFTone()
   154 void TestDTMFService::testPlayDTMFTone()
   164 {
   155 {
   165     QChar six('6');
   156     QChar six('6');