health 2.0 vts: Allow for battery-less devices

Battery-less devices reports UNKNOWN for getChargeStatus.
Allow it.

Test: on cuttlefish
Change-Id: I06dd2841d43cab9528209d0bfd61969a8f2409c8
This commit is contained in:
Yifan Hong 2020-01-27 16:20:49 -08:00
parent 116a7e2ed4
commit 5ac6f5bc99

View file

@ -315,9 +315,7 @@ TEST_P(HealthHidlTest, getEnergyCounter) {
TEST_P(HealthHidlTest, getChargeStatus) { TEST_P(HealthHidlTest, getChargeStatus) {
SKIP_IF_SKIPPED(); SKIP_IF_SKIPPED();
EXPECT_OK(mHealth->getChargeStatus([](auto result, auto value) { EXPECT_OK(mHealth->getChargeStatus([](auto result, auto value) {
EXPECT_VALID_OR_UNSUPPORTED_PROP( EXPECT_VALID_OR_UNSUPPORTED_PROP(result, toString(value), verifyEnum<BatteryStatus>(value));
result, toString(value),
value != BatteryStatus::UNKNOWN && verifyEnum<BatteryStatus>(value));
})); }));
} }