Inject last location in InjectBestLocation VTS test

Bug: 110626730
Test: run VTS on device.
Merged-In: I6f57dd7f9164dacf011f25412e55fcd22821aca0
Change-Id: I6f57dd7f9164dacf011f25412e55fcd22821aca0
(cherry picked from commit bb372e5984)
This commit is contained in:
Yu-Han Yang 2018-06-29 16:21:32 -07:00 committed by Keun Soo Yim
parent a9ad41d1ad
commit 75b0c4bba2

View file

@ -358,23 +358,8 @@ TEST_F(GnssHalTest, BlacklistConstellation) {
* Ensure successfully injecting a location.
*/
TEST_F(GnssHalTest, InjectBestLocation) {
GnssLocation gnssLocation = {.gnssLocationFlags = 0, // set below
.latitudeDegrees = 43.0,
.longitudeDegrees = -180,
.altitudeMeters = 1000,
.speedMetersPerSec = 0,
.bearingDegrees = 0,
.horizontalAccuracyMeters = 0.1,
.verticalAccuracyMeters = 0.1,
.speedAccuracyMetersPerSecond = 0.1,
.bearingAccuracyDegrees = 0.1,
.timestamp = 1534567890123L};
gnssLocation.gnssLocationFlags |=
GnssLocationFlags::HAS_LAT_LONG | GnssLocationFlags::HAS_ALTITUDE |
GnssLocationFlags::HAS_SPEED | GnssLocationFlags::HAS_HORIZONTAL_ACCURACY |
GnssLocationFlags::HAS_VERTICAL_ACCURACY | GnssLocationFlags::HAS_SPEED_ACCURACY |
GnssLocationFlags::HAS_BEARING | GnssLocationFlags::HAS_BEARING_ACCURACY;
StartAndCheckLocations(1);
GnssLocation gnssLocation = last_location_;
CheckLocation(gnssLocation, true);
auto result = gnss_hal_->injectBestLocation(gnssLocation);
@ -382,7 +367,7 @@ TEST_F(GnssHalTest, InjectBestLocation) {
ASSERT_TRUE(result.isOk());
EXPECT_TRUE(result);
auto resultVoid = gnss_hal_->deleteAidingData(IGnss::GnssAidingData::DELETE_ALL);
auto resultVoid = gnss_hal_->deleteAidingData(IGnss::GnssAidingData::DELETE_POSITION);
ASSERT_TRUE(resultVoid.isOk());
}