Loading automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h +1 −2 Original line number Diff line number Diff line Loading @@ -754,8 +754,7 @@ const std::vector<ConfigDeclaration> kVehicleProperties = { {.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .configArray = {3}}, .initialValue = {.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}}}, .configArray = {3}}}, {.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .access = VehiclePropertyAccess::READ_WRITE, Loading automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +36 −37 Original line number Diff line number Diff line Loading @@ -58,7 +58,6 @@ using ::android::base::unexpected; using ::testing::ContainerEq; using ::testing::ContainsRegex; using ::testing::Eq; using ::testing::IsSubsetOf; using ::testing::WhenSortedBy; constexpr int INVALID_PROP_ID = 0; Loading Loading @@ -634,17 +633,17 @@ std::vector<SetSpecialValueTestCase> setSpecialValueTestCases() { }, .expectedValuesToGet = { VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::DEEP_SLEEP_EXIT)}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::DEEP_SLEEP_EXIT)}, }, }, }, SetSpecialValueTestCase{ Loading @@ -659,17 +658,17 @@ std::vector<SetSpecialValueTestCase> setSpecialValueTestCases() { }, .expectedValuesToGet = { VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::HIBERNATION_EXIT)}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::HIBERNATION_EXIT)}, }, }, }, SetSpecialValueTestCase{ Loading @@ -684,17 +683,17 @@ std::vector<SetSpecialValueTestCase> setSpecialValueTestCases() { }, .expectedValuesToGet = { VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::SHUTDOWN_CANCELLED)}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::SHUTDOWN_CANCELLED)}, }, }, }, SetSpecialValueTestCase{ Loading @@ -709,17 +708,17 @@ std::vector<SetSpecialValueTestCase> setSpecialValueTestCases() { }, .expectedValuesToGet = { VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::WAIT_FOR_VHAL)}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::WAIT_FOR_VHAL)}, }, }, }, SetSpecialValueTestCase{ Loading @@ -734,17 +733,17 @@ std::vector<SetSpecialValueTestCase> setSpecialValueTestCases() { }, .expectedValuesToGet = { VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::DEEP_SLEEP_ENTRY)}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::FINISHED), 0}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::DEEP_SLEEP_ENTRY)}, }, }, }, SetSpecialValueTestCase{ Loading @@ -759,17 +758,17 @@ std::vector<SetSpecialValueTestCase> setSpecialValueTestCases() { }, .expectedValuesToGet = { VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::HIBERNATION_ENTRY)}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::FINISHED), 0}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::HIBERNATION_ENTRY)}, }, }, }, SetSpecialValueTestCase{ Loading @@ -784,17 +783,17 @@ std::vector<SetSpecialValueTestCase> setSpecialValueTestCases() { }, .expectedValuesToGet = { VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::SHUTDOWN_START)}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::FINISHED), 0}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::SHUTDOWN_START)}, }, }, }, SetSpecialValueTestCase{ Loading Loading @@ -915,7 +914,7 @@ TEST_P(FakeVehicleHardwareSpecialValuesTest, testSetSpecialProperties) { // 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, IsSubsetOf(gotValues))); ASSERT_THAT(getChangedProperties(), WhenSortedBy(mPropValueCmp, Eq(gotValues))); } INSTANTIATE_TEST_SUITE_P( Loading Loading
automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h +1 −2 Original line number Diff line number Diff line Loading @@ -754,8 +754,7 @@ const std::vector<ConfigDeclaration> kVehicleProperties = { {.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .configArray = {3}}, .initialValue = {.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}}}, .configArray = {3}}}, {.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .access = VehiclePropertyAccess::READ_WRITE, Loading
automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +36 −37 Original line number Diff line number Diff line Loading @@ -58,7 +58,6 @@ using ::android::base::unexpected; using ::testing::ContainerEq; using ::testing::ContainsRegex; using ::testing::Eq; using ::testing::IsSubsetOf; using ::testing::WhenSortedBy; constexpr int INVALID_PROP_ID = 0; Loading Loading @@ -634,17 +633,17 @@ std::vector<SetSpecialValueTestCase> setSpecialValueTestCases() { }, .expectedValuesToGet = { VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::DEEP_SLEEP_EXIT)}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::DEEP_SLEEP_EXIT)}, }, }, }, SetSpecialValueTestCase{ Loading @@ -659,17 +658,17 @@ std::vector<SetSpecialValueTestCase> setSpecialValueTestCases() { }, .expectedValuesToGet = { VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::HIBERNATION_EXIT)}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::HIBERNATION_EXIT)}, }, }, }, SetSpecialValueTestCase{ Loading @@ -684,17 +683,17 @@ std::vector<SetSpecialValueTestCase> setSpecialValueTestCases() { }, .expectedValuesToGet = { VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::SHUTDOWN_CANCELLED)}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::SHUTDOWN_CANCELLED)}, }, }, }, SetSpecialValueTestCase{ Loading @@ -709,17 +708,17 @@ std::vector<SetSpecialValueTestCase> setSpecialValueTestCases() { }, .expectedValuesToGet = { VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::WAIT_FOR_VHAL)}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::WAIT_FOR_VHAL)}, }, }, }, SetSpecialValueTestCase{ Loading @@ -734,17 +733,17 @@ std::vector<SetSpecialValueTestCase> setSpecialValueTestCases() { }, .expectedValuesToGet = { VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::DEEP_SLEEP_ENTRY)}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::FINISHED), 0}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::DEEP_SLEEP_ENTRY)}, }, }, }, SetSpecialValueTestCase{ Loading @@ -759,17 +758,17 @@ std::vector<SetSpecialValueTestCase> setSpecialValueTestCases() { }, .expectedValuesToGet = { VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::HIBERNATION_ENTRY)}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::FINISHED), 0}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::HIBERNATION_ENTRY)}, }, }, }, SetSpecialValueTestCase{ Loading @@ -784,17 +783,17 @@ std::vector<SetSpecialValueTestCase> setSpecialValueTestCases() { }, .expectedValuesToGet = { VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::SHUTDOWN_START)}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::FINISHED), 0}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .value.int32Values = {toInt( VehicleApPowerStateReport::SHUTDOWN_START)}, }, }, }, SetSpecialValueTestCase{ Loading Loading @@ -915,7 +914,7 @@ TEST_P(FakeVehicleHardwareSpecialValuesTest, testSetSpecialProperties) { // 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, IsSubsetOf(gotValues))); ASSERT_THAT(getChangedProperties(), WhenSortedBy(mPropValueCmp, Eq(gotValues))); } INSTANTIATE_TEST_SUITE_P( Loading