Author: vedantk
Date: Mon Oct 15 20:31:33 2018
New Revision: 344581

URL: http://llvm.org/viewvc/llvm-project?rev=344581&view=rev
Log:
Use assertEqual to improve test failure logging

Some tests in test/functionalities/tail_call_frames are failing on
non-Darwin platforms. Use assertEqual to improve logging on failure.

Modified:
    
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
    
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py?rev=344581&r1=344580&r2=344581&view=diff
==============================================================================
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
 Mon Oct 15 20:31:33 2018
@@ -43,11 +43,11 @@ class TestTailCallFrameSBAPI(TestBase):
         # Did we hit our breakpoint?
         threads = lldbutil.get_threads_stopped_at_breakpoint(process,
                 breakpoint)
-        self.assertTrue(
-            len(threads) == 1,
+        self.assertEqual(
+            len(threads), 1,
             "There should be a thread stopped at our breakpoint")
 
-        self.assertTrue(breakpoint.GetHitCount() == 1)
+        self.assertEqual(breakpoint.GetHitCount(), 1)
 
         thread = threads[0]
 
@@ -61,5 +61,5 @@ class TestTailCallFrameSBAPI(TestBase):
         artificiality = [False, True, False, True, False]
         for idx, (name, is_artificial) in enumerate(zip(names, artificiality)):
             frame = thread.GetFrameAtIndex(idx)
-            self.assertTrue(frame.GetDisplayFunctionName() == name)
-            self.assertTrue(frame.IsArtificial() == is_artificial)
+            self.assertEqual(frame.GetDisplayFunctionName(), name)
+            self.assertEqual(frame.IsArtificial(), is_artificial)

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py?rev=344581&r1=344580&r2=344581&view=diff
==============================================================================
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py
 Mon Oct 15 20:31:33 2018
@@ -35,11 +35,11 @@ class TestArtificialFrameThreadStepOut1(
         # Did we hit our breakpoint?
         threads = lldbutil.get_threads_stopped_at_breakpoint(process,
                 breakpoint)
-        self.assertTrue(
-            len(threads) == 1,
+        self.assertEqual(
+            len(threads), 1,
             "There should be a thread stopped at our breakpoint")
 
-        self.assertTrue(breakpoint.GetHitCount() == 1)
+        self.assertEqual(breakpoint.GetHitCount(), 1)
 
         thread = threads[0]
 
@@ -59,13 +59,13 @@ class TestArtificialFrameThreadStepOut1(
         # frame #2, because we behave as-if artificial frames were not present.
         thread.StepOut()
         frame2 = thread.GetSelectedFrame()
-        self.assertTrue(frame2.GetDisplayFunctionName() == "func2()")
+        self.assertEqual(frame2.GetDisplayFunctionName(), "func2()")
         self.assertFalse(frame2.IsArtificial())
 
         # Ditto: stepping out of frame #2 should move to frame #4.
         thread.StepOut()
         frame4 = thread.GetSelectedFrame()
-        self.assertTrue(frame4.GetDisplayFunctionName() == "main")
+        self.assertEqual(frame4.GetDisplayFunctionName(), "main")
         self.assertFalse(frame2.IsArtificial())
 
     def test_return_past_artificial_frame(self):
@@ -78,13 +78,13 @@ class TestArtificialFrameThreadStepOut1(
         # to frame #2.
         thread.ReturnFromFrame(thread.GetSelectedFrame(), value)
         frame2 = thread.GetSelectedFrame()
-        self.assertTrue(frame2.GetDisplayFunctionName() == "func2()")
+        self.assertEqual(frame2.GetDisplayFunctionName(), "func2()")
         self.assertFalse(frame2.IsArtificial())
 
         # Ditto: stepping out of frame #2 should move to frame #4.
         thread.ReturnFromFrame(thread.GetSelectedFrame(), value)
         frame4 = thread.GetSelectedFrame()
-        self.assertTrue(frame4.GetDisplayFunctionName() == "main")
+        self.assertEqual(frame4.GetDisplayFunctionName(), "main")
         self.assertFalse(frame2.IsArtificial())
 
     def setUp(self):


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to