Remove unit test made redundant by garbage collection
authorWincent Colaiuta <win@wincent.com>
Wed, 25 Jul 2007 07:26:01 +0000 (09:26 +0200)
committerWincent Colaiuta <win@wincent.com>
Wed, 25 Jul 2007 07:26:01 +0000 (09:26 +0200)
One of the unit tests expected an exception to be raised when working with
objects that don't respond to the retain and release methods, but in a garbage
collected world these messages become no-ops (and in fact I believe that the
compiler literally optimizes them away to nothing).

As such, no exception was being raised and there is no way to "fix" either the
test or the tested implementation: it's simply that the test no longer makes
sense in the context of garbage collection. This commit removes the
now-redundant test.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Tests/WOObjectStubTests.m

index 84b7311523c3c8fc6072387d76f78162cf5f8776..89fa2f8ca14ee6bdb86197490d607b39b7acffe8 100644 (file)
     WO_TEST_DOES_NOT_THROW([stub raising:@"foo"]);
     WO_TEST_THROWS([stub raising:@"bar"]);
 
-    // should raise if raising: passed an object that does not respond to
-    // retain, release or autorelease
-    WOLightweightRoot *root = [WOLightweightRoot newLightweightRoot];
-    stub = [WOObjectStub stubForClass:[NSString class] withDelegate:nil];
-    WO_TEST_THROWS([stub raising:root]);
-    [root dealloc];
-
     // should raise expected exception
     mock = [WOObjectMock mockForClass:[NSString class]];
     [[[mock accept] raising:exception] lowercaseString];