Skip to content

Commit 33a9971

Browse files
committed
Update python tests to use expect_var_path where possible.
1 parent 5d592e3 commit 33a9971

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

lldb/test/API/commands/frame/var-dil/basics/GlobalVariableLookup/TestFrameVarDILGlobalVariableLookup.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ def test_frame_var(self):
2424
lldb.SBFileSpec("main.cpp"))
2525

2626
self.expect("settings set target.experimental.use-DIL true", substrs=[""])
27-
self.expect("frame variable 'globalVar'", substrs=["-559038737"]) # 0xDEADBEEF
28-
self.expect("frame variable 'globalPtr'", patterns=["0x[0-9]+"])
29-
self.expect("frame variable 'globalRef'", substrs=["-559038737"])
30-
self.expect("frame variable '::globalPtr'", patterns=["0x[0-9]+"])
31-
self.expect("frame variable '::globalRef'", substrs=["-559038737"])
27+
self.expect_var_path("globalVar", type="int", value="-559038737") # 0xDEADBEEF
28+
self.expect_var_path("globalPtr", type="int *")
29+
self.expect_var_path("globalRef", value="-559038737")
30+
self.expect_var_path("::globalVar", value="-559038737")
31+
self.expect_var_path("::globalPtr", type="int *")
32+
self.expect_var_path("::globalRef", value="-559038737")
3233

3334
self.expect(
3435
"frame variable 'externGlobalVar'",
@@ -40,8 +41,9 @@ def test_frame_var(self):
4041
error=True,
4142
substrs=["use of undeclared identifier"],
4243
) # ["12648430"])
43-
self.expect("frame variable 'ns::globalVar'", substrs=["13"])
44-
self.expect("frame variable 'ns::globalPtr'", patterns=["0x[0-9]+"])
45-
self.expect("frame variable 'ns::globalRef'", substrs=["13"])
46-
self.expect("frame variable '::ns::globalVar'", substrs=["13"])
47-
self.expect("frame variable '::ns::globalPtr'", patterns=["0x[0-9]+"])
44+
45+
self.expect_var_path("ns::globalVar", value="13")
46+
self.expect_var_path("ns::globalPtr", type="int *")
47+
self.expect_var_path("ns::globalRef", value="13")
48+
self.expect_var_path("::ns::globalVar", value="13")
49+
self.expect_var_path("::ns::globalPtr", type="int *")

lldb/test/API/commands/frame/var-dil/basics/InstanceVariables/TestFrameVarDILInstanceVariables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ def test_frame_var(self):
2424
lldb.SBFileSpec("main.cpp"))
2525

2626
self.expect("settings set target.experimental.use-DIL true", substrs=[""])
27-
self.expect("frame variable 'this'", patterns=["0x[0-9]+"])
27+
self.expect_var_path("this", type="TestMethods *")
2828
self.expect("frame variable 'c'", substrs=["(field_ = -1)"])

lldb/test/API/commands/frame/var-dil/basics/LocalVars/TestFrameVarDILLocalVars.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def test_frame_var(self):
2424
lldb.SBFileSpec("main.cpp"))
2525

2626
self.expect("settings set target.experimental.use-DIL true", substrs=[""])
27-
self.expect("frame variable a", substrs=["1"])
28-
self.expect("frame variable b", substrs=["2"])
29-
self.expect("frame variable c", substrs=["\\xfd"])
30-
self.expect("frame variable s", substrs=["4"])
27+
self.expect_var_path("a", value="1")
28+
self.expect_var_path("b", value="2")
29+
self.expect_var_path("c", value="'\\xfd'")
30+
self.expect_var_path("s", value="4")

0 commit comments

Comments
 (0)