diff --git a/Test/PropertyIntrospectionTest2.m b/Test/PropertyIntrospectionTest2.m index 9e07589..b77721d 100644 --- a/Test/PropertyIntrospectionTest2.m +++ b/Test/PropertyIntrospectionTest2.m @@ -244,44 +244,60 @@ __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 void testPropertyForProperty(objc_property_t p, +static BOOL testPropertyForProperty_alt(objc_property_t p, const char *name, const char *types, objc_property_attribute_t* list, - unsigned int size) + unsigned int size, BOOL abort) { - assert(0 != p); - assert(strcmp(name, property_getName(p)) == 0); + OPT_ASSERT(0 != p); + OPT_ASSERT(strcmp(name, property_getName(p)) == 0); const char *attrs = property_getAttributes(p); - assert(0 != attrs); - assert(strcmp(types, attrs) == 0); + OPT_ASSERT(0 != attrs); + OPT_ASSERT(strcmp(types, attrs) == 0); unsigned int attrsCount = 0; objc_property_attribute_t *attrsList = property_copyAttributeList(p, &attrsCount); - assert(0 != attrsList); - assert(attrsCount == size); + OPT_ASSERT(0 != attrsList); + OPT_ASSERT(attrsCount == size); for (unsigned int index=0; indexname != NULL; attrsCount++, ra++) {} - assert(attrsCount == size); + OPT_ASSERT(attrsCount == size); free(attrsList); for (unsigned int index=0; index