b163fa56fae5390c48b52b9885958e3f71942b6b
[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 TestDataFormatterLibcxxQueue(TestBase):
14
15     mydir = TestBase.compute_mydir(__file__)
16
17     def setUp(self):
18         TestBase.setUp(self)
19         ns = 'ndk' if lldbplatformutil.target_is_android() else ''
20         self.namespace = 'std::__' + ns + '1'
21
22     def check_variable(self, name):
23         var = self.frame().FindVariable(name)
24         self.assertTrue(var.IsValid())
25
26         queue = self.namespace + '::queue'
27         self.assertTrue(queue in var.GetTypeName())
28         self.assertEqual(var.GetNumChildren(), 5)
29         for i in range(5):
30             ch = var.GetChildAtIndex(i)
31             self.assertTrue(ch.IsValid())
32             self.assertEqual(ch.GetValueAsSigned(), i+1)
33
34     @expectedFailureAll(bugnumber="llvm.org/pr36109", debug_info="gmodules", triple=".*-android")
35     @add_test_categories(["libc++"])
36     def test(self):
37         """Test that std::queue is displayed correctly"""
38         self.build()
39         lldbutil.run_to_source_breakpoint(self, '// break here',
40                 lldb.SBFileSpec("main.cpp", False))
41
42         self.check_variable('q1')
43         self.check_variable('q2')