From c1391b5079cc623b7a5f15bbd6191fa8f598789c Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Thu, 5 Apr 2018 11:44:45 +0100 Subject: [PATCH] Add test for class property in category. --- Test/category_properties.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Test/category_properties.m b/Test/category_properties.m index 836849b..3d3d05d 100644 --- a/Test/category_properties.m +++ b/Test/category_properties.m @@ -4,6 +4,7 @@ @interface Test (Property) @property (readonly) int val; +@property (class, readonly) int val2; @end @interface Test (Property2) @@ -12,6 +13,7 @@ @implementation Test (Property) +@dynamic val2; - (int)val { return 0; } @end @@ -29,5 +31,11 @@ int main(int argc, char** argv) prop = class_getProperty(test, "val2"); assert(prop); 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 }