Revert "Fix the test case by using the same lock in SDAnimatedImageView to avoid thread-safe issue"
This reverts commit 031f21a18d
.
This commit is contained in:
parent
0de548f103
commit
eb05b9f4fc
|
@ -8,7 +8,6 @@
|
|||
*/
|
||||
|
||||
#import "SDTestCase.h"
|
||||
#import "SDInternalMacros.h"
|
||||
#import <KVOController/KVOController.h>
|
||||
|
||||
static const NSUInteger kTestGIFFrameCount = 5; // local TestImage.gif loop count
|
||||
|
@ -18,8 +17,6 @@ static const NSUInteger kTestGIFFrameCount = 5; // local TestImage.gif loop coun
|
|||
|
||||
@property (nonatomic, assign) BOOL isProgressive;
|
||||
@property (nonatomic, strong) NSMutableDictionary<NSNumber *, UIImage *> *frameBuffer;
|
||||
@property (nonatomic, strong) dispatch_semaphore_t lock;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
@ -319,10 +316,8 @@ static const NSUInteger kTestGIFFrameCount = 5; // local TestImage.gif loop coun
|
|||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
// 0.5s is not finished, frame index should not be 0
|
||||
SD_LOCK(imageView.lock);
|
||||
expect(imageView.frameBuffer.count).beGreaterThan(0);
|
||||
expect(imageView.currentFrameIndex).beGreaterThan(0);
|
||||
SD_UNLOCK(imageView.lock);
|
||||
});
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
|
@ -331,10 +326,8 @@ static const NSUInteger kTestGIFFrameCount = 5; // local TestImage.gif loop coun
|
|||
#else
|
||||
imageView.animates = NO;
|
||||
#endif
|
||||
SD_LOCK(imageView.lock);
|
||||
expect(imageView.frameBuffer.count).beGreaterThan(0);
|
||||
expect(imageView.currentFrameIndex).beGreaterThan(0);
|
||||
SD_UNLOCK(imageView.lock);
|
||||
|
||||
[imageView removeFromSuperview];
|
||||
[expectation fulfill];
|
||||
|
@ -361,10 +354,8 @@ static const NSUInteger kTestGIFFrameCount = 5; // local TestImage.gif loop coun
|
|||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
// 0.5s is not finished, frame index should not be 0
|
||||
SD_LOCK(imageView.lock);
|
||||
expect(imageView.frameBuffer.count).beGreaterThan(0);
|
||||
expect(imageView.currentFrameIndex).beGreaterThan(0);
|
||||
SD_UNLOCK(imageView.lock);
|
||||
});
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
|
@ -373,10 +364,8 @@ static const NSUInteger kTestGIFFrameCount = 5; // local TestImage.gif loop coun
|
|||
#else
|
||||
imageView.animates = NO;
|
||||
#endif
|
||||
SD_LOCK(imageView.lock);
|
||||
expect(imageView.frameBuffer.count).equal(0);
|
||||
expect(imageView.currentFrameIndex).equal(0);
|
||||
SD_UNLOCK(imageView.lock);
|
||||
|
||||
[imageView removeFromSuperview];
|
||||
[expectation fulfill];
|
||||
|
|
Loading…
Reference in New Issue