From f56c39aab2085c296e58abf89e9214ba789fffe9 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Sat, 1 Feb 2020 18:18:52 +0800 Subject: [PATCH] Fix the test case compile issue on macOS --- Tests/WebImageTests.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tests/WebImageTests.swift b/Tests/WebImageTests.swift index 4eef0ed..91a2e41 100644 --- a/Tests/WebImageTests.swift +++ b/Tests/WebImageTests.swift @@ -110,7 +110,11 @@ class WebImageTests: XCTestCase { let expectation = self.expectation(description: "WebImage onSuccess when memory hit") let imageUrl = URL(string: "https://foo.bar/buzz.png") let cacheKey = SDWebImageManager.shared.cacheKey(for: imageUrl) + #if os(macOS) + let testImage = TestUtils.testImageBundle().image(forResource: "TestImage") + #else let testImage = UIImage(named: "TestImage", in: TestUtils.testImageBundle(), compatibleWith: nil) + #endif SDImageCache.shared.storeImage(toMemory: testImage, forKey: cacheKey) let imageView = WebImage(url: imageUrl) let introspectView = imageView.onSuccess { image, cacheType in