Merge branch 'unit_tests'

Unit testing setup + created workspace
- created a SDWebImage.xcworkspace
- includes the existing SDWebImage.xcodeproj (responsible of compiling the library)
- includes the existing SDWebImage Demo.xcodeproj
- includes the newly created SDWebImage Tests.xcodeproj (tests project). The test project uses the local CocoaPods repo to link to the library

Unit testing backbone:
- XCTest framework (the one from Apple)
- XCTestAsync - extension for XCTest that allows easily creating asynchronous tests. Relies on dispatch_after.
- Expecta - matcher Framework for Objective-C/Cocoa

Updated gitignore
This commit is contained in:
Bogdan Poplauschi 2014-06-23 21:23:56 +03:00
commit c7330db3a6
11 changed files with 647 additions and 54 deletions

24
.gitignore vendored
View File

@ -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
*.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

View File

@ -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 = "<group>"; };
53A2B50C155B155A00B12423 /* placeholder@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "placeholder@2x.png"; sourceTree = "<group>"; };
53EEC18816484553007601E1 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../Default-568h@2x.png"; sourceTree = "<group>"; };
53EEC1A3164845D8007601E1 /* SDWebImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDWebImage.xcodeproj; path = ../SDWebImage.xcodeproj; sourceTree = "<group>"; };
DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDWebImage.xcodeproj; path = ../SDWebImage.xcodeproj; sourceTree = "<group>"; };
/* 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 = "<group>";
};
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 = "<group>";
@ -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;

View File

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "53761294155AB74D005750A4"
BuildableName = "SDWebImage Demo.app"
BlueprintName = "SDWebImage Demo"
ReferencedContainer = "container:SDWebImage Demo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "53761294155AB74D005750A4"
BuildableName = "SDWebImage Demo.app"
BlueprintName = "SDWebImage Demo"
ReferencedContainer = "container:SDWebImage Demo.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "53761294155AB74D005750A4"
BuildableName = "SDWebImage Demo.app"
BlueprintName = "SDWebImage Demo"
ReferencedContainer = "container:SDWebImage Demo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "53761294155AB74D005750A4"
BuildableName = "SDWebImage Demo.app"
BlueprintName = "SDWebImage Demo"
ReferencedContainer = "container:SDWebImage Demo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Examples/SDWebImage Demo.xcodeproj">
</FileRef>
<FileRef
location = "group:Tests/SDWebImage Tests.xcodeproj">
</FileRef>
<FileRef
location = "group:Tests/Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

14
Tests/Podfile Normal file
View File

@ -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

View File

@ -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 = "<group>"; };
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 = "<group>"; };
DA248D60195472AA00390AB0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
DA248D64195472AA00390AB0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; };
DA248D68195475D800390AB0 /* SDImageCacheTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDImageCacheTests.m; sourceTree = "<group>"; };
DA248D6A195476AC00390AB0 /* SDWebImageManagerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDWebImageManagerTests.m; sourceTree = "<group>"; };
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 = "<group>";
};
DA248D54195472AA00390AB0 /* Products */ = {
isa = PBXGroup;
children = (
DA248D53195472AA00390AB0 /* Tests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
DA248D55195472AA00390AB0 /* Frameworks */ = {
isa = PBXGroup;
children = (
DA248D56195472AA00390AB0 /* XCTest.framework */,
DA248D58195472AA00390AB0 /* Foundation.framework */,
DA248D5A195472AA00390AB0 /* UIKit.framework */,
EB0D107E6B4C4094BA2FEE29 /* libPods-ios.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
DA248D5C195472AA00390AB0 /* Tests */ = {
isa = PBXGroup;
children = (
DA248D5D195472AA00390AB0 /* Supporting Files */,
DA248D68195475D800390AB0 /* SDImageCacheTests.m */,
DA248D6A195476AC00390AB0 /* SDWebImageManagerTests.m */,
);
path = Tests;
sourceTree = "<group>";
};
DA248D5D195472AA00390AB0 /* Supporting Files */ = {
isa = PBXGroup;
children = (
DA248D5E195472AA00390AB0 /* Tests-Info.plist */,
DA248D5F195472AA00390AB0 /* InfoPlist.strings */,
DA248D64195472AA00390AB0 /* Tests-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* 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 = "<group>";
};
/* 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 */;
}

View File

@ -0,0 +1,43 @@
//
// SDImageCacheTests.m
// SDWebImage Tests
//
// Created by Bogdan Poplauschi on 20/06/14.
//
//
#define EXP_SHORTHAND // required by Expecta
#import <XCTest/XCTest.h>
#import <XCTestAsync/XCTestAsync.h>
#import <Expecta.h>
#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

View File

@ -0,0 +1,67 @@
//
// SDWebImageManagerTests.m
// SDWebImage Tests
//
// Created by Bogdan Poplauschi on 20/06/14.
//
//
#define EXP_SHORTHAND // required by Expecta
#import <XCTest/XCTest.h>
#import <XCTestAsync/XCTestAsync.h>
#import <Expecta.h>
#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

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.SDWebImage.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View File

@ -0,0 +1,10 @@
//
// Prefix header
//
// The contents of this file are implicitly included at the beginning of every source file.
//
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif

View File

@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */