Skip to content

Commit f56c39a

Browse files
committed
Fix the test case compile issue on macOS
1 parent 3363162 commit f56c39a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Tests/WebImageTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ class WebImageTests: XCTestCase {
110110
let expectation = self.expectation(description: "WebImage onSuccess when memory hit")
111111
let imageUrl = URL(string: "https://foo.bar/buzz.png")
112112
let cacheKey = SDWebImageManager.shared.cacheKey(for: imageUrl)
113+
#if os(macOS)
114+
let testImage = TestUtils.testImageBundle().image(forResource: "TestImage")
115+
#else
113116
let testImage = UIImage(named: "TestImage", in: TestUtils.testImageBundle(), compatibleWith: nil)
117+
#endif
114118
SDImageCache.shared.storeImage(toMemory: testImage, forKey: cacheKey)
115119
let imageView = WebImage(url: imageUrl)
116120
let introspectView = imageView.onSuccess { image, cacheType in

0 commit comments

Comments
 (0)