[Lldb-commits] [lldb] r330170 - [Statistics] Relax the test output a little bit.

Davide Italiano via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 16 16:59:02 PDT 2018


Author: davide
Date: Mon Apr 16 16:59:01 2018
New Revision: 330170

URL: http://llvm.org/viewvc/llvm-project?rev=330170&view=rev
Log:
[Statistics] Relax the test output a little bit.

We don't really care about the order as this is a dictionary.
It should be more resilient to changes (adding/shuffling stats
around).

Pointed out by Jason Molenda in a post-commit review (thanks Jason).

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/stats_api/TestStatisticsAPI.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/stats_api/TestStatisticsAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/stats_api/TestStatisticsAPI.py?rev=330170&r1=330169&r2=330170&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/stats_api/TestStatisticsAPI.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/stats_api/TestStatisticsAPI.py Mon Apr 16 16:59:01 2018
@@ -22,7 +22,7 @@ class TestStatsAPI(TestBase):
         res = stats.GetAsJSON(stream)
         stats_json = sorted(json.loads(stream.GetData()))
         self.assertEqual(len(stats_json), 4)
-        self.assertEqual(stats_json[0], "Number of expr evaluation failures")
-        self.assertEqual(stats_json[1], "Number of expr evaluation successes")
-        self.assertEqual(stats_json[2], "Number of frame var failures")
-        self.assertEqual(stats_json[3], "Number of frame var successes")
+        self.assertTrue("Number of expr evaluation failures" in stats_json)
+        self.assertTrue("Number of expr evaluation successes" in stats_json)
+        self.assertTrue("Number of frame var failures" in stats_json)
+        self.assertTrue("Number of frame var successes" in stats_json)




More information about the lldb-commits mailing list