UnitTest: object Should be Dealllocated
UnitTest: object Should be Dealllocated
- Subject: UnitTest: object Should be Dealllocated
- From: Andreas Grosam <email@hidden>
- Date: Wed, 26 Jun 2013 15:15:55 +0200
There is a class whose implementation may be prone to accidentally have a _strong_ reference elsewhere (namely within a block), which effectively prevents the object to be deallocated in certain scenarios when it should.
When carefully implemented that doesn't happen, though.
How can I create a Unit Test which tests such cases, e.g.:
Foo* foo;
@autoreleaspool {
foo = [Foo new];
[foo doSomething];
foo = nil; // should deallocate foo
}
ASSERT_DEALLOCATED_TRUE(foo);
Of course, the "doSomething" is more complicated involving possibly suspended dispatch queues and blocks, etc.
Thanks for tips!
Andreas
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden