Loading gnss/1.1/vts/functional/gnss_hal_test.cpp +9 −6 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ void GnssHalTest::SetPositionMode(const int min_interval_msec, const bool low_po EXPECT_TRUE(result); } bool GnssHalTest::StartAndCheckFirstLocation() { bool GnssHalTest::StartAndCheckFirstLocation(bool strict) { auto result = gnss_hal_->start(); EXPECT_TRUE(result.isOk()); Loading @@ -110,11 +110,14 @@ bool GnssHalTest::StartAndCheckFirstLocation() { * so allow time to demodulate ephemeris over the air. */ const int kFirstGnssLocationTimeoutSeconds = 75; int locationCalledCount = 0; if (strict) { EXPECT_TRUE(gnss_cb_->location_cbq_.retrieve(gnss_cb_->last_location_, kFirstGnssLocationTimeoutSeconds)); int locationCalledCount = gnss_cb_->location_cbq_.calledCount(); locationCalledCount = gnss_cb_->location_cbq_.calledCount(); EXPECT_EQ(locationCalledCount, 1); } if (locationCalledCount > 0) { // don't require speed on first fix Loading @@ -138,7 +141,7 @@ void GnssHalTest::StartAndCheckLocations(int count) { SetPositionMode(kMinIntervalMsec, kLowPowerMode); EXPECT_TRUE(StartAndCheckFirstLocation()); EXPECT_TRUE(StartAndCheckFirstLocation(/* strict= */ true)); for (int i = 1; i < count; i++) { EXPECT_TRUE(gnss_cb_->location_cbq_.retrieve(gnss_cb_->last_location_, Loading gnss/1.1/vts/functional/gnss_hal_test.h +3 −1 Original line number Diff line number Diff line Loading @@ -102,9 +102,11 @@ class GnssHalTest : public testing::TestWithParam<std::string> { * <p> Note this leaves the Location request active, to enable Stop call vs. other call * reordering tests. * * <p> if 'strict' is true, the test will fail if no location is generated. * * returns true if a location was successfully generated */ bool StartAndCheckFirstLocation(); bool StartAndCheckFirstLocation(bool strict); /* * CheckLocation: Loading gnss/1.1/vts/functional/gnss_hal_test_cases.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ TEST_P(GnssHalTest, GetLocationLowPower) { SetPositionMode(kMinIntervalMsec, kLowPowerMode); // Don't expect true - as without AGPS access if (!StartAndCheckFirstLocation()) { if (!StartAndCheckFirstLocation(/* strict= */ false)) { ALOGW("GetLocationLowPower test - no first low power location received."); } Loading gnss/2.0/vts/functional/gnss_hal_test.cpp +9 −7 Original line number Diff line number Diff line Loading @@ -97,7 +97,7 @@ void GnssHalTest::SetPositionMode(const int min_interval_msec, const bool low_po EXPECT_TRUE(result); } bool GnssHalTest::StartAndCheckFirstLocation() { bool GnssHalTest::StartAndCheckFirstLocation(bool strict) { const auto result = gnss_hal_->start(); EXPECT_TRUE(result.isOk()); Loading @@ -107,12 +107,14 @@ bool GnssHalTest::StartAndCheckFirstLocation() { * so allow time to demodulate ephemeris over the air. */ const int kFirstGnssLocationTimeoutSeconds = 75; int locationCalledCount = 0; if (strict) { EXPECT_TRUE(gnss_cb_->location_cbq_.retrieve(gnss_cb_->last_location_, kFirstGnssLocationTimeoutSeconds)); int locationCalledCount = gnss_cb_->location_cbq_.calledCount(); locationCalledCount = gnss_cb_->location_cbq_.calledCount(); EXPECT_EQ(locationCalledCount, 1); } if (locationCalledCount > 0) { // don't require speed on first fix CheckLocation(gnss_cb_->last_location_, false); Loading @@ -135,7 +137,7 @@ void GnssHalTest::StartAndCheckLocations(int count) { SetPositionMode(kMinIntervalMsec, kLowPowerMode); EXPECT_TRUE(StartAndCheckFirstLocation()); EXPECT_TRUE(StartAndCheckFirstLocation(/* strict= */ true)); for (int i = 1; i < count; i++) { EXPECT_TRUE(gnss_cb_->location_cbq_.retrieve(gnss_cb_->last_location_, Loading gnss/2.0/vts/functional/gnss_hal_test.h +3 −1 Original line number Diff line number Diff line Loading @@ -152,9 +152,11 @@ class GnssHalTest : public testing::TestWithParam<std::string> { * <p> Note this leaves the Location request active, to enable Stop call vs. other call * reordering tests. * * <p> if 'strict' is true, the test will fail if no location is generated. * * returns true if a location was successfully generated */ bool StartAndCheckFirstLocation(); bool StartAndCheckFirstLocation(bool strict); /* * CheckLocation: Loading Loading
gnss/1.1/vts/functional/gnss_hal_test.cpp +9 −6 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ void GnssHalTest::SetPositionMode(const int min_interval_msec, const bool low_po EXPECT_TRUE(result); } bool GnssHalTest::StartAndCheckFirstLocation() { bool GnssHalTest::StartAndCheckFirstLocation(bool strict) { auto result = gnss_hal_->start(); EXPECT_TRUE(result.isOk()); Loading @@ -110,11 +110,14 @@ bool GnssHalTest::StartAndCheckFirstLocation() { * so allow time to demodulate ephemeris over the air. */ const int kFirstGnssLocationTimeoutSeconds = 75; int locationCalledCount = 0; if (strict) { EXPECT_TRUE(gnss_cb_->location_cbq_.retrieve(gnss_cb_->last_location_, kFirstGnssLocationTimeoutSeconds)); int locationCalledCount = gnss_cb_->location_cbq_.calledCount(); locationCalledCount = gnss_cb_->location_cbq_.calledCount(); EXPECT_EQ(locationCalledCount, 1); } if (locationCalledCount > 0) { // don't require speed on first fix Loading @@ -138,7 +141,7 @@ void GnssHalTest::StartAndCheckLocations(int count) { SetPositionMode(kMinIntervalMsec, kLowPowerMode); EXPECT_TRUE(StartAndCheckFirstLocation()); EXPECT_TRUE(StartAndCheckFirstLocation(/* strict= */ true)); for (int i = 1; i < count; i++) { EXPECT_TRUE(gnss_cb_->location_cbq_.retrieve(gnss_cb_->last_location_, Loading
gnss/1.1/vts/functional/gnss_hal_test.h +3 −1 Original line number Diff line number Diff line Loading @@ -102,9 +102,11 @@ class GnssHalTest : public testing::TestWithParam<std::string> { * <p> Note this leaves the Location request active, to enable Stop call vs. other call * reordering tests. * * <p> if 'strict' is true, the test will fail if no location is generated. * * returns true if a location was successfully generated */ bool StartAndCheckFirstLocation(); bool StartAndCheckFirstLocation(bool strict); /* * CheckLocation: Loading
gnss/1.1/vts/functional/gnss_hal_test_cases.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ TEST_P(GnssHalTest, GetLocationLowPower) { SetPositionMode(kMinIntervalMsec, kLowPowerMode); // Don't expect true - as without AGPS access if (!StartAndCheckFirstLocation()) { if (!StartAndCheckFirstLocation(/* strict= */ false)) { ALOGW("GetLocationLowPower test - no first low power location received."); } Loading
gnss/2.0/vts/functional/gnss_hal_test.cpp +9 −7 Original line number Diff line number Diff line Loading @@ -97,7 +97,7 @@ void GnssHalTest::SetPositionMode(const int min_interval_msec, const bool low_po EXPECT_TRUE(result); } bool GnssHalTest::StartAndCheckFirstLocation() { bool GnssHalTest::StartAndCheckFirstLocation(bool strict) { const auto result = gnss_hal_->start(); EXPECT_TRUE(result.isOk()); Loading @@ -107,12 +107,14 @@ bool GnssHalTest::StartAndCheckFirstLocation() { * so allow time to demodulate ephemeris over the air. */ const int kFirstGnssLocationTimeoutSeconds = 75; int locationCalledCount = 0; if (strict) { EXPECT_TRUE(gnss_cb_->location_cbq_.retrieve(gnss_cb_->last_location_, kFirstGnssLocationTimeoutSeconds)); int locationCalledCount = gnss_cb_->location_cbq_.calledCount(); locationCalledCount = gnss_cb_->location_cbq_.calledCount(); EXPECT_EQ(locationCalledCount, 1); } if (locationCalledCount > 0) { // don't require speed on first fix CheckLocation(gnss_cb_->last_location_, false); Loading @@ -135,7 +137,7 @@ void GnssHalTest::StartAndCheckLocations(int count) { SetPositionMode(kMinIntervalMsec, kLowPowerMode); EXPECT_TRUE(StartAndCheckFirstLocation()); EXPECT_TRUE(StartAndCheckFirstLocation(/* strict= */ true)); for (int i = 1; i < count; i++) { EXPECT_TRUE(gnss_cb_->location_cbq_.retrieve(gnss_cb_->last_location_, Loading
gnss/2.0/vts/functional/gnss_hal_test.h +3 −1 Original line number Diff line number Diff line Loading @@ -152,9 +152,11 @@ class GnssHalTest : public testing::TestWithParam<std::string> { * <p> Note this leaves the Location request active, to enable Stop call vs. other call * reordering tests. * * <p> if 'strict' is true, the test will fail if no location is generated. * * returns true if a location was successfully generated */ bool StartAndCheckFirstLocation(); bool StartAndCheckFirstLocation(bool strict); /* * CheckLocation: Loading