Browse Source

Fixes tests warnings

onevcat 1 năm trước cách đây
mục cha
commit
94247033e1

+ 2 - 0
Kingfisher.xcodeproj/project.pbxproj

@@ -1222,6 +1222,7 @@
 				SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
 				SWIFT_OBJC_BRIDGING_HEADER = "Tests/KingfisherTests/KingfisherTests-Bridging-Header.h";
 				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+				SWIFT_VERSION = 5.0;
 				TARGETED_DEVICE_FAMILY = "1,2,3,4,7";
 			};
 			name = Debug;
@@ -1249,6 +1250,7 @@
 				SWIFT_COMPILATION_MODE = wholemodule;
 				SWIFT_OBJC_BRIDGING_HEADER = "Tests/KingfisherTests/KingfisherTests-Bridging-Header.h";
 				SWIFT_OPTIMIZATION_LEVEL = "-O";
+				SWIFT_VERSION = 5.0;
 				TARGETED_DEVICE_FAMILY = "1,2,3,4,7";
 			};
 			name = Release;

+ 1 - 1
Tests/KingfisherTests/DiskStorageTests.swift

@@ -27,7 +27,7 @@
 import XCTest
 @testable import Kingfisher
 
-extension String: DataTransformable {
+extension String: @retroactive DataTransformable {
     public func toData() throws -> Data {
         return data(using: .utf8)!
     }

+ 1 - 1
Tests/KingfisherTests/ImageDownloaderTests.swift

@@ -586,7 +586,7 @@ class ImageDownloaderTests: XCTestCase {
     
     
     func testSessionDelegate() {
-        class ExtensionDelegate: SessionDelegate {
+        class ExtensionDelegate: SessionDelegate, @unchecked Sendable {
             //'exp' only for test
             public let exp: XCTestExpectation
             init(_ expectation:XCTestExpectation) {

+ 1 - 1
Tests/KingfisherTests/ImageViewExtensionTests.swift

@@ -922,4 +922,4 @@ class ImageViewExtensionTests: XCTestCase {
 
 }
 
-extension KFCrossPlatformView: Placeholder {}
+extension KFCrossPlatformView: @retroactive Placeholder {}

+ 1 - 1
Tests/KingfisherTests/MemoryStorageTests.swift

@@ -27,7 +27,7 @@
 import XCTest
 @testable import Kingfisher
 
-extension Int: CacheCostCalculable {
+extension Int: @retroactive CacheCostCalculable {
     public var cacheCost: Int {
         return 1
     }