void CT_LbsClientPosTp2::CheckPositionSatelliteInfoL(TPositionSatelliteInfo& aSatelliteInfo) { CheckPositionCourseInfoL(aSatelliteInfo); if((TUint)aSatelliteInfo.NumSatellitesUsed() != KNumberOfSatellitesUsed || aSatelliteInfo.SatelliteTime() != TTime(KSatelliteTime) || (TUint)aSatelliteInfo.NumSatellitesInView() != KNumberOfSatellitesInView || aSatelliteInfo.HorizontalDoP() != KHorizontalDoPValue || aSatelliteInfo.VerticalDoP() != KVerticalDoPValue || aSatelliteInfo.TimeDoP() != KTimeDoPValue) { _LIT(KErrBasicSat, "Basic satellite information not correct"); LogErrorAndLeaveL(KErrBasicSat); } TInt sats = aSatelliteInfo.NumSatellitesInView(); for (int i = 0; i < sats; i++) { TSatelliteData satelliteData; TInt err = aSatelliteInfo.GetSatelliteData(i,satelliteData); if (err != KErrNone) { _LIT(KErrGetSat, "Not possible to get satellite data, error code = %d"); TBuf<100> buf; buf.Format(KErrGetSat, err); LogErrorAndLeaveL(buf); } if ( (i%2) == 0 ) { if( satelliteData.SatelliteId() != (KSatelliteId +i) || satelliteData.Azimuth() != KAzimuth || satelliteData.Elevation() != KElevation || satelliteData.IsUsed() != KIsUsed || satelliteData.SignalStrength() != KSignalStrength) { _LIT(KErrSatDataEven, "Incorrect satellite data on even satellites"); LogErrorAndLeaveL(KErrSatDataEven); } } else { if( satelliteData.SatelliteId() != (KSatelliteId +i) || satelliteData.Azimuth() != KAzimuthOdd || satelliteData.Elevation() != KElevationOdd || satelliteData.IsUsed() != KIsUsedOdd || satelliteData.SignalStrength() != KSignalStrengthOdd) { _LIT(KErrSatDataOdd, "Incorrect satellite data on odd satellites"); LogErrorAndLeaveL(KErrSatDataOdd); } } } }
// --------------------------------------------------------- // CPosPSYClearPositionDataTest::CheckSatelliteInfoClearsL // // (other items were commented in a header). // --------------------------------------------------------- // void CPosPSYClearPositionDataTest::CheckSatelliteInfoClearsL() { TBool allIsCleared = ETrue; TPositionSatelliteInfo* satInfo = static_cast<TPositionSatelliteInfo*> (iPosInfo); if (satInfo->SatelliteTime() == KSatelliteTime) { _LIT(KError, "Satellite Time was not cleared for TPositionSatelliteInfo."); AddTestResultL(KError, EErrorMessage); allIsCleared = EFalse; } if (!Math::IsNaN(satInfo->HorizontalDoP())) { if (satInfo->HorizontalDoP() == KSatelliteHorizontalDoP) { _LIT(KError, "Horizontal DoP was not cleared for TPositionSatelliteInfo."); AddTestResultL(KError, EErrorMessage); allIsCleared = EFalse; } } if (!Math::IsNaN(satInfo->VerticalDoP())) { if (satInfo->VerticalDoP() == KSatelliteVerticalDoP) { _LIT(KError, "Vertical DoP was not cleared for TPositionSatelliteInfo."); AddTestResultL(KError, EErrorMessage); allIsCleared = EFalse; } } if (!Math::IsNaN(satInfo->TimeDoP())) { if (satInfo->TimeDoP() == KSatelliteTimeDoP) { _LIT(KError, "Time DoP was not cleared for TPositionSatelliteInfo."); AddTestResultL(KError, EErrorMessage); allIsCleared = EFalse; } } TBool satelliteDataNotCleared = EFalse; for (TInt i = 0; i < KSatelliteNumInView; i++) { TSatelliteData satellite; TInt error = satInfo->GetSatelliteData(i, satellite); if (error != KErrNotFound) { if (!Math::IsNaN(satellite.Azimuth())) { if (satellite.Azimuth() == KAzimuth) { satelliteDataNotCleared = ETrue; } } if (!Math::IsNaN(satellite.Elevation())) { if (satellite.Elevation() == KElevation) { satelliteDataNotCleared = ETrue; } } if (satellite.SatelliteId() == KSatelliteId || satellite.SignalStrength() == KSignalStrength) { satelliteDataNotCleared = ETrue; } } } if (satelliteDataNotCleared) { _LIT(KError, "Satellite Data was not cleared for all satellites in TPositionSatelliteInfo."); AddTestResultL(KError, EErrorMessage); allIsCleared = EFalse; } if (allIsCleared) { _LIT(KInfo, "All fields were cleared for TPositionSatelliteInfo."); AddTestResultL(KInfo, EInfoMessage); } }