void CT_LbsX3PIntByMoLr::OnNotifyPositionUpdate(TInt32 aErr, const TPositionInfoBase& aPosInfo) { // Verify error. TEST(aErr == KErrNone); // Verify position. TEST(aPosInfo.PositionClassType() == EPositionInfoClass); // Expecting ref pos. if (iState == EInitializing) { iState = ERefLocReceived; TEST(aPosInfo.PositionMode() == TPositionModuleInfo::ETechnologyNetwork); } // Expecting network pos. else if (iState == ERefLocReceived) { iState = EGpsLocReceived; TEST(aPosInfo.PositionMode() == (TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted)); } // Not expecting anything else. else { TEST(EFalse); } ReturnToTestStep(); }
void CT_LbsMolrResetAssistance::OnNotifyPositionUpdate(TInt32 aErr, const TPositionInfoBase& aPosInfo) { INFO_PRINTF2(_L("CT_LbsMolrResetAssistance::OnNotifyPositionUpdate() >> NPUD() complete with %d"), aErr); if(iGPSModeNotSupported) { TEST(aErr == KErrNotSupported); } else { // Verify error. TEST(aErr == KErrNone); // Verify position. // Expecting ref pos. if (iState == EInitializing) { iState = ERefLocReceived; TEST(aPosInfo.PositionClassType() == EPositionInfoClass); TEST(aPosInfo.PositionMode() == TPositionModuleInfo::ETechnologyNetwork); // check for refpos details const TPositionInfo posInfo = static_cast<const TPositionInfo&>(aPosInfo); TEST(ArgUtils::ComparePositionInfoToMolrRefPos(posInfo)); } // Expecting gps pos. else if (iState == ERefLocReceived) { iState = EGpsLocReceived; TEST(aPosInfo.PositionClassType() == EPositionInfoClass); if(iPlannedPositionOriginator == EPositionOriginatorModule) { TEST(aPosInfo.PositionMode() == (TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted)); } if(iPlannedPositionOriginator == EPositionOriginatorNetwork) { TEST(aPosInfo.PositionMode() == (TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted)); } } // Not expecting anything else. else { INFO_PRINTF1(_L("CT_LbsMolrResetAssistance::OnNotifyPositionUpdate() - FAILED: unexpected state")); TEST(EFalse); } } ReturnToTestStep(); }
void CT_LbsATAEarlyComplete::OnNotifyPositionUpdate(TInt32 aErr, const TPositionInfoBase& aPosInfo) { // Verify position. if (iState == EInitializing) { INFO_PRINTF2(_L("OnNotifyPositionUpdate, Expecting KPositionQualityLoss and got err %d."), aErr); TEST(aErr == KPositionQualityLoss); TInt testCaseId; if (GetIntFromConfig(ConfigSection(), KTestCaseId, testCaseId)) { T_LbsUtils utils; TPositionInfo networkPosInfo = ArgUtils::MolrNetworkPositionInfo(); TEST(utils.Compare_PosInfo(aPosInfo, networkPosInfo)); TEST(aPosInfo.PositionMode() == (TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted)); TEST(aPosInfo.PositionClassType() == EPositionInfoClass); TEST(aPosInfo.ModuleId() == TUid::Uid(0x10281D43)); // id of NetLocManager } iState = EGotCompleteRequestPosition; } else if (iState == EGotCompleteRequestPosition) { TEST(aErr == KPositionEarlyComplete); T_LbsUtils utils; TPositionInfo networkPosInfo = ArgUtils::MolrNetworkPositionInfo(); TEST(utils.Compare_PosInfo(aPosInfo, networkPosInfo)); TEST(aPosInfo.PositionMode() == (TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted)); TEST(aPosInfo.PositionClassType() == EPositionInfoClass); TEST(aPosInfo.ModuleId() == TUid::Uid(0x10281D43)); // id of NetLocManager iState = EDone; } else if (iState == EDone) { // not used } else { TEST(EFalse); } ReturnToTestStep(); }
void CT_LbsPTAMOLRPartialEarlyComplete::OnNotifyPositionUpdate(TInt32 aErr, const TPositionInfoBase& aPosInfo) { // Verify position. TEST(aPosInfo.PositionClassType() == EPositionInfoClass); // Expecting first partial update, NaN position. if (iState == EInitializing) { iState = EGpsPartialInitReceived; TEST(aErr == KPositionPartialUpdate); TEST(aPosInfo.PositionMode() == (TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted)); // check for nan in partial updates const TPositionInfo posInfo = static_cast<const TPositionInfo&>(aPosInfo); TESTL(ArgUtils::ComparePositionInfoToNan(posInfo)); } // Expecting previous partial update due to CompleteRequest(...) else if (iState == EGpsPartialInitReceived) { iState = EGpsPartialEarlyReceived; TEST(aErr == KPositionEarlyComplete); TEST(aPosInfo.PositionMode() == (TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted)); const TPositionInfo posInfo = static_cast<const TPositionInfo&>(aPosInfo); TESTL(ArgUtils::ComparePositionInfoToNan(posInfo)); } // Not expecting anything else. else { TEST(EFalse); } ReturnToTestStep(); }
void CT_LbsHybridUEAssistedMOLRNoGPSUpdate::OnNotifyPositionUpdate(TInt32 aErr, const TPositionInfoBase& aPosInfo) { INFO_PRINTF1(_L("RunL() - OnNotifyPositionUpdate()")); // Verify position. TEST(aPosInfo.PositionClassType() == EPositionInfoClass); // Expecting ref pos. if (iState == EInitializing) { // Verify error. TEST(aErr == KErrNone); iState = ERefLocReceived; TEST(aPosInfo.PositionMode() == TPositionModuleInfo::ETechnologyNetwork); INFO_PRINTF1(_L("RunL() - Got ref location")); } else { // expecting a position but not of the requitred quality INFO_PRINTF2(_L("RunL() - second %d"), aErr); if(iExpectedApiBehaviour == EApiVariant2) { // for variant 2 behaviour TEST(aErr == KErrTimedOut); } else { TEST(aErr == KPositionQualityLoss); } TEST(ETrue); } ReturnToTestStep(); }