/** * @SYMTestCaseID BA-CTSYD-DIS-SIM-NEGATIVE-UN0016 * @SYMComponent telephony_ctsy * @SYMTestCaseDesc Test handing in CTSY dispatch when the SendAPDUReq API is disabled * @SYMTestPriority High * @SYMTestActions Disable API, call API, check correct error returned * @SYMTestExpectedResults Pass * @SYMTestType CT */ void CCTsySimFUNegative::TestSendAPDUReqL() { TConfig config; config.SetSupportedValue(MLtsyDispatchSimSendApduRequest::KLtsyDispatchSimSendApduRequestApiId, EFalse); config.PushL(); OpenEtelServerL(EUseExtendedError); CleanupStack::PushL(TCleanupItem(Cleanup,this)); OpenPhoneL(); RMmCustomAPI customApi; OpenCustomApiLC(customApi); TBuf8<3> info; info.Append(1); info.Append(1); info.Append(1); RBuf8 dataBuf; CleanupClosePushL(dataBuf); _LIT8(KApduDataExp,"APDU DATA EXP "); dataBuf.CreateL(KApduDataExp); RMmCustomAPI::TApdu apdu(info,dataBuf); TRequestStatus status; customApi.SendAPDUReq(status, apdu); User::WaitForRequest(status); ASSERT_EQUALS(status.Int(), KErrNotSupported); AssertMockLtsyStatusL(); config.Reset(); CleanupStack::PopAndDestroy(4, &config); // dataBuf, customApi, this, config }
/** @SYMTestCaseID BA-CTSYD-DIS-SUPPLEMENTARYSERVICES-NEGATIVE-UN0012 @SYMComponent telephony_ctsy @SYMTestCaseDesc Test returned value if EMobileUssdMessagingSendRelease is not supported by LTSY @SYMTestPriority High @SYMTestActions Invokes RMobileUssdMessaging::SendRelease() @SYMTestExpectedResults Pass @SYMTestType UT */ void CCTsySupplementaryServicesFUNegative::TestUnit0012L() { TConfig config; config.SetSupportedValue(MLtsyDispatchSupplementaryServicesSendUssdRelease::KLtsyDispatchSupplementaryServicesSendUssdReleaseApiId, EFalse); OpenEtelServerL(EUseExtendedError); CleanupStack::PushL(TCleanupItem(Cleanup,this)); OpenPhoneL(); TRequestStatus requestStatus; RMobileUssdMessaging ussdMessaging; ASSERT_EQUALS(KErrNone, ussdMessaging.Open(iPhone)); CleanupClosePushL(ussdMessaging); RMobilePhone::TMobilePhoneSendSSRequestV3 sendSSRequest; RMobilePhone::TMobilePhoneSendSSRequestV3Pckg sendSSRequestPckg(sendSSRequest); ussdMessaging.SendRelease(requestStatus, sendSSRequestPckg); User::WaitForRequest(requestStatus); ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); AssertMockLtsyStatusL(); config.Reset(); CleanupStack::PopAndDestroy(2, this); // ussdMessaging, this }
bool MTable::fieldSeek( int i_ln, TConfig &cfg, vector< vector<string> > *full ) { int i_clm; ResAlloc res(mRes, false); if((i_ln=findKeyLine(cfg,i_ln,true)) < 0) return false; //Get config fields list vector<string> cf_el; cfg.cfgList(cf_el); //Seek and get data for(unsigned i_cf = 0; i_cf < cf_el.size(); i_cf++) { TCfg &e_cfg = cfg.cfg(cf_el[i_cf]); // Find collumn db_str_rec *fld_rec; for(i_clm = 0; (fld_rec=basa->getField(i_clm)) != NULL; i_clm++) if(cf_el[i_cf].compare(0,10,fld_rec->name) == 0) break; if(fld_rec == NULL) continue; // Get table volume string val; if(basa->GetFieldIt(i_ln,i_clm,val) < 0) throw err_sys(_("Error the cell.")); // Write value setVal(e_cfg, val); } return true; }
/** * @SYMTestCaseID BA-CTSYD-DIS-SIM-NEGATIVE-UN0025 * @SYMComponent telephony_ctsy * @SYMTestCaseDesc Test handing in CTSY dispatch when the GetSimAuthenticationEapSimData API is disabled * @SYMTestPriority High * @SYMTestActions Disable API, call API, check correct error returned * @SYMTestExpectedResults Pass * @SYMTestType CT */ void CCTsySimFUNegative::TestGetSimAuthenticationEapSimDataL() { TConfig config; config.SetSupportedValue(MLtsyDispatchSimGetSimAuthenticationEapSimData::KLtsyDispatchSimGetSimAuthenticationEapSimDataApiId, EFalse); config.PushL(); OpenEtelServerL(EUseExtendedError); CleanupStack::PushL(TCleanupItem(Cleanup,this)); OpenPhoneL(); RMmCustomAPI customApi; OpenCustomApiLC(customApi); // generate a random parameter TUint32 randomValue; TBuf8<16> randomParameter; for (TInt i = 0; i< 16; i++) { randomValue = Math::Random(); randomParameter.Append(randomValue); } RMmCustomAPI::TSimAuthenticationEapSim eapSim; eapSim.iRandomParameters.Copy(randomParameter); RMmCustomAPI::TSimDataPckg simDataPckg(eapSim); TRequestStatus status; customApi.GetWlanSimAuthenticationData(status, simDataPckg); User::WaitForRequest(status); ASSERT_EQUALS(status.Int(), KErrNotSupported); AssertMockLtsyStatusL(); config.Reset(); CleanupStack::PopAndDestroy(3, &config); // customAPI, this, config }
void MTable::fieldDel( TConfig &cfg ) { if( tblStrct.empty() ) throw TError(TSYS::DBTableEmpty,nodePath().c_str(),_("Table is empty.")); mLstUse = time(NULL); //> Get config fields list vector<string> cf_el; cfg.cfgList(cf_el); //> Prepare request string req = "DELETE FROM '"+mod->sqlReqCode(name())+"' WHERE "; //>> Add key list to queue bool next = false; for( unsigned i_el = 0; i_el < cf_el.size(); i_el++ ) { TCfg &u_cfg = cfg.cfg(cf_el[i_el]); if( u_cfg.fld().flg()&TCfg::Key && u_cfg.keyUse() ) { req = req + (next?" AND \"":"\"") + mod->sqlReqCode(cf_el[i_el],'"') + "\"='" + mod->sqlReqCode(getVal(u_cfg)) + "' "; next = true; } } req += ";"; try{ owner().sqlReq(req, NULL, true); } catch( TError err ) { if( (err.cod-100) == SQLITE_READONLY ) throw TError(TSYS::DBReadOnly,nodePath().c_str(),_("Deletion is not permitted. Data base is read only.")); throw; } }
/** * @SYMTestCaseID BA-CTSYD-DIS-SIM-NEGATIVE-UN0023 * @SYMComponent telephony_ctsy * @SYMTestCaseDesc Test handing in CTSY dispatch when the GetAnswerToReset (ATR) API is disabled * @SYMTestPriority High * @SYMTestActions Disable API, call API, check correct error returned * @SYMTestExpectedResults Pass * @SYMTestType CT */ void CCTsySimFUNegative::TestGetAnswerToResetL() { TConfig config; config.SetSupportedValue(MLtsyDispatchSimGetAnswerToReset::KLtsyDispatchSimGetAnswerToResetApiId, EFalse); config.PushL(); OpenEtelServerL(EUseExtendedError); CleanupStack::PushL(TCleanupItem(Cleanup,this)); OpenPhoneL(); RMmCustomAPI customApi; OpenCustomApiLC(customApi); _LIT8(KAnswerToResetSend, "ExampleAnswerToResetSend"); TBuf8<100> answerToReset(KAnswerToResetSend); TRequestStatus status; customApi.GetATR(status, answerToReset); User::WaitForRequest(status); ASSERT_EQUALS(status.Int(), KErrNotSupported); AssertMockLtsyStatusL(); config.Reset(); CleanupStack::PopAndDestroy(3, &config); // customAPI, this, config }
void MTable::fieldGet( TConfig &cfg ) { int i_ln, i_clm; //Alloc resource ResAlloc res(mRes, false); //Get key line if((i_ln=findKeyLine(cfg)) < 0) throw err_sys(_("The field is not present.")); //Get config fields list vector<string> cf_el; cfg.cfgList(cf_el); //Write data to cfg for(unsigned i_cf = 0; i_cf < cf_el.size(); i_cf++) { TCfg &e_cfg = cfg.cfg(cf_el[i_cf]); // Find collumn db_str_rec *fld_rec; for(i_clm = 0; (fld_rec = basa->getField(i_clm)) != NULL; i_clm++) if(cf_el[i_cf].compare(0,10,fld_rec->name) == 0) break; if(fld_rec == NULL) continue; // Get table volume string val; if(basa->GetFieldIt(i_ln,i_clm,val) < 0) throw err_sys(_("Error the cell.")); // Write value setVal(e_cfg, val); } }
/** * @SYMTestCaseID BA-CTSYD-DIS-SIM-NEGATIVE-UN0010 * @SYMComponent telephony_ctsy * @SYMTestCaseDesc Test handing in CTSY dispatch when the ChangeSecurityCode API is disabled * @SYMTestPriority High * @SYMTestActions Disable API, call API, check correct error returned * @SYMTestExpectedResults Pass * @SYMTestType CT */ void CCTsySimFUNegative::TestChangeSecurityCodeL() { TConfig config; config.SetSupportedValue(MLtsyDispatchSimChangeSecurityCode::KLtsyDispatchSimChangeSecurityCodeApiId, EFalse); config.PushL(); OpenEtelServerL(EUseExtendedError); CleanupStack::PushL(TCleanupItem(Cleanup,this)); OpenPhoneL(); _LIT(KOldPwd,"oldPswd"); _LIT(KNewPwd,"newPswd"); RMobilePhone::TMobilePhonePasswordChangeV1 pwdChange; pwdChange.iNewPassword = KNewPwd; pwdChange.iOldPassword = KOldPwd; // Choose Phone Device Lock RMobilePhone::TMobilePhoneSecurityCode secCode = RMobilePhone::ESecurityCodePhonePassword; TRequestStatus status; iPhone.ChangeSecurityCode(status, secCode, pwdChange); User::WaitForRequest(status); ASSERT_EQUALS(status.Int(), KErrNotSupported); AssertMockLtsyStatusL(); config.Reset(); CleanupStack::PopAndDestroy(2, &config); // this, config }
/** * @SYMTestCaseID BA-CTSYD-DIS-SMS-NEGATIVE-UN0006 * @SYMComponent telephony_ctsy * @SYMTestCaseDesc Test handing in CTSY dispatch when the SendMessageNoFdnCheck API is disabled * @SYMTestPriority High * @SYMTestActions Disable API, call API, check correct error returned * @SYMTestExpectedResults Pass * @SYMTestType CT */ void CCTsySmsFUNegative::TestSendMessageNoFdnCheckL() { TConfig config; config.SetSupportedValue(MLtsyDispatchSmsSendSmsMessageNoFdnCheck::KLtsyDispatchSmsSendSmsMessageNoFdnCheckApiId, EFalse); config.PushL(); OpenEtelServerL(EUseExtendedError); CleanupStack::PushL(TCleanupItem(Cleanup,this)); OpenPhoneL(); RMobileSmsMessaging messaging; TInt err = messaging.Open(iPhone); CleanupClosePushL(messaging); _LIT8(KMessage, "Hello"); RMobileSmsMessaging::TMobileSmsSendAttributesV1 smsAttr; RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg smsAttrPckg(smsAttr); TRequestStatus status; messaging.SendMessageNoFdnCheck(status, KMessage, smsAttrPckg); User::WaitForRequest(status); ASSERT_EQUALS(status.Int(), KErrNotSupported); AssertMockLtsyStatusL(); CleanupStack::PopAndDestroy(3, &config); // messaging, this, config }
/** * @SYMTestCaseID BA-CTSYD-DIS-SMS-NEGATIVE-UN0001 * @SYMComponent telephony_ctsy * @SYMTestCaseDesc Test handing in CTSY dispatch when the NackSmsStored API is disabled * @SYMTestPriority High * @SYMTestActions Disable API, call API, check correct error returned * @SYMTestExpectedResults Pass * @SYMTestType CT */ void CCTsySmsFUNegative::TestNackSmsStoredL() { TConfig config; config.SetSupportedValue(MLtsyDispatchSmsNackSmsStored::KLtsyDispatchSmsNackSmsStoredApiId, EFalse); config.PushL(); OpenEtelServerL(EUseExtendedError); CleanupStack::PushL(TCleanupItem(Cleanup,this)); OpenPhoneL(); RMobileSmsMessaging messaging; TInt err = messaging.Open(iPhone); ASSERT_EQUALS(KErrNone, err); CleanupClosePushL(messaging); RBuf8 data; CleanupClosePushL(data); TRequestStatus reqStatus; TRequestStatus mockLtsyStatus; RMobileSmsMessaging::TMobileSmsReceiveAttributesV1 receiveAttr; RMobileSmsMessaging::TMobileSmsReceiveAttributesV1Pckg receiveAttrPckg(receiveAttr); _LIT8(KMessage, "Happy New Year"); TBuf8<100> forMsg; // receiving message: messaging.ReceiveMessage(reqStatus, forMsg, receiveAttrPckg); TSmsMsg smsMsg; TSmsMsg* smsMsgPtr(&smsMsg); TBool ind(EFalse); smsMsg.iSmsClass2 = ETrue; smsMsg.iDeleteAfterClientAck = ETrue; smsMsg.iSmsMsg.Copy(KMessage); TMockLtsyData2<TBool, TSmsMsg*> compTsyData(ind, smsMsgPtr); compTsyData.SerialiseL(data); iMockLTSY.CompleteL(KMockLtsyDispatchSmsNotifyReceiveSmsMessageIndId, KErrNone, data); User::WaitForRequest(reqStatus); ASSERT_EQUALS(KErrNone, reqStatus.Int()); AssertMockLtsyStatusL(); TDesC8* msgPtr = const_cast<TDesC8*>(&KMessage); TInt rpCause(0); TMockLtsyData2<TDesC8*, TInt> expTsyData(msgPtr, rpCause); data.Close(); expTsyData.SerialiseL(data); messaging.NackSmsStored(reqStatus, KMessage, rpCause); User::WaitForRequest(reqStatus); ASSERT_EQUALS(KErrNotSupported, reqStatus.Int()); AssertMockLtsyStatusL(); CleanupStack::PopAndDestroy(4, &config); // messaging, this, data, config }
/** * @SYMTestCaseID BA-CTSYD-DIS-SMS-NEGATIVE-UN0004 * @SYMComponent telephony_ctsy * @SYMTestCaseDesc Test handing in CTSY dispatch when the GetMessageStoreInfo (a.k.a GetSmsStoreInfo) API is disabled * @SYMTestPriority High * @SYMTestActions Disable API, call API, check correct error returned * @SYMTestExpectedResults Pass * @SYMTestType CT */ void CCTsySmsFUNegative::TestGetSmsStoreInfoL() { TConfig config; config.SetSupportedValue(MLtsyDispatchSmsGetSmsStoreInfo::KLtsyDispatchSmsGetSmsStoreInfoApiId, EFalse); config.PushL(); OpenEtelServerL(EUseExtendedError); CleanupStack::PushL(TCleanupItem(Cleanup,this)); OpenPhoneL(); RMobileSmsMessaging messaging; TInt err = messaging.Open(iPhone); CleanupClosePushL(messaging); RMobilePhoneStore::TMobilePhoneStoreInfoV1 info; RMobilePhoneStore::TMobilePhoneStoreInfoV1Pckg pckgInfo(info); TInt index(0); TRequestStatus status; messaging.GetMessageStoreInfo(status, index, pckgInfo); User::WaitForRequest(status); ASSERT_EQUALS(status.Int(), KErrNotSupported); AssertMockLtsyStatusL(); CleanupStack::PopAndDestroy(3, &config); // messaging, this, config }
/** * @SYMTestCaseID BA-CTSYD-DIS-SIM-NEGATIVE-UN0022 * @SYMComponent telephony_ctsy * @SYMTestCaseDesc Test handing in CTSY dispatch when the API is disabled * @SYMTestPriority High * @SYMTestActions Disable API, call API, check correct error returned for both async & sync APIs * @SYMTestExpectedResults Pass * @SYMTestType CT */ void CCTsySimFUNegative::TestDeActivateSimLockL() { TConfig config; config.SetSupportedValue(MLtsyDispatchSimSimLockDeActivate::KLtsyDispatchSimSimLockDeActivateApiId, EFalse); config.PushL(); OpenEtelServerL(EUseExtendedError); CleanupStack::PushL(TCleanupItem(Cleanup,this)); OpenPhoneL(); RMmCustomAPI customApi; OpenCustomApiLC(customApi); _LIT(KPassword, "12345"); RMmCustomAPI::TSimLockPassword simLockPassword; RMmCustomAPI::TLockNumber lockNumber; lockNumber = RMmCustomAPI::EOperator; simLockPassword.Copy(KPassword); TRequestStatus status; // async version customApi.DeActivateSimLock(status, simLockPassword, lockNumber); User::WaitForRequest(status); ASSERT_EQUALS(status.Int(), KErrNotSupported); // synchronous version TInt ret = customApi.DeActivateSimLock(simLockPassword, lockNumber); ASSERT_EQUALS(ret, KErrNotSupported); AssertMockLtsyStatusL(); config.Reset(); CleanupStack::PopAndDestroy(3, &config); // customAPI, this, config }
TConfig *TApplication::config(const QString &group) { TConfig *config = TConfig::instance(); config->beginGroup(group); return config; }
/** @SYMTestCaseID BA-CTSYD-DIS-SUPPLEMENTARYSERVICES-NEGATIVE-UN0011 @SYMComponent telephony_ctsy @SYMTestCaseDesc Test returned value if EMobileUssdMessagingSendMessageNoFdnCheck is not supported by LTSY @SYMTestPriority High @SYMTestActions Invokes RMobileUssdMessaging::SendMessageNoFdnCheck() @SYMTestExpectedResults Pass @SYMTestType UT */ void CCTsySupplementaryServicesFUNegative::TestUnit0011L() { TConfig config; config.SetSupportedValue(MLtsyDispatchSupplementaryServicesSendUssdMessageNoFdnCheck::KLtsyDispatchSupplementaryServicesSendUssdMessageNoFdnCheckApiId, EFalse); OpenEtelServerL(EUseExtendedError); CleanupStack::PushL(TCleanupItem(Cleanup,this)); OpenPhoneL(); TRequestStatus requestStatus; RMobileUssdMessaging ussdMessaging; ASSERT_EQUALS(KErrNone, ussdMessaging.Open(iPhone)); CleanupClosePushL(ussdMessaging); _LIT8(KMsg1,"SendMessage1.1"); RMobileUssdMessaging::TGsmUssdMessageData expSendData(KMsg1); RMobileUssdMessaging::TMobileUssdAttributesV1 expSendAttr; RMobileUssdMessaging::TMobileUssdAttributesV1Pckg sendAttrPckg(expSendAttr); ussdMessaging.SendMessageNoFdnCheck(requestStatus, expSendData, sendAttrPckg); User::WaitForRequest(requestStatus); ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); AssertMockLtsyStatusL(); config.Reset(); CleanupStack::PopAndDestroy(2, this); // ussdMessaging, this }
/** @SYMTestCaseID BA-CTSYD-DIS-SUPPLEMENTARYSERVICES-NEGATIVE-UN0008 @SYMComponent telephony_ctsy @SYMTestCaseDesc Test returned value if EMobilePhoneSetSSPassword is not supported by LTSY @SYMTestPriority High @SYMTestActions Invokes RMobilePhone::SetSSPassword() @SYMTestExpectedResults Pass @SYMTestType UT */ void CCTsySupplementaryServicesFUNegative::TestUnit0008L() { TConfig config; config.SetSupportedValue(MLtsyDispatchSupplementaryServicesSetSsPassword::KLtsyDispatchSupplementaryServicesSetSsPasswordApiId, EFalse); OpenEtelServerL(EUseExtendedError); CleanupStack::PushL(TCleanupItem(Cleanup,this)); OpenPhoneL(); TRequestStatus requestStatus; _LIT(KOldPassword,"oldPswd"); _LIT(KNewPassword,"newPswd"); RMobilePhone::TMobilePhonePasswordChangeV2 pwdChange; pwdChange.iOldPassword.Copy(KOldPassword); pwdChange.iNewPassword.Copy(KNewPassword); pwdChange.iVerifiedPassword.Copy(KNewPassword); TPckg<RMobilePhone::TMobilePhonePasswordChangeV2> password(pwdChange); TUint16 service = 330; // Can be only 0 for all or 330 for Barring iPhone.SetSSPassword(requestStatus,password,service); User::WaitForRequest(requestStatus); ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); AssertMockLtsyStatusL(); config.Reset(); CleanupStack::PopAndDestroy(this); // this }
/** @SYMTestCaseID BA-CTSYD-DIS-SUPPLEMENTARYSERVICES-NEGATIVE-UN0006 @SYMComponent telephony_ctsy @SYMTestCaseDesc Test returned value if EMobilePhoneSetCallForwardingStatus is not supported by LTSY @SYMTestPriority High @SYMTestActions Invokes RMobilePhone::SetCallForwardingStatus() @SYMTestExpectedResults Pass @SYMTestType UT */ void CCTsySupplementaryServicesFUNegative::TestUnit0006L() { TConfig config; config.SetSupportedValue(MLtsyDispatchSupplementaryServicesSetCallForwardingStatus::KLtsyDispatchSupplementaryServicesSetCallForwardingStatusApiId, EFalse); OpenEtelServerL(EUseExtendedError); CleanupStack::PushL(TCleanupItem(Cleanup,this)); OpenPhoneL(); TRequestStatus requestStatus; RMobilePhone::TMobilePhoneCFCondition setCondition = RMobilePhone::ECallForwardingNoReply; RMobilePhone::TMobilePhoneCFChangeV1 callForwardinginfo; callForwardinginfo.iAction = RMobilePhone::EServiceActionRegister; callForwardinginfo.iNumber.iTypeOfNumber = RMobilePhone::EInternationalNumber; callForwardinginfo.iNumber.iNumberPlan = RMobilePhone::EIsdnNumberPlan; _LIT(KTelNumber,"+74951000000"); callForwardinginfo.iNumber.iTelNumber.Copy(KTelNumber); callForwardinginfo.iServiceGroup = RMobilePhone::EVoiceService; callForwardinginfo.iTimeout = 20; iPhone.SetCallForwardingStatus(requestStatus, setCondition, callForwardinginfo); User::WaitForRequest(requestStatus); ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); AssertMockLtsyStatusL(); config.Reset(); CleanupStack::PopAndDestroy(this); // this }
/** @SYMTestCaseID BA-CTSYD-DIS-SUPPLEMENTARYSERVICES-NEGATIVE-UN0005 @SYMComponent telephony_ctsy @SYMTestCaseDesc Test returned value if EMobilePhoneSetCallBarringStatus is not supported by LTSY @SYMTestPriority High @SYMTestActions Invokes RMobilePhone::SetCallBarringStatus() @SYMTestExpectedResults Pass @SYMTestType UT */ void CCTsySupplementaryServicesFUNegative::TestUnit0005L() { TConfig config; config.SetSupportedValue(MLtsyDispatchSupplementaryServicesSetCallBarringStatus::KLtsyDispatchSupplementaryServicesSetCallBarringStatusApiId, EFalse); OpenEtelServerL(EUseExtendedError); CleanupStack::PushL(TCleanupItem(Cleanup,this)); OpenPhoneL(); TRequestStatus requestStatus; RMobilePhone::TMobilePhoneCBCondition setCondition = RMobilePhone::EBarIncomingRoaming; RMobilePhone::TMobilePhoneCBChangeV1 setInfo; setInfo.iAction = RMobilePhone::EServiceActionDeactivate; setInfo.iServiceGroup = RMobilePhone::EPadAccess; _LIT(KPassword,"1234"); setInfo.iPassword = KPassword; iPhone.SetCallBarringStatus(requestStatus, setCondition, setInfo); User::WaitForRequest(requestStatus); ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); AssertMockLtsyStatusL(); config.Reset(); CleanupStack::PopAndDestroy(this); // this }
/** * @SYMTestCaseID BA-CTSYD-DIS-SMS-NEGATIVE-UN0009 * @SYMComponent telephony_ctsy * @SYMTestCaseDesc Test handing in CTSY dispatch when the StoreSmspListEntry API is disabled * @SYMTestPriority High * @SYMTestActions Disable API, call API, check correct error returned * @SYMTestExpectedResults Pass * @SYMTestType CT */ void CCTsySmsFUNegative::TestStoreSmspListEntryL() { TConfig config; config.SetSupportedValue(MLtsyDispatchSmsStoreSmspListEntry::KLtsyDispatchSmsStoreSmspListEntryApiId, EFalse); config.PushL(); OpenEtelServerL(EUseExtendedError); CleanupStack::PushL(TCleanupItem(Cleanup,this)); OpenPhoneL(); RMobileSmsMessaging messaging; TInt err = messaging.Open(iPhone); CleanupClosePushL(messaging); RMobileSmsMessaging::TMobileSmspEntryV1 smspEntry; CMobilePhoneSmspList* smspListPtr = CMobilePhoneSmspList::NewL(); CleanupStack::PushL(smspListPtr); smspListPtr->AddEntryL(smspEntry); TRequestStatus status; messaging.StoreSmspListL(status, smspListPtr); User::WaitForRequest(status); ASSERT_EQUALS(status.Int(), KErrNotSupported); AssertMockLtsyStatusL(); CleanupStack::PopAndDestroy(4, &config); // smspListPtr, messaging, this, config }
/** @SYMTestCaseID BA-CTSYD-DIS-SUPPLEMENTARYSERVICES-NEGATIVE-UN0002 @SYMComponent telephony_ctsy @SYMTestCaseDesc Test returned value if EMobilePhoneGetWaitingStatusPhase1 is not supported by LTSY @SYMTestPriority High @SYMTestActions Invokes CRetrieveMobilePhoneCWList::Start() @SYMTestExpectedResults Pass @SYMTestType UT */ void CCTsySupplementaryServicesFUNegative::TestUnit0002L() { TConfig config; config.SetSupportedValue(MLtsyDispatchSupplementaryServicesGetCallWaitingStatus::KLtsyDispatchSupplementaryServicesGetCallWaitingStatusApiId, EFalse); OpenEtelServerL(EUseExtendedError); CleanupStack::PushL(TCleanupItem(Cleanup,this)); OpenPhoneL(); CFilteringActiveScheduler scheduler; CActiveScheduler::Install(&scheduler); CRetrieveMobilePhoneCWList* asyncRetrieveMobilePhoneCWList = CRetrieveMobilePhoneCWList::NewL(iPhone); CleanupStack::PushL(asyncRetrieveMobilePhoneCWList); CActiveRetriever::ResetRequestsNumber(); CActiveRetriever* activeRetriever = CActiveRetriever::NewL(*asyncRetrieveMobilePhoneCWList); CleanupStack::PushL(activeRetriever); scheduler.AddRetrieverL(*activeRetriever); RMobilePhone::TMobileInfoLocation location = RMobilePhone::EInfoLocationCachePreferred; asyncRetrieveMobilePhoneCWList->Start(activeRetriever->iStatus, location); activeRetriever->Activate(); scheduler.StartScheduler(); ASSERT_EQUALS(0, CActiveRetriever::ResetRequestsNumber()); ASSERT_EQUALS(KErrNotSupported, activeRetriever->iStatus.Int()); AssertMockLtsyStatusL(); config.Reset(); CleanupStack::PopAndDestroy(3, this); // activeRetriever, asyncRetrieveMobilePhoneCWList, this }
void MTable::fieldGet( TConfig &cfg ) { vector< vector<string> > tbl; if( tblStrct.empty() ) throw TError(TSYS::DBTableEmpty,nodePath().c_str(),_("Table is empty.")); mLstUse = time(NULL); string sid; //> Prepare request string req = "SELECT "; string req_where, first_key; //>> Add fields list to queue bool first_sel = true, next_wr = false, trPresent = false; for(unsigned i_fld = 1; i_fld < tblStrct.size(); i_fld++) { sid = tblStrct[i_fld][1]; TCfg *u_cfg = cfg.at(sid,true); if(!cfg.noTransl() && !u_cfg && sid.size() > 3 && sid.substr(0,3) == (Mess->lang2Code()+"#")) { u_cfg = cfg.at(sid.substr(3),true); if(u_cfg && !(u_cfg->fld().flg()&TCfg::TransltText)) continue; trPresent = true; } if(!u_cfg) continue; if(u_cfg->fld().flg()&TCfg::Key) { req_where = req_where + (next_wr?" AND \"":"\"") + mod->sqlReqCode(sid,'"') + "\"='" + mod->sqlReqCode(getVal(*u_cfg)) + "'"; if(first_key.empty()) first_key = mod->sqlReqCode(sid,'"'); next_wr = true; } else if(u_cfg->view()) { req = req + (first_sel?"\"":",\"") + mod->sqlReqCode(sid,'"') + "\""; first_sel = false; } } if(first_sel) req += "\""+first_key+"\""; req = req + " FROM '" + mod->sqlReqCode(name()) + "' WHERE " + req_where + ";"; //> Query owner().sqlReq(req, &tbl, false); if( tbl.size() < 2 ) throw TError(TSYS::DBRowNoPresent,nodePath().c_str(),_("Row is not present.")); //> Processing of query for( unsigned i_fld = 0; i_fld < tbl[0].size(); i_fld++ ) { sid = tbl[0][i_fld]; TCfg *u_cfg = cfg.at(sid,true); if( u_cfg ) setVal(*u_cfg,tbl[1][i_fld]); else if( trPresent && sid.compare(0,3,Mess->lang2Code()+"#") == 0 && tbl[1][i_fld].size() ) { u_cfg = cfg.at(sid.substr(3),true); if( u_cfg && u_cfg->fld().flg()&TCfg::TransltText && !u_cfg->noTransl() ) setVal(*u_cfg,tbl[1][i_fld]); } } }
bool MTable::fieldSeek( int row, TConfig &cfg ) { vector< vector<string> > tbl; if( tblStrct.empty() ) throw TError(TSYS::DBTableEmpty,nodePath().c_str(),_("Table is empty.")); mLstUse = time(NULL); string sid; //> Make WHERE string req = "SELECT "; string req_where = "WHERE "; //>> Add use keys to list bool first_sel = true, next = false, trPresent = false; for( unsigned i_fld = 1; i_fld < tblStrct.size(); i_fld++ ) { sid = tblStrct[i_fld][1]; TCfg *u_cfg = cfg.at(sid,true); if( !cfg.noTransl() && !u_cfg && sid.size() > 3 && sid.substr(0,3) == (Mess->lang2Code()+"#") ) { u_cfg = cfg.at(sid.substr(3),true); if( u_cfg && !(u_cfg->fld().flg()&TCfg::TransltText) ) continue; trPresent = true; } if( !u_cfg ) continue; if( u_cfg->fld().flg()&TCfg::Key && u_cfg->keyUse() ) { req_where = req_where + (next?" AND \"":"\"") + mod->sqlReqCode(sid,'"') + "\"='" + mod->sqlReqCode(getVal(*u_cfg)) + "' "; next = true; } else if( u_cfg->fld().flg()&TCfg::Key || u_cfg->view() ) { req = req + (first_sel?"\"":",\"")+mod->sqlReqCode(sid,'"')+"\""; first_sel = false; } } //> Request if( first_sel ) return false; req = req + " FROM '" + mod->sqlReqCode(name()) + "' " + ((next)?req_where:"") + " LIMIT " + TSYS::int2str(row) + ",1;"; owner().sqlReq(req, &tbl/*, false*/); // For seek to deletion into save context do not set to "false" if( tbl.size() < 2 ) return false; //> Processing of query for( unsigned i_fld = 0; i_fld < tbl[0].size(); i_fld++ ) { sid = tbl[0][i_fld]; TCfg *u_cfg = cfg.at(sid,true); if( u_cfg ) setVal(*u_cfg,tbl[1][i_fld]); else if( trPresent && sid.size() > 3 && sid.substr(0,3) == (Mess->lang2Code()+"#") && tbl[1][i_fld].size() ) { u_cfg = cfg.at(sid.substr(3),true); if( u_cfg ) setVal(*u_cfg,tbl[1][i_fld]); } } return true; }
/** * @SYMTestCaseID BA-CTSYD-DIS-CALLCONTROLMULTIPARTY-NEGATIVE-UN0003 * @SYMComponent telephony_ctsy * @SYMTestCaseDesc Test handing in CTSY dispatch when the CreateConference API is disabled * @SYMTestPriority High * @SYMTestActions Disable API, call API, check correct error returned * @SYMTestExpectedResults Pass * @SYMTestType CT */ void CCTsyCallControlMultipartyFUNegative::TestCreateConferenceL() { TConfig config; config.SetSupportedValue(MLtsyDispatchCallControlMultipartyCreateConference::KLtsyDispatchCallControlMultipartyCreateConferenceApiId, EFalse); config.PushL(); OpenEtelServerL(EUseExtendedError); CleanupStack::PushL(TCleanupItem(Cleanup,this)); OpenPhoneL(); RBuf8 data; CleanupClosePushL(data); // Set up correct conditions to be able to create a conference TInt callId1 = 1; TInt callId2 = 2; RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; DriverDialAndHoldFirstCallDialSecondCallL(mobileService, callId1, callId2); RMobileLine mobileLine; CleanupClosePushL(mobileLine); RMobileCall mobileCall; CleanupClosePushL(mobileCall); RMobileLine mobileLine2; CleanupClosePushL(mobileLine2); RMobileCall mobileCall2; CleanupClosePushL(mobileCall2); ClientDialAndHoldFirstCallDialSecondCallL(mobileService, mobileCall, mobileLine, mobileCall2, mobileLine2); RMobileConferenceCall confCall; CleanupClosePushL(confCall); ASSERT_EQUALS(KErrNone, confCall.Open(iPhone)); // Hang up cause for normal hang up DriverHangUpCallL(callId1, KErrGsmCCNormalCallClearing, EFalse); DriverHangUpCallL(callId2, KErrGsmCCNormalCallClearing); TRequestStatus status; confCall.CreateConference(status); User::WaitForRequest(status); ASSERT_EQUALS(status.Int(), KErrNotSupported); // Hang up the calls ClientHangUpCallL(mobileCall); ClientHangUpCallL(mobileCall2); User::After(100000); // Allow the lifetimer to be updated before ending the test mobileCall.Close(); mobileCall2.Close(); AssertMockLtsyStatusL(); CleanupStack::PopAndDestroy(8, &config); }
void MTable::fieldGet( TConfig &cfg ) { MtxAlloc resource(owner().connRes, true); if(!owner().enableStat()) return; mLstUse = SYS->sysTm(); vector<string> cf_el; //Request preparing cfg.cfgList(cf_el); char *attrs[cf_el.size()+1]; string fltr; int fltrN = 0; for(unsigned iC = 0, iA = 0; iC < cf_el.size(); iC++) { TCfg &cf = cfg.cfg(cf_el[iC]); if(cf.isKey()) { fltr += "("+cf_el[iC]+"="+getVal(cf)+")"; fltrN++; } else if(cf.view()) { attrs[iA++] = (char*)cf_el[iC].c_str(); attrs[iA] = NULL; setVal(cf, ""); //Clear from previous value } } if(fltrN > 1) fltr = "&"+fltr; if(fltr.empty()) fltr = "(objectclass=*)"; //Request int rez; LDAPMessage *result = NULL, *entry; try { if((rez=ldap_search_s(owner().ldp,("ou="+name()+","+owner().bdn).c_str(),LDAP_SCOPE_ONE,fltr.c_str(),attrs,0,&result)) != LDAP_SUCCESS) throw err_sys(_("SEARCH: %s"), ldap_err2string(rez)); if(!ldap_count_entries(owner().ldp,result) || !(entry=ldap_first_entry(owner().ldp,result))) throw err_sys(_("Entry \"%s\" is not present."), fltr.c_str()); char *a, **vals; BerElement *ber; for(a = ldap_first_attribute(owner().ldp,entry,&ber); a != NULL; a = ldap_next_attribute(owner().ldp,entry,ber)) { string attr = a; ldap_memfree(a); string val; if((vals=ldap_get_values(owner().ldp,entry,attr.c_str())) != NULL) { for(int iV = 0; vals[iV] != NULL; iV++) val += vals[iV]; ldap_value_free(vals); } TCfg *cf = NULL; //cfg.at(attr, true); for(unsigned iC = 0; iC < cf_el.size() && !cf; iC++) if(strcasecmp(attr.c_str(),cf_el[iC].c_str()) == 0) { cf = cfg.at(cf_el[iC], true); attr = cf_el[iC]; } if(cf) setVal(*cf, val); } ldap_msgfree(result); } catch(TError&) { if(result) ldap_msgfree(result); throw; } }
void MTable::fieldGet( TConfig &cfg ) { vector< vector<string> > tbl; if(tblStrct.empty()) throw TError(nodePath().c_str(), _("Table is empty.")); mLstUse = SYS->sysTm(); string sid; //Prepare request string req = "SELECT "; string req_where, first_key; // Add fields list to queue bool first_sel = true, next_wr = false, trPresent = false; for(unsigned i_fld = 1; i_fld < tblStrct.size(); i_fld++) { sid = tblStrct[i_fld][1]; TCfg *u_cfg = cfg.at(sid,true); if(!u_cfg && !Mess->translDyn() && sid.compare(0,3,Mess->lang2Code()+"#") == 0) { u_cfg = cfg.at(sid.substr(3), true); if(u_cfg && !(u_cfg->fld().flg()&TCfg::TransltText)) continue; trPresent = true; } if(!u_cfg) continue; if(u_cfg->isKey()) { req_where += (next_wr?" AND \"":"\"") + mod->sqlReqCode(sid,'"') + "\"=" + getVal(*u_cfg); if(first_key.empty()) first_key = mod->sqlReqCode(sid,'"'); next_wr = true; } else if(u_cfg->view()) { req += (first_sel?"\"":",\"") + mod->sqlReqCode(sid,'"') + "\""; first_sel = false; } } if(first_sel) req += "\""+first_key+"\""; req += " FROM '" + mod->sqlReqCode(name()) + "' WHERE " + req_where + ";"; //Query owner().sqlReq(req, &tbl, false); if(tbl.size() < 2) throw TError(nodePath().c_str(), _("Row \"%s\" is not present."), req_where.c_str()); //Processing of query for(unsigned i_fld = 0; i_fld < tbl[0].size(); i_fld++) { sid = tbl[0][i_fld]; TCfg *u_cfg = cfg.at(sid, true); if(u_cfg) setVal(*u_cfg, tbl[1][i_fld]); else if(trPresent && sid.compare(0,3,Mess->lang2Code()+"#") == 0 && tbl[1][i_fld].size() && (u_cfg=cfg.at(sid.substr(3),true))) setVal(*u_cfg, tbl[1][i_fld], true); } }
void MTable::fieldDel( TConfig &cfg ) { if(tblStrct.empty()) return; mLstUse = SYS->sysTm(); //Where prepare string req_where = "WHERE "; bool next = false; for(unsigned i_fld = 1; i_fld < tblStrct.size(); i_fld++) { string sid = tblStrct[i_fld][1]; TCfg *u_cfg = cfg.at(sid, true); if(u_cfg && u_cfg->isKey() && u_cfg->keyUse()) { req_where += (next?" AND \"":"\"") + mod->sqlReqCode(sid,'"') + "\"=" + getVal(*u_cfg) + " "; next = true; } } //Main request try { owner().sqlReq("DELETE FROM '"+mod->sqlReqCode(name())+"' "+req_where+";", NULL, true); } catch(TError err) { //Check for present vector< vector<string> > tbl; owner().sqlReq("SELECT 1 FROM '"+mod->sqlReqCode(name())+"' "+req_where+";", &tbl, true); if(tbl.size() < 2) return; } }
int MTable::findKeyLine( TConfig &cfg, int cnt, bool useKey, int off ) { int i_ln, i_clm, i_cnt = 0; mLstUse = time(NULL); //Get config fields list vector<string> cf_el; cfg.cfgList(cf_el); //Left only keys into list for(unsigned i_cf = 0; i_cf < cf_el.size(); ) if(cfg.cfg(cf_el[i_cf]).isKey()) i_cf++; else cf_el.erase(cf_el.begin()+i_cf); //Find want field for(i_ln = off; i_ln < basa->GetCountItems(); i_ln++) { int cnt_key = 0; for(unsigned i_cf = 0; i_cf < cf_el.size(); i_cf++) { if(useKey && !cfg.cfg(cf_el[i_cf]).keyUse()) { cnt_key++; continue; } //Check key // Find collumn db_str_rec *fld_rec; for(i_clm = 0; (fld_rec = basa->getField(i_clm)) != NULL; i_clm++) if(cf_el[i_cf].compare(0,10,fld_rec->name) == 0) break; if(fld_rec == NULL) throw err_sys(_("The key column '%s' is not present."), cf_el[i_cf].c_str()); // Get table volume string val; if(basa->GetFieldIt(i_ln,i_clm,val) < 0) throw err_sys(_("Error the cell.")); // Remove spaces from end int i; for(i = val.size(); i > 0 && val[i-1] == ' '; i--) ; if(i != (int)val.size()) val.resize(i); // Compare value if(val != cfg.cfg(cf_el[i_cf]).getS(TCfg::ExtValTwo)/*getVal(cfg.cfg(cf_el[i_cf]))*/) { cnt_key = 0; break; } cnt_key++; } if(cnt_key && cnt <= i_cnt++) break; } if(i_ln >= basa->GetCountItems()) return -1; return i_ln; }
void MTable::fieldStruct( TConfig &cfg ) { if(tblStrct.empty()) throw TError(nodePath().c_str(), _("Table is empty.")); mLstUse = SYS->sysTm(); for(unsigned i_fld = 1; i_fld < tblStrct.size(); i_fld++) { string sid = tblStrct[i_fld][1]; if(cfg.cfgPresent(sid)) continue; int flg = (tblStrct[i_fld][5] == "1") ? (int)TCfg::Key : (int)TFld::NoFlag; if(tblStrct[i_fld][2] == "TEXT") cfg.elem().fldAdd(new TFld(sid.c_str(),sid.c_str(),TFld::String,flg,"16777215")); else if(tblStrct[i_fld][2] == "INTEGER") cfg.elem().fldAdd(new TFld(sid.c_str(),sid.c_str(),TFld::Integer,flg)); else if(tblStrct[i_fld][2] == "REAL" || tblStrct[i_fld][2] == "DOUBLE") cfg.elem().fldAdd(new TFld(sid.c_str(),sid.c_str(),TFld::Real,flg)); } }
/** * @SYMTestCaseID BA-CTSYD-DIS-SIM-NEGATIVE-UN0020 * @SYMComponent telephony_ctsy * @SYMTestCaseDesc Test handing in CTSY dispatch when the ReadSimFile API is disabled * @SYMTestPriority High * @SYMTestActions Disable API, call API, check correct error returned * @SYMTestExpectedResults Pass * @SYMTestType CT */ void CCTsySimFUNegative::TestReadSimFileL() { TConfig config; config.SetSupportedValue(MLtsyDispatchSimReadSimFile::KLtsyDispatchSimReadSimFileApiId, EFalse); config.PushL(); OpenEtelServerL(EUseExtendedError); CleanupStack::PushL(TCleanupItem(Cleanup,this)); OpenPhoneL(); RMmCustomAPI customApi; OpenCustomApiLC(customApi); //example Ef(Imsi) path RMmCustomAPI::TSimFilePath path; path.Append(0x3F); path.Append(0x00); path.Append(0x7F); path.Append(0x00); path.Append(0x6F); path.Append(0x07); path.Append(0x00); path.Append(0x00); const TUint16 offset = 0; const TUint16 size = 15; RMmCustomAPI::TSimFileInfo simFileInfo; simFileInfo.iPath = path; simFileInfo.iOffSet = offset; simFileInfo.iSize = size; RMmCustomAPI::TSimFileInfoPckg simFileInfoPckg(simFileInfo); TBuf8<20> responseBytes; TRequestStatus status; customApi.ReadSimFile(status, simFileInfoPckg, responseBytes); User::WaitForRequest(status); ASSERT_EQUALS(status.Int(), KErrNotSupported); AssertMockLtsyStatusL(); config.Reset(); CleanupStack::PopAndDestroy(3, &config); // customAPI, this, config }
/** * @SYMTestCaseID BA-CTSYD-DIS-SIM-NEGATIVE-UN0008 * @SYMComponent telephony_ctsy * @SYMTestCaseDesc Test handing in CTSY dispatch when the DeleteAPNName API is disabled * @SYMTestPriority High * @SYMTestActions Disable API, call API, check correct error returned * @SYMTestExpectedResults Pass * @SYMTestType CT */ void CCTsySimFUNegative::TestDeleteAPNNameL() { TConfig config; config.SetSupportedValue(MLtsyDispatchSimDeleteApnName::KLtsyDispatchSimDeleteApnNameApiId, EFalse); config.PushL(); OpenEtelServerL(EUseExtendedError); CleanupStack::PushL(TCleanupItem(Cleanup,this)); OpenPhoneL(); TRequestStatus status; iPhone.DeleteAPNName(status, 1); User::WaitForRequest(status); ASSERT_EQUALS(status.Int(), KErrNotSupported); AssertMockLtsyStatusL(); config.Reset(); CleanupStack::PopAndDestroy(2, &config); // this, config }
/** @SYMTestCaseID BA-CTSYD-DIS-SUPPLEMENTARYSERVICES-NEGATIVE-UN0001 @SYMComponent telephony_ctsy @SYMTestCaseDesc Test returned value if EMobilePhoneSendNetworkServiceRequestNoFdnCheck is not supported by LTSY @SYMTestPriority High @SYMTestActions Invokes RMobilePhone::SendNetworkServiceRequestNoFdnCheck() @SYMTestExpectedResults Pass @SYMTestType UT */ void CCTsySupplementaryServicesFUNegative::TestUnit0001L() { TConfig config; config.SetSupportedValue(MLtsyDispatchSupplementaryServicesSendNetworkServiceRequestNoFdnCheck::KLtsyDispatchSupplementaryServicesSendNetworkServiceRequestNoFdnCheckApiId, EFalse); OpenEtelServerL(EUseExtendedError); CleanupStack::PushL(TCleanupItem(Cleanup,this)); OpenPhoneL(); TRequestStatus requestStatus; _LIT(KMsg2,"SendNetworkServiceRequest1.2"); TName expServiceStringNoFDN(KMsg2); iPhone.SendNetworkServiceRequestNoFdnCheck(requestStatus, expServiceStringNoFDN); User::WaitForRequest(requestStatus); ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); AssertMockLtsyStatusL(); config.Reset(); CleanupStack::PopAndDestroy(this); // this }