summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lang/objc
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lang/objc')
-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