Changeset 148

Show
Ignore:
Timestamp:
04/15/08 22:34:45 (1 month ago)
Author:
andym
Message:

Finally added unit tests.
For now, covering only version comparison.
Actually found and fixed a bug that made 1.0b1 < 1.0a1
Feel free to add more tests.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/SUStandardVersionComparator.m

    r147 r148  
    9999                } 
    100100            } else if (typeA == kStringType) { 
    101                 NSComparisonResult result = [partB compare:partA]; 
     101                NSComparisonResult result = [partA compare:partB]; 
    102102                if (result != NSOrderedSame) { 
    103103                    return result; 
  • trunk/Sparkle.xcodeproj/project.pbxproj

    r147 r148  
    2020                6120721209CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h in Headers */ = {isa = PBXBuildFile; fileRef = 6120721009CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h */; settings = {ATTRIBUTES = (Public, ); }; }; 
    2121                6120721309CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 6120721109CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.m */; }; 
     22                61227A080DB5480900AB99EA /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Sparkle.framework */; }; 
     23                61227A160DB548B800AB99EA /* SUVersionComparisonTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 61227A150DB548B800AB99EA /* SUVersionComparisonTest.m */; }; 
    2224                61299A2F09CA2DAB00B7442F /* NSFileManager+Verification.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299A2D09CA2DAB00B7442F /* NSFileManager+Verification.h */; settings = {ATTRIBUTES = (Public, ); }; }; 
    2325                61299A3009CA2DAB00B7442F /* NSFileManager+Verification.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A2E09CA2DAB00B7442F /* NSFileManager+Verification.m */; }; 
     
    8890 
    8991/* Begin PBXContainerItemProxy section */ 
     92                612279ED0DB547FE00AB99EA /* PBXContainerItemProxy */ = { 
     93                        isa = PBXContainerItemProxy; 
     94                        containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; 
     95                        proxyType = 1; 
     96                        remoteGlobalIDString = 8DC2EF4F0486A6940098B216; 
     97                        remoteInfo = Sparkle; 
     98                }; 
     99                61227AB90DB5C4BB00AB99EA /* PBXContainerItemProxy */ = { 
     100                        isa = PBXContainerItemProxy; 
     101                        containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; 
     102                        proxyType = 1; 
     103                        remoteGlobalIDString = 612279D80DB5470200AB99EA /* Sparkle Unit Tests */; 
     104                        remoteInfo = "Sparkle Unit Tests"; 
     105                }; 
    90106                61B5F91B09C4CF7200B25A18 /* PBXContainerItemProxy */ = { 
    91107                        isa = PBXContainerItemProxy; 
     
    142158                6120721009CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUAutomaticUpdateAlert.h; sourceTree = "<group>"; }; 
    143159                6120721109CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUAutomaticUpdateAlert.m; sourceTree = "<group>"; }; 
     160                612279D90DB5470200AB99EA /* Sparkle Unit Tests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Sparkle Unit Tests.octest"; sourceTree = BUILT_PRODUCTS_DIR; }; 
     161                612279DA0DB5470200AB99EA /* Sparkle Unit Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Sparkle Unit Tests-Info.plist"; sourceTree = "<group>"; }; 
     162                61227A140DB548B800AB99EA /* SUVersionComparisonTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUVersionComparisonTest.h; path = Tests/SUVersionComparisonTest.h; sourceTree = "<group>"; }; 
     163                61227A150DB548B800AB99EA /* SUVersionComparisonTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUVersionComparisonTest.m; path = Tests/SUVersionComparisonTest.m; sourceTree = "<group>"; }; 
    144164                6129984309C9E2DA00B7442F /* NSFileManager+Authentication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSFileManager+Authentication.h"; sourceTree = "<group>"; }; 
    145165                61299A2D09CA2DAB00B7442F /* NSFileManager+Verification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSFileManager+Verification.h"; sourceTree = "<group>"; }; 
     
    293313 
    294314/* Begin PBXFrameworksBuildPhase section */ 
     315                612279D60DB5470200AB99EA /* Frameworks */ = { 
     316                        isa = PBXFrameworksBuildPhase; 
     317                        buildActionMask = 2147483647; 
     318                        files = ( 
     319                                61227A080DB5480900AB99EA /* Sparkle.framework in Frameworks */, 
     320                        ); 
     321                        runOnlyForDeploymentPostprocessing = 0; 
     322                }; 
    295323                61B5F90009C4CEE200B25A18 /* Frameworks */ = { 
    296324                        isa = PBXFrameworksBuildPhase; 
     
    333361                                61B5F90209C4CEE200B25A18 /* Sparkle Test App.app */, 
    334362                                DAAEFC960DA571DF0051E0D0 /* relaunch */, 
     363                                612279D90DB5470200AB99EA /* Sparkle Unit Tests.octest */, 
    335364                        ); 
    336365                        name = Products; 
     
    341370                        children = ( 
    342371                                08FB77AEFE84172EC02AAC07 /* Sparkle Classes */, 
     372                                61227A100DB5484000AB99EA /* Tests */, 
    343373                                61B5F91D09C4CF7F00B25A18 /* Test Application Sources */, 
    344374                                32C88DFF0371C24200C91783 /* Other Sources */, 
     
    347377                                0867D69AFE84028FC02AAC07 /* Apple Frameworks and Libraries */, 
    348378                                034768DFFF38A50411DB9C8B /* Products */, 
     379                                612279DA0DB5470200AB99EA /* Sparkle Unit Tests-Info.plist */, 
    349380                        ); 
    350381                        name = Sparkle; 
     
    402433                        ); 
    403434                        name = "Other Sources"; 
     435                        sourceTree = "<group>"; 
     436                }; 
     437                61227A100DB5484000AB99EA /* Tests */ = { 
     438                        isa = PBXGroup; 
     439                        children = ( 
     440                                61227A140DB548B800AB99EA /* SUVersionComparisonTest.h */, 
     441                                61227A150DB548B800AB99EA /* SUVersionComparisonTest.m */, 
     442                        ); 
     443                        name = Tests; 
    404444                        sourceTree = "<group>"; 
    405445                }; 
     
    559599 
    560600/* Begin PBXNativeTarget section */ 
     601                612279D80DB5470200AB99EA /* Sparkle Unit Tests */ = { 
     602                        isa = PBXNativeTarget; 
     603                        buildConfigurationList = 612279DD0DB5470300AB99EA /* Build configuration list for PBXNativeTarget "Sparkle Unit Tests" */; 
     604                        buildPhases = ( 
     605                                612279D40DB5470200AB99EA /* Resources */, 
     606                                612279D50DB5470200AB99EA /* Sources */, 
     607                                612279D60DB5470200AB99EA /* Frameworks */, 
     608                                612279D70DB5470200AB99EA /* ShellScript */, 
     609                        ); 
     610                        buildRules = ( 
     611                        ); 
     612                        dependencies = ( 
     613                                612279EE0DB547FE00AB99EA /* PBXTargetDependency */, 
     614                        ); 
     615                        name = "Sparkle Unit Tests"; 
     616                        productName = "Sparkle Unit Tests"; 
     617                        productReference = 612279D90DB5470200AB99EA /* Sparkle Unit Tests.octest */; 
     618                        productType = "com.apple.product-type.bundle"; 
     619                }; 
    561620                61B5F90109C4CEE200B25A18 /* Sparkle Test App */ = { 
    562621                        isa = PBXNativeTarget; 
     
    572631                        dependencies = ( 
    573632                                61B5F91C09C4CF7200B25A18 /* PBXTargetDependency */, 
     633                                61227ABA0DB5C4BB00AB99EA /* PBXTargetDependency */, 
    574634                        ); 
    575635                        name = "Sparkle Test App"; 
     
    664724                                61B5F90109C4CEE200B25A18 /* Sparkle Test App */, 
    665725                                DAAEFC950DA571DF0051E0D0 /* relaunch tool */, 
     726                                612279D80DB5470200AB99EA /* Sparkle Unit Tests */, 
    666727                        ); 
    667728                }; 
     
    669730 
    670731/* Begin PBXResourcesBuildPhase section */ 
     732                612279D40DB5470200AB99EA /* Resources */ = { 
     733                        isa = PBXResourcesBuildPhase; 
     734                        buildActionMask = 2147483647; 
     735                        files = ( 
     736                        ); 
     737                        runOnlyForDeploymentPostprocessing = 0; 
     738                }; 
    671739                61B5F8FE09C4CEE200B25A18 /* Resources */ = { 
    672740                        isa = PBXResourcesBuildPhase; 
     
    694762/* End PBXResourcesBuildPhase section */ 
    695763 
     764/* Begin PBXShellScriptBuildPhase section */ 
     765                612279D70DB5470200AB99EA /* ShellScript */ = { 
     766                        isa = PBXShellScriptBuildPhase; 
     767                        buildActionMask = 2147483647; 
     768                        files = ( 
     769                        ); 
     770                        inputPaths = ( 
     771                        ); 
     772                        outputPaths = ( 
     773                        ); 
     774                        runOnlyForDeploymentPostprocessing = 0; 
     775                        shellPath = /bin/sh; 
     776                        shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; 
     777                }; 
     778/* End PBXShellScriptBuildPhase section */ 
     779 
    696780/* Begin PBXSourcesBuildPhase section */ 
     781                612279D50DB5470200AB99EA /* Sources */ = { 
     782                        isa = PBXSourcesBuildPhase; 
     783                        buildActionMask = 2147483647; 
     784                        files = ( 
     785                                61227A160DB548B800AB99EA /* SUVersionComparisonTest.m in Sources */, 
     786                        ); 
     787                        runOnlyForDeploymentPostprocessing = 0; 
     788                }; 
    697789                61B5F8FF09C4CEE200B25A18 /* Sources */ = { 
    698790                        isa = PBXSourcesBuildPhase; 
     
    747839 
    748840/* Begin PBXTargetDependency section */ 
     841                612279EE0DB547FE00AB99EA /* PBXTargetDependency */ = { 
     842                        isa = PBXTargetDependency; 
     843                        target = 8DC2EF4F0486A6940098B216 /* Sparkle */; 
     844                        targetProxy = 612279ED0DB547FE00AB99EA /* PBXContainerItemProxy */; 
     845                }; 
     846                61227ABA0DB5C4BB00AB99EA /* PBXTargetDependency */ = { 
     847                        isa = PBXTargetDependency; 
     848                        target = 612279D80DB5470200AB99EA /* Sparkle Unit Tests */; 
     849                        targetProxy = 61227AB90DB5C4BB00AB99EA /* PBXContainerItemProxy */; 
     850                }; 
    749851                61B5F91C09C4CF7200B25A18 /* PBXTargetDependency */ = { 
    750852                        isa = PBXTargetDependency; 
     
    9121014                        name = Release; 
    9131015                }; 
     1016                612279DB0DB5470300AB99EA /* Debug */ = { 
     1017                        isa = XCBuildConfiguration; 
     1018                        buildSettings = { 
     1019                                ALWAYS_SEARCH_USER_PATHS = NO; 
     1020                                ARCHS = "$(NATIVE_ARCH)"; 
     1021                                COPY_PHASE_STRIP = NO; 
     1022                                FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; 
     1023                                GCC_DYNAMIC_NO_PIC = NO; 
     1024                                GCC_ENABLE_FIX_AND_CONTINUE = NO; 
     1025                                GCC_ENABLE_OBJC_EXCEPTIONS = YES; 
     1026                                GCC_MODEL_TUNING = G5; 
     1027                                GCC_OPTIMIZATION_LEVEL = 0; 
     1028                                GCC_PRECOMPILE_PREFIX_HEADER = YES; 
     1029                                GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h"; 
     1030                                INFOPLIST_FILE = "Sparkle Unit Tests-Info.plist"; 
     1031                                INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; 
     1032                                OTHER_LDFLAGS = ( 
     1033                                        "-framework", 
     1034                                        Cocoa, 
     1035                                        "-framework", 
     1036                                        SenTestingKit, 
     1037                                ); 
     1038                                PREBINDING = NO; 
     1039                                PRODUCT_NAME = "Sparkle Unit Tests"; 
     1040                                WRAPPER_EXTENSION = octest; 
     1041                        }; 
     1042                        name = Debug; 
     1043                }; 
     1044                612279DC0DB5470300AB99EA /* Release */ = { 
     1045                        isa = XCBuildConfiguration; 
     1046                        buildSettings = { 
     1047                                ALWAYS_SEARCH_USER_PATHS = NO; 
     1048                                ARCHS = "$(NATIVE_ARCH)"; 
     1049                                COPY_PHASE_STRIP = YES; 
     1050                                DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 
     1051                                FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; 
     1052                                GCC_ENABLE_FIX_AND_CONTINUE = NO; 
     1053                                GCC_ENABLE_OBJC_EXCEPTIONS = YES; 
     1054                                GCC_MODEL_TUNING = G5; 
     1055                                GCC_PRECOMPILE_PREFIX_HEADER = YES; 
     1056                                GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h"; 
     1057                                INFOPLIST_FILE = "Sparkle Unit Tests-Info.plist"; 
     1058                                INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; 
     1059                                OTHER_LDFLAGS = ( 
     1060                                        "-framework", 
     1061                                        Cocoa, 
     1062                                        "-framework", 
     1063                                        SenTestingKit, 
     1064                                ); 
     1065                                PREBINDING = NO; 
     1066                                PRODUCT_NAME = "Sparkle Unit Tests"; 
     1067                                WRAPPER_EXTENSION = octest; 
     1068                                ZERO_LINK = NO; 
     1069                        }; 
     1070                        name = Release; 
     1071                }; 
    9141072                61B5F90609C4CEE300B25A18 /* Debug */ = { 
    9151073                        isa = XCBuildConfiguration; 
     
    9611119                        defaultConfigurationName = Release; 
    9621120                }; 
     1121                612279DD0DB5470300AB99EA /* Build configuration list for PBXNativeTarget "Sparkle Unit Tests" */ = { 
     1122                        isa = XCConfigurationList; 
     1123                        buildConfigurations = ( 
     1124                                612279DB0DB5470300AB99EA /* Debug */, 
     1125                                612279DC0DB5470300AB99EA /* Release */, 
     1126                        ); 
     1127                        defaultConfigurationIsVisible = 0; 
     1128                        defaultConfigurationName = Release; 
     1129                }; 
    9631130                61B5F90509C4CEE300B25A18 /* Build configuration list for PBXNativeTarget "Sparkle Test App" */ = { 
    9641131                        isa = XCConfigurationList;