diff --git a/lldb/test/API/test_linker/TestLinkerLaunch.py b/lldb/test/API/test_linker/TestLinkerLaunch.py index e968bd951d874a6562dc64491dd7855a212e1c0f..223bc6c75c94f00d95a9b993c6dbcf52e4cc09ca 100644 --- a/lldb/test/API/test_linker/TestLinkerLaunch.py +++ b/lldb/test/API/test_linker/TestLinkerLaunch.py @@ -19,12 +19,14 @@ a remote-ohos connection, will skip on CI or remote = false. import subprocess import sys +import os import lldb -from lldbsuite.test.decorators import * -from lldbsuite.test.lldbtest import * +from lldbsuite.test.decorators import skipIf, skipUnlessPlatform +from lldbsuite.test.lldbtest import TestBase, PROCESS_IS_VALID, BREAKPOINT_HIT_ONCE from lldbsuite.test import lldbutil + class LaunchLinker(TestBase): NO_DEBUG_INFO_TESTCASE = True @@ -47,10 +49,10 @@ class LaunchLinker(TestBase): """Create target, breakpoint, launch a process, and then kill it.""" target = self.dbg.CreateTarget(self.exe) - breakpoint = target.BreakpointCreateByName("__dls2b") + bkpt_dls2b = target.BreakpointCreateByName("__dls2b") # The default state after breakpoint creation should be enabled. self.assertTrue( - breakpoint.IsEnabled(), "Breakpoint should be enabled after creation" + bkpt_dls2b.IsEnabled(), "Breakpoint should be enabled after creation" ) process = target.LaunchSimple(None, None, self.get_process_working_directory()) self.assertTrue(process, PROCESS_IS_VALID) @@ -59,7 +61,7 @@ class LaunchLinker(TestBase): self.assertIsNotNone(thread) # The breakpoint should have a hit count of 1. - self.assertEqual(breakpoint.GetHitCount(), 1, BREAKPOINT_HIT_ONCE) + self.assertEqual(bkpt_dls2b.GetHitCount(), 1, BREAKPOINT_HIT_ONCE) # Destroy process before TestBase.tearDown() self.dbg.GetSelectedTarget().GetProcess().Destroy() @@ -70,10 +72,10 @@ class LaunchLinker(TestBase): """Create target, breakpoint, launch a process, and then kill it.""" target = self.dbg.CreateTarget(self.exe) - breakpoint = target.BreakpointCreateByName("printf") + bkpt_printf = target.BreakpointCreateByName("printf") # The default state after breakpoint creation should be enabled. self.assertTrue( - breakpoint.IsEnabled(), "Breakpoint should be enabled after creation" + bkpt_printf.IsEnabled(), "Breakpoint should be enabled after creation" ) process = target.LaunchSimple(None, None, self.get_process_working_directory()) self.assertTrue(process, PROCESS_IS_VALID) @@ -82,7 +84,7 @@ class LaunchLinker(TestBase): self.assertIsNotNone(thread) # The breakpoint should have a hit count of 1. - self.assertEqual(breakpoint.GetHitCount(), 1, BREAKPOINT_HIT_ONCE) + self.assertEqual(bkpt_printf.GetHitCount(), 1, BREAKPOINT_HIT_ONCE) # Destroy process before TestBase.tearDown() self.dbg.GetSelectedTarget().GetProcess().Destroy() diff --git a/lldb/test/API/test_linker/main.c b/lldb/test/API/test_linker/main.c index f404bb69b769e7c3d3d3587d27ba6c99479bdb79..f93b92476b5a379cd2df9853f7e6fb1677e1b48a 100644 --- a/lldb/test/API/test_linker/main.c +++ b/lldb/test/API/test_linker/main.c @@ -15,8 +15,8 @@ #include -int main () +int main() { - printf("test musl/linker!\n"); - return 0; + printf("test musl/linker!\n"); + return 0; }