diff --git a/Tests/Tests/SDImageCoderTests.m b/Tests/Tests/SDImageCoderTests.m index c5a5cc5e..cf749b3a 100644 --- a/Tests/Tests/SDImageCoderTests.m +++ b/Tests/Tests/SDImageCoderTests.m @@ -9,8 +9,12 @@ #import "SDTestCase.h" #import "UIColor+SDHexString.h" +#if !SD_VISION #if __has_include() #import +#else +@import SDWebImageWebPCoder; +#endif #endif @interface SDWebImageDecoderTests : SDTestCase diff --git a/Tests/Tests/SDTestCase.m b/Tests/Tests/SDTestCase.m index 64ebd2fb..06a085ec 100644 --- a/Tests/Tests/SDTestCase.m +++ b/Tests/Tests/SDTestCase.m @@ -39,7 +39,9 @@ NSString *const kTestAPNGPURL = @"https://upload.wikimedia.org/wikipedia/commons CGRect screenFrame = mainScreen.bounds; #endif _window = [[UIWindow alloc] initWithFrame:screenFrame]; -#else +#endif // UIKit +#if SD_MAC + UIScreen *mainScreen = [UIScreen mainScreen]; _window = [[NSWindow alloc] initWithContentRect:mainScreen.frame styleMask:0 backing:NSBackingStoreBuffered defer:NO screen:mainScreen]; #endif } diff --git a/Tests/Tests/SDWebImageManagerTests.m b/Tests/Tests/SDWebImageManagerTests.m index 205a4167..5dd48a2a 100644 --- a/Tests/Tests/SDWebImageManagerTests.m +++ b/Tests/Tests/SDWebImageManagerTests.m @@ -10,8 +10,12 @@ #import "SDWebImageTestTransformer.h" #import "SDWebImageTestCache.h" #import "SDWebImageTestLoader.h" +#if !SD_VISION #if __has_include() #import +#else +@import SDWebImageWebPCoder; +#endif #endif // Keep strong references for object @@ -646,7 +650,7 @@ [self waitForExpectationsWithCommonTimeout]; } -#if __has_include() +#if !SD_VISION - (void)test22ThatForceDecodePolicyAlways { XCTestExpectation *expectation = [self expectationWithDescription:@"Always policy with WebP image (libwebp) should force-decode"]; NSURL *url = [NSURL URLWithString:@"https://www.gstatic.com/webp/gallery/4.webp"];