Fixed the an objective C test case so it passes correctly.
authorGreg Clayton <gclayton@apple.com>
Wed, 16 Jul 2014 00:42:06 +0000 (00:42 +0000)
committerGreg Clayton <gclayton@apple.com>
Wed, 16 Jul 2014 00:42:06 +0000 (00:42 +0000)
Fixed the test case to use a runtime function prototype that will be correct ([NSString stringWithCString: "new"]) instead of one that won't (expression str = [NSString stringWithFormat: @"%cew", 'N']). The runtime doesn't track vararg functions correctly so we can't reconstitute the function correctly.

Also fixed some expressions that used "str_id" whose type was "id" and do the necessary casting since "id" doesn't have any methods.

llvm-svn: 213113

lldb/test/lang/objc/foundation/TestObjCMethods2.py

index d113fff..fb74e60 100644 (file)
@@ -158,7 +158,6 @@ class FoundationTestCase2(TestBase):
             patterns = ["\(int\) \$.* = 3"])
         self.runCmd("process continue")
 
-    @unittest2.expectedFailure(8741897)
     def NSString_expr(self):
         """Test expression commands for NSString."""
         exe = os.path.join(os.getcwd(), "a.out")
@@ -178,12 +177,13 @@ class FoundationTestCase2(TestBase):
             patterns = ["\(int\) \$.* ="])
         self.expect("expression [str description]",
             patterns = ["\(id\) \$.* = 0x"])
-        self.expect("expression [str_id description]",
+        self.expect("expression (id)[str_id description]",
             patterns = ["\(id\) \$.* = 0x"])
+        self.expect("expression str.length")
         self.expect("expression str.description")
-        self.expect("expression str_id.description")
         self.expect('expression str = @"new"')
-        self.expect('expression str = [NSString stringWithFormat: @"%cew", \'N\']')
+        self.runCmd("image lookup -t NSString")
+        self.expect('expression str = [NSString stringWithCString: "new"]')
         self.runCmd("process continue")
 
     def MyString_dump(self):