Skip to content
This repository has been archived by the owner on Jun 5, 2018. It is now read-only.

Commit

Permalink
Fixing analyze warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel committed Sep 27, 2012
1 parent 8642ca7 commit c954c9c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Classes/GHTest/GHTestGroup.m
Expand Up @@ -56,15 +56,15 @@ - (id)initWithName:(NSString *)name delegate:(id<GHTestDelegate>)delegate {
}

- (id)initWithTestCase:(id)testCase delegate:(id<GHTestDelegate>)delegate {
if ([self initWithName:NSStringFromClass([testCase class]) delegate:delegate]) {
if ((self = [self initWithName:NSStringFromClass([testCase class]) delegate:delegate])) {
testCase_ = testCase;
[self _addTestsFromTestCase:testCase];
}
return self;
}

- (id)initWithTestCase:(id)testCase selector:(SEL)selector delegate:(id<GHTestDelegate>)delegate {
if ([self initWithName:NSStringFromClass([testCase class]) delegate:delegate]) {
if ((self = [self initWithName:NSStringFromClass([testCase class]) delegate:delegate])) {
testCase_ = testCase;
[self addTest:[GHTest testWithTarget:testCase selector:selector]];
}
Expand Down
6 changes: 5 additions & 1 deletion Classes/GHViewTestCase.m
Expand Up @@ -136,7 +136,9 @@ + (BOOL)compareImage:(UIImage *)image withRenderedImage:(UIImage *)renderedImage
GHPixel *renderedImagePixels = (GHPixel *) calloc(1, image.size.width * image.size.height * sizeof(GHPixel));

if (!imagePixels || !renderedImagePixels) {
GHUDebug(@"Unable to create pixel array for image comparieson.");
GHUDebug(@"Unable to create pixel array for image comparison.");
if (imagePixels) free(imagePixels);
if (renderedImagePixels) free(renderedImagePixels);
return NO;
}
CGContextRef imageContext = CGBitmapContextCreate((void *)imagePixels,
Expand All @@ -159,6 +161,8 @@ + (BOOL)compareImage:(UIImage *)image withRenderedImage:(UIImage *)renderedImage
GHUDebug(@"Unable to create image contexts for image comparison");
CGContextRelease(imageContext);
CGContextRelease(renderedImageContext);
free(imagePixels);
free(renderedImagePixels);
return NO;
}
// Draw the image in the bitmap
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion XcodeConfig/Shared.xcconfig
@@ -1,4 +1,4 @@
GHUNIT_VERSION = 0.5.4
GHUNIT_VERSION = 0.5.5

GHUNIT_GENERAL_OTHER_CFLAGS = -Wdiv-by-zero -Wbad-function-cast -Wnested-externs -Wold-style-definition

Expand Down

0 comments on commit c954c9c

Please sign in to comment.