Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: client/common_lib/site_power_status.py

Issue 6580020: Add check for charge_full or charge_now >> charge_full_design. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/common_lib/site_power_status.py
diff --git a/client/common_lib/site_power_status.py b/client/common_lib/site_power_status.py
index aa4c0e127e3f5455dda22b97e72703c635f9928b..488aa562cc7f4e47643a5433c2c05bcf03818aa5 100644
--- a/client/common_lib/site_power_status.py
+++ b/client/common_lib/site_power_status.py
@@ -90,6 +90,10 @@ class BatteryStat(DevStat):
self.voltage_min_design = self.voltage_min_design / 1000000
self.voltage_now = self.voltage_now / 1000000
+ if self.charge_full > (self.charge_full_design * 1.5):
+ raise error.TestError('Unreasonable charge_full value')
+ if self.charge_now > (self.charge_full_design * 1.5):
+ raise error.TestError('Unreasonable charge_now value')
self.energy = self.voltage_now * self.charge_now
self.energy_full = self.voltage_now * self.charge_full
self.energy_full_design = self.voltage_now * self.charge_full_design
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698