mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
iOSTest works with ARC
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
|
||||
[window addSubview:view];
|
||||
[window makeKeyAndVisible];
|
||||
[view release];
|
||||
arcSafeRelease( view );
|
||||
|
||||
return YES;
|
||||
}
|
||||
@@ -42,8 +42,10 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
- (void)dealloc
|
||||
{
|
||||
#if !CATCH_ARC_ENABLED
|
||||
[window release];
|
||||
[super dealloc];
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@@ -38,9 +38,9 @@
|
||||
|
||||
appName = [[UITextField alloc] initWithFrame: CGRectMake( 0, 50, 320, 50 )];
|
||||
[self addSubview: appName];
|
||||
[appName release];
|
||||
arcSafeRelease( appName );
|
||||
appName.textColor = [[UIColor alloc] initWithRed:0.35 green:0.35 blue:1 alpha:1];
|
||||
[appName.textColor release];
|
||||
arcSafeRelease( appName.textColor );
|
||||
appName.textAlignment = UITextAlignmentCenter;
|
||||
|
||||
appName.text = [NSString stringWithFormat:@"CATCH tests"];
|
||||
@@ -55,7 +55,9 @@
|
||||
-(void) dealloc
|
||||
{
|
||||
[appName removeFromSuperview];
|
||||
#if !CATCH_ARC_ENABLED
|
||||
[super dealloc];
|
||||
#endif
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -67,7 +69,7 @@
|
||||
destructiveButtonTitle:nil
|
||||
otherButtonTitles:@"Run all tests", nil];
|
||||
[menu showInView: self];
|
||||
[menu release];
|
||||
arcSafeRelease( menu );
|
||||
|
||||
}
|
||||
|
||||
|
@@ -11,10 +11,16 @@
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#if !CATCH_ARC_ENABLED
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
#endif
|
||||
|
||||
Catch::registerTestMethods();
|
||||
int retVal = UIApplicationMain(argc, argv, nil, @"iTchRunnerAppDelegate");
|
||||
|
||||
#if !CATCH_ARC_ENABLED
|
||||
[pool release];
|
||||
#endif
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
Reference in New Issue
Block a user