Browse Source

Fix the compile issue for test cases on macOS

DreamPiggy 6 years ago
parent
commit
70b8fec54a
1 changed files with 8 additions and 0 deletions
  1. 8 0
      Tests/Tests/SDAnimatedImageTest.m

+ 8 - 0
Tests/Tests/SDAnimatedImageTest.m

@@ -321,7 +321,11 @@ static const NSUInteger kTestGIFFrameCount = 5; // local TestImage.gif loop coun
     });
     
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+#if SD_UIKIT
         [imageView stopAnimating];
+#else
+        imageView.animates = NO;
+#endif
         expect(imageView.frameBuffer.count).beGreaterThan(0);
         expect(imageView.currentFrameIndex).beGreaterThan(0);
         
@@ -355,7 +359,11 @@ static const NSUInteger kTestGIFFrameCount = 5; // local TestImage.gif loop coun
     });
     
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+#if SD_UIKIT
         [imageView stopAnimating];
+#else
+        imageView.animates = NO;
+#endif
         expect(imageView.frameBuffer.count).equal(0);
         expect(imageView.currentFrameIndex).equal(0);