associationForbidden3.m 464 B

123456789101112131415161718192021
  1. // TEST_CRASHES
  2. /*
  3. TEST_RUN_OUTPUT
  4. Associated object is 0x[0-9a-fA-F]+
  5. objc\[\d+\]: objc_setAssociatedObject called on instance \(0x[0-9a-fA-F]+\) of class ForbiddenSubclass which does not allow associated objects
  6. objc\[\d+\]: HALTED
  7. END
  8. */
  9. #include "associationForbidden.h"
  10. @interface ForbiddenSubclass : Forbidden
  11. @end
  12. @implementation ForbiddenSubclass
  13. @end
  14. void test(void)
  15. {
  16. ShouldSucceed([Normal alloc]);
  17. ShouldSucceed([ForbiddenSubclass alloc]);
  18. }