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

Unified Diff: tools/telemetry/telemetry/util/statistics_unittest.py

Issue 226613004: telemetry: add additional discrepancy test cases (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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: tools/telemetry/telemetry/util/statistics_unittest.py
diff --git a/tools/telemetry/telemetry/util/statistics_unittest.py b/tools/telemetry/telemetry/util/statistics_unittest.py
index 02b257bf3edc0f115d7a0e848f275860405637b1..918604db85cec2b8be3b9dd4835e8e100d8750ef 100644
--- a/tools/telemetry/telemetry/util/statistics_unittest.py
+++ b/tools/telemetry/telemetry/util/statistics_unittest.py
@@ -99,6 +99,14 @@ class StatisticsUnitTest(unittest.TestCase):
d = statistics.Discrepancy(samples)
self.assertEquals(d, 0.25)
+ samples = [1.0/8.0, 5.0/8.0, 5.0/8.0, 7.0/8.0]
+ d = statistics.Discrepancy(samples)
+ self.assertEquals(d, 0.5)
+
+ samples = [1.0/8.0, 3.0/8.0, 5.0/8.0, 5.0/8.0, 7.0/8.0]
+ d = statistics.Discrepancy(samples)
+ self.assertEquals(d, 0.4)
+
samples = [0.0, 1.0/3.0, 2.0/3.0, 1.0]
d = statistics.Discrepancy(samples)
self.assertEquals(d, 0.5)
« 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