This revision was automatically updated to reflect the committed changes.
Closed by commit rG6919c58262b0: [lldb] Add a test for Obj-C properties with
conflicting names (authored by teemperor).
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99513/new/
https://reviews.llvm.org/D99513
Files:
lldb/test/API/lang/objc/objc-property/TestObjCProperty.py
lldb/test/API/lang/objc/objc-property/main.m
Index: lldb/test/API/lang/objc/objc-property/main.m
===================================================================
--- lldb/test/API/lang/objc/objc-property/main.m
+++ lldb/test/API/lang/objc/objc-property/main.m
@@ -22,12 +22,16 @@
- (int) getAccessCount;
++ (int) propConflict;
+
+(BaseClass *) baseClassWithBackedInt: (int) inInt andUnbackedInt: (int)
inOtherInt;
@property(getter=myGetUnbackedInt,setter=mySetUnbackedInt:) int unbackedInt;
@property int backedInt;
@property (nonatomic, assign) id <MyProtocol> idWithProtocol;
@property(class) int classInt;
+@property(getter=propConflict,readonly) int propConflict;
+@property(readonly,class) int propConflict;
@end
@implementation BaseClass
@@ -85,6 +89,15 @@
{
return _access_count;
}
+
+- (int) propConflict
+{
+ return 4;
+}
++ (int) propConflict
+{
+ return 6;
+}
@end
typedef BaseClass TypedefBaseClass;
@@ -94,6 +107,7 @@
{
BaseClass *mine = [BaseClass baseClassWithBackedInt: 10 andUnbackedInt: 20];
TypedefBaseClass *typedefd = mine;
+ int propConflict = mine.propConflict + BaseClass.propConflict;
// Set a breakpoint here.
int nonexistant = mine.nonexistantInt;
Index: lldb/test/API/lang/objc/objc-property/TestObjCProperty.py
===================================================================
--- lldb/test/API/lang/objc/objc-property/TestObjCProperty.py
+++ lldb/test/API/lang/objc/objc-property/TestObjCProperty.py
@@ -137,3 +137,8 @@
value = frame.EvaluateExpression("BaseClass.classInt", False)
self.assertTrue(value.GetError().Success())
self.assertEquals(value.GetValueAsUnsigned(11111), 234)
+
+ # Test that accessing two distinct class and instance properties that
+ # share the same name works.
+ self.expect_expr("mine.propConflict", result_value="4")
+ self.expect_expr("BaseClass.propConflict", result_value="6")
Index: lldb/test/API/lang/objc/objc-property/main.m
===================================================================
--- lldb/test/API/lang/objc/objc-property/main.m
+++ lldb/test/API/lang/objc/objc-property/main.m
@@ -22,12 +22,16 @@
- (int) getAccessCount;
++ (int) propConflict;
+
+(BaseClass *) baseClassWithBackedInt: (int) inInt andUnbackedInt: (int) inOtherInt;
@property(getter=myGetUnbackedInt,setter=mySetUnbackedInt:) int unbackedInt;
@property int backedInt;
@property (nonatomic, assign) id <MyProtocol> idWithProtocol;
@property(class) int classInt;
+@property(getter=propConflict,readonly) int propConflict;
+@property(readonly,class) int propConflict;
@end
@implementation BaseClass
@@ -85,6 +89,15 @@
{
return _access_count;
}
+
+- (int) propConflict
+{
+ return 4;
+}
++ (int) propConflict
+{
+ return 6;
+}
@end
typedef BaseClass TypedefBaseClass;
@@ -94,6 +107,7 @@
{
BaseClass *mine = [BaseClass baseClassWithBackedInt: 10 andUnbackedInt: 20];
TypedefBaseClass *typedefd = mine;
+ int propConflict = mine.propConflict + BaseClass.propConflict;
// Set a breakpoint here.
int nonexistant = mine.nonexistantInt;
Index: lldb/test/API/lang/objc/objc-property/TestObjCProperty.py
===================================================================
--- lldb/test/API/lang/objc/objc-property/TestObjCProperty.py
+++ lldb/test/API/lang/objc/objc-property/TestObjCProperty.py
@@ -137,3 +137,8 @@
value = frame.EvaluateExpression("BaseClass.classInt", False)
self.assertTrue(value.GetError().Success())
self.assertEquals(value.GetValueAsUnsigned(11111), 234)
+
+ # Test that accessing two distinct class and instance properties that
+ # share the same name works.
+ self.expect_expr("mine.propConflict", result_value="4")
+ self.expect_expr("BaseClass.propConflict", result_value="6")
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits