From d32d7ef0818bd425aa1b0b33e407472d7cb53106 Mon Sep 17 00:00:00 2001 From: Andrew Kitchen and Dmitriy Kalinin Date: Thu, 4 Apr 2013 13:44:34 -0700 Subject: [PATCH 1/2] OCUnitAppDelegate window gets a rootViewController --- OCUnitApp/OCUnitAppAppDelegate.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OCUnitApp/OCUnitAppAppDelegate.m b/OCUnitApp/OCUnitAppAppDelegate.m index e0182fc5..2726479b 100644 --- a/OCUnitApp/OCUnitAppAppDelegate.m +++ b/OCUnitApp/OCUnitAppAppDelegate.m @@ -15,8 +15,9 @@ @implementation OCUnitAppAppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Override point for customization after application launch. + self.window.rootViewController = [[[UIViewController alloc] init] autorelease]; [self.window makeKeyAndVisible]; + return YES; } From a31053e768d4cc262be4b87dcc79503e9d1efc30 Mon Sep 17 00:00:00 2001 From: Andrew Kitchen and Dmitriy Kalinin Date: Thu, 4 Apr 2013 13:45:17 -0700 Subject: [PATCH 2/2] Print output to stderr for OCUnit --- Source/CDROTestReporter.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/CDROTestReporter.m b/Source/CDROTestReporter.m index 0fcb7b44..837af660 100644 --- a/Source/CDROTestReporter.m +++ b/Source/CDROTestReporter.m @@ -28,25 +28,25 @@ - (void)reportOnExample:(CDRExample *)example { - (void)printStats { const char *startTimeString = [[startTime_ description] cStringUsingEncoding:NSUTF8StringEncoding]; - printf("Test Suite 'CDROTestReporter' started at %s\n", startTimeString); + fprintf(stderr, "Test Suite 'CDROTestReporter' started at %s\n", startTimeString); for (CDRExample *example in failedExamples_) { - printf("Test Case '-[Spec example]' started.\n"); + fprintf(stderr, "Test Case '-[Spec example]' started.\n"); NSString *testResult = [NSString stringWithFormat:@"%@:%d: error: -[Spec example] : %@ # %@", example.failure.fileName, example.failure.lineNumber, example.fullText, example.failure.reason]; - printf("%s\n", [testResult cStringUsingEncoding:NSUTF8StringEncoding]); - printf("Test Case '-[Spec example]' failed (0.001 seconds).\n"); + fprintf(stderr, "%s\n", [testResult cStringUsingEncoding:NSUTF8StringEncoding]); + fprintf(stderr, "Test Case '-[Spec example]' failed (0.001 seconds).\n"); } const char *endTimeString = [[endTime_ description] cStringUsingEncoding:NSUTF8StringEncoding]; - printf("Test Suite 'CDROTestReporter' finished at %s.\n", endTimeString); + fprintf(stderr, "Test Suite 'CDROTestReporter' finished at %s.\n", endTimeString); const char *testsString = exampleCount_ == 1 ? "test" : "tests"; const char *failuresString = exampleCount_ == 1 ? "failure" : "failures"; float totalTimeElapsed = [endTime_ timeIntervalSinceDate:startTime_]; - printf("Executed %u %s, with %u %s (0 unexpected) in %.4f (%.4f) seconds\n", + fprintf(stderr, "Executed %u %s, with %u %s (0 unexpected) in %.4f (%.4f) seconds\n", exampleCount_, testsString, (unsigned int)failedExamples_.count, failuresString, totalTimeElapsed, totalTimeElapsed); }