health 2.1 VTS: fix test on batteryFullCapacityUah
getHealthInfo_2_1 reports batteryFullCapacityUah: - 0 if value is unknown. In such case, no requirement is enforced. - positive if value is known. In such case, require it to be 50%~120% of batteryFullCharge. Test: run on cuttlefish Bug: 144948996 Change-Id: I7856729aafa3a19a3bfcc00e6e0ad5162f22afea
This commit is contained in:
parent
3a8eb92143
commit
3f91f296ba
1 changed files with 7 additions and 3 deletions
|
@ -233,9 +233,13 @@ TEST_P(HealthHidlTest, getHealthInfo_2_1) {
|
|||
EXPECT_TRUE(IsEnum(value.batteryCapacityLevel)) << " BatteryCapacityLevel";
|
||||
EXPECT_GE(value.batteryChargeTimeToFullNowSeconds, 0);
|
||||
|
||||
EXPECT_GE(value.batteryFullCapacityUah, 0) << "batteryFullCapacityUah is unknown";
|
||||
EXPECT_GE(value.batteryFullCapacityUah, legacy.batteryFullCharge * 0.50);
|
||||
EXPECT_LE(value.batteryFullCapacityUah, legacy.batteryFullCharge * 1.20);
|
||||
EXPECT_GE(value.batteryFullCapacityUah, 0)
|
||||
<< "batteryFullCapacityUah should not be negative";
|
||||
|
||||
if (value.batteryFullCapacityUah > 0) {
|
||||
EXPECT_GE(value.batteryFullCapacityUah, legacy.batteryFullCharge * 0.50);
|
||||
EXPECT_LE(value.batteryFullCapacityUah, legacy.batteryFullCharge * 1.20);
|
||||
}
|
||||
})));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue