diff options
Diffstat (limited to 'gnss/1.1/vts/functional/gnss_hal_test_cases.cpp')
-rw-r--r-- | gnss/1.1/vts/functional/gnss_hal_test_cases.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
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 8f4691e1..cce46f18 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) { | |||
84 | } | 84 | } |
85 | 85 | ||
86 | /* | 86 | /* |
87 | * FindStrongFrequentSource: | 87 | * FindStrongFrequentNonGpsSource: |
88 | * | 88 | * |
89 | * Search through a GnssSvStatus list for the strongest satellite observed enough times | 89 | * Search through a GnssSvStatus list for the strongest non-GPS satellite observed enough times |
90 | * | 90 | * |
91 | * returns the strongest source, | 91 | * returns the strongest source, |
92 | * or a source with constellation == UNKNOWN if none are found sufficient times | 92 | * or a source with constellation == UNKNOWN if none are found sufficient times |
93 | */ | 93 | */ |
94 | 94 | ||
95 | IGnssConfiguration::BlacklistedSource FindStrongFrequentSource( | 95 | IGnssConfiguration::BlacklistedSource FindStrongFrequentNonGpsSource( |
96 | const list<IGnssCallback::GnssSvStatus> list_gnss_sv_status, const int min_observations) { | 96 | const list<IGnssCallback::GnssSvStatus> list_gnss_sv_status, const int min_observations) { |
97 | struct ComparableBlacklistedSource { | 97 | struct ComparableBlacklistedSource { |
98 | IGnssConfiguration::BlacklistedSource id; | 98 | IGnssConfiguration::BlacklistedSource id; |
@@ -113,7 +113,8 @@ IGnssConfiguration::BlacklistedSource FindStrongFrequentSource( | |||
113 | for (const auto& gnss_sv_status : list_gnss_sv_status) { | 113 | for (const auto& gnss_sv_status : list_gnss_sv_status) { |
114 | for (uint32_t iSv = 0; iSv < gnss_sv_status.numSvs; iSv++) { | 114 | for (uint32_t iSv = 0; iSv < gnss_sv_status.numSvs; iSv++) { |
115 | const auto& gnss_sv = gnss_sv_status.gnssSvList[iSv]; | 115 | const auto& gnss_sv = gnss_sv_status.gnssSvList[iSv]; |
116 | if (gnss_sv.svFlag & IGnssCallback::GnssSvFlags::USED_IN_FIX) { | 116 | if ((gnss_sv.svFlag & IGnssCallback::GnssSvFlags::USED_IN_FIX) && |
117 | (gnss_sv.constellation != GnssConstellationType::GPS)) { | ||
117 | ComparableBlacklistedSource source; | 118 | ComparableBlacklistedSource source; |
118 | source.id.svid = gnss_sv.svid; | 119 | source.id.svid = gnss_sv.svid; |
119 | source.id.constellation = gnss_sv.constellation; | 120 | source.id.constellation = gnss_sv.constellation; |
@@ -187,8 +188,12 @@ TEST_F(GnssHalTest, BlacklistIndividualSatellites) { | |||
187 | */ | 188 | */ |
188 | 189 | ||
189 | IGnssConfiguration::BlacklistedSource source_to_blacklist = | 190 | IGnssConfiguration::BlacklistedSource source_to_blacklist = |
190 | FindStrongFrequentSource(list_gnss_sv_status_, kLocationsToAwait - 1); | 191 | FindStrongFrequentNonGpsSource(list_gnss_sv_status_, kLocationsToAwait - 1); |
191 | EXPECT_NE(source_to_blacklist.constellation, GnssConstellationType::UNKNOWN); | 192 | |
193 | if (source_to_blacklist.constellation == GnssConstellationType::UNKNOWN) { | ||
194 | // Cannot find a non-GPS satellite. Let the test pass. | ||
195 | return; | ||
196 | } | ||
192 | 197 | ||
193 | // Stop locations, blacklist the common SV | 198 | // Stop locations, blacklist the common SV |
194 | StopAndClearLocations(); | 199 | StopAndClearLocations(); |