2 Test that objective-c method returning BOOL works correctly.
5 from __future__ import print_function
11 from lldbsuite.test.decorators import *
12 from lldbsuite.test.lldbtest import *
13 from lldbsuite.test import lldbutil
16 class MethodReturningBOOLTestCase(TestBase):
18 mydir = TestBase.compute_mydir(__file__)
21 # Call super's setUp().
23 # We'll use the test method name as the exe_name.
24 self.exe_name = self.testMethodName
25 # Find the line number to break inside main().
26 self.main_source = "main.m"
27 self.line = line_number(self.main_source, '// Set breakpoint here.')
29 def test_method_ret_BOOL(self):
30 """Test that objective-c method returning BOOL works correctly."""
31 d = {'EXE': self.exe_name}
32 self.build(dictionary=d)
33 self.setTearDownCleanup(dictionary=d)
35 exe = os.path.join(os.getcwd(), self.exe_name)
36 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
38 lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
40 self.runCmd("run", RUN_SUCCEEDED)
41 self.expect("process status", STOPPED_DUE_TO_BREAKPOINT,
42 substrs = [" at %s:%d" % (self.main_source, self.line),
43 "stop reason = breakpoint"])
45 # rdar://problem/9691614
46 self.runCmd('p (int)[my isValid]')