[Lldb-commits] [lldb] 1b8c735 - [lldb] Use assertState in even more tests (NFC)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 29 17:06:02 PDT 2022


Author: Jonas Devlieghere
Date: 2022-06-29T17:05:58-07:00
New Revision: 1b8c73522ebf5b937912ef91c297a5b77ddc95ec

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

LOG: [lldb] Use assertState in even more tests (NFC)

Followup to D127355 and D127378, converting more instances of
assertEqual to assertState.

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/lldbutil.py
    lldb/test/API/android/platform/TestDefaultCacheLineSize.py
    lldb/test/API/arm/breakpoint-it/TestBreakpointIt.py
    lldb/test/API/arm/breakpoint-thumb-codesection/TestBreakpointThumbCodesection.py
    lldb/test/API/commands/expression/expr-in-syscall/TestExpressionInSyscall.py
    lldb/test/API/commands/process/handle/TestProcessHandle.py
    lldb/test/API/commands/process/launch/TestProcessLaunch.py
    lldb/test/API/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
    lldb/test/API/functionalities/breakpoint/debugbreak/TestDebugBreak.py
    lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/loop/TestDataFormatterGenericListLoop.py
    lldb/test/API/functionalities/gdb_remote_client/TestRecognizeBreakpoint.py
    lldb/test/API/functionalities/jitloader_gdb/TestJITLoaderGDB.py
    lldb/test/API/functionalities/plugins/python_os_plugin/stepping_plugin_threads/TestOSPluginStepping.py
    lldb/test/API/functionalities/process_group/TestChangeProcessGroup.py
    lldb/test/API/functionalities/signal/handle-abrt/TestHandleAbort.py
    lldb/test/API/functionalities/signal/handle-segv/TestHandleSegv.py
    lldb/test/API/functionalities/signal/raise/TestRaise.py
    lldb/test/API/functionalities/thread/exit_during_step/TestExitDuringStep.py
    lldb/test/API/functionalities/thread/state/TestThreadStates.py
    lldb/test/API/functionalities/thread/thread_exit/TestThreadExit.py
    lldb/test/API/functionalities/tty/TestTerminal.py
    lldb/test/API/linux/aarch64/unwind_signal/TestUnwindSignal.py
    lldb/test/API/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
    lldb/test/API/macosx/posix_spawn/TestLaunchProcessPosixSpawn.py
    lldb/test/API/macosx/profile_vrs_detach/TestDetachVrsProfile.py
    lldb/test/API/python_api/process/io/TestProcessIO.py
    lldb/test/API/python_api/target/TestTargetAPI.py
    lldb/test/API/python_api/watchpoint/TestWatchpointIgnoreCount.py
    lldb/test/API/qemu/TestQemuLaunch.py

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/lldbutil.py b/lldb/packages/Python/lldbsuite/test/lldbutil.py
index e3e81a7f59358..74ca7dd060e3b 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -945,7 +945,7 @@ def run_to_breakpoint_do_run(test, target, bkpt, launch_info = None,
     test.assertFalse(error.Fail(),
                      "Process launch failed: %s" % (error.GetCString()))
 
-    test.assertEqual(process.GetState(), lldb.eStateStopped)
+    test.assertState(process.GetState(), lldb.eStateStopped)
 
     # Frame #0 should be at our breakpoint.
     threads = get_threads_stopped_at_breakpoint(

diff  --git a/lldb/test/API/android/platform/TestDefaultCacheLineSize.py b/lldb/test/API/android/platform/TestDefaultCacheLineSize.py
index 7e8f88e77c5a8..0a07766640d4c 100644
--- a/lldb/test/API/android/platform/TestDefaultCacheLineSize.py
+++ b/lldb/test/API/android/platform/TestDefaultCacheLineSize.py
@@ -40,4 +40,4 @@ def test_cache_line_size(self):
 
         # Run to completion.
         process.Continue()
-        self.assertEqual(process.GetState(), lldb.eStateExited, PROCESS_EXITED)
+        self.assertState(process.GetState(), lldb.eStateExited, PROCESS_EXITED)

diff  --git a/lldb/test/API/arm/breakpoint-it/TestBreakpointIt.py b/lldb/test/API/arm/breakpoint-it/TestBreakpointIt.py
index 7d8da022b75ec..a2164e744537c 100644
--- a/lldb/test/API/arm/breakpoint-it/TestBreakpointIt.py
+++ b/lldb/test/API/arm/breakpoint-it/TestBreakpointIt.py
@@ -24,7 +24,7 @@ def test_false(self):
                 extra_options="--skip-prologue 0")
 
         self.runCmd("run")
-        self.assertEqual(self.process().GetState(), lldb.eStateExited,
+        self.assertState(self.process().GetState(), lldb.eStateExited,
                 "Breakpoint does not get hit")
 
     @skipIf(archs=no_match(["arm"]))

diff  --git a/lldb/test/API/arm/breakpoint-thumb-codesection/TestBreakpointThumbCodesection.py b/lldb/test/API/arm/breakpoint-thumb-codesection/TestBreakpointThumbCodesection.py
index c318f741e9fbe..a340dcb6920e3 100644
--- a/lldb/test/API/arm/breakpoint-thumb-codesection/TestBreakpointThumbCodesection.py
+++ b/lldb/test/API/arm/breakpoint-thumb-codesection/TestBreakpointThumbCodesection.py
@@ -29,4 +29,4 @@ def test_breakpoint(self):
             self.process(), bpid), "Process is not stopped at breakpoint")
 
         self.process().Continue()
-        self.assertEqual(self.process().GetState(), lldb.eStateExited, PROCESS_EXITED)
+        self.assertState(self.process().GetState(), lldb.eStateExited, PROCESS_EXITED)

diff  --git a/lldb/test/API/commands/expression/expr-in-syscall/TestExpressionInSyscall.py b/lldb/test/API/commands/expression/expr-in-syscall/TestExpressionInSyscall.py
index 4c20c7f535ccc..1003c2faf7b1e 100644
--- a/lldb/test/API/commands/expression/expr-in-syscall/TestExpressionInSyscall.py
+++ b/lldb/test/API/commands/expression/expr-in-syscall/TestExpressionInSyscall.py
@@ -80,5 +80,5 @@ def expr_syscall(self):
             if new_state == lldb.eStateExited:
                 break
 
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
         self.assertEqual(process.GetExitStatus(), 0)

diff  --git a/lldb/test/API/commands/process/handle/TestProcessHandle.py b/lldb/test/API/commands/process/handle/TestProcessHandle.py
index 14e118bf87811..68d8e66e4e51c 100644
--- a/lldb/test/API/commands/process/handle/TestProcessHandle.py
+++ b/lldb/test/API/commands/process/handle/TestProcessHandle.py
@@ -34,7 +34,7 @@ def test_process_handle(self):
 
         process.Continue()
         
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
         self.assertEqual(process.GetExitStatus(), 0)
         
         # Check that we preserved the setting:

diff  --git a/lldb/test/API/commands/process/launch/TestProcessLaunch.py b/lldb/test/API/commands/process/launch/TestProcessLaunch.py
index e03cc6e1456d5..a7ce5bf8fd41b 100644
--- a/lldb/test/API/commands/process/launch/TestProcessLaunch.py
+++ b/lldb/test/API/commands/process/launch/TestProcessLaunch.py
@@ -199,4 +199,4 @@ def test_environment_with_special_char(self):
 
         self.assertEqual(value, evil_var)
         process.Continue()
-        self.assertEqual(process.GetState(), lldb.eStateExited, PROCESS_EXITED)
+        self.assertState(process.GetState(), lldb.eStateExited, PROCESS_EXITED)

diff  --git a/lldb/test/API/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py b/lldb/test/API/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
index 3c8dd117f94c2..4633d65fa5fa3 100644
--- a/lldb/test/API/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
+++ b/lldb/test/API/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
@@ -39,7 +39,7 @@ def test_breakpoint_one_shot(self):
         self.assertTrue(frame0.GetFunctionName() == "a(int)" or frame0.GetFunctionName() == "int a(int)");
 
         process.Continue()
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
 
     def setUp(self):
         # Call super's setUp().

diff  --git a/lldb/test/API/functionalities/breakpoint/debugbreak/TestDebugBreak.py b/lldb/test/API/functionalities/breakpoint/debugbreak/TestDebugBreak.py
index 3d8dcc9b0ac67..6da37e95a2f7d 100644
--- a/lldb/test/API/functionalities/breakpoint/debugbreak/TestDebugBreak.py
+++ b/lldb/test/API/functionalities/breakpoint/debugbreak/TestDebugBreak.py
@@ -52,4 +52,4 @@ def test_asm_int_3(self):
             process.Continue()
 
         # The inferior should exit after the last iteration.
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)

diff  --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/loop/TestDataFormatterGenericListLoop.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/loop/TestDataFormatterGenericListLoop.py
index 0577e02ad059d..7c47ebebf5925 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/loop/TestDataFormatterGenericListLoop.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/loop/TestDataFormatterGenericListLoop.py
@@ -64,7 +64,7 @@ def do_test_with_run_command(self, stdlib_type):
 
         # Run to completion.
         process.Continue()
-        self.assertEqual(process.GetState(), lldb.eStateExited, PROCESS_EXITED)
+        self.assertState(process.GetState(), lldb.eStateExited, PROCESS_EXITED)
 
     @add_test_categories(["libstdcxx"])
     def test_with_run_command_libstdcpp(self):

diff  --git a/lldb/test/API/functionalities/gdb_remote_client/TestRecognizeBreakpoint.py b/lldb/test/API/functionalities/gdb_remote_client/TestRecognizeBreakpoint.py
index ce57da14e6067..783240b87ce30 100644
--- a/lldb/test/API/functionalities/gdb_remote_client/TestRecognizeBreakpoint.py
+++ b/lldb/test/API/functionalities/gdb_remote_client/TestRecognizeBreakpoint.py
@@ -122,7 +122,7 @@ def other (self, packet):
         # Now continue and we will fake hitting a breakpoint.
         process.Continue()
 
-        self.assertEqual(process.GetState(),lldb.eStateStopped, "Process is stopped")
+        self.assertState(process.GetState(),lldb.eStateStopped, "Process is stopped")
         num_threads = len(process.threads)
 
         num_threads = len(process.threads)

diff  --git a/lldb/test/API/functionalities/jitloader_gdb/TestJITLoaderGDB.py b/lldb/test/API/functionalities/jitloader_gdb/TestJITLoaderGDB.py
index a857e28ebf2cb..7dab9b7f5610b 100644
--- a/lldb/test/API/functionalities/jitloader_gdb/TestJITLoaderGDB.py
+++ b/lldb/test/API/functionalities/jitloader_gdb/TestJITLoaderGDB.py
@@ -31,7 +31,7 @@ def test_bogus_values(self):
 
         # The inferior will now pass bogus values over the interface. Make sure
         # we don't crash.
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
         self.assertEqual(process.GetExitStatus(), 0)
 
     def gen_log_file(self):
@@ -67,7 +67,7 @@ def cleanup():
             None, None, self.get_process_working_directory())
         self.assertTrue(process, PROCESS_IS_VALID)
 
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
         self.assertEqual(process.GetExitStatus(), 0)
 
         self.assertTrue(os.path.exists(logfile))
@@ -95,7 +95,7 @@ def cleanup():
             None, None, self.get_process_working_directory())
         self.assertTrue(process, PROCESS_IS_VALID)
 
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
         self.assertEqual(process.GetExitStatus(), 0)
 
         self.assertTrue(os.path.exists(logfile))

diff  --git a/lldb/test/API/functionalities/plugins/python_os_plugin/stepping_plugin_threads/TestOSPluginStepping.py b/lldb/test/API/functionalities/plugins/python_os_plugin/stepping_plugin_threads/TestOSPluginStepping.py
index 17c5d9c337314..a04bf3b627b07 100644
--- a/lldb/test/API/functionalities/plugins/python_os_plugin/stepping_plugin_threads/TestOSPluginStepping.py
+++ b/lldb/test/API/functionalities/plugins/python_os_plugin/stepping_plugin_threads/TestOSPluginStepping.py
@@ -103,7 +103,7 @@ def run_python_os_step_missing_thread(self, do_prune):
             self.assertFalse(result.Succeeded(), "We still found plans for the unreported thread.")
             
             self.process.Continue()
-            self.assertEqual(self.process.GetState(), lldb.eStateExited, "We exited.")
+            self.assertState(self.process.GetState(), lldb.eStateExited, "We exited.")
         else:
             # Now we are going to continue, and when we hit the step-out breakpoint, we will
             # put the OS plugin thread back, lldb will recover its ThreadPlanStack, and
@@ -112,5 +112,3 @@ def run_python_os_step_missing_thread(self, do_prune):
             os_thread = self.get_os_thread()
             self.assertTrue(os_thread.IsValid(), "The OS thread is back after continue")
             self.assertIn("step out", os_thread.GetStopDescription(100), "Completed step out plan")
-        
-        

diff  --git a/lldb/test/API/functionalities/process_group/TestChangeProcessGroup.py b/lldb/test/API/functionalities/process_group/TestChangeProcessGroup.py
index 8a63cb3ab4ee1..98f35521cd2f4 100644
--- a/lldb/test/API/functionalities/process_group/TestChangeProcessGroup.py
+++ b/lldb/test/API/functionalities/process_group/TestChangeProcessGroup.py
@@ -87,4 +87,4 @@ def cleanupChild():
 
         # run to completion
         process.Continue()
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)

diff  --git a/lldb/test/API/functionalities/signal/handle-abrt/TestHandleAbort.py b/lldb/test/API/functionalities/signal/handle-abrt/TestHandleAbort.py
index fd35e1d986eb3..aea0e379205d6 100644
--- a/lldb/test/API/functionalities/signal/handle-abrt/TestHandleAbort.py
+++ b/lldb/test/API/functionalities/signal/handle-abrt/TestHandleAbort.py
@@ -64,5 +64,5 @@ def test_inferior_handle_sigabrt(self):
 
         # Continue until we exit.
         process.Continue()
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
         self.assertEqual(process.GetExitStatus(), 0)

diff  --git a/lldb/test/API/functionalities/signal/handle-segv/TestHandleSegv.py b/lldb/test/API/functionalities/signal/handle-segv/TestHandleSegv.py
index 9802c4e33e4a1..7922a88617073 100644
--- a/lldb/test/API/functionalities/signal/handle-segv/TestHandleSegv.py
+++ b/lldb/test/API/functionalities/signal/handle-segv/TestHandleSegv.py
@@ -41,5 +41,5 @@ def test_inferior_handle_sigsegv(self):
 
         # Continue until we exit.
         process.Continue()
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
         self.assertEqual(process.GetExitStatus(), 0)

diff  --git a/lldb/test/API/functionalities/signal/raise/TestRaise.py b/lldb/test/API/functionalities/signal/raise/TestRaise.py
index eea97fabee40c..67e7a88a1f9a7 100644
--- a/lldb/test/API/functionalities/signal/raise/TestRaise.py
+++ b/lldb/test/API/functionalities/signal/raise/TestRaise.py
@@ -93,7 +93,7 @@ def signal_test(self, signal, test_passing):
 
         # Continue until we exit.
         process.Continue()
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
         self.assertEqual(process.GetExitStatus(), 0)
 
         process = self.launch(target, signal)
@@ -106,7 +106,7 @@ def signal_test(self, signal, test_passing):
             substrs=[
                 "stopped and restarted",
                 signal])
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
         self.assertEqual(process.GetExitStatus(), 0)
 
         # launch again
@@ -119,7 +119,7 @@ def signal_test(self, signal, test_passing):
             "process continue",
             substrs=["stopped and restarted"],
             matching=False)
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
         self.assertEqual(process.GetExitStatus(), 0)
 
         if not test_passing:
@@ -149,7 +149,7 @@ def signal_test(self, signal, test_passing):
 
         # Continue until we exit. The process should receive the signal.
         process.Continue()
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
         self.assertEqual(process.GetExitStatus(), signo)
 
         # launch again
@@ -163,7 +163,7 @@ def signal_test(self, signal, test_passing):
             substrs=[
                 "stopped and restarted",
                 signal])
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
         self.assertEqual(process.GetExitStatus(), signo)
 
         # launch again
@@ -176,7 +176,7 @@ def signal_test(self, signal, test_passing):
             "process continue",
             substrs=["stopped and restarted"],
             matching=False)
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
         self.assertEqual(process.GetExitStatus(), signo)
 
         # reset signal handling to default

diff  --git a/lldb/test/API/functionalities/thread/exit_during_step/TestExitDuringStep.py b/lldb/test/API/functionalities/thread/exit_during_step/TestExitDuringStep.py
index b9be2c83d7918..bfa5aa0786578 100644
--- a/lldb/test/API/functionalities/thread/exit_during_step/TestExitDuringStep.py
+++ b/lldb/test/API/functionalities/thread/exit_during_step/TestExitDuringStep.py
@@ -142,4 +142,4 @@ def exit_during_step_base(self, step_cmd, step_stop_reason, by_instruction):
         self.runCmd("continue")
 
         # At this point, the inferior process should have exited.
-        self.assertEqual(process.GetState(), lldb.eStateExited, PROCESS_EXITED)
+        self.assertState(process.GetState(), lldb.eStateExited, PROCESS_EXITED)

diff  --git a/lldb/test/API/functionalities/thread/state/TestThreadStates.py b/lldb/test/API/functionalities/thread/state/TestThreadStates.py
index 4c5ebcdc7791f..9d6863f610edd 100644
--- a/lldb/test/API/functionalities/thread/state/TestThreadStates.py
+++ b/lldb/test/API/functionalities/thread/state/TestThreadStates.py
@@ -320,4 +320,4 @@ def thread_states_test(self):
         self.runCmd("continue")
 
         # At this point, the inferior process should have exited.
-        self.assertEqual(process.GetState(), lldb.eStateExited, PROCESS_EXITED)
+        self.assertState(process.GetState(), lldb.eStateExited, PROCESS_EXITED)

diff  --git a/lldb/test/API/functionalities/thread/thread_exit/TestThreadExit.py b/lldb/test/API/functionalities/thread/thread_exit/TestThreadExit.py
index 4f8951fe08bfc..e9788f73d7253 100644
--- a/lldb/test/API/functionalities/thread/thread_exit/TestThreadExit.py
+++ b/lldb/test/API/functionalities/thread/thread_exit/TestThreadExit.py
@@ -116,4 +116,4 @@ def test(self):
         self.runCmd("continue")
 
         # At this point, the inferior process should have exited.
-        self.assertEqual(process.GetState(), lldb.eStateExited, PROCESS_EXITED)
+        self.assertState(process.GetState(), lldb.eStateExited, PROCESS_EXITED)

diff  --git a/lldb/test/API/functionalities/tty/TestTerminal.py b/lldb/test/API/functionalities/tty/TestTerminal.py
index 57da57f5c4eb2..e4af08fa00ead 100644
--- a/lldb/test/API/functionalities/tty/TestTerminal.py
+++ b/lldb/test/API/functionalities/tty/TestTerminal.py
@@ -46,4 +46,4 @@ def test_launch_in_terminal(self):
             "Make sure launch happened successfully in a terminal window")
         # Running in synchronous mode our process should have run and already
         # exited by the time target.Launch() returns
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)

diff  --git a/lldb/test/API/linux/aarch64/unwind_signal/TestUnwindSignal.py b/lldb/test/API/linux/aarch64/unwind_signal/TestUnwindSignal.py
index a635fb4cc3a6d..f5039a3617210 100644
--- a/lldb/test/API/linux/aarch64/unwind_signal/TestUnwindSignal.py
+++ b/lldb/test/API/linux/aarch64/unwind_signal/TestUnwindSignal.py
@@ -73,5 +73,5 @@ def test_unwind_signal(self):
 
         # Continue until we exit.
         process.Continue()
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
         self.assertEqual(process.GetExitStatus(), 0)

diff  --git a/lldb/test/API/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py b/lldb/test/API/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
index e6d4db9950502..a06533a8c7026 100644
--- a/lldb/test/API/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
+++ b/lldb/test/API/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
@@ -74,4 +74,4 @@ def test_step_inst(self):
         process.Continue()
 
         # At this point, the inferior process should have exited.
-        self.assertEqual(process.GetState(), lldb.eStateExited, PROCESS_EXITED)
+        self.assertState(process.GetState(), lldb.eStateExited, PROCESS_EXITED)

diff  --git a/lldb/test/API/macosx/posix_spawn/TestLaunchProcessPosixSpawn.py b/lldb/test/API/macosx/posix_spawn/TestLaunchProcessPosixSpawn.py
index e028ebf2a06d4..229faa07f802d 100644
--- a/lldb/test/API/macosx/posix_spawn/TestLaunchProcessPosixSpawn.py
+++ b/lldb/test/API/macosx/posix_spawn/TestLaunchProcessPosixSpawn.py
@@ -35,7 +35,7 @@ def run_arch(self, exe, arch):
         self.runCmd('run')
 
         process = self.dbg.GetSelectedTarget().process
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
         self.assertIn('slice: {}'.format(arch), process.GetSTDOUT(1000))
 
     @skipUnlessDarwin

diff  --git a/lldb/test/API/macosx/profile_vrs_detach/TestDetachVrsProfile.py b/lldb/test/API/macosx/profile_vrs_detach/TestDetachVrsProfile.py
index 7e288701ec0b9..624f52d517def 100644
--- a/lldb/test/API/macosx/profile_vrs_detach/TestDetachVrsProfile.py
+++ b/lldb/test/API/macosx/profile_vrs_detach/TestDetachVrsProfile.py
@@ -68,7 +68,7 @@ def cleanup():
         success = listener.WaitForEventForBroadcaster(0, process.GetBroadcaster(), event)
         self.assertTrue(success, "Got an event which should be running.")
         event_state = process.GetStateFromEvent(event)
-        self.assertEqual(event_state, lldb.eStateRunning, "Got the running event")
+        self.assertState(event_state, lldb.eStateRunning, "Got the running event")
 
         # Now detach:
         error = process.Detach()

diff  --git a/lldb/test/API/python_api/process/io/TestProcessIO.py b/lldb/test/API/python_api/process/io/TestProcessIO.py
index fa6a434a24503..0051a4b88cfa3 100644
--- a/lldb/test/API/python_api/process/io/TestProcessIO.py
+++ b/lldb/test/API/python_api/process/io/TestProcessIO.py
@@ -209,7 +209,7 @@ def run_process(self, put_stdin):
         # Let process continue so it will exit
         self.process.Continue()
         state = self.process.GetState()
-        self.assertEqual(state, lldb.eStateExited, PROCESS_IS_VALID)
+        self.assertState(state, lldb.eStateExited, PROCESS_IS_VALID)
 
     def check_process_output(self, output, error):
             # Since we launched the process without specifying stdin/out/err,

diff  --git a/lldb/test/API/python_api/target/TestTargetAPI.py b/lldb/test/API/python_api/target/TestTargetAPI.py
index e24f0b568d993..bebbb08a4e474 100644
--- a/lldb/test/API/python_api/target/TestTargetAPI.py
+++ b/lldb/test/API/python_api/target/TestTargetAPI.py
@@ -118,7 +118,7 @@ def test_get_ABIName(self):
 
         abi_pre_launch = target.GetABIName()
         self.assertTrue(len(abi_pre_launch) != 0, "Got an ABI string")
-        
+
         breakpoint = target.BreakpointCreateByLocation(
             "main.c", self.line_main)
         self.assertTrue(breakpoint, VALID_BREAKPOINT)
@@ -178,7 +178,7 @@ def test_launch_simple(self):
         process = target.LaunchSimple(
             ['foo', 'bar'], ['baz'], self.get_process_working_directory())
         process.Continue()
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
         output = process.GetSTDOUT(9999)
         self.assertIn('arg: foo', output)
         self.assertIn('arg: bar', output)
@@ -189,7 +189,7 @@ def test_launch_simple(self):
         process = target.LaunchSimple(None, None,
                                       self.get_process_working_directory())
         process.Continue()
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
         output = process.GetSTDOUT(9999)
         self.assertIn('arg: foo', output)
         self.assertIn('env: bar=baz', output)
@@ -198,7 +198,7 @@ def test_launch_simple(self):
         process = target.LaunchSimple(
             None, None, self.get_process_working_directory())
         process.Continue()
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
         output = process.GetSTDOUT(9999)
         self.assertEqual(output, "")
 

diff  --git a/lldb/test/API/python_api/watchpoint/TestWatchpointIgnoreCount.py b/lldb/test/API/python_api/watchpoint/TestWatchpointIgnoreCount.py
index 7c33dec38facc..4e8288acfcc93 100644
--- a/lldb/test/API/python_api/watchpoint/TestWatchpointIgnoreCount.py
+++ b/lldb/test/API/python_api/watchpoint/TestWatchpointIgnoreCount.py
@@ -87,7 +87,7 @@ def test_set_watch_ignore_count(self):
         process.Continue()
 
         # At this point, the inferior process should have exited.
-        self.assertEqual(process.GetState(), lldb.eStateExited, PROCESS_EXITED)
+        self.assertState(process.GetState(), lldb.eStateExited, PROCESS_EXITED)
 
         # Verify some vital statistics.
         self.assertTrue(watchpoint)

diff  --git a/lldb/test/API/qemu/TestQemuLaunch.py b/lldb/test/API/qemu/TestQemuLaunch.py
index 072efe6f0e456..d9342701ba3b4 100644
--- a/lldb/test/API/qemu/TestQemuLaunch.py
+++ b/lldb/test/API/qemu/TestQemuLaunch.py
@@ -66,7 +66,7 @@ def _run_and_get_state(self, target=None, info=None):
         process = target.Launch(info, error)
         self.assertSuccess(error)
         self.assertIsNotNone(process)
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
         self.assertEqual(process.GetExitStatus(), 0x47)
 
         # Verify the qemu invocation parameters.
@@ -142,7 +142,7 @@ def test_stdio_redirect(self):
 
         process = target.Launch(info, error)
         self.assertSuccess(error)
-        self.assertEqual(process.GetState(), lldb.eStateExited)
+        self.assertState(process.GetState(), lldb.eStateExited)
 
         with open(self.getBuildArtifact("stdout.txt")) as f:
             self.assertEqual(f.read(), "STDOUT CONTENT")


        


More information about the lldb-commits mailing list