Skip to content

Commit 0692935

Browse files
committed
[lldb][test] TestCppUnionStaticMembers.py: split out assertions that fail on some platforms
Split out the assertions that fail on Windows in preparation to XFAILing them. Drive-by change: * Add a missing `self.build()` call in `test_union_in_anon_namespace` * Fix formatting
1 parent 46518a1 commit 0692935

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

lldb/test/API/lang/cpp/union-static-data-members/TestCppUnionStaticMembers.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
import lldbsuite.test.lldbutil as lldbutil
99

1010
class CppUnionStaticMembersTestCase(TestBase):
11-
def test(self):
11+
def test_print_union(self):
1212
"""Tests that frame variable and expr work
13-
for union static data members"""
13+
for union with static data members"""
1414
self.build()
1515

1616
(target, process, main_thread, _) = lldbutil.run_to_source_breakpoint(
1717
self, "return 0", lldb.SBFileSpec("main.cpp")
18-
)
18+
)
1919

2020
self.expect("frame variable foo", substrs=["val = 42"])
2121
self.expect("frame variable bar", substrs=["val = 137"])
@@ -27,6 +27,15 @@ def test(self):
2727
name="val", value="137"
2828
)])
2929

30+
def test_expr_union_static_members(self):
31+
"""Tests that frame variable and expr work
32+
for union static data members"""
33+
self.build()
34+
35+
(target, process, main_thread, _) = lldbutil.run_to_source_breakpoint(
36+
self, "return 0", lldb.SBFileSpec("main.cpp")
37+
)
38+
3039
self.expect_expr("Foo::sVal1", result_type="const int", result_value="-42")
3140
self.expect_expr("Foo::sVal2", result_type="Foo", result_children=[ValueCheck(
3241
name="val", value="42"
@@ -37,6 +46,12 @@ def test_union_in_anon_namespace(self):
3746
"""Tests that frame variable and expr work
3847
for union static data members in anonymous
3948
namespaces"""
49+
self.build()
50+
51+
(target, process, main_thread, _) = lldbutil.run_to_source_breakpoint(
52+
self, "return 0", lldb.SBFileSpec("main.cpp")
53+
)
54+
4055
self.expect_expr("Bar::sVal1", result_type="const int", result_value="-137")
4156
self.expect_expr("Bar::sVal2", result_type="Bar", result_children=[ValueCheck(
4257
name="val", value="137"

0 commit comments

Comments
 (0)