2
2
Test that we do not attempt to make a dynamic type for a 'const char*'
3
3
"""
4
4
5
-
6
5
import lldb
7
6
from lldbsuite .test .decorators import *
8
7
from lldbsuite .test .lldbtest import *
9
8
from lldbsuite .test import lldbutil
10
9
11
-
12
- class Rdar10967107TestCase (TestBase ):
10
+ class TestCaseCharStarDynType (TestBase ):
13
11
def setUp (self ):
14
12
# Call super's setUp().
15
13
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." )
21
14
22
15
def test_charstar_dyntype (self ):
23
16
"""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" )
33
20
)
34
21
35
- self .runCmd ("run" , RUN_SUCCEEDED )
36
22
# check that we correctly see the const char*, even with dynamic types
37
23
# on
38
24
self .expect ("frame variable -raw-output my_string" , substrs = ["const char *" ])
@@ -41,7 +27,7 @@ def test_charstar_dyntype(self):
41
27
substrs = ["const char *" ],
42
28
)
43
29
# 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 *" ])
45
31
self .expect ("expr -R -d run -- my_string" , substrs = ["const char *" ])
46
32
# but check that we get the real Foolie as such
47
33
self .expect ("frame variable my_foolie" , substrs = ["FoolMeOnce *" ])
0 commit comments