소스 검색

Add tests for image cache

onevcat 11 년 전
부모
커밋
70ba15735e
3개의 변경된 파일27개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      Kingfisher-Demo.xcodeproj/project.pbxproj
  2. 4 0
      Kingfisher/KingfisherManager.swift
  3. 19 0
      KingfisherTests/ImageCacheTests.swift

+ 4 - 0
Kingfisher-Demo.xcodeproj/project.pbxproj

@@ -7,6 +7,7 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
+		4B82DDFC1AD7701900074995 /* ImageCacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B82DDFB1AD7701900074995 /* ImageCacheTests.swift */; };
 		4BAFBA3D1AD671E400FB0300 /* CollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BAFBA3C1AD671E400FB0300 /* CollectionViewCell.swift */; };
 		D151E72B1AD3C48D004FD4AE /* UIImage+Decode.swift in Sources */ = {isa = PBXBuildFile; fileRef = D151E72A1AD3C48D004FD4AE /* UIImage+Decode.swift */; };
 		D1ED2D111AD2CFA600CFC3EB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1ED2D101AD2CFA600CFC3EB /* AppDelegate.swift */; };
@@ -66,6 +67,7 @@
 /* End PBXCopyFilesBuildPhase section */
 
 /* Begin PBXFileReference section */
+		4B82DDFB1AD7701900074995 /* ImageCacheTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageCacheTests.swift; sourceTree = "<group>"; };
 		4BAFBA3C1AD671E400FB0300 /* CollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionViewCell.swift; sourceTree = "<group>"; };
 		D151E72A1AD3C48D004FD4AE /* UIImage+Decode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+Decode.swift"; sourceTree = "<group>"; };
 		D1ED2D0B1AD2CFA600CFC3EB /* Kingfisher-Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Kingfisher-Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -186,6 +188,7 @@
 			isa = PBXGroup;
 			children = (
 				D1ED2D481AD2D09F00CFC3EB /* KingfisherTests.swift */,
+				4B82DDFB1AD7701900074995 /* ImageCacheTests.swift */,
 				D1ED2D461AD2D09F00CFC3EB /* Supporting Files */,
 			);
 			path = KingfisherTests;
@@ -366,6 +369,7 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				4B82DDFC1AD7701900074995 /* ImageCacheTests.swift in Sources */,
 				D1ED2D491AD2D09F00CFC3EB /* KingfisherTests.swift in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;

+ 4 - 0
Kingfisher/KingfisherManager.swift

@@ -36,6 +36,10 @@ public class KingfisherManager {
     
     public typealias Options = (forceRefresh: Bool, lowPriority: Bool, cacheMemoryOnly: Bool, shouldDecode: Bool)
     
+    public static var OptionsNone: Options = {
+        return (forceRefresh: false, lowPriority: false, cacheMemoryOnly: false, shouldDecode: false)
+    }()
+    
     public class var sharedManager: KingfisherManager {
         return instance
     }

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 19 - 0
KingfisherTests/ImageCacheTests.swift


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.