81b44c02744de3aab1a1c0719218e6e1ee0de81d
[openbsd] /
1 """
2 Test displayed value of a vector variable while doing watchpoint operations
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 TestValueOfVectorVariableTestCase(TestBase):
14
15     mydir = TestBase.compute_mydir(__file__)
16     NO_DEBUG_INFO_TESTCASE = True
17
18     def test_value_of_vector_variable_using_watchpoint_set(self):
19         """Test verify displayed value of vector variable."""
20         exe = self.getBuildArtifact("a.out")
21         d = {'C_SOURCES': self.source, 'EXE': exe}
22         self.build(dictionary=d)
23         self.setTearDownCleanup(dictionary=d)
24         self.value_of_vector_variable_with_watchpoint_set()
25
26     def setUp(self):
27         # Call super's setUp().
28         TestBase.setUp(self)
29         # Our simple source filename.
30         self.source = 'main.c'
31
32     def value_of_vector_variable_with_watchpoint_set(self):
33         """Test verify displayed value of vector variable"""
34         exe = self.getBuildArtifact("a.out")
35         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
36
37         # Set break to get a frame
38         self.runCmd("b main")
39
40         # Run the program.
41         self.runCmd("run", RUN_SUCCEEDED)
42
43         # Value of a vector variable should be displayed correctly
44         self.expect(
45             "watchpoint set variable global_vector",
46             WATCHPOINT_CREATED,
47             substrs=['new value: (1, 2, 3, 4)'])