[Lldb-commits] [lldb] r151221 - in /lldb/trunk/test/lang/objc/hidden-ivars: TestHiddenIvars.py main.m

Sean Callanan scallanan at apple.com
Wed Feb 22 17:06:42 PST 2012


Author: spyffe
Date: Wed Feb 22 19:06:42 2012
New Revision: 151221

URL: http://llvm.org/viewvc/llvm-project?rev=151221&view=rev
Log:
Made the hidden-ivar test a little more rigorous.

Modified:
    lldb/trunk/test/lang/objc/hidden-ivars/TestHiddenIvars.py
    lldb/trunk/test/lang/objc/hidden-ivars/main.m

Modified: lldb/trunk/test/lang/objc/hidden-ivars/TestHiddenIvars.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/hidden-ivars/TestHiddenIvars.py?rev=151221&r1=151220&r2=151221&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/hidden-ivars/TestHiddenIvars.py (original)
+++ lldb/trunk/test/lang/objc/hidden-ivars/TestHiddenIvars.py Wed Feb 22 19:06:42 2012
@@ -54,21 +54,21 @@
         self.common_setup()
 
         # This should display correctly.
-        self.expect("expression (i->bar)", VARIABLES_DISPLAYED_CORRECTLY,
-            substrs = ["= 3"])
+        self.expect("expression (j->_definer->bar)", VARIABLES_DISPLAYED_CORRECTLY,
+            substrs = ["= 5"])
             
-        self.expect("expression (*i)", VARIABLES_DISPLAYED_CORRECTLY,
-            substrs = ["foo = 0", "bar = 3"])
+        self.expect("expression *(j->_definer)", VARIABLES_DISPLAYED_CORRECTLY,
+            substrs = ["foo = 0", "bar = 5"])
 
     def frame_var(self):
         self.common_setup()
 
         # This should display correctly.
-        self.expect("frame variable i->bar", VARIABLES_DISPLAYED_CORRECTLY,
-            substrs = ["= 3"])
+        self.expect("frame variable j->_definer->bar", VARIABLES_DISPLAYED_CORRECTLY,
+            substrs = ["= 5"])
             
-        self.expect("frame variable *i", VARIABLES_DISPLAYED_CORRECTLY,
-            substrs = ["foo = 0", "bar = 3"])
+        self.expect("frame variable *j->_definer", VARIABLES_DISPLAYED_CORRECTLY,
+            substrs = ["foo = 0", "bar = 5"])
                        
 if __name__ == '__main__':
     import atexit

Modified: lldb/trunk/test/lang/objc/hidden-ivars/main.m
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/hidden-ivars/main.m?rev=151221&r1=151220&r2=151221&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/hidden-ivars/main.m (original)
+++ lldb/trunk/test/lang/objc/hidden-ivars/main.m Wed Feb 22 19:06:42 2012
@@ -1,18 +1,33 @@
 #import <Foundation/Foundation.h>
 #import "InternalDefiner.h"
 
+ at interface Container : NSObject {
+ at public
+    InternalDefiner *_definer;
+}
+
+-(id)init;
+ at end
+
+ at implementation Container
+
+-(id)init
+{
+    _definer = [InternalDefiner alloc];
+    [_definer setBarTo:5];
+    return self;
+}
+
+ at end
+
 int main(int argc, const char * argv[])
 {
 
     @autoreleasepool {
-        
-        InternalDefiner *i = [InternalDefiner alloc];
-        
-        [i setBarTo:3];
-        
-        printf("ivar value = %d", i->foo); // Set breakpoint 0 here.
-        
-    }
+        Container *j = [[Container alloc] init];
+
+        printf("ivar value = %d", j->_definer->foo); // Set breakpoint 0 here.
+    }   
     return 0;
 }
 





More information about the lldb-commits mailing list