diff --git a/Test/PropertyIntrospectionTest2.m b/Test/PropertyIntrospectionTest2.m index 9e07589..b77721d 100644 --- a/Test/PropertyIntrospectionTest2.m +++ b/Test/PropertyIntrospectionTest2.m @@ -244,6 +244,52 @@ __attribute__((objc_root_class)) #define ATTR(n, v) (objc_property_attribute_t){(n), (v)} #define ATTRS(...) (objc_property_attribute_t[]){ __VA_ARGS__ }, \ sizeof((objc_property_attribute_t[]){ __VA_ARGS__ }) / sizeof(objc_property_attribute_t) +#define OPT_ASSERT(stmt) if (abort) { \ + assert(stmt);\ +} else { \ + if (!(stmt)) { return NO; } \ +} + +static BOOL testPropertyForProperty_alt(objc_property_t p, + const char *name, + const char *types, + objc_property_attribute_t* list, + unsigned int size, BOOL abort) +{ + OPT_ASSERT(0 != p); + OPT_ASSERT(strcmp(name, property_getName(p)) == 0); + const char *attrs = property_getAttributes(p); + OPT_ASSERT(0 != attrs); + OPT_ASSERT(strcmp(types, attrs) == 0); + unsigned int attrsCount = 0; + objc_property_attribute_t *attrsList = property_copyAttributeList(p, &attrsCount); + OPT_ASSERT(0 != attrsList); + OPT_ASSERT(attrsCount == size); + for (unsigned int index=0; indexname != NULL; attrsCount++, ra++) {} + OPT_ASSERT(attrsCount == size); + free(attrsList); + for (unsigned int index=0; indexname != NULL; attrsCount++, ra++) {} - assert(attrsCount == size); - free(attrsList); - for (unsigned int index=0; index