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:
Treehugger Robot 2020-09-25 19:08:57 +00:00 committed by Automerger Merge Worker
commit b2ab00e90d

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";
}
})));
}