1import lldb 2from lldbsuite.test.decorators import * 3from lldbsuite.test.lldbtest import * 4from lldbsuite.test import lldbutil 5 6 7class TestOrderedSet(TestBase): 8 def test_ordered_set(self): 9 self.build() 10 self.run_tests() 11 12 @skipUnlessDarwin 13 def test_ordered_set_no_const(self): 14 disable_constant_classes = { 15 "CFLAGS_EXTRAS": "-fno-constant-nsnumber-literals " 16 + "-fno-constant-nsarray-literals " 17 + "-fno-constant-nsdictionary-literals", 18 } 19 # FIXME: Remove when flags are available upstream. 20 self.build(dictionary=disable_constant_classes, compiler="xcrun clang") 21 self.run_tests() 22 23 def run_tests(self): 24 src_file = "main.m" 25 src_file_spec = lldb.SBFileSpec(src_file) 26 (target, process, thread, main_breakpoint) = lldbutil.run_to_source_breakpoint( 27 self, "break here", src_file_spec, exe_name="a.out" 28 ) 29 frame = thread.GetSelectedFrame() 30 self.expect("expr -d run -- orderedSet", substrs=["3 elements"]) 31 self.expect( 32 "expr -d run -- *orderedSet", substrs=["(int)1", "(int)2", "(int)3"] 33 ) 34