Use IsSubsetOf matcher for comparing changed vs updated properties
The previous implementation did not work as intended because it was
comparing using equality. This means that if there is a mismatch in
the number of elements in each list it would fail.
Bug: 277359330
Bug: 277359630
Bug: 277359374
Bug: 277359394
Bug: 277359419
Bug: 277359421
Bug: 277359396
Bug: 277359260
Test: atest FakeVehicleHardwareTest
Change-Id: If624ee39271725c6158c004181104ca6b30d4598
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
index 254d30f..b399bdf 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
@@ -83,6 +83,7 @@
using ::testing::ContainsRegex;
using ::testing::Eq;
using ::testing::HasSubstr;
+using ::testing::IsSubsetOf;
using ::testing::WhenSortedBy;
using std::chrono::milliseconds;
@@ -1066,7 +1067,7 @@
// Some of the updated properties might be the same as default config, thus not causing
// a property change event. So the changed properties should be a subset of all the updated
// properties.
- ASSERT_THAT(getChangedProperties(), WhenSortedBy(mPropValueCmp, Eq(gotValues)));
+ ASSERT_THAT(getChangedProperties(), IsSubsetOf(gotValues));
}
INSTANTIATE_TEST_SUITE_P(