[Lldb-commits] [lldb] ce825e4 - [lldb] Add assertState function to the API test suite

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 8 16:16:57 PDT 2022


Author: Jonas Devlieghere
Date: 2022-06-08T16:16:38-07:00
New Revision: ce825e46743be3e402820484bef639d12deefc2a

URL: https://github.com/llvm/llvm-project/commit/ce825e46743be3e402820484bef639d12deefc2a
DIFF: https://github.com/llvm/llvm-project/commit/ce825e46743be3e402820484bef639d12deefc2a.diff

LOG: [lldb] Add assertState function to the API test suite

Add a function to make it easier to debug a test failure caused by an
unexpected state.

Currently, tests are using assertEqual which results in a cryptic error
message: "AssertionError: 5 != 10". Even when a test provides a message
to make it clear why a particular state is expected, you still have to
figure out which of the two was the expected state, and what the other
value corresponds to.

We have a function in lldbutil that helps you convert the state number
into a user readable string. This patch adds a wrapper around
assertEqual specifically for comparing states and reporting better error
messages.

The aforementioned error message now looks like this: "AssertionError:
stopped (5) != exited (10)". If the user provided a message, that
continues to get printed as well.

Differential revision: https://reviews.llvm.org/D127355

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/lldbtest.py
    lldb/test/API/commands/process/launch-with-shellexpand/TestLaunchWithShellExpand.py
    lldb/test/API/commands/watchpoints/step_over_watchpoint/TestStepOverWatchpoint.py
    lldb/test/API/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py
    lldb/test/API/functionalities/breakpoint/move_nearest/TestMoveNearest.py
    lldb/test/API/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
    lldb/test/API/functionalities/completion/TestCompletion.py
    lldb/test/API/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
    lldb/test/API/functionalities/launch_stop_at_entry/TestStopAtEntry.py
    lldb/test/API/functionalities/return-value/TestReturnValue.py
    lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
    lldb/test/API/lang/cpp/gmodules/TestWithModuleDebugging.py
    lldb/test/API/lang/objc/ivar-IMP/TestObjCiVarIMP.py
    lldb/test/API/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py
    lldb/test/API/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
    lldb/test/API/lang/objc/objc-property/TestObjCProperty.py
    lldb/test/API/linux/add-symbols/TestTargetSymbolsAddCommand.py
    lldb/test/API/linux/mix-dwo-and-regular-objects/TestMixedDwarfBinary.py
    lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
    lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
    lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py
    lldb/test/API/python_api/objc_type/TestObjCType.py
    lldb/test/API/python_api/value/change_values/TestChangeValueAPI.py
    lldb/test/API/python_api/value/empty_class/TestValueAPIEmptyClass.py

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 5c536f4ed8ae..c3dc2a983611 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -519,9 +519,9 @@ def compute_mydir(test_file):
         # /abs/path/to/packages/group/subdir/mytest.py -> group/subdir
         lldb_test_src = configuration.test_src_root
         if not test_file.startswith(lldb_test_src):
-          raise Exception(
-              "Test file '%s' must reside within lldb_test_src "
-              "(which is '%s')." % (test_file, lldb_test_src))
+            raise Exception(
+                "Test file '%s' must reside within lldb_test_src "
+                "(which is '%s')." % (test_file, lldb_test_src))
         return os.path.dirname(os.path.relpath(test_file, start=lldb_test_src))
 
     def TraceOn(self):
@@ -2474,6 +2474,14 @@ def assertSuccess(self, obj, msg=None):
             self.fail(self._formatMessage(msg,
                 "'{}' is not success".format(error)))
 
+    """Assert two states are equal"""
+    def assertState(self, first, second, msg=None):
+        if first != second:
+            error = "{} ({}) != {} ({})".format(
+                lldbutil.state_type_to_str(first), first,
+                lldbutil.state_type_to_str(second), second)
+            self.fail(self._formatMessage(msg, error))
+
     def createTestTarget(self, file_path=None, msg=None,
                          load_dependent_modules=True):
         """

diff  --git a/lldb/test/API/commands/process/launch-with-shellexpand/TestLaunchWithShellExpand.py b/lldb/test/API/commands/process/launch-with-shellexpand/TestLaunchWithShellExpand.py
index dd7120326ca6..956070fd509a 100644
--- a/lldb/test/API/commands/process/launch-with-shellexpand/TestLaunchWithShellExpand.py
+++ b/lldb/test/API/commands/process/launch-with-shellexpand/TestLaunchWithShellExpand.py
@@ -41,8 +41,8 @@ def test(self):
 
         process = self.process()
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        STOPPED_DUE_TO_BREAKPOINT)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         STOPPED_DUE_TO_BREAKPOINT)
 
         thread = process.GetThreadAtIndex(0)
 
@@ -72,8 +72,8 @@ def test(self):
 
         process = self.process()
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        STOPPED_DUE_TO_BREAKPOINT)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         STOPPED_DUE_TO_BREAKPOINT)
 
         thread = process.GetThreadAtIndex(0)
 
@@ -95,8 +95,8 @@ def test(self):
 
         process = self.process()
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        STOPPED_DUE_TO_BREAKPOINT)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         STOPPED_DUE_TO_BREAKPOINT)
 
         thread = process.GetThreadAtIndex(0)
 

diff  --git a/lldb/test/API/commands/watchpoints/step_over_watchpoint/TestStepOverWatchpoint.py b/lldb/test/API/commands/watchpoints/step_over_watchpoint/TestStepOverWatchpoint.py
index 1d2812e15f60..14871a99b68d 100644
--- a/lldb/test/API/commands/watchpoints/step_over_watchpoint/TestStepOverWatchpoint.py
+++ b/lldb/test/API/commands/watchpoints/step_over_watchpoint/TestStepOverWatchpoint.py
@@ -36,8 +36,8 @@ def test(self):
         process = target.LaunchSimple(None, None,
                                       self.get_process_working_directory())
         self.assertTrue(process.IsValid(), PROCESS_IS_VALID)
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         thread = lldbutil.get_stopped_thread(process,
                                              lldb.eStopReasonBreakpoint)
@@ -63,8 +63,8 @@ def test(self):
         self.assertEquals(thread.GetStopDescription(20), 'watchpoint 1')
 
         process.Continue()
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
         self.assertEquals(thread.GetStopDescription(20), 'step over')
 
         self.step_inst_for_watchpoint(1)
@@ -90,8 +90,8 @@ def test(self):
         self.assertEquals(thread.GetStopDescription(20), 'watchpoint 2')
 
         process.Continue()
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
         self.assertEquals(thread.GetStopDescription(20), 'step over')
 
         self.step_inst_for_watchpoint(2)

diff  --git a/lldb/test/API/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py b/lldb/test/API/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py
index dfdabe146cd3..0bab92fd3705 100644
--- a/lldb/test/API/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py
+++ b/lldb/test/API/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py
@@ -37,7 +37,7 @@ def prepare_test(self):
     def finish_test(self):
         # Run the process until termination
         self.process.Continue()
-        self.assertEquals(self.process.GetState(), lldb.eStateExited)
+        self.assertState(self.process.GetState(), lldb.eStateExited)
 
     @no_debug_info_test
     def test_continue(self):
@@ -45,7 +45,7 @@ def test_continue(self):
         self.prepare_test()
 
         self.process.Continue()
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+        self.assertState(self.process.GetState(), lldb.eStateStopped)
         # We should be stopped at the second breakpoint
         self.thread = lldbutil.get_one_thread_stopped_at_breakpoint(
             self.process, self.breakpoint2)
@@ -63,7 +63,7 @@ def test_single_step(self):
         step_over = False
         self.thread.StepInstruction(step_over)
 
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+        self.assertState(self.process.GetState(), lldb.eStateStopped)
         self.assertEquals(
             self.thread.GetFrameAtIndex(0).GetPCAddress().GetLoadAddress(
                 self.target), self.bkpt_address.GetLoadAddress(
@@ -90,7 +90,7 @@ def test_single_step_thread_specific(self):
         step_over = False
         self.thread.StepInstruction(step_over)
 
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+        self.assertState(self.process.GetState(), lldb.eStateStopped)
         self.assertEquals(
             self.thread.GetFrameAtIndex(0).GetPCAddress().GetLoadAddress(
                 self.target), self.bkpt_address.GetLoadAddress(

diff  --git a/lldb/test/API/functionalities/breakpoint/move_nearest/TestMoveNearest.py b/lldb/test/API/functionalities/breakpoint/move_nearest/TestMoveNearest.py
index b8281e9c85bd..05f77cf74e8b 100644
--- a/lldb/test/API/functionalities/breakpoint/move_nearest/TestMoveNearest.py
+++ b/lldb/test/API/functionalities/breakpoint/move_nearest/TestMoveNearest.py
@@ -32,7 +32,7 @@ def test(self):
         lldbutil.run_break_set_by_symbol(self, 'main', sym_exact=True)
         environment = self.registerSharedLibrariesWithTarget(target, ["foo"])
         process = target.LaunchSimple(None, environment, self.get_process_working_directory())
-        self.assertEquals(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
 
         # Regardless of the -m value the breakpoint should have exactly one
         # location on the foo functions

diff  --git a/lldb/test/API/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py b/lldb/test/API/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
index b20490f3cefd..90da4c02b46a 100644
--- a/lldb/test/API/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
+++ b/lldb/test/API/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
@@ -71,7 +71,7 @@ def test_step_instruction(self):
         while True:
             self.thread.StepInstruction(True)
             step_count = step_count + 1
-            self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+            self.assertState(self.process.GetState(), lldb.eStateStopped)
             self.assertTrue(self.thread.GetStopReason() == lldb.eStopReasonPlanComplete or
                             self.thread.GetStopReason() == lldb.eStopReasonBreakpoint)
             if (self.thread.GetStopReason() == lldb.eStopReasonBreakpoint) :
@@ -83,24 +83,24 @@ def test_step_instruction(self):
 
         # Run the process until termination
         self.process.Continue()
-        self.assertEquals(self.process.GetState(), lldb.eStateExited)
+        self.assertState(self.process.GetState(), lldb.eStateExited)
 
     @skipIf(bugnumber="llvm.org/pr31972", hostoslist=["windows"])
     def test_step_over(self):
 
         self.thread.StepOver()
         # We should be stopped at the breakpoint_2 line with stop plan complete reason
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+        self.assertState(self.process.GetState(), lldb.eStateStopped)
         self.assertEquals(self.thread.GetStopReason(), lldb.eStopReasonPlanComplete)
 
         self.thread.StepOver()
         # We should be stopped at the breakpoint_3 line with stop plan complete reason
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+        self.assertState(self.process.GetState(), lldb.eStateStopped)
         self.assertEquals(self.thread.GetStopReason(), lldb.eStopReasonPlanComplete)
 
         self.thread.StepOver()
         # We should be stopped at the breakpoint_4
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+        self.assertState(self.process.GetState(), lldb.eStateStopped)
         self.assertEquals(self.thread.GetStopReason(), lldb.eStopReasonBreakpoint)
         thread1 = lldbutil.get_one_thread_stopped_at_breakpoint(self.process, self.breakpoint4)
         self.assertEquals(self.thread, thread1, "Didn't stop at breakpoint 4.")
@@ -113,5 +113,5 @@ def test_step_over(self):
 
         # Run the process until termination
         self.process.Continue()
-        self.assertEquals(self.process.GetState(), lldb.eStateExited)
+        self.assertState(self.process.GetState(), lldb.eStateExited)
 

diff  --git a/lldb/test/API/functionalities/completion/TestCompletion.py b/lldb/test/API/functionalities/completion/TestCompletion.py
index ed901890f7df..90e2ff2384e3 100644
--- a/lldb/test/API/functionalities/completion/TestCompletion.py
+++ b/lldb/test/API/functionalities/completion/TestCompletion.py
@@ -43,7 +43,7 @@ def test_frame_variable(self):
 
         (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
                                           '// Break here', self.main_source_spec)
-        self.assertEquals(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
 
         # Since CommandInterpreter has been corrected to update the current execution
         # context at the beginning of HandleCompletion, we're here explicitly testing

diff  --git a/lldb/test/API/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py b/lldb/test/API/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
index d444b3c50bde..ead18af1cc1a 100644
--- a/lldb/test/API/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
+++ b/lldb/test/API/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
@@ -65,8 +65,8 @@ def test_get_dynamic_vals(self):
         process = target.LaunchSimple(
             None, None, self.get_process_working_directory())
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         b = self.frame().FindVariable("b").GetDynamicValue(lldb.eDynamicCanRunTarget)
         self.assertEquals(b.GetNumChildren(), 0, "b has 0 children")

diff  --git a/lldb/test/API/functionalities/launch_stop_at_entry/TestStopAtEntry.py b/lldb/test/API/functionalities/launch_stop_at_entry/TestStopAtEntry.py
index c745cc4ac7e0..79e66c7dabd9 100644
--- a/lldb/test/API/functionalities/launch_stop_at_entry/TestStopAtEntry.py
+++ b/lldb/test/API/functionalities/launch_stop_at_entry/TestStopAtEntry.py
@@ -63,7 +63,7 @@ def test_stop_remote_platform_sync(self):
     def test_stop_remote_platform_async(self):
         self.do_test_stop_at_entry(False, True)
 
-    def do_test_stop_at_entry(self, synchronous, remote):        
+    def do_test_stop_at_entry(self, synchronous, remote):
         """Test the normal launch path in either sync or async mode"""
         self.build()
 
@@ -98,7 +98,7 @@ def cleanup ():
             result = listener.WaitForEvent(30, event)
             self.assertTrue(result, "Timed out waiting for event from process")
             state = lldb.SBProcess.GetStateFromEvent(event)
-            self.assertEqual(state, lldb.eStateStopped, "Didn't get a stopped state after launch")
+            self.assertState(state, lldb.eStateStopped, "Didn't get a stopped state after launch")
 
         # Okay, we should be stopped.  Make sure we are indeed at the
         # entry point.  I only know how to do this on darwin:
@@ -127,13 +127,13 @@ def cleanup ():
                 self.assertTrue(result, "Timed out waiting for running")
                 state = lldb.SBProcess.GetStateFromEvent(event)
                 if num_running == 1:
-                    self.assertEqual(state, lldb.eStateRunning, "Got running event")
+                    self.assertState(state, lldb.eStateRunning, "Got running event")
             # The last event we should get is the exited event
-            self.assertEqual(state, lldb.eStateExited, "Got running event")
+            self.assertState(state, lldb.eStateExited, "Got exit event")
         else:
             # Make sure that the process has indeed exited
             state = process.GetState()
-            self.assertEqual(state, lldb.eStateExited);
+            self.assertState(state, lldb.eStateExited);
 
     def setup_remote_platform(self):
         return

diff  --git a/lldb/test/API/functionalities/return-value/TestReturnValue.py b/lldb/test/API/functionalities/return-value/TestReturnValue.py
index 9f4745cb7901..8670c44dcb6c 100644
--- a/lldb/test/API/functionalities/return-value/TestReturnValue.py
+++ b/lldb/test/API/functionalities/return-value/TestReturnValue.py
@@ -62,7 +62,7 @@ def test_with_python(self):
 
         thread.StepOut()
 
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+        self.assertState(self.process.GetState(), lldb.eStateStopped)
         self.assertEquals(thread.GetStopReason(), lldb.eStopReasonPlanComplete)
 
         frame = thread.GetFrameAtIndex(0)
@@ -94,7 +94,7 @@ def test_with_python(self):
 
         thread.StepOutOfFrame(frame)
 
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+        self.assertState(self.process.GetState(), lldb.eStateStopped)
         self.assertEquals(thread.GetStopReason(), lldb.eStopReasonPlanComplete)
         frame = thread.GetFrameAtIndex(0)
         fun_name = frame.GetFunctionName()
@@ -123,7 +123,7 @@ def test_with_python(self):
         in_float = float(in_value.GetValue())
         thread.StepOut()
 
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+        self.assertState(self.process.GetState(), lldb.eStateStopped)
         self.assertEquals(thread.GetStopReason(), lldb.eStopReasonPlanComplete)
 
         frame = thread.GetFrameAtIndex(0)
@@ -263,7 +263,7 @@ def return_and_test_struct_value(self, func_name):
 
         thread.StepOut()
 
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped)
+        self.assertState(self.process.GetState(), lldb.eStateStopped)
         self.assertEquals(thread.GetStopReason(), lldb.eStopReasonPlanComplete)
 
         # Assuming all these functions step out to main.  Could figure out the caller dynamically

diff  --git a/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py b/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
index 30b6c8f89532..f865211dd4f8 100644
--- a/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
+++ b/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
@@ -61,8 +61,8 @@ def test_get_dynamic_vals(self):
         process = target.LaunchSimple(
             None, None, self.get_process_working_directory())
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         threads = lldbutil.get_threads_stopped_at_breakpoint(
             process, first_call_bpt)

diff  --git a/lldb/test/API/lang/cpp/gmodules/TestWithModuleDebugging.py b/lldb/test/API/lang/cpp/gmodules/TestWithModuleDebugging.py
index 3f1af7c9e728..53c30141286b 100644
--- a/lldb/test/API/lang/cpp/gmodules/TestWithModuleDebugging.py
+++ b/lldb/test/API/lang/cpp/gmodules/TestWithModuleDebugging.py
@@ -38,7 +38,7 @@ def test_specialized_typedef_from_pch(self):
         self.assertTrue(process.IsValid(), PROCESS_IS_VALID)
 
         # Get the thread of the process
-        self.assertEquals(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(

diff  --git a/lldb/test/API/lang/objc/ivar-IMP/TestObjCiVarIMP.py b/lldb/test/API/lang/objc/ivar-IMP/TestObjCiVarIMP.py
index f3183d5bd1ef..c85c74a0369f 100644
--- a/lldb/test/API/lang/objc/ivar-IMP/TestObjCiVarIMP.py
+++ b/lldb/test/API/lang/objc/ivar-IMP/TestObjCiVarIMP.py
@@ -34,8 +34,8 @@ def test_imp_ivar_type(self):
         process = target.LaunchSimple(
             None, None, self.get_process_working_directory())
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         self.expect(
             'frame variable --ptr-depth=1 --show-types -d run -- object',

diff  --git a/lldb/test/API/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py b/lldb/test/API/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py
index 10a97b8d2020..17bc5313b952 100644
--- a/lldb/test/API/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py
+++ b/lldb/test/API/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py
@@ -41,8 +41,8 @@ def test_get_baseclass(self):
         process = target.LaunchSimple(
             None, None, self.get_process_working_directory())
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         var = self.frame().FindVariable("foo")
         var_ptr_type = var.GetType()

diff  --git a/lldb/test/API/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py b/lldb/test/API/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
index ed0f73af8bb2..d70ff320a9e2 100644
--- a/lldb/test/API/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
+++ b/lldb/test/API/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
@@ -63,8 +63,8 @@ def test_get_objc_dynamic_vals(self):
         process = target.LaunchSimple(
             None, None, self.get_process_working_directory())
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         threads = lldbutil.get_threads_stopped_at_breakpoint(
             process, main_before_setProperty_bkpt)

diff  --git a/lldb/test/API/lang/objc/objc-property/TestObjCProperty.py b/lldb/test/API/lang/objc/objc-property/TestObjCProperty.py
index 13e3fc7e91d4..73bf673ab749 100644
--- a/lldb/test/API/lang/objc/objc-property/TestObjCProperty.py
+++ b/lldb/test/API/lang/objc/objc-property/TestObjCProperty.py
@@ -47,8 +47,8 @@ def test_objc_properties(self):
         process = target.LaunchSimple(
             None, None, self.get_process_working_directory())
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         threads = lldbutil.get_threads_stopped_at_breakpoint(
             process, main_bkpt)

diff  --git a/lldb/test/API/linux/add-symbols/TestTargetSymbolsAddCommand.py b/lldb/test/API/linux/add-symbols/TestTargetSymbolsAddCommand.py
index be7a71f78424..d88980722a64 100644
--- a/lldb/test/API/linux/add-symbols/TestTargetSymbolsAddCommand.py
+++ b/lldb/test/API/linux/add-symbols/TestTargetSymbolsAddCommand.py
@@ -33,8 +33,8 @@ def test_target_symbols_add(self):
         self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # The stop reason of the thread should be breakpoint.
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped,
-                        STOPPED_DUE_TO_BREAKPOINT)
+        self.assertState(self.process.GetState(), lldb.eStateStopped,
+                         STOPPED_DUE_TO_BREAKPOINT)
 
         exe_module = self.target.GetModuleAtIndex(0)
 

diff  --git a/lldb/test/API/linux/mix-dwo-and-regular-objects/TestMixedDwarfBinary.py b/lldb/test/API/linux/mix-dwo-and-regular-objects/TestMixedDwarfBinary.py
index cea9f65ec17f..a22a8bef9e15 100644
--- a/lldb/test/API/linux/mix-dwo-and-regular-objects/TestMixedDwarfBinary.py
+++ b/lldb/test/API/linux/mix-dwo-and-regular-objects/TestMixedDwarfBinary.py
@@ -30,8 +30,8 @@ def test_mixed_dwarf(self):
         self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # The stop reason of the thread should be breakpoint.
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped,
-                        STOPPED_DUE_TO_BREAKPOINT)
+        self.assertState(self.process.GetState(), lldb.eStateStopped,
+                         STOPPED_DUE_TO_BREAKPOINT)
 
         frame = self.process.GetThreadAtIndex(0).GetFrameAtIndex(0)
         x = frame.FindVariable("x")

diff  --git a/lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py b/lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
index 9c5d5fee0d63..68efcc89cfd7 100644
--- a/lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
+++ b/lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
@@ -79,8 +79,8 @@ def do_test(self, command):
         self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # The stop reason of the thread should be breakpoint.
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped,
-                          STOPPED_DUE_TO_BREAKPOINT)
+        self.assertState(self.process.GetState(), lldb.eStateStopped,
+                         STOPPED_DUE_TO_BREAKPOINT)
 
         self.runCmd(command)
         self.expect("frame select", substrs=['a.out`main at main.c'])

diff  --git a/lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py b/lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
index 6488ed6b9872..639f57d954e3 100644
--- a/lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
+++ b/lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
@@ -36,8 +36,8 @@ def test_add_dsym_mid_execution(self):
         self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # The stop reason of the thread should be breakpoint.
-        self.assertEquals(self.process.GetState(), lldb.eStateStopped,
-                        STOPPED_DUE_TO_BREAKPOINT)
+        self.assertState(self.process.GetState(), lldb.eStateStopped,
+                         STOPPED_DUE_TO_BREAKPOINT)
 
         self.runCmd("add-dsym " +
                     self.getBuildArtifact("hide.app/Contents/a.out.dSYM"))

diff  --git a/lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py b/lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py
index 061556ac0552..1dcafbced1a5 100644
--- a/lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py
+++ b/lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py
@@ -45,7 +45,7 @@ def test(self):
         self.assertTrue(process, PROCESS_IS_VALID)
 
         # Get Frame #0.
-        self.assertEquals(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(

diff  --git a/lldb/test/API/python_api/objc_type/TestObjCType.py b/lldb/test/API/python_api/objc_type/TestObjCType.py
index aa64244a73f3..de0cd395e3b2 100644
--- a/lldb/test/API/python_api/objc_type/TestObjCType.py
+++ b/lldb/test/API/python_api/objc_type/TestObjCType.py
@@ -39,7 +39,7 @@ def test(self):
         self.assertTrue(process, PROCESS_IS_VALID)
 
         # Get Frame #0.
-        self.assertEquals(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(

diff  --git a/lldb/test/API/python_api/value/change_values/TestChangeValueAPI.py b/lldb/test/API/python_api/value/change_values/TestChangeValueAPI.py
index d8b490b780d6..3e2d3c630989 100644
--- a/lldb/test/API/python_api/value/change_values/TestChangeValueAPI.py
+++ b/lldb/test/API/python_api/value/change_values/TestChangeValueAPI.py
@@ -59,7 +59,7 @@ def test_change_value(self):
         self.assertTrue(process, PROCESS_IS_VALID)
 
         # Get Frame #0.
-        self.assertEquals(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(
@@ -136,7 +136,7 @@ def test_change_value(self):
         # Now continue.
         process.Continue()
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(
@@ -169,7 +169,7 @@ def test_change_value(self):
 
         process.Continue()
 
-        self.assertEquals(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(

diff  --git a/lldb/test/API/python_api/value/empty_class/TestValueAPIEmptyClass.py b/lldb/test/API/python_api/value/empty_class/TestValueAPIEmptyClass.py
index ac8f60bb0c26..f4a3f5a0f7e6 100644
--- a/lldb/test/API/python_api/value/empty_class/TestValueAPIEmptyClass.py
+++ b/lldb/test/API/python_api/value/empty_class/TestValueAPIEmptyClass.py
@@ -27,7 +27,7 @@ def test(self):
         self.assertTrue(process, PROCESS_IS_VALID)
 
         # Get Frame #0.
-        self.assertEquals(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(


        


More information about the lldb-commits mailing list