Skip to content
Browse files

Fix compile warning. Only output failed test info if there were actua…

…l failed tests.
1 parent bdab199 commit fd4af78c3b331e01fce5a46cd66a65f597b855bc @gabriel gabriel committed Jan 30, 2014
Showing with 9 additions and 6 deletions.
  1. +2 −2 Classes-iOS/GHViewTestCase.m
  2. +7 −4 Classes/GHTest/GHTestRunner.m
View
4 Classes-iOS/GHViewTestCase.m
@@ -168,15 +168,15 @@ + (BOOL)compareImage:(UIImage *)image withRenderedImage:(UIImage *)renderedImage
CGImageGetBitsPerComponent(image.CGImage),
bytesPerRow,
CGImageGetColorSpace(image.CGImage),
- kCGImageAlphaPremultipliedLast
+ (CGBitmapInfo)kCGImageAlphaPremultipliedLast
);
CGContextRef renderedImageContext = CGBitmapContextCreate(renderedImagePixels,
CGImageGetWidth(renderedImage.CGImage),
CGImageGetHeight(renderedImage.CGImage),
CGImageGetBitsPerComponent(renderedImage.CGImage),
bytesPerRow,
CGImageGetColorSpace(renderedImage.CGImage),
- kCGImageAlphaPremultipliedLast
+ (CGBitmapInfo)kCGImageAlphaPremultipliedLast
);
if (!imageContext || !renderedImageContext) {
GHUDebug(@"Unable to create image contexts for image comparison");
View
11 Classes/GHTest/GHTestRunner.m
@@ -263,11 +263,14 @@ - (void)_notifyFinished {
if ([test_ isKindOfClass:[GHTestGroup class]]) {
GHTestGroup *testGroup = (GHTestGroup *)test_;
- [self log:@"\nFailed tests:\n"];
- for(id<GHTest> test in [testGroup failedTests]) {
- [self log:[NSString stringWithFormat:@"\t%@\n", [test identifier]]];
+ NSArray *failedTests = [testGroup failedTests];
+ if ([failedTests count] > 0) {
+ [self log:@"\nFailed tests:\n"];
+ for(id<GHTest> test in failedTests) {
+ [self log:[NSString stringWithFormat:@"\t%@\n", [test identifier]]];
+ }
+ [self log:@"\n"];
}
- [self log:@"\n"];
}
if ([test_ isKindOfClass:[GHTestSuite class]]) {

0 comments on commit fd4af78

Please sign in to comment.
Something went wrong with that request. Please try again.