57b777837165e9c87aa9e80b88ec6ac259a3a828
[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 TestDataFormatterLibcxxTuple(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::tuple is displayed correctly"""
26         self.build()
27         lldbutil.run_to_source_breakpoint(self, '// break here',
28                 lldb.SBFileSpec("main.cpp", False))
29
30         tuple_name = self.namespace + '::tuple'
31         self.expect("frame variable empty",
32                     substrs=[tuple_name,
33                              'size=0',
34                              '{}'])
35
36         self.expect("frame variable one_elt",
37                     substrs=[tuple_name,
38                              'size=1',
39                              '{',
40                              '[0] = 47',
41                              '}'])
42
43         self.expect("frame variable three_elts",
44                     substrs=[tuple_name,
45                              'size=3',
46                              '{',
47                              '[0] = 1',
48                              '[1] = 47',
49                              '[2] = "foo"',
50                              '}'])