summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2016-07-14 19:31:18 +0000
committerGreg Clayton <gclayton@apple.com>2016-07-14 19:31:18 +0000
commit7853dd5decf27f2e09c61d42d537a868a748ce27 (patch)
tree5eb8c7478c60e32eff2903305f1a55a5a0b1695e /lldb/packages/Python/lldbsuite/test
parentecea07c50ecc85f6e474d8f4831e566f97ac2be2 (diff)
downloadbcm5719-llvm-7853dd5decf27f2e09c61d42d537a868a748ce27.tar.gz
bcm5719-llvm-7853dd5decf27f2e09c61d42d537a868a748ce27.zip
Add support for Objective-C class properties.
Added test cases to exiting tests to cover the new functionality. <rdar://problem/24311282> llvm-svn: 275459
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py14
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/objc/objc-property/main.m13
2 files changed, 27 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py
index 9943d5f4b6a..22fe3136a51 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py
@@ -113,3 +113,17 @@ class ObjCPropertyTestCase(TestBase):
idWithProtocol_error = idWithProtocol_value.GetError()
self.assertTrue (idWithProtocol_error.Success())
self.assertTrue (idWithProtocol_value.GetTypeName() == "id")
+
+ # Make sure that class property getter works as expected
+ value = frame.EvaluateExpression("BaseClass.classInt", False)
+ self.assertTrue (value.GetError().Success())
+ self.assertTrue (value.GetValueAsUnsigned (11111) == 123)
+
+ # Make sure that class property setter works as expected
+ value = frame.EvaluateExpression("BaseClass.classInt = 234", False)
+ self.assertTrue (value.GetError().Success())
+
+ # Verify that setter above actually worked
+ value = frame.EvaluateExpression("BaseClass.classInt", False)
+ self.assertTrue (value.GetError().Success())
+ self.assertTrue (value.GetValueAsUnsigned (11111) == 234)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-property/main.m b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-property/main.m
index 2ef142be9b0..8d14759fb38 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-property/main.m
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-property/main.m
@@ -6,6 +6,8 @@
@end
+static int _class_int = 123;
+
@interface BaseClass : NSObject
{
int _backedInt;
@@ -25,6 +27,7 @@
@property(getter=myGetUnbackedInt,setter=mySetUnbackedInt:) int unbackedInt;
@property int backedInt;
@property (nonatomic, assign) id <MyProtocol> idWithProtocol;
+@property(class) int classInt;
@end
@implementation BaseClass
@@ -68,6 +71,16 @@
_access_count++;
}
++ (int) classInt
+{
+ return _class_int;
+}
+
++ (void) setClassInt:(int) n
+{
+ _class_int = n;
+}
+
- (int) getAccessCount
{
return _access_count;
OpenPOWER on IntegriCloud