diff options
Diffstat (limited to 'objective-c/test/ios/controller/Classes/ViewController.m')
-rw-r--r-- | objective-c/test/ios/controller/Classes/ViewController.m | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/objective-c/test/ios/controller/Classes/ViewController.m b/objective-c/test/ios/controller/Classes/ViewController.m index 803d411011d..da565850060 100644 --- a/objective-c/test/ios/controller/Classes/ViewController.m +++ b/objective-c/test/ios/controller/Classes/ViewController.m @@ -17,6 +17,7 @@ { id<ViewController> _controller; void* _func; + NSString* _exe; NSArray* _args; BOOL _ready; BOOL _completed; @@ -55,7 +56,7 @@ @end @implementation MainHelper --(id) init:(id<ViewController>)controller func:(void*)func args:(NSArray*)args +-(id) init:(id<ViewController>)controller func:(void*)func exe:(NSString*)exe args:(NSArray*)args { self = [super init]; if(self == nil) @@ -64,6 +65,7 @@ } _controller = ICE_RETAIN(controller); _func = func; + _exe = ICE_RETAIN(exe); _args = ICE_RETAIN(args); _ready = FALSE; _completed = FALSE; @@ -76,6 +78,7 @@ -(void) dealloc { [_controller release]; + [_exe release]; [_args release]; [_cond release]; [_out release]; @@ -125,6 +128,14 @@ argv[i++] = (char*)[arg UTF8String]; } argv[_args.count] = 0; + if([_exe isEqualToString:@"client"] || [_exe isEqualToString:@"collocated"]) + { + TestCommonSetOutput(self, @selector(print:)); + } + else + { + TestCommonTestInit(self, @selector(serverReady), @"", NO, NO); + } @try { [self completed:mainEntryPoint((int)_args.count, argv)]; @@ -134,6 +145,10 @@ [self print:[NSString stringWithFormat:@"unexpected exception while running `%s':%@\n", argv[0], ex]]; [self completed:EXIT_FAILURE]; } + if([_exe isEqualToString:@"client"] || [_exe isEqualToString:@"collocated"]) + { + TestCommonSetOutput(nil, nil); + } free(argv); } -(void) completed:(int)status @@ -287,16 +302,7 @@ [NSString stringWithFormat:@"couldn't find %@", func]]; } args = [@[[NSString stringWithFormat:@"%@ %@", testSuite, exe]] arrayByAddingObjectsFromArray:args]; - MainHelper* helper = ICE_AUTORELEASE([[MainHelper alloc] init:_controller func:sym args:args]); - if([exe isEqualToString:@"client"] || [exe isEqualToString:@"collocated"]) - { - TestCommonInit(helper, @selector(print:)); - } - else - { - TestCommonInit(helper, @selector(print:)); - TestCommonTestInit(helper, @selector(serverReady), @"", NO, NO); - } + MainHelper* helper = ICE_AUTORELEASE([[MainHelper alloc] init:_controller func:sym exe:exe args:args]); // // Use a 768KB thread stack size for the objects test. This is necessary when running the |