diff options
Diffstat (limited to 'packages/Python/lldbsuite/test/lang/objc/objc-property')
-rw-r--r-- | packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py | 17 | ||||
-rw-r--r-- | packages/Python/lldbsuite/test/lang/objc/objc-property/main.m | 13 |
2 files changed, 29 insertions, 1 deletions
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py b/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py index c22a1f1ad532a..22fe3136a5114 100644 --- a/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py +++ b/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py @@ -9,8 +9,9 @@ from __future__ import print_function import os, time import re import lldb -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil class ObjCPropertyTestCase(TestBase): @@ -112,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/packages/Python/lldbsuite/test/lang/objc/objc-property/main.m b/packages/Python/lldbsuite/test/lang/objc/objc-property/main.m index 2ef142be9b00d..8d14759fb384d 100644 --- a/packages/Python/lldbsuite/test/lang/objc/objc-property/main.m +++ b/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; |