brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 2cd1386 Raw
29 lines · python
1"""2Test more expression command sequences with objective-c.3"""4 5 6import lldb7from lldbsuite.test.decorators import *8from lldbsuite.test.lldbtest import *9from lldbsuite.test import lldbutil10 11 12class FoundationTestCaseNSArray(TestBase):13    def test_NSArray_expr_commands(self):14        """Test expression commands for NSArray."""15        self.build()16        self.target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(17            self, "// Break here for NSArray tests", lldb.SBFileSpec("main.m", False)18        )19 20        self.runCmd("thread backtrace")21        self.expect(22            "expression (int)[nil_mutable_array count]", patterns=[r"\(int\) \$.* = 0"]23        )24        self.expect("expression (int)[array1 count]", patterns=[r"\(int\) \$.* = 3"])25        self.expect("expression (int)[array2 count]", patterns=[r"\(int\) \$.* = 3"])26        self.expect("expression (int)array1.count", patterns=[r"\(int\) \$.* = 3"])27        self.expect("expression (int)array2.count", patterns=[r"\(int\) \$.* = 3"])28        self.runCmd("process continue")29