Add test for class property in category.

main
David Chisnall 8 years ago
parent aba7e406ff
commit c1391b5079

@ -4,6 +4,7 @@
@interface Test (Property) @interface Test (Property)
@property (readonly) int val; @property (readonly) int val;
@property (class, readonly) int val2;
@end @end
@interface Test (Property2) @interface Test (Property2)
@ -12,6 +13,7 @@
@implementation Test (Property) @implementation Test (Property)
@dynamic val2;
- (int)val { return 0; } - (int)val { return 0; }
@end @end
@ -29,5 +31,11 @@ int main(int argc, char** argv)
prop = class_getProperty(test, "val2"); prop = class_getProperty(test, "val2");
assert(prop); assert(prop);
assert(strcmp("Ti,R,D", property_getAttributes(prop)) == 0); assert(strcmp("Ti,R,D", property_getAttributes(prop)) == 0);
#ifdef DGS_RUNTIME_V2
test = object_getClass(test);
objc_property_t prop = class_getProperty(test, "val2");
assert(prop);
assert(strcmp("Ti,R,D", property_getAttributes(prop)) == 0);
#endif
} }

Loading…
Cancel
Save