Skip to content

Commit

Permalink
Merge pull request nytimes#172 from NYTimes/cdz/failing-scalingimagev…
Browse files Browse the repository at this point in the history
…iew-test

Remove `ANIMATED_GIF_SUPPORT` preprocessor conditionals from unit tests
  • Loading branch information
Twigz committed Mar 11, 2016
2 parents 069096e + bdd7510 commit fe58069
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions NYTPhotoViewerTests/NYTScalingImageViewTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
@import XCTest;

#import <NYTPhotoViewer/NYTScalingImageView.h>

#ifdef ANIMATED_GIF_SUPPORT
#import <FLAnimatedImage/FLAnimatedImage.h>
#endif

@interface NYTScalingImageViewTests : XCTestCase

Expand Down Expand Up @@ -70,11 +67,7 @@ - (void)testImageInitializationSetsImage {
- (void)testDataInitializationSetsImage {
NYTScalingImageView *scalingImageView = [[NYTScalingImageView alloc] initWithImageData:self.imageData frame:CGRectZero];

#ifdef ANIMATED_GIF_SUPPORT
XCTAssertEqual(self.imageData, scalingImageView.imageView.animatedImage.data);
#else
XCTAssertNotNil(scalingImageView.imageView.image);
#endif
XCTAssertEqual(self.imageData, ((FLAnimatedImageView *)scalingImageView.imageView).animatedImage.data);
}

- (void)testUpdateImageUpdatesImage {
Expand All @@ -90,21 +83,14 @@ - (void)testUpdateImageDataUpdatesImage {

NYTScalingImageView *scalingImageView = [[NYTScalingImageView alloc] initWithImageData:self.imageData frame:CGRectZero];
[scalingImageView updateImageData:image2];

#ifdef ANIMATED_GIF_SUPPORT
XCTAssertEqual(image2, scalingImageView.imageView.animatedImage.data);
#else
XCTAssertNotNil(scalingImageView.imageView.image);
#endif

XCTAssertEqual(image2, ((FLAnimatedImageView *)scalingImageView.imageView).animatedImage.data);
}

- (void)testImageViewIsOfCorrectKindAfterInitialization {
NYTScalingImageView *scalingImageViewer = [[NYTScalingImageView alloc] initWithImageData:self.imageData frame:CGRectZero];
#ifdef ANIMATED_GIF_SUPPORT

XCTAssertTrue([scalingImageViewer.imageView isKindOfClass:FLAnimatedImageView.class]);
#else
XCTAssertTrue([scalingImageViewer.imageView isKindOfClass:UIImageView.class]);
#endif
}

@end

0 comments on commit fe58069

Please sign in to comment.