phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpplugincommon/ut_cpplugincommon.cpp
branchGCC_SURGE
changeset 51 f39ed5e045e0
parent 27 2f8f8080a020
parent 45 6b911d05207e
equal deleted inserted replaced
40:bab96b7ed1a4 51:f39ed5e045e0
    68 {
    68 {
    69     
    69     
    70 }
    70 }
    71 
    71 
    72 /*!
    72 /*!
    73   UT_CpPluginCommon::t_memleak
    73   UT_CpPluginCommon::t_showCallDuration
    74  */
    74  */
    75 void UT_CpPluginCommon::t_showCallDuration()
    75 void UT_CpPluginCommon::t_showCallDuration()
    76 {
    76 {
    77     expect("XQSettingsManager::readItemValue").
    77     expect("XQSettingsManager::readItemValue").
    78         returns(QVariant(23324));
    78         returns(QVariant(23324));
    80     mWrapper->showCallDuration();
    80     mWrapper->showCallDuration();
    81     QVERIFY(verify());
    81     QVERIFY(verify());
    82 }
    82 }
    83 
    83 
    84 /*!
    84 /*!
    85   UT_CpPluginCommon::t_memleak
    85   UT_CpPluginCommon::t_setShowCallDuration
    86  */
    86  */
    87 void UT_CpPluginCommon::t_setShowCallDuration()
    87 void UT_CpPluginCommon::t_setShowCallDuration()
    88 {
    88 {
    89     mWrapper->setShowCallDuration(true);
    89     mWrapper->setShowCallDuration(true);
    90 }
    90     mWrapper->setShowCallDuration(false);
    91 
    91     QVERIFY(verify());
    92 /*!
    92 }
    93   UT_CpPluginCommon::t_memleak
    93 
       
    94 /*!
       
    95   UT_CpPluginCommon::t_readSoftRejectText
    94  */
    96  */
    95 void UT_CpPluginCommon::t_readSoftRejectText()
    97 void UT_CpPluginCommon::t_readSoftRejectText()
    96 {
    98 {
    97     QString text="";
    99     QString text="";
    98     bool userDefined=true;
   100     bool userDefined=true;
    99     expect("XQSettingsManager::readItemValue").
   101     expect("XQSettingsManager::readItemValue").
   100             returns(QVariant(true));
   102             returns(QVariant(true));
   101     
   103     
   102     expect("XQSettingsManager::readItemValue").
   104     expect("XQSettingsManager::readItemValue").
   103                 returns(QVariant("text"));
   105             returns(QVariant("text"));
   104     
   106     
   105     mWrapper->readSoftRejectText(text, userDefined);
   107     mWrapper->readSoftRejectText(text, userDefined);
   106     QVERIFY(verify());
   108     
   107 }
   109     userDefined=false;
   108 
   110     expect("XQSettingsManager::readItemValue").
   109 /*!
   111                     returns(QVariant(false));
   110   UT_CpPluginCommon::t_memleak
   112     expect("XQSettingsManager::readItemValue").
       
   113             returns(QVariant("text"));
       
   114     mWrapper->readSoftRejectText(text, userDefined);
       
   115     
       
   116     QVERIFY(verify());
       
   117 }
       
   118 
       
   119 /*!
       
   120   UT_CpPluginCommon::t_writeSoftRejectText
   111  */
   121  */
   112 void UT_CpPluginCommon::t_writeSoftRejectText()
   122 void UT_CpPluginCommon::t_writeSoftRejectText()
   113 {
   123 {
   114     QString text="";
   124     QString text="";
   115     bool userDefined=true;
   125     bool userDefined=true;
   116     mWrapper->writeSoftRejectText(text, userDefined);
   126     mWrapper->writeSoftRejectText(text, userDefined);
   117 }
   127     userDefined=false;
   118 
   128     mWrapper->writeSoftRejectText(text, userDefined);
   119 /*!
   129     QVERIFY(verify());
   120   UT_CpPluginCommon::t_memleak
   130 }
       
   131 
       
   132 /*!
       
   133   UT_CpPluginCommon::t_numberGroupingSupported
   121  */
   134  */
   122 void UT_CpPluginCommon::t_numberGroupingSupported()
   135 void UT_CpPluginCommon::t_numberGroupingSupported()
   123 {
   136 {
   124     expect("XQSettingsManager::readItemValue").
   137     expect("XQSettingsManager::readItemValue").
   125             returns(QVariant(true));
   138             returns(QVariant(true));
   158     
   171     
   159     QVERIFY( verify() );
   172     QVERIFY( verify() );
   160 }
   173 }
   161 
   174 
   162 /*!
   175 /*!
   163   UT_CpPluginCommon::t_memleak
   176   UT_CpPluginCommon::t_errorCodeTextMapping
   164  */
   177  */
   165 void UT_CpPluginCommon::t_errorCodeTextMapping()
   178 void UT_CpPluginCommon::t_errorCodeTextMapping()
   166 {
   179 {
   167     QString text = "";
   180     QString text = "";
   168     Tools::errorCodeTextMapping(KErrGsmSSSubscriptionViolation, text);
   181     Tools::errorCodeTextMapping(KErrGsmSSSubscriptionViolation, text);
   189     Tools::errorCodeTextMapping(KErrGsmSSDataMissing, text);
   202     Tools::errorCodeTextMapping(KErrGsmSSDataMissing, text);
   190     QCOMPARE( text, QString(
   203     QCOMPARE( text, QString(
   191             "txt_phone_info_not_allowed"));
   204             "txt_phone_info_not_allowed"));
   192     Tools::errorCodeTextMapping(KErrGsmSSIncompatibility, text);
   205     Tools::errorCodeTextMapping(KErrGsmSSIncompatibility, text);
   193     QCOMPARE( text, QString(
   206     QCOMPARE( text, QString(
   194             "Services in conflict"));
   207             "txt_phone_info_conflict_error"));
   195     Tools::errorCodeTextMapping(KErrGsmSSSystemFailure, text);
   208     Tools::errorCodeTextMapping(KErrGsmSSSystemFailure, text);
   196     QCOMPARE( text, QString(
   209     QCOMPARE( text, QString(
   197             "txt_phone_info_result_unknown"));
   210             "txt_phone_info_result_unknown"));
   198     Tools::errorCodeTextMapping(KErrGsmSSUnexpectedDataValue, text);
   211     Tools::errorCodeTextMapping(KErrGsmSSUnexpectedDataValue, text);
   199     QCOMPARE( text, QString(
   212     QCOMPARE( text, QString(
   247     
   260     
   248     QVERIFY( verify() );
   261     QVERIFY( verify() );
   249         
   262         
   250 }
   263 }
   251 
   264 
       
   265 /*!
       
   266   UT_CpPluginCommon::t_readVtVideoSending
       
   267  */
       
   268 void UT_CpPluginCommon::t_readVtVideoSending()
       
   269 {
       
   270     expect("XQSettingsManager::readItemValue").
       
   271             returns(QVariant(1));
       
   272     mWrapper->readVtVideoSending();
       
   273     QVERIFY( verify() );
       
   274 }
       
   275 
       
   276 /*!
       
   277   UT_CpPluginCommon::t_writeVtVideoSending
       
   278  */
       
   279 void UT_CpPluginCommon::t_writeVtVideoSending()
       
   280 {
       
   281     expect("XQSettingsManager::writeItemValue");//.
       
   282             //times(2);
       
   283     int i=0;
       
   284     mWrapper->writeVtVideoSending(i);
       
   285     QVERIFY( verify() );
       
   286 }
       
   287 
       
   288 /*!
       
   289   UT_CpPluginCommon::t_isFeatureCallWaitingDistiquishNotProvisionedEnabled
       
   290  */
       
   291 void UT_CpPluginCommon::t_isFeatureCallWaitingDistiquishNotProvisionedEnabled()
       
   292 {
       
   293     expect("XQSettingsManager::readItemValue").
       
   294                 returns(QVariant(1));
       
   295     mWrapper->isFeatureCallWaitingDistiquishNotProvisionedEnabled();
       
   296     QVERIFY( verify() );
       
   297 }
       
   298 
       
   299 /*!
       
   300   UT_CpPluginCommon::t_isPhoneOffline
       
   301  */
       
   302 void UT_CpPluginCommon::t_isPhoneOffline()
       
   303 {
       
   304     expect("XQSysInfo::isSupported");
       
   305     mWrapper->isPhoneOffline();
       
   306     QVERIFY( verify() );
       
   307 }
       
   308 
       
   309 /*!
       
   310   UT_CpPluginCommon::t_isOngoingCall
       
   311  */
       
   312 void UT_CpPluginCommon::t_isOngoingCall()
       
   313 {
       
   314     expect("XQSettingsManager::readItemValue").
       
   315                     returns(QVariant(1));
       
   316     mWrapper->isOngoingCall();
       
   317     QVERIFY( verify() );
       
   318 }
   252 
   319 
   253 QTEST_MAIN_S60(UT_CpPluginCommon)
   320 QTEST_MAIN_S60(UT_CpPluginCommon)