Merge "Allow batteryFullChargeDesignCapacityUah to be 0" am: 2be786937c am: 4912a028cf

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1437294

Change-Id: Ib11c5e88b55bee8ce5121601f3574a53606544ad
This commit is contained in:
Treehugger Robot 2020-09-25 18:40:42 +00:00 committed by Automerger Merge Worker
commit 0c5dad9ce2

View file

@ -235,14 +235,15 @@ TEST_P(HealthHidlTest, getHealthInfo_2_1) {
EXPECT_TRUE(IsEnum(value.batteryCapacityLevel)) << " BatteryCapacityLevel";
EXPECT_GE(value.batteryChargeTimeToFullNowSeconds, -1);
EXPECT_GE(value.batteryFullChargeDesignCapacityUah, 0)
<< "batteryFullChargeDesignCapacityUah should not be negative";
if (value.batteryFullChargeDesignCapacityUah != 0) {
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)
<< "batteryFullChargeDesignCapacityUah should be greater than 100 mAh";
EXPECT_LT((long)value.batteryFullChargeDesignCapacityUah, FULL_CHARGE_DESIGN_CAP_MAX)
<< "batteryFullChargeDesignCapacityUah should be less than 100,000 mAh";
EXPECT_LT((long)value.batteryFullChargeDesignCapacityUah, FULL_CHARGE_DESIGN_CAP_MAX)
<< "batteryFullChargeDesignCapacityUah should be less than 100,000 mAh, or 0 "
"if unknown";
}
})));
}