2 Test more expression command sequences with objective-c.
7 from lldbsuite
.test
.decorators
import *
8 from lldbsuite
.test
.lldbtest
import *
9 from lldbsuite
.test
import lldbutil
12 class FoundationTestCaseNSError(TestBase
):
13 @expectedFailureAll(archs
=["i[3-6]86"], bugnumber
="<rdar://problem/28814052>")
14 def test_runtime_types(self
):
15 """Test commands that require runtime types"""
17 self
.target
, process
, thread
, bkpt
= lldbutil
.run_to_source_breakpoint(
18 self
, "// Break here for NSString tests", lldb
.SBFileSpec("main.m", False)
22 self
.runCmd("thread backtrace")
23 self
.expect("expression [str length]", patterns
=["\(NSUInteger\) \$.* ="])
24 self
.expect("expression str.length")
25 self
.expect('expression str = [NSString stringWithCString: "new"]')
27 'po [NSError errorWithDomain:@"Hello" code:35 userInfo:@{@"NSDescription" : @"be completed."}]',
28 substrs
=["Error Domain=Hello", "Code=35", "be completed."],
30 self
.runCmd("process continue")
32 @expectedFailureAll(archs
=["i[3-6]86"], bugnumber
="<rdar://problem/28814052>")
33 def test_NSError_p(self
):
34 """Test that p of the result of an unknown method does require a cast."""
36 self
.target
, process
, thread
, bkpt
= lldbutil
.run_to_source_breakpoint(
37 self
, "// Set break point at this line", lldb
.SBFileSpec("main.m", False)
40 "expression [NSError thisMethodIsntImplemented:0]",
44 "cast the message send to the method's return type",
47 self
.runCmd("process continue")