Skip to content

Commit 9dfc6d3

Browse files
Clean up test case (#66400)
1 parent 07acfe3 commit 9dfc6d3

File tree

3 files changed

+5
-22
lines changed

3 files changed

+5
-22
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
OBJC_SOURCES := main.m
2-
3-
4-
52
LD_EXTRAS := -framework Foundation
63
include Makefile.rules

lldb/test/API/lang/objc/rdar-11355592/TestRdar11355592.py renamed to lldb/test/API/lang/objc/charstar_dyntype/TestCharStarDynType.py

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,23 @@
22
Test that we do not attempt to make a dynamic type for a 'const char*'
33
"""
44

5-
65
import lldb
76
from lldbsuite.test.decorators import *
87
from lldbsuite.test.lldbtest import *
98
from lldbsuite.test import lldbutil
109

11-
12-
class Rdar10967107TestCase(TestBase):
10+
class TestCaseCharStarDynType(TestBase):
1311
def setUp(self):
1412
# Call super's setUp().
1513
TestBase.setUp(self)
16-
# We'll use the test method name as the exe_name.
17-
self.exe_name = self.testMethodName
18-
# Find the line number to break inside main().
19-
self.main_source = "main.m"
20-
self.line = line_number(self.main_source, "// Set breakpoint here.")
2114

2215
def test_charstar_dyntype(self):
2316
"""Test that we do not attempt to make a dynamic type for a 'const char*'"""
24-
d = {"EXE": self.exe_name}
25-
self.build(dictionary=d)
26-
self.setTearDownCleanup(dictionary=d)
27-
28-
exe = self.getBuildArtifact(self.exe_name)
29-
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
30-
31-
lldbutil.run_break_set_by_file_and_line(
32-
self, self.main_source, self.line, num_expected_locations=1, loc_exact=True
17+
self.build()
18+
lldbutil.run_to_source_breakpoint(
19+
self, "// Set breakpoint here.", lldb.SBFileSpec("main.m")
3320
)
3421

35-
self.runCmd("run", RUN_SUCCEEDED)
3622
# check that we correctly see the const char*, even with dynamic types
3723
# on
3824
self.expect("frame variable -raw-output my_string", substrs=["const char *"])
@@ -41,7 +27,7 @@ def test_charstar_dyntype(self):
4127
substrs=["const char *"],
4228
)
4329
# check that expr also gets it right
44-
self.expect("e -R -- my_string", substrs=["const char *"])
30+
self.expect("expr -R -- my_string", substrs=["const char *"])
4531
self.expect("expr -R -d run -- my_string", substrs=["const char *"])
4632
# but check that we get the real Foolie as such
4733
self.expect("frame variable my_foolie", substrs=["FoolMeOnce *"])

0 commit comments

Comments
 (0)