Skip to content

Commit

Permalink
Fix the test case compile issue on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
dreampiggy committed Feb 1, 2020
1 parent 3363162 commit f56c39a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Tests/WebImageTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f56c39a

Please sign in to comment.