Skip to content

Commit 78a2769

Browse files
committed
Fix the test case testWebImageEXIFImage
1 parent 09c5524 commit 78a2769

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Tests/WebImageTests.swift

+9-4
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,15 @@ class WebImageTests: XCTestCase {
162162
let displayImage = try? imageView.inspect().group().image(0).nsImage()
163163
XCTAssertNotNil(displayImage)
164164
#else
165-
let displayImage = try? imageView.inspect().group().image(0).cgImage()
166-
let orientation = try! imageView.inspect().group().image(0).orientation()
167-
XCTAssertNotNil(displayImage)
168-
XCTAssertEqual(orientation, .leftMirrored)
165+
if #available(iOS 14.0, watchOS 7.0, tvOS 14.0, *) {
166+
let displayImage = try? imageView.inspect().group().image(0).uiImage()
167+
XCTAssertEqual(displayImage, image)
168+
} else {
169+
let displayImage = try? imageView.inspect().group().image(0).cgImage()
170+
let orientation = try? imageView.inspect().group().image(0).orientation()
171+
XCTAssertNotNil(displayImage)
172+
XCTAssertEqual(orientation, .leftMirrored)
173+
}
169174
#endif
170175
expectation.fulfill()
171176
}.onFailure { error in

0 commit comments

Comments
 (0)