From 374bec341fb7c405126680816fa75f57125e9d87 Mon Sep 17 00:00:00 2001 From: Nathan Harold Date: Fri, 4 Feb 2022 13:06:36 -0800 Subject: [PATCH] Update UsageSetting Cache before comparison in VTS The final step of the RadioNewtorkTest#setUsageSetting is to restore the original value to the modem in case it was changed. After doing that, the locally cached value in the VTS layer needs to be updated before comparing it with the originally queried value to ensure that the modem was restored to its initial state. Bug: 211819471 Test: m VtsHalRadioTargetTest Change-Id: Ibdd584d91b16bb779a0cefa2f45d2704cdcf7288 --- radio/aidl/vts/radio_network_test.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp index 391d63c2b6..e1d508d1d3 100644 --- a/radio/aidl/vts/radio_network_test.cpp +++ b/radio/aidl/vts/radio_network_test.cpp @@ -264,11 +264,16 @@ TEST_P(RadioNetworkTest, setUsageSetting) { [&](int serial) { return radio_network->setUsageSetting(serial, originalSetting); }, {RadioError::NONE}); + // After resetting the value to its original value, update the local cache, which must + // always succeed. + invokeAndExpectResponse([&](int serial) { return radio_network->getUsageSetting(serial); }, + {RadioError::NONE}); + // Check that indeed the updated setting was set. We do this after resetting to original // conditions to avoid early-exiting the test and leaving the device in a modified state. - ASSERT_TRUE(expectedSetting == updatedSetting); + EXPECT_EQ(expectedSetting, updatedSetting); // Check that indeed the original setting was reset. - ASSERT_TRUE(originalSetting == radioRsp_network->usageSetting); + EXPECT_EQ(originalSetting, radioRsp_network->usageSetting); } /* @@ -1728,4 +1733,4 @@ TEST_P(RadioNetworkTest, supplyNetworkDepersonalization) { RadioError::PASSWORD_INCORRECT, RadioError::SIM_ABSENT, RadioError::SYSTEM_ERR})); } LOG(DEBUG) << "supplyNetworkDepersonalization finished"; -} \ No newline at end of file +}