Index: src/OFExceptions.m ================================================================== --- src/OFExceptions.m +++ src/OFExceptions.m @@ -33,11 +33,11 @@ } - init: (id)obj withSize: (size_t)size { - fprintf(stderr, "ERROR: Could not allocate %zu byte for object %s!\n", + fprintf(stderr, "ERROR: Could not allocate %zu bytes for object %s!\n", size, [obj name]); return [super init]; } @end Index: tests/OFObject/OFObject.m ================================================================== --- tests/OFObject/OFObject.m +++ tests/OFObject/OFObject.m @@ -76,10 +76,17 @@ CATCH_EXCEPTION([obj freeMem: r], OFMemNotPartOfObjException) puts("Got all 3!"); puts("Trying to allocate more memory than possible..."); CATCH_EXCEPTION(p = [obj getMem: 4294967295U], OFNoMemException) + + puts("Allocating 1 byte..."); + p = [obj getMem: 1]; + + puts("Trying to resize that 1 byte to more than possible..."); + CATCH_EXCEPTION(p = [obj resizeMem: p toSize: 4294967295U], + OFNoMemException) /* TODO: Test if freeing object frees all memory */ return 0; }