diff --git a/.gitignore b/.gitignore index 981b41c..2e98e9f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ -.DS_Store - # Xcode -build/* +# +build/ *.pbxuser !default.pbxuser *.mode1v3 @@ -10,8 +9,21 @@ build/* !default.mode2v3 *.perspectivev3 !default.perspectivev3 -*.xcworkspace +project.xcworkspace !default.xcworkspace xcuserdata -profile -*.moved-aside \ No newline at end of file +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control +# +Pods/ +Podfile.lock \ No newline at end of file diff --git a/Examples/SDWebImage Demo.xcodeproj/project.pbxproj b/Examples/SDWebImage Demo.xcodeproj/project.pbxproj index 14f80f9..073051c 100644 --- a/Examples/SDWebImage Demo.xcodeproj/project.pbxproj +++ b/Examples/SDWebImage Demo.xcodeproj/project.pbxproj @@ -9,7 +9,6 @@ /* Begin PBXBuildFile section */ 3E75A9861742DBE700DA412D /* CustomPathImages in Resources */ = {isa = PBXBuildFile; fileRef = 3E75A9851742DBE700DA412D /* CustomPathImages */; }; 531041C1157EAC8F00BBABC3 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 537612E6155ABA44005750A4 /* ImageIO.framework */; }; - 5324F0FB17FF4390008DF7F6 /* libSDWebImage+WebP.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5324F0F817FF436E008DF7F6 /* libSDWebImage+WebP.a */; }; 5376129A155AB74D005750A4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53761299155AB74D005750A4 /* UIKit.framework */; }; 5376129C155AB74D005750A4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5376129B155AB74D005750A4 /* Foundation.framework */; }; 5376129E155AB74D005750A4 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5376129D155AB74D005750A4 /* CoreGraphics.framework */; }; @@ -22,33 +21,28 @@ 53A2B50D155B155A00B12423 /* placeholder.png in Resources */ = {isa = PBXBuildFile; fileRef = 53A2B50B155B155A00B12423 /* placeholder.png */; }; 53A2B50E155B155A00B12423 /* placeholder@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 53A2B50C155B155A00B12423 /* placeholder@2x.png */; }; 53EEC18916484553007601E1 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 53EEC18816484553007601E1 /* Default-568h@2x.png */; }; + DA248D44195470FD00390AB0 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 537612E3155ABA3C005750A4 /* MapKit.framework */; }; + DA248D79195484A500390AB0 /* libSDWebImage+WebP.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA248D761954841D00390AB0 /* libSDWebImage+WebP.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 5324F0F717FF436E008DF7F6 /* PBXContainerItemProxy */ = { + DA248D731954841D00390AB0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 53EEC1A3164845D8007601E1 /* SDWebImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 537D95C117ECC1FE0097C263; - remoteInfo = "SDWebImage+WebP"; - }; - 5324F0F917FF4389008DF7F6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 53EEC1A3164845D8007601E1 /* SDWebImage.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 537D957317ECC1FE0097C263; - remoteInfo = "SDWebImage+WebP"; - }; - 53EEC1AC164845D9007601E1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 53EEC1A3164845D8007601E1 /* SDWebImage.xcodeproj */; + containerPortal = DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = 53761325155AD0D5005750A4; remoteInfo = SDWebImage; }; - 53EEC1AE164845D9007601E1 /* PBXContainerItemProxy */ = { + DA248D751954841D00390AB0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 53EEC1A3164845D8007601E1 /* SDWebImage.xcodeproj */; + containerPortal = DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 537D95C117ECC1FE0097C263; + remoteInfo = "SDWebImage+WebP"; + }; + DA248D771954841D00390AB0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = 531041E0157EAFA400BBABC3; remoteInfo = "SDWebImage+MKAnnotation"; @@ -77,7 +71,7 @@ 53A2B50B155B155A00B12423 /* placeholder.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = placeholder.png; sourceTree = ""; }; 53A2B50C155B155A00B12423 /* placeholder@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "placeholder@2x.png"; sourceTree = ""; }; 53EEC18816484553007601E1 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../Default-568h@2x.png"; sourceTree = ""; }; - 53EEC1A3164845D8007601E1 /* SDWebImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDWebImage.xcodeproj; path = ../SDWebImage.xcodeproj; sourceTree = ""; }; + DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDWebImage.xcodeproj; path = ../SDWebImage.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -85,7 +79,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 5324F0FB17FF4390008DF7F6 /* libSDWebImage+WebP.a in Frameworks */, + DA248D79195484A500390AB0 /* libSDWebImage+WebP.a in Frameworks */, + DA248D44195470FD00390AB0 /* MapKit.framework in Frameworks */, 531041C1157EAC8F00BBABC3 /* ImageIO.framework in Frameworks */, 5376129A155AB74D005750A4 /* UIKit.framework in Frameworks */, 5376129C155AB74D005750A4 /* Foundation.framework in Frameworks */, @@ -99,6 +94,7 @@ 5376128A155AB74D005750A4 = { isa = PBXGroup; children = ( + DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */, 5376129F155AB74D005750A4 /* SDWebImage Demo */, 53761298155AB74D005750A4 /* Frameworks */, 53761296155AB74D005750A4 /* Products */, @@ -116,7 +112,6 @@ 53761298155AB74D005750A4 /* Frameworks */ = { isa = PBXGroup; children = ( - 53EEC1A3164845D8007601E1 /* SDWebImage.xcodeproj */, 537612E6155ABA44005750A4 /* ImageIO.framework */, 537612E3155ABA3C005750A4 /* MapKit.framework */, 53761299155AB74D005750A4 /* UIKit.framework */, @@ -156,12 +151,12 @@ name = "Supporting Files"; sourceTree = ""; }; - 53EEC1A4164845D8007601E1 /* Products */ = { + DA248D6D1954841D00390AB0 /* Products */ = { isa = PBXGroup; children = ( - 53EEC1AD164845D9007601E1 /* libSDWebImage.a */, - 5324F0F817FF436E008DF7F6 /* libSDWebImage+WebP.a */, - 53EEC1AF164845D9007601E1 /* libSDWebImage+MKAnnotation.a */, + DA248D741954841D00390AB0 /* libSDWebImage.a */, + DA248D761954841D00390AB0 /* libSDWebImage+WebP.a */, + DA248D781954841D00390AB0 /* libSDWebImage+MKAnnotation.a */, ); name = Products; sourceTree = ""; @@ -180,7 +175,6 @@ buildRules = ( ); dependencies = ( - 5324F0FA17FF4389008DF7F6 /* PBXTargetDependency */, ); name = "SDWebImage Demo"; productName = "SDWebImage Demo"; @@ -208,8 +202,8 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = 53EEC1A4164845D8007601E1 /* Products */; - ProjectRef = 53EEC1A3164845D8007601E1 /* SDWebImage.xcodeproj */; + ProductGroup = DA248D6D1954841D00390AB0 /* Products */; + ProjectRef = DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */; }, ); projectRoot = ""; @@ -220,25 +214,25 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 5324F0F817FF436E008DF7F6 /* libSDWebImage+WebP.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = "libSDWebImage+WebP.a"; - remoteRef = 5324F0F717FF436E008DF7F6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 53EEC1AD164845D9007601E1 /* libSDWebImage.a */ = { + DA248D741954841D00390AB0 /* libSDWebImage.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libSDWebImage.a; - remoteRef = 53EEC1AC164845D9007601E1 /* PBXContainerItemProxy */; + remoteRef = DA248D731954841D00390AB0 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 53EEC1AF164845D9007601E1 /* libSDWebImage+MKAnnotation.a */ = { + DA248D761954841D00390AB0 /* libSDWebImage+WebP.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libSDWebImage+WebP.a"; + remoteRef = DA248D751954841D00390AB0 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + DA248D781954841D00390AB0 /* libSDWebImage+MKAnnotation.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libSDWebImage+MKAnnotation.a"; - remoteRef = 53EEC1AE164845D9007601E1 /* PBXContainerItemProxy */; + remoteRef = DA248D771954841D00390AB0 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -273,14 +267,6 @@ }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 5324F0FA17FF4389008DF7F6 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "SDWebImage+WebP"; - targetProxy = 5324F0F917FF4389008DF7F6 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin PBXVariantGroup section */ 537612B1155AB74D005750A4 /* MasterViewController.xib */ = { isa = PBXVariantGroup; diff --git a/Examples/SDWebImage Demo.xcodeproj/xcshareddata/xcschemes/SDWebImage Demo.xcscheme b/Examples/SDWebImage Demo.xcodeproj/xcshareddata/xcschemes/SDWebImage Demo.xcscheme new file mode 100644 index 0000000..dfaec08 --- /dev/null +++ b/Examples/SDWebImage Demo.xcodeproj/xcshareddata/xcschemes/SDWebImage Demo.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SDWebImage.xcworkspace/contents.xcworkspacedata b/SDWebImage.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..efc16df --- /dev/null +++ b/SDWebImage.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/Tests/Podfile b/Tests/Podfile new file mode 100644 index 0000000..fb5409f --- /dev/null +++ b/Tests/Podfile @@ -0,0 +1,14 @@ +xcodeproj 'SDWebImage Tests' +workspace '../SDWebImage' + +def import_pods + pod 'Expecta' # A Matcher Framework for Objective-C/Cocoa + pod 'XCTestAsync' # Extension to XCTest for asynchronous testing + pod 'SDWebImage', :path => '../' +end + +target :ios do + platform :ios, '5.0' + link_with 'Tests' + import_pods +end \ No newline at end of file diff --git a/Tests/SDWebImage Tests.xcodeproj/project.pbxproj b/Tests/SDWebImage Tests.xcodeproj/project.pbxproj new file mode 100644 index 0000000..fd80a8e --- /dev/null +++ b/Tests/SDWebImage Tests.xcodeproj/project.pbxproj @@ -0,0 +1,338 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + ABC8501F672447AA91C788DA /* libPods-ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EB0D107E6B4C4094BA2FEE29 /* libPods-ios.a */; }; + DA248D57195472AA00390AB0 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA248D56195472AA00390AB0 /* XCTest.framework */; }; + DA248D59195472AA00390AB0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA248D58195472AA00390AB0 /* Foundation.framework */; }; + DA248D5B195472AA00390AB0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA248D5A195472AA00390AB0 /* UIKit.framework */; }; + DA248D61195472AA00390AB0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = DA248D5F195472AA00390AB0 /* InfoPlist.strings */; }; + DA248D69195475D800390AB0 /* SDImageCacheTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA248D68195475D800390AB0 /* SDImageCacheTests.m */; }; + DA248D6B195476AC00390AB0 /* SDWebImageManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA248D6A195476AC00390AB0 /* SDWebImageManagerTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 5421361315E74CAA8FCCC423 /* Pods-ios.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ios.xcconfig"; path = "Pods/Pods-ios.xcconfig"; sourceTree = ""; }; + DA248D53195472AA00390AB0 /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + DA248D56195472AA00390AB0 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + DA248D58195472AA00390AB0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + DA248D5A195472AA00390AB0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + DA248D5E195472AA00390AB0 /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; + DA248D60195472AA00390AB0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + DA248D64195472AA00390AB0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; + DA248D68195475D800390AB0 /* SDImageCacheTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDImageCacheTests.m; sourceTree = ""; }; + DA248D6A195476AC00390AB0 /* SDWebImageManagerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDWebImageManagerTests.m; sourceTree = ""; }; + EB0D107E6B4C4094BA2FEE29 /* libPods-ios.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ios.a"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + DA248D50195472AA00390AB0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + DA248D57195472AA00390AB0 /* XCTest.framework in Frameworks */, + DA248D5B195472AA00390AB0 /* UIKit.framework in Frameworks */, + DA248D59195472AA00390AB0 /* Foundation.framework in Frameworks */, + ABC8501F672447AA91C788DA /* libPods-ios.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + DA248D451954721A00390AB0 = { + isa = PBXGroup; + children = ( + DA248D5C195472AA00390AB0 /* Tests */, + DA248D55195472AA00390AB0 /* Frameworks */, + DA248D54195472AA00390AB0 /* Products */, + 5421361315E74CAA8FCCC423 /* Pods-ios.xcconfig */, + ); + sourceTree = ""; + }; + DA248D54195472AA00390AB0 /* Products */ = { + isa = PBXGroup; + children = ( + DA248D53195472AA00390AB0 /* Tests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + DA248D55195472AA00390AB0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + DA248D56195472AA00390AB0 /* XCTest.framework */, + DA248D58195472AA00390AB0 /* Foundation.framework */, + DA248D5A195472AA00390AB0 /* UIKit.framework */, + EB0D107E6B4C4094BA2FEE29 /* libPods-ios.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + DA248D5C195472AA00390AB0 /* Tests */ = { + isa = PBXGroup; + children = ( + DA248D5D195472AA00390AB0 /* Supporting Files */, + DA248D68195475D800390AB0 /* SDImageCacheTests.m */, + DA248D6A195476AC00390AB0 /* SDWebImageManagerTests.m */, + ); + path = Tests; + sourceTree = ""; + }; + DA248D5D195472AA00390AB0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + DA248D5E195472AA00390AB0 /* Tests-Info.plist */, + DA248D5F195472AA00390AB0 /* InfoPlist.strings */, + DA248D64195472AA00390AB0 /* Tests-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + DA248D52195472AA00390AB0 /* Tests */ = { + isa = PBXNativeTarget; + buildConfigurationList = DA248D67195472AA00390AB0 /* Build configuration list for PBXNativeTarget "Tests" */; + buildPhases = ( + FBC8982311CD4ED9A3006D45 /* Check Pods Manifest.lock */, + DA248D4F195472AA00390AB0 /* Sources */, + DA248D50195472AA00390AB0 /* Frameworks */, + DA248D51195472AA00390AB0 /* Resources */, + D6347736BDF64FC5A4D078A4 /* Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Tests; + productName = Tests; + productReference = DA248D53195472AA00390AB0 /* Tests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + DA248D461954721A00390AB0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0510; + }; + buildConfigurationList = DA248D491954721A00390AB0 /* Build configuration list for PBXProject "SDWebImage Tests" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = DA248D451954721A00390AB0; + productRefGroup = DA248D54195472AA00390AB0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + DA248D52195472AA00390AB0 /* Tests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + DA248D51195472AA00390AB0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DA248D61195472AA00390AB0 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + D6347736BDF64FC5A4D078A4 /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Pods-ios-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + FBC8982311CD4ED9A3006D45 /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + DA248D4F195472AA00390AB0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DA248D69195475D800390AB0 /* SDImageCacheTests.m in Sources */, + DA248D6B195476AC00390AB0 /* SDWebImageManagerTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + DA248D5F195472AA00390AB0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + DA248D60195472AA00390AB0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + DA248D4A1954721A00390AB0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Debug; + }; + DA248D4B1954721A00390AB0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Release; + }; + DA248D65195472AA00390AB0 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5421361315E74CAA8FCCC423 /* Pods-ios.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = "Tests/Tests-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + DA248D66195472AA00390AB0 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5421361315E74CAA8FCCC423 /* Pods-ios.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = "Tests/Tests-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + DA248D491954721A00390AB0 /* Build configuration list for PBXProject "SDWebImage Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DA248D4A1954721A00390AB0 /* Debug */, + DA248D4B1954721A00390AB0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + DA248D67195472AA00390AB0 /* Build configuration list for PBXNativeTarget "Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DA248D65195472AA00390AB0 /* Debug */, + DA248D66195472AA00390AB0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = DA248D461954721A00390AB0 /* Project object */; +} diff --git a/Tests/Tests/SDImageCacheTests.m b/Tests/Tests/SDImageCacheTests.m new file mode 100644 index 0000000..4858efd --- /dev/null +++ b/Tests/Tests/SDImageCacheTests.m @@ -0,0 +1,43 @@ +// +// SDImageCacheTests.m +// SDWebImage Tests +// +// Created by Bogdan Poplauschi on 20/06/14. +// +// + +#define EXP_SHORTHAND // required by Expecta + + +#import +#import +#import + +#import "SDImageCache.h" + + +@interface SDImageCacheTests : XCTestCase + +@end + +@implementation SDImageCacheTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testSharedImageCache { + SDImageCache *sharedImageCache = [SDImageCache sharedImageCache]; + + expect(sharedImageCache).toNot.beNil(); +} + +@end diff --git a/Tests/Tests/SDWebImageManagerTests.m b/Tests/Tests/SDWebImageManagerTests.m new file mode 100644 index 0000000..9465fbf --- /dev/null +++ b/Tests/Tests/SDWebImageManagerTests.m @@ -0,0 +1,67 @@ +// +// SDWebImageManagerTests.m +// SDWebImage Tests +// +// Created by Bogdan Poplauschi on 20/06/14. +// +// + +#define EXP_SHORTHAND // required by Expecta + + +#import +#import +#import + +#import "SDWebImageManager.h" + +static int64_t kAsyncTestTimeout = 5; + + +@interface SDWebImageManagerTests : XCTestCase + +@end + +@implementation SDWebImageManagerTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testThatDownloadInvokesCompletionBlockWithCorrectParamsAsync { + NSURL *originalImageURL = [NSURL URLWithString:@"http://static2.dmcdn.net/static/video/656/177/44771656:jpeg_preview_small.jpg?20120509154705"]; + + [[SDWebImageManager sharedManager] downloadImageWithURL:originalImageURL options:SDWebImageRefreshCached progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + expect(image).toNot.beNil(); + expect(error).to.beNil(); + expect(originalImageURL).to.equal(imageURL); + + XCAsyncSuccess(); + }]; + + XCAsyncFailAfter(kAsyncTestTimeout, @"Download image timed out"); +} + +- (void)testThatDownloadWithIncorrectURLInvokesCompletionBlockWithAnErrorAsync { + NSURL *originalImageURL = [NSURL URLWithString:@"http://static2.dmcdn.net/static/video/656/177/44771656:jpeg_preview_small.png"]; + + [[SDWebImageManager sharedManager] downloadImageWithURL:originalImageURL options:SDWebImageRefreshCached progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + expect(image).to.beNil(); + expect(error).toNot.beNil(); + expect(originalImageURL).to.equal(imageURL); + + XCAsyncSuccess(); + }]; + + XCAsyncFailAfter(kAsyncTestTimeout, @"Download image timed out"); +} + +@end diff --git a/Tests/Tests/Tests-Info.plist b/Tests/Tests/Tests-Info.plist new file mode 100644 index 0000000..8213999 --- /dev/null +++ b/Tests/Tests/Tests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.SDWebImage.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/Tests/Tests/Tests-Prefix.pch b/Tests/Tests/Tests-Prefix.pch new file mode 100644 index 0000000..3fdee9d --- /dev/null +++ b/Tests/Tests/Tests-Prefix.pch @@ -0,0 +1,10 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Tests/Tests/en.lproj/InfoPlist.strings b/Tests/Tests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Tests/Tests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ +