2 Test lldb data formatter subsystem.
5 from __future__ import print_function
12 from lldbsuite.test.decorators import *
13 from lldbsuite.test.lldbtest import *
14 from lldbsuite.test import lldbutil
16 class NSSetSyntheticTestCase(TestBase):
18 mydir = TestBase.compute_mydir(__file__)
21 # Call super's setUp().
23 # Find the line number to break at.
24 self.line = line_number('main.m', '// Set break point at this line.')
27 def test_rdar12529957_with_run_command(self):
28 """Test that NSSet reports its synthetic children properly."""
30 self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
32 lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
34 self.runCmd("run", RUN_SUCCEEDED)
36 # The stop reason of the thread should be breakpoint.
37 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
39 'stop reason = breakpoint'])
41 # This is the function to remove the custom formats in order to have a
42 # clean slate for the next test case.
44 self.runCmd('type format clear', check=False)
45 self.runCmd('type summary clear', check=False)
46 self.runCmd('type synth clear', check=False)
48 # Execute the cleanup function during test case tear down.
49 self.addTearDownHook(cleanup)
51 # Now check that we are displaying Cocoa classes correctly
52 self.expect('frame variable set',
53 substrs = ['4 elements'])
54 self.expect('frame variable mutable',
55 substrs = ['9 elements'])
56 self.expect('frame variable set --ptr-depth 1 -d run -T',
57 substrs = ['4 elements','[0]','[1]','[2]','[3]','hello','world','(int)1','(int)2'])
58 self.expect('frame variable mutable --ptr-depth 1 -d run -T',
59 substrs = ['9 elements','(int)5','@"3 elements"','@"www.apple.com"','(int)3','@"world"','(int)4'])
62 self.expect('frame variable mutable',
63 substrs = ['0 elements'])
66 self.expect('frame variable mutable',
67 substrs = ['4 elements'])
68 self.expect('frame variable mutable --ptr-depth 1 -d run -T',
69 substrs = ['4 elements','[0]','[1]','[2]','[3]','hello','world','(int)1','(int)2'])
72 self.expect('frame variable mutable',
73 substrs = ['4 elements'])
74 self.expect('frame variable mutable --ptr-depth 1 -d run -T',
75 substrs = ['4 elements','[0]','[1]','[2]','[3]','hello','world','(int)1','(int)2'])