This repository has been archived by the owner on Aug 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update carthage dependency, update test cases
- Loading branch information
1 parent
213c86e
commit 2613921
Showing
6 changed files
with
81 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
github "rs/SDWebImage" "5.x" | ||
github "rs/SDWebImage" >= 5.0 | ||
github "Flipboard/FLAnimatedImage" >= 1.0.11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
github "Flipboard/FLAnimatedImage" "1.0.14" | ||
github "rs/SDWebImage" "2bb336bc12a5690dd11988c0bc8bef2c7318508d" | ||
github "rs/SDWebImage" "5.0.0-beta3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* This file is part of the SDWebImage package. | ||
* (c) Olivier Poitrey <[email protected]> | ||
* (c) Matt Galloway | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
#import "SDTestCase.h" | ||
|
||
@interface SDFLAnimatedImageTests : SDTestCase | ||
|
||
@end | ||
|
||
@implementation SDFLAnimatedImageTests | ||
|
||
- (void)testSDFLAnimatedImageInitWithCoder { | ||
SDFLAnimatedImage *image1 = [SDFLAnimatedImage imageWithContentsOfFile:[self testGIFPath]]; | ||
expect(image1).notTo.beNil(); | ||
NSData *encodedData = [NSKeyedArchiver archivedDataWithRootObject:image1]; | ||
expect(encodedData).notTo.beNil(); | ||
SDFLAnimatedImage *image2 = [NSKeyedUnarchiver unarchiveObjectWithData:encodedData]; | ||
expect(image2).notTo.beNil(); | ||
|
||
// Check each property | ||
expect(image1.scale).equal(image2.scale); | ||
expect(image1.size).equal(image2.size); | ||
expect(image1.animatedImageData).equal(image2.animatedImageData); | ||
expect(image1.animatedImageLoopCount).equal(image2.animatedImageLoopCount); | ||
expect(image1.animatedImageFrameCount).equal(image2.animatedImageFrameCount); | ||
} | ||
|
||
// Since `SDFLAnimatedImage` confroms to `SDAnimatedImage` protocol, it should be compatible for `SDAnimatedImageView` rendering. Maybe this may be changed in the future but currently add this test as well. | ||
- (void)testSDFLAnimatedImageWorksForSDAnimatedImageView { | ||
SDAnimatedImageView *imageView = [SDAnimatedImageView new]; | ||
SDFLAnimatedImage *image = [SDFLAnimatedImage imageWithData:[self testGIFData]]; | ||
imageView.image = image; | ||
expect(imageView.image).notTo.beNil(); | ||
expect(imageView.currentFrame).notTo.beNil(); // current frame | ||
} | ||
|
||
#pragma mark - Util | ||
|
||
- (NSString *)testGIFPath { | ||
NSBundle *testBundle = [NSBundle bundleForClass:[self class]]; | ||
return [testBundle pathForResource:@"TestImage" ofType:@"gif"]; | ||
} | ||
|
||
- (NSData *)testGIFData { | ||
NSData *testData = [NSData dataWithContentsOfFile:[self testGIFPath]]; | ||
return testData; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters