I have written some Objective-C test cases. A typical looks the following:
- (void) test_size_Equals_Excpectation_After_initWithSize
{
int size = 10;
Buffer* buff = [[Buffer alloc] initWithSize:size];
GHAssertEquals([buff size], size, nil);
}
Buffer alloc returns buffer with reference count 1, I didn't care to call autorelease on buffer, so it is leaked after the funciton exits. Is this acceptable in testing scenarios?