Merge "Allow batteryFullChargeDesignCapacityUah to be 0" am: 2be786937c
am: 4912a028cf
am: 0c5dad9ce2
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1437294 Change-Id: Iba499c16eb92851ac7e04fabc962a4e3cedfc2ec
This commit is contained in:
commit
b2ab00e90d
1 changed files with 8 additions and 7 deletions
|
@ -235,14 +235,15 @@ TEST_P(HealthHidlTest, getHealthInfo_2_1) {
|
||||||
EXPECT_TRUE(IsEnum(value.batteryCapacityLevel)) << " BatteryCapacityLevel";
|
EXPECT_TRUE(IsEnum(value.batteryCapacityLevel)) << " BatteryCapacityLevel";
|
||||||
EXPECT_GE(value.batteryChargeTimeToFullNowSeconds, -1);
|
EXPECT_GE(value.batteryChargeTimeToFullNowSeconds, -1);
|
||||||
|
|
||||||
EXPECT_GE(value.batteryFullChargeDesignCapacityUah, 0)
|
if (value.batteryFullChargeDesignCapacityUah != 0) {
|
||||||
<< "batteryFullChargeDesignCapacityUah should not be negative";
|
EXPECT_GT((long)value.batteryFullChargeDesignCapacityUah, FULL_CHARGE_DESIGN_CAP_MIN)
|
||||||
|
<< "batteryFullChargeDesignCapacityUah should be greater than 100 mAh, or 0 if "
|
||||||
|
"unknown";
|
||||||
|
|
||||||
EXPECT_GT((long)value.batteryFullChargeDesignCapacityUah, FULL_CHARGE_DESIGN_CAP_MIN)
|
EXPECT_LT((long)value.batteryFullChargeDesignCapacityUah, FULL_CHARGE_DESIGN_CAP_MAX)
|
||||||
<< "batteryFullChargeDesignCapacityUah should be greater than 100 mAh";
|
<< "batteryFullChargeDesignCapacityUah should be less than 100,000 mAh, or 0 "
|
||||||
|
"if unknown";
|
||||||
EXPECT_LT((long)value.batteryFullChargeDesignCapacityUah, FULL_CHARGE_DESIGN_CAP_MAX)
|
}
|
||||||
<< "batteryFullChargeDesignCapacityUah should be less than 100,000 mAh";
|
|
||||||
})));
|
})));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue