|
| 1 | +""" |
| 2 | +Test formatting of types annotated with |
| 3 | +[[clang::preferred_name]] attributes. |
| 4 | +""" |
| 5 | + |
| 6 | +import lldb |
| 7 | +import lldbsuite.test.lldbutil as lldbutil |
| 8 | +from lldbsuite.test.lldbtest import * |
| 9 | +from lldbsuite.test import decorators |
| 10 | + |
| 11 | + |
| 12 | +class TestPreferredName(TestBase): |
| 13 | + |
| 14 | + def test_frame_var(self): |
| 15 | + self.build() |
| 16 | + lldbutil.run_to_source_breakpoint(self, "return", lldb.SBFileSpec("main.cpp")) |
| 17 | + |
| 18 | + self.expect("frame variable barInt", substrs=["BarInt"]) |
| 19 | + self.expect("frame variable barDouble", substrs=["BarDouble"]) |
| 20 | + self.expect("frame variable barShort", substrs=["Bar<short>"]) |
| 21 | + self.expect("frame variable barChar", substrs=["Bar<char>"]) |
| 22 | + |
| 23 | + self.expect("frame variable varInt", substrs=["BarInt"]) |
| 24 | + self.expect("frame variable varDouble", substrs=["BarDouble"]) |
| 25 | + self.expect("frame variable varShort", substrs=["Bar<short>"]) |
| 26 | + self.expect("frame variable varChar", substrs=["Bar<char>"]) |
| 27 | + self.expect("frame variable varFooInt", substrs=["Foo<BarInt>"]) |
| 28 | + |
| 29 | + def test_expr(self): |
| 30 | + self.build() |
| 31 | + lldbutil.run_to_source_breakpoint(self, "return", lldb.SBFileSpec("main.cpp")) |
| 32 | + |
| 33 | + self.expect_expr("barInt", result_type="BarInt") |
| 34 | + self.expect_expr("barDouble", result_type="BarDouble") |
| 35 | + self.expect_expr("barShort", result_type="Bar<short>") |
| 36 | + self.expect_expr("barChar", result_type="Bar<char>") |
| 37 | + |
| 38 | + self.expect_expr("varInt", result_type="BarInt") |
| 39 | + self.expect_expr("varDouble", result_type="BarDouble") |
| 40 | + self.expect_expr("varShort", result_type="Bar<short>") |
| 41 | + self.expect_expr("varChar", result_type="Bar<char>") |
| 42 | + self.expect_expr("varFooInt", result_type="Foo<BarInt>") |
0 commit comments