From d0efba359b185fe140635b6269442a81e49e4c69 Mon Sep 17 00:00:00 2001 From: robertocn Date: Thu, 23 Oct 2014 14:33:26 -0700 Subject: Re-applying reverted changes plus fix. ConfidenceScore now takes flat lists and the previously offending code now checks whether the lists need to be flattened before being passed to the function. BUG=422727 Review URL: https://codereview.chromium.org/644323002 Cr-Commit-Position: refs/heads/master@{#300196} Review URL: https://codereview.chromium.org/665893003 Cr-Commit-Position: refs/heads/master@{#300953} --- tools/auto_bisect/bisect_results_test.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'tools/auto_bisect/bisect_results_test.py') diff --git a/tools/auto_bisect/bisect_results_test.py b/tools/auto_bisect/bisect_results_test.py index 4b77806..25359c5 100644 --- a/tools/auto_bisect/bisect_results_test.py +++ b/tools/auto_bisect/bisect_results_test.py @@ -87,22 +87,14 @@ class BisectResultsTest(unittest.TestCase): bad_values: First list of numbers. good_values: Second list of numbers. """ - # ConfidenceScore takes a list of lists but these lists are flattened - # inside the function. - confidence = BisectResults.ConfidenceScore( - [[v] for v in bad_values], - [[v] for v in good_values]) + confidence = BisectResults.ConfidenceScore(bad_values, good_values) self.assertEqual(score, confidence) def testConfidenceScoreIsZeroOnTooFewLists(self): - self._AssertConfidence(0.0, [], [[1], [2]]) - self._AssertConfidence(0.0, [[1], [2]], []) - self._AssertConfidence(0.0, [[1]], [[1], [2]]) - self._AssertConfidence(0.0, [[1], [2]], [[1]]) - - def testConfidenceScoreIsZeroOnEmptyLists(self): - self.assertEqual(BisectResults.ConfidenceScore([[], []], [[1], [2]]), 0.0) - self.assertEqual(BisectResults.ConfidenceScore([[1], [2]], [[], []]), 0.0) + self._AssertConfidence(0.0, [], [1, 2]) + self._AssertConfidence(0.0, [1, 2], []) + self._AssertConfidence(0.0, [1], [1, 2]) + self._AssertConfidence(0.0, [1, 2], [1]) def testConfidenceScore_ZeroConfidence(self): # The good and bad sets contain the same values, so the confidence that -- cgit v1.1