a9983dd045e994506f35d8d243e95eec781403ac
[openbsd] /
1 """
2 Test lldb data formatter subsystem.
3 """
4
5
6
7 import lldb
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
11
12
13 class TestDataFormatterLibcxxForwardList(TestBase):
14
15     mydir = TestBase.compute_mydir(__file__)
16
17     def setUp(self):
18         TestBase.setUp(self)
19         self.line = line_number('main.cpp', '// break here')
20         ns = 'ndk' if lldbplatformutil.target_is_android() else ''
21         self.namespace = 'std::__' + ns + '1'
22
23     @add_test_categories(["libc++"])
24     def test(self):
25         """Test that std::forward_list is displayed correctly"""
26         self.build()
27         lldbutil.run_to_source_breakpoint(self, '// break here',
28                 lldb.SBFileSpec("main.cpp", False))
29
30         forward_list = self.namespace + '::forward_list'
31         self.expect("frame variable empty",
32                     substrs=[forward_list,
33                              'size=0',
34                              '{}'])
35
36         self.expect("frame variable one_elt",
37                     substrs=[forward_list,
38                              'size=1',
39                              '{',
40                              '[0] = 47',
41                              '}'])
42
43         self.expect("frame variable five_elts",
44                     substrs=[forward_list,
45                              'size=5',
46                              '{',
47                              '[0] = 1',
48                              '[1] = 22',
49                              '[2] = 333',
50                              '[3] = 4444',
51                              '[4] = 55555',
52                              '}'])