diff options
author | Yu-Han Yang <yuhany@google.com> | 2018-05-16 13:31:24 -0700 |
---|---|---|
committer | Yu-Han Yang <yuhany@google.com> | 2018-05-22 11:26:21 -0700 |
commit | ca63cbf6e280c10614ae5bfa1f08cc32a3c9a59e (patch) | |
tree | 5cf959a4880d8be86c6d01014c2bd837022b2a90 | |
parent | 318d3c4ff6d648d7a6a57cc379c065b0b72c8060 (diff) | |
download | platform_hardware_interfaces-ca63cbf6e280c10614ae5bfa1f08cc32a3c9a59e.tar.gz platform_hardware_interfaces-ca63cbf6e280c10614ae5bfa1f08cc32a3c9a59e.tar.bz2 platform_hardware_interfaces-ca63cbf6e280c10614ae5bfa1f08cc32a3c9a59e.zip |
Update VTS test to blacklist only non-GPS satellites
Bug: 79481978
Change-Id: Ieef04d816448d37ae54c61375db4955d4d3a24d7
Fixes: 79481978
Test: make vts
-rw-r--r-- | gnss/1.1/default/Gnss.cpp | 4 | ||||
-rw-r--r-- | gnss/1.1/vts/functional/gnss_hal_test_cases.cpp | 17 |
2 files changed, 14 insertions, 7 deletions
diff --git a/gnss/1.1/default/Gnss.cpp b/gnss/1.1/default/Gnss.cpp index bbc4940c31..bbf1cd31de 100644 --- a/gnss/1.1/default/Gnss.cpp +++ b/gnss/1.1/default/Gnss.cpp @@ -227,7 +227,9 @@ Return<GnssSvStatus> Gnss::getMockSvStatus() const { getSvInfo(5, GnssConstellationType::GPS, 27.0, 29.0, 56.5), getSvInfo(17, GnssConstellationType::GPS, 30.5, 71.0, 77.0), getSvInfo(26, GnssConstellationType::GPS, 24.1, 28.0, 253.0), - getSvInfo(30, GnssConstellationType::GPS, 20.5, 11.5, 116.0), + getSvInfo(5, GnssConstellationType::GLONASS, 20.5, 11.5, 116.0), + getSvInfo(17, GnssConstellationType::GLONASS, 21.5, 28.5, 186.0), + getSvInfo(18, GnssConstellationType::GLONASS, 28.3, 38.8, 69.0), getSvInfo(10, GnssConstellationType::GLONASS, 25.0, 66.0, 247.0)}; GnssSvStatus svStatus = {.numSvs = sizeof(mockGnssSvInfoList) / sizeof(GnssSvInfo)}; diff --git a/gnss/1.1/vts/functional/gnss_hal_test_cases.cpp b/gnss/1.1/vts/functional/gnss_hal_test_cases.cpp index 8f4691e1a6..cce46f18e1 100644 --- a/gnss/1.1/vts/functional/gnss_hal_test_cases.cpp +++ b/gnss/1.1/vts/functional/gnss_hal_test_cases.cpp @@ -84,15 +84,15 @@ TEST_F(GnssHalTest, GetLocationLowPower) { } /* - * FindStrongFrequentSource: + * FindStrongFrequentNonGpsSource: * - * Search through a GnssSvStatus list for the strongest satellite observed enough times + * Search through a GnssSvStatus list for the strongest non-GPS satellite observed enough times * * returns the strongest source, * or a source with constellation == UNKNOWN if none are found sufficient times */ -IGnssConfiguration::BlacklistedSource FindStrongFrequentSource( +IGnssConfiguration::BlacklistedSource FindStrongFrequentNonGpsSource( const list<IGnssCallback::GnssSvStatus> list_gnss_sv_status, const int min_observations) { struct ComparableBlacklistedSource { IGnssConfiguration::BlacklistedSource id; @@ -113,7 +113,8 @@ IGnssConfiguration::BlacklistedSource FindStrongFrequentSource( for (const auto& gnss_sv_status : list_gnss_sv_status) { for (uint32_t iSv = 0; iSv < gnss_sv_status.numSvs; iSv++) { const auto& gnss_sv = gnss_sv_status.gnssSvList[iSv]; - if (gnss_sv.svFlag & IGnssCallback::GnssSvFlags::USED_IN_FIX) { + if ((gnss_sv.svFlag & IGnssCallback::GnssSvFlags::USED_IN_FIX) && + (gnss_sv.constellation != GnssConstellationType::GPS)) { ComparableBlacklistedSource source; source.id.svid = gnss_sv.svid; source.id.constellation = gnss_sv.constellation; @@ -187,8 +188,12 @@ TEST_F(GnssHalTest, BlacklistIndividualSatellites) { */ IGnssConfiguration::BlacklistedSource source_to_blacklist = - FindStrongFrequentSource(list_gnss_sv_status_, kLocationsToAwait - 1); - EXPECT_NE(source_to_blacklist.constellation, GnssConstellationType::UNKNOWN); + FindStrongFrequentNonGpsSource(list_gnss_sv_status_, kLocationsToAwait - 1); + + if (source_to_blacklist.constellation == GnssConstellationType::UNKNOWN) { + // Cannot find a non-GPS satellite. Let the test pass. + return; + } // Stop locations, blacklist the common SV StopAndClearLocations(); |