Loading gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp +29 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <log/log.h> #include <chrono> #include <cmath> #include <condition_variable> #include <mutex> Loading Loading @@ -402,6 +403,34 @@ TEST_P(GnssHalTest, InjectDelete) { StopAndClearLocations(); } /* * InjectSeedLocation: * Injects a seed location and ensures the injected seed location is not fused in the resulting * GNSS location. */ TEST_P(GnssHalTest, InjectSeedLocation) { // An arbitrary position in North Pacific Ocean (where no VTS labs will ever likely be located). const double seedLatDegrees = 32.312894; const double seedLngDegrees = -172.954117; const float seedAccuracyMeters = 150.0; auto result = gnss_hal_->injectLocation(seedLatDegrees, seedLngDegrees, seedAccuracyMeters); ASSERT_TRUE(result.isOk()); EXPECT_TRUE(result); StartAndGetSingleLocation(false); // Ensure we don't get a location anywhere within 111km (1 degree of lat or lng) of the seed // location. EXPECT_TRUE(std::abs(last_location_.latitudeDegrees - seedLatDegrees) > 1.0 || std::abs(last_location_.longitudeDegrees - seedLngDegrees) > 1.0); StopAndClearLocations(); auto resultVoid = gnss_hal_->deleteAidingData(IGnss::GnssAidingData::DELETE_POSITION); ASSERT_TRUE(resultVoid.isOk()); } /* * GetAllExtentions: * Tries getting all optional extensions, and ensures a valid return Loading Loading
gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp +29 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <log/log.h> #include <chrono> #include <cmath> #include <condition_variable> #include <mutex> Loading Loading @@ -402,6 +403,34 @@ TEST_P(GnssHalTest, InjectDelete) { StopAndClearLocations(); } /* * InjectSeedLocation: * Injects a seed location and ensures the injected seed location is not fused in the resulting * GNSS location. */ TEST_P(GnssHalTest, InjectSeedLocation) { // An arbitrary position in North Pacific Ocean (where no VTS labs will ever likely be located). const double seedLatDegrees = 32.312894; const double seedLngDegrees = -172.954117; const float seedAccuracyMeters = 150.0; auto result = gnss_hal_->injectLocation(seedLatDegrees, seedLngDegrees, seedAccuracyMeters); ASSERT_TRUE(result.isOk()); EXPECT_TRUE(result); StartAndGetSingleLocation(false); // Ensure we don't get a location anywhere within 111km (1 degree of lat or lng) of the seed // location. EXPECT_TRUE(std::abs(last_location_.latitudeDegrees - seedLatDegrees) > 1.0 || std::abs(last_location_.longitudeDegrees - seedLngDegrees) > 1.0); StopAndClearLocations(); auto resultVoid = gnss_hal_->deleteAidingData(IGnss::GnssAidingData::DELETE_POSITION); ASSERT_TRUE(resultVoid.isOk()); } /* * GetAllExtentions: * Tries getting all optional extensions, and ensures a valid return Loading