Added a unit test bundle target to the Growl Xcode project.
authorPeter Hosey <hg@boredzo.org>
Tue Oct 13 02:32:55 2009 -0700 (2009-10-13)
changeset 4514d71f842e5297
parent 4513 845941e3fa7f
child 4515 8e4e8d23bf2d
Added a unit test bundle target to the Growl Xcode project.

These unit tests cover part of GrowlVersionUtilities. More should follow. We have three failures.
Growl.xcodeproj/project.pbxproj
Unit tests/TestVersionUtilities.h
Unit tests/TestVersionUtilities.m
Unit tests/Unit tests-Info.plist
Unit tests/UnitTests-Prefix.pch
     1.1 --- a/Growl.xcodeproj/project.pbxproj	Mon Oct 12 17:51:00 2009 -0700
     1.2 +++ b/Growl.xcodeproj/project.pbxproj	Tue Oct 13 02:32:55 2009 -0700
     1.3 @@ -97,6 +97,10 @@
     1.4  		0AEE179D0702C4960024B1A0 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AEE179C0702C4960024B1A0 /* ApplicationServices.framework */; };
     1.5  		31340CDD0D5B8E7100B9BEE0 /* GrowlPropertyListFilePathway.m in Sources */ = {isa = PBXBuildFile; fileRef = 31340CDB0D5B8E7100B9BEE0 /* GrowlPropertyListFilePathway.m */; };
     1.6  		31C7594B1047202B008547BF /* simple-mailer.py in Resources */ = {isa = PBXBuildFile; fileRef = 31C7594A1047202B008547BF /* simple-mailer.py */; };
     1.7 +		31E184E0108462F30011C78B /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 31E184DF108462F30011C78B /* SenTestingKit.framework */; };
     1.8 +		31E184F51084632C0011C78B /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83282741073A6BD70044A959 /* Cocoa.framework */; };
     1.9 +		31E18503108463E60011C78B /* TestVersionUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 31E18502108463E60011C78B /* TestVersionUtilities.m */; };
    1.10 +		31E18504108465590011C78B /* GrowlVersionUtilities.c in Sources */ = {isa = PBXBuildFile; fileRef = 0790135507D9321B0023B640 /* GrowlVersionUtilities.c */; };
    1.11  		342157C00C2AE377004003BB /* PriorityTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 342157BE0C2AE377004003BB /* PriorityTransformer.m */; };
    1.12  		3433456E0790E39200C84B15 /* Bubbles.growlView in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0AB508AE0767C87B006EA5CB /* Bubbles.growlView */; };
    1.13  		343345880790E3D600C84B15 /* Smoke.growlView in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0AB508AF0767C87B006EA5CB /* Smoke.growlView */; };
    1.14 @@ -687,6 +691,12 @@
    1.15  		31340CDB0D5B8E7100B9BEE0 /* GrowlPropertyListFilePathway.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GrowlPropertyListFilePathway.m; path = Core/Source/GrowlPropertyListFilePathway.m; sourceTree = "<group>"; };
    1.16  		315C88BB1068F9A200880530 /* Localization.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Localization.xcconfig; path = xcconfig/Localization.xcconfig; sourceTree = "<group>"; };
    1.17  		31C7594A1047202B008547BF /* simple-mailer.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = "simple-mailer.py"; path = "external_dependencies/simple-mailer.py"; sourceTree = SOURCE_ROOT; };
    1.18 +		31E184D61084628D0011C78B /* Unit tests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Unit tests.octest"; sourceTree = BUILT_PRODUCTS_DIR; };
    1.19 +		31E184D71084628D0011C78B /* Unit tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Unit tests-Info.plist"; path = "Unit tests/Unit tests-Info.plist"; sourceTree = "<group>"; };
    1.20 +		31E184DF108462F30011C78B /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
    1.21 +		31E18501108463E60011C78B /* TestVersionUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestVersionUtilities.h; path = "Unit tests/TestVersionUtilities.h"; sourceTree = "<group>"; };
    1.22 +		31E18502108463E60011C78B /* TestVersionUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TestVersionUtilities.m; path = "Unit tests/TestVersionUtilities.m"; sourceTree = "<group>"; };
    1.23 +		31E1852A108469460011C78B /* UnitTests-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UnitTests-Prefix.pch"; path = "Unit tests/UnitTests-Prefix.pch"; sourceTree = "<group>"; };
    1.24  		32DBCFA20370C41700C91783 /* Growl_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Growl_Prefix.pch; path = Core/Source/Growl_Prefix.pch; sourceTree = "<group>"; };
    1.25  		342157BD0C2AE377004003BB /* PriorityTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PriorityTransformer.h; path = Core/Source/PriorityTransformer.h; sourceTree = "<group>"; };
    1.26  		342157BE0C2AE377004003BB /* PriorityTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PriorityTransformer.m; path = Core/Source/PriorityTransformer.m; sourceTree = "<group>"; };
    1.27 @@ -1189,6 +1199,15 @@
    1.28  			);
    1.29  			runOnlyForDeploymentPostprocessing = 0;
    1.30  		};
    1.31 +		31E184D31084628D0011C78B /* Frameworks */ = {
    1.32 +			isa = PBXFrameworksBuildPhase;
    1.33 +			buildActionMask = 2147483647;
    1.34 +			files = (
    1.35 +				31E184F51084632C0011C78B /* Cocoa.framework in Frameworks */,
    1.36 +				31E184E0108462F30011C78B /* SenTestingKit.framework in Frameworks */,
    1.37 +			);
    1.38 +			runOnlyForDeploymentPostprocessing = 0;
    1.39 +		};
    1.40  		34725B0D0C0678A000499F50 /* Frameworks */ = {
    1.41  			isa = PBXFrameworksBuildPhase;
    1.42  			buildActionMask = 2147483647;
    1.43 @@ -1453,6 +1472,7 @@
    1.44  				63C0610006C8948700B0B7D4 /* AppleScript */,
    1.45  				CB5F836E0638B69900EADD7A /* HelperApp */,
    1.46  				07803B3808E7E67000299E08 /* Plug-ins */,
    1.47 +				31E184BB1084625C0011C78B /* Test cases */,
    1.48  				34A96DDA0C95F61800F46006 /* GrowlAction.xcodeproj */,
    1.49  				089C1671FE841209C02AAC07 /* Frameworks */,
    1.50  				19C28FB8FE9D52D311CA2CBB /* Products */,
    1.51 @@ -1660,6 +1680,7 @@
    1.52  				83282746073A6C110044A959 /* PreferencePanes.framework */,
    1.53  				343354B20792F84B00C84B15 /* Carbon.framework */,
    1.54  				93FCE57D0812D93B00320D8E /* SystemUIPlugin.framework */,
    1.55 +				31E184DF108462F30011C78B /* SenTestingKit.framework */,
    1.56  			);
    1.57  			name = "Linked Frameworks";
    1.58  			sourceTree = "<group>";
    1.59 @@ -1693,10 +1714,22 @@
    1.60  				93BC379E095A662B0002B365 /* Nano.growlView */,
    1.61  				E14410EF0A94072E0063C4DC /* iCal.growlView */,
    1.62  				34725B0F0C0678A000499F50 /* Growl.dylib */,
    1.63 +				31E184D61084628D0011C78B /* Unit tests.octest */,
    1.64  			);
    1.65  			name = Products;
    1.66  			sourceTree = "<group>";
    1.67  		};
    1.68 +		31E184BB1084625C0011C78B /* Test cases */ = {
    1.69 +			isa = PBXGroup;
    1.70 +			children = (
    1.71 +				31E184D71084628D0011C78B /* Unit tests-Info.plist */,
    1.72 +				31E1852A108469460011C78B /* UnitTests-Prefix.pch */,
    1.73 +				31E18501108463E60011C78B /* TestVersionUtilities.h */,
    1.74 +				31E18502108463E60011C78B /* TestVersionUtilities.m */,
    1.75 +			);
    1.76 +			name = "Test cases";
    1.77 +			sourceTree = "<group>";
    1.78 +		};
    1.79  		3433500C079275A300C84B15 /* Growl-WithInstaller.framework */ = {
    1.80  			isa = PBXGroup;
    1.81  			children = (
    1.82 @@ -2199,6 +2232,25 @@
    1.83  			productReference = 0AB508B30767C87B006EA5CB /* MusicVideo.growlView */;
    1.84  			productType = "com.apple.product-type.bundle";
    1.85  		};
    1.86 +		31E184D51084628D0011C78B /* Unit tests */ = {
    1.87 +			isa = PBXNativeTarget;
    1.88 +			buildConfigurationList = 31E184DB1084628E0011C78B /* Build configuration list for PBXNativeTarget "Unit tests" */;
    1.89 +			buildPhases = (
    1.90 +				31E184D11084628D0011C78B /* Resources */,
    1.91 +				31E184D21084628D0011C78B /* Sources */,
    1.92 +				31E184D31084628D0011C78B /* Frameworks */,
    1.93 +				31E1856C10846F800011C78B /* Set bundle bit */,
    1.94 +				31E184D41084628D0011C78B /* Run tests */,
    1.95 +			);
    1.96 +			buildRules = (
    1.97 +			);
    1.98 +			dependencies = (
    1.99 +			);
   1.100 +			name = "Unit tests";
   1.101 +			productName = "Unit tests";
   1.102 +			productReference = 31E184D61084628D0011C78B /* Unit tests.octest */;
   1.103 +			productType = "com.apple.product-type.bundle";
   1.104 +		};
   1.105  		34725B0E0C0678A000499F50 /* Growl.dylib */ = {
   1.106  			isa = PBXNativeTarget;
   1.107  			buildConfigurationList = 34725DC90C0678C800499F50 /* Build configuration list for PBXNativeTarget "Growl.dylib" */;
   1.108 @@ -2450,6 +2502,7 @@
   1.109  				DD4939CB084BACA700D1CCCB /* SMS */,
   1.110  				95E17B8F085E216A00990AB3 /* hg revision */,
   1.111  				9340E2E90C94D48000A1F682 /* SystemPreferencesTesting */,
   1.112 +				31E184D51084628D0011C78B /* Unit tests */,
   1.113  			);
   1.114  		};
   1.115  /* End PBXProject section */
   1.116 @@ -2514,6 +2567,13 @@
   1.117  			);
   1.118  			runOnlyForDeploymentPostprocessing = 0;
   1.119  		};
   1.120 +		31E184D11084628D0011C78B /* Resources */ = {
   1.121 +			isa = PBXResourcesBuildPhase;
   1.122 +			buildActionMask = 2147483647;
   1.123 +			files = (
   1.124 +			);
   1.125 +			runOnlyForDeploymentPostprocessing = 0;
   1.126 +		};
   1.127  		34F60EF5078E226300CECA86 /* Resources */ = {
   1.128  			isa = PBXResourcesBuildPhase;
   1.129  			buildActionMask = 2147483647;
   1.130 @@ -2617,6 +2677,36 @@
   1.131  /* End PBXRezBuildPhase section */
   1.132  
   1.133  /* Begin PBXShellScriptBuildPhase section */
   1.134 +		31E184D41084628D0011C78B /* Run tests */ = {
   1.135 +			isa = PBXShellScriptBuildPhase;
   1.136 +			buildActionMask = 2147483647;
   1.137 +			files = (
   1.138 +			);
   1.139 +			inputPaths = (
   1.140 +				"$(BUILT_PRODUCTS_DIR)/$(WRAPPER_NAME)",
   1.141 +			);
   1.142 +			name = "Run tests";
   1.143 +			outputPaths = (
   1.144 +			);
   1.145 +			runOnlyForDeploymentPostprocessing = 0;
   1.146 +			shellPath = /bin/sh;
   1.147 +			shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
   1.148 +		};
   1.149 +		31E1856C10846F800011C78B /* Set bundle bit */ = {
   1.150 +			isa = PBXShellScriptBuildPhase;
   1.151 +			buildActionMask = 2147483647;
   1.152 +			files = (
   1.153 +			);
   1.154 +			inputPaths = (
   1.155 +				"$(BUILT_PRODUCTS_DIR)/$(WRAPPER_NAME)",
   1.156 +			);
   1.157 +			name = "Set bundle bit";
   1.158 +			outputPaths = (
   1.159 +			);
   1.160 +			runOnlyForDeploymentPostprocessing = 0;
   1.161 +			shellPath = /bin/sh;
   1.162 +			shellScript = "SetFile -a B \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\"";
   1.163 +		};
   1.164  		340832FE075C2C0A00703011 /* ShellScript */ = {
   1.165  			isa = PBXShellScriptBuildPhase;
   1.166  			buildActionMask = 2147483647;
   1.167 @@ -2756,6 +2846,15 @@
   1.168  			);
   1.169  			runOnlyForDeploymentPostprocessing = 0;
   1.170  		};
   1.171 +		31E184D21084628D0011C78B /* Sources */ = {
   1.172 +			isa = PBXSourcesBuildPhase;
   1.173 +			buildActionMask = 2147483647;
   1.174 +			files = (
   1.175 +				31E18503108463E60011C78B /* TestVersionUtilities.m in Sources */,
   1.176 +				31E18504108465590011C78B /* GrowlVersionUtilities.c in Sources */,
   1.177 +			);
   1.178 +			runOnlyForDeploymentPostprocessing = 0;
   1.179 +		};
   1.180  		34725B0C0C0678A000499F50 /* Sources */ = {
   1.181  			isa = PBXSourcesBuildPhase;
   1.182  			buildActionMask = 2147483647;
   1.183 @@ -3931,6 +4030,88 @@
   1.184  			};
   1.185  			name = Localization;
   1.186  		};
   1.187 +		31E184D81084628E0011C78B /* Debug */ = {
   1.188 +			isa = XCBuildConfiguration;
   1.189 +			buildSettings = {
   1.190 +				ALWAYS_SEARCH_USER_PATHS = NO;
   1.191 +				ARCHS = (
   1.192 +					ppc,
   1.193 +					x86_64,
   1.194 +				);
   1.195 +				COPY_PHASE_STRIP = NO;
   1.196 +				DEBUG_INFORMATION_FORMAT = dwarf;
   1.197 +				FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
   1.198 +				GCC_DYNAMIC_NO_PIC = NO;
   1.199 +				GCC_ENABLE_FIX_AND_CONTINUE = NO;
   1.200 +				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
   1.201 +				GCC_GENERATE_TEST_COVERAGE_FILES = YES;
   1.202 +				GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES;
   1.203 +				GCC_MODEL_TUNING = G5;
   1.204 +				GCC_OPTIMIZATION_LEVEL = 0;
   1.205 +				GCC_PRECOMPILE_PREFIX_HEADER = YES;
   1.206 +				GCC_PREFIX_HEADER = "$(SRCROOT)/Unit tests/UnitTests-Prefix.pch";
   1.207 +				GCC_VERSION = 4.0;
   1.208 +				INFOPLIST_FILE = "$(SRCROOT)/Unit tests/Unit tests-Info.plist";
   1.209 +				INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles";
   1.210 +				OTHER_LDFLAGS = "-lgcov";
   1.211 +				PREBINDING = NO;
   1.212 +				PRODUCT_NAME = "Unit tests";
   1.213 +				WRAPPER_EXTENSION = octest;
   1.214 +			};
   1.215 +			name = Debug;
   1.216 +		};
   1.217 +		31E184D91084628E0011C78B /* Localization */ = {
   1.218 +			isa = XCBuildConfiguration;
   1.219 +			buildSettings = {
   1.220 +				ALWAYS_SEARCH_USER_PATHS = NO;
   1.221 +				ARCHS = (
   1.222 +					ppc,
   1.223 +					x86_64,
   1.224 +				);
   1.225 +				DEBUG_INFORMATION_FORMAT = dwarf;
   1.226 +				FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
   1.227 +				GCC_ENABLE_FIX_AND_CONTINUE = NO;
   1.228 +				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
   1.229 +				GCC_MODEL_TUNING = G5;
   1.230 +				GCC_PRECOMPILE_PREFIX_HEADER = YES;
   1.231 +				GCC_PREFIX_HEADER = "$(SRCROOT)/Unit tests/UnitTests-Prefix.pch";
   1.232 +				GCC_VERSION = 4.0;
   1.233 +				INFOPLIST_FILE = "$(SRCROOT)/Unit tests/Unit tests-Info.plist";
   1.234 +				INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles";
   1.235 +				OTHER_LDFLAGS = "-lgcov";
   1.236 +				PREBINDING = NO;
   1.237 +				PRODUCT_NAME = "Unit tests";
   1.238 +				WRAPPER_EXTENSION = octest;
   1.239 +			};
   1.240 +			name = Localization;
   1.241 +		};
   1.242 +		31E184DA1084628E0011C78B /* Release */ = {
   1.243 +			isa = XCBuildConfiguration;
   1.244 +			buildSettings = {
   1.245 +				ALWAYS_SEARCH_USER_PATHS = NO;
   1.246 +				ARCHS = (
   1.247 +					ppc,
   1.248 +					x86_64,
   1.249 +				);
   1.250 +				COPY_PHASE_STRIP = YES;
   1.251 +				DEBUG_INFORMATION_FORMAT = dwarf;
   1.252 +				FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
   1.253 +				GCC_ENABLE_FIX_AND_CONTINUE = NO;
   1.254 +				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
   1.255 +				GCC_MODEL_TUNING = G5;
   1.256 +				GCC_PRECOMPILE_PREFIX_HEADER = YES;
   1.257 +				GCC_PREFIX_HEADER = "$(SRCROOT)/Unit tests/UnitTests-Prefix.pch";
   1.258 +				GCC_VERSION = 4.0;
   1.259 +				INFOPLIST_FILE = "$(SRCROOT)/Unit tests/Unit tests-Info.plist";
   1.260 +				INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles";
   1.261 +				OTHER_LDFLAGS = "-lgcov";
   1.262 +				PREBINDING = NO;
   1.263 +				PRODUCT_NAME = "Unit tests";
   1.264 +				WRAPPER_EXTENSION = octest;
   1.265 +				ZERO_LINK = NO;
   1.266 +			};
   1.267 +			name = Release;
   1.268 +		};
   1.269  		34725DCA0C0678C800499F50 /* Debug */ = {
   1.270  			isa = XCBuildConfiguration;
   1.271  			buildSettings = {
   1.272 @@ -4850,6 +5031,16 @@
   1.273  /* End XCBuildConfiguration section */
   1.274  
   1.275  /* Begin XCConfigurationList section */
   1.276 +		31E184DB1084628E0011C78B /* Build configuration list for PBXNativeTarget "Unit tests" */ = {
   1.277 +			isa = XCConfigurationList;
   1.278 +			buildConfigurations = (
   1.279 +				31E184D81084628E0011C78B /* Debug */,
   1.280 +				31E184D91084628E0011C78B /* Localization */,
   1.281 +				31E184DA1084628E0011C78B /* Release */,
   1.282 +			);
   1.283 +			defaultConfigurationIsVisible = 0;
   1.284 +			defaultConfigurationName = Debug;
   1.285 +		};
   1.286  		34725DC90C0678C800499F50 /* Build configuration list for PBXNativeTarget "Growl.dylib" */ = {
   1.287  			isa = XCConfigurationList;
   1.288  			buildConfigurations = (
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/Unit tests/TestVersionUtilities.h	Tue Oct 13 02:32:55 2009 -0700
     2.3 @@ -0,0 +1,29 @@
     2.4 +//
     2.5 +//  TestVersionUtilities.h
     2.6 +//  Growl
     2.7 +//
     2.8 +//  Created by Peter Hosey on 2009-10-13.
     2.9 +//  Copyright 2009 Peter Hosey. All rights reserved.
    2.10 +//
    2.11 +
    2.12 +#import <SenTestingKit/SenTestingKit.h>
    2.13 +
    2.14 +@interface TestVersionUtilities : SenTestCase {
    2.15 +}
    2.16 +
    2.17 +- (void) testParseNil;
    2.18 +- (void) testParseTwoComponentSVNVersion;
    2.19 +- (void) testParseTwoComponentDevelopmentVersion;
    2.20 +- (void) testParseTwoComponentAlphaVersion;
    2.21 +- (void) testParseTwoComponentBetaVersion;
    2.22 +- (void) testParseTwoComponentReleaseVersion;
    2.23 +- (void) testParseThreeComponentSVNVersion;
    2.24 +- (void) testParseThreeComponentDevelopmentVersion;
    2.25 +- (void) testParseThreeComponentAlphaVersion;
    2.26 +- (void) testParseThreeComponentBetaVersion;
    2.27 +- (void) testParseThreeComponentReleaseVersion;
    2.28 +- (void) testParseWord;
    2.29 +- (void) testParseWordFollowedByReleaseVersion;
    2.30 +- (void) testParseReleaseVersionFollowedByWord;
    2.31 +
    2.32 +@end
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/Unit tests/TestVersionUtilities.m	Tue Oct 13 02:32:55 2009 -0700
     3.3 @@ -0,0 +1,292 @@
     3.4 +//
     3.5 +//  TestVersionUtilities.m
     3.6 +//  Growl
     3.7 +//
     3.8 +//  Created by Peter Hosey on 2009-10-13.
     3.9 +//  Copyright 2009 Peter Hosey. All rights reserved.
    3.10 +//
    3.11 +
    3.12 +#import "TestVersionUtilities.h"
    3.13 +
    3.14 +#import "GrowlVersionUtilities.h"
    3.15 +
    3.16 +@implementation TestVersionUtilities
    3.17 +
    3.18 +#pragma mark Things that should work
    3.19 +
    3.20 +- (void) testParseTwoComponentSVNVersion {
    3.21 +	struct Version version;
    3.22 +	NSString *string = @"1.3svn1400";
    3.23 +	STAssertTrue(parseVersionString(string, &version), @"Parse of %@ failed", string);
    3.24 +	STAssertEquals(
    3.25 +		version.major, (u_int16_t)1,
    3.26 +		@"Major component was %u, not %u",
    3.27 +		version.major, (u_int16_t)1);
    3.28 +	STAssertEquals(
    3.29 +		version.minor, (u_int16_t)3,
    3.30 +		@"Minor component was %u, not %u",
    3.31 +		version.minor, (u_int16_t)3);
    3.32 +	STAssertEquals(
    3.33 +		version.incremental, (u_int8_t)0,
    3.34 +		@"Incremental component was %u, not %u",
    3.35 +		version.incremental, (u_int8_t)0);
    3.36 +	STAssertEquals(
    3.37 +		version.releaseType, (u_int8_t)releaseType_svn,
    3.38 +		@"Release-type component was %u, not %u",
    3.39 +		version.releaseType, (u_int8_t)releaseType_svn);
    3.40 +	STAssertEquals(
    3.41 +		version.development, (u_int32_t)1400,
    3.42 +		@"Development component (SVN revision) was %u, not %u",
    3.43 +		version.development, (u_int32_t)1400);
    3.44 +}
    3.45 +- (void) testParseTwoComponentDevelopmentVersion {
    3.46 +	struct Version version;
    3.47 +	NSString *string = @"1.3d1";
    3.48 +	STAssertTrue(parseVersionString(string, &version), @"Parse of %@ failed", string);
    3.49 +	STAssertEquals(
    3.50 +		version.major, (u_int16_t)1,
    3.51 +		@"Major component was %u, not %u",
    3.52 +		version.major, (u_int16_t)1);
    3.53 +	STAssertEquals(
    3.54 +		version.minor, (u_int16_t)3,
    3.55 +		@"Minor component was %u, not %u",
    3.56 +		version.minor, (u_int16_t)3);
    3.57 +	STAssertEquals(
    3.58 +		version.incremental, (u_int8_t)0,
    3.59 +		@"Incremental component was %u, not %u",
    3.60 +		version.incremental, (u_int8_t)0);
    3.61 +	STAssertEquals(
    3.62 +		version.releaseType, (u_int8_t)releaseType_development,
    3.63 +		@"Release-type component was %u, not %u",
    3.64 +		version.releaseType, (u_int8_t)releaseType_development);
    3.65 +	STAssertEquals(
    3.66 +		version.development, (u_int32_t)1,
    3.67 +		@"Development component was %u, not %u",
    3.68 +		version.development, (u_int32_t)1);
    3.69 +}
    3.70 +- (void) testParseTwoComponentAlphaVersion {
    3.71 +	struct Version version;
    3.72 +	NSString *string = @"1.3a1";
    3.73 +	STAssertTrue(parseVersionString(string, &version), @"Parse of %@ failed", string);
    3.74 +	STAssertEquals(
    3.75 +		version.major, (u_int16_t)1,
    3.76 +		@"Major component was %u, not %u",
    3.77 +		version.major, (u_int16_t)1);
    3.78 +	STAssertEquals(
    3.79 +		version.minor, (u_int16_t)3,
    3.80 +		@"Minor component was %u, not %u",
    3.81 +		version.minor, (u_int16_t)3);
    3.82 +	STAssertEquals(
    3.83 +		version.incremental, (u_int8_t)0,
    3.84 +		@"Incremental component was %u, not %u",
    3.85 +		version.incremental, (u_int8_t)0);
    3.86 +	STAssertEquals(
    3.87 +		version.releaseType, (u_int8_t)releaseType_alpha,
    3.88 +		@"Release-type component was %u, not %u",
    3.89 +		version.releaseType, (u_int8_t)releaseType_alpha);
    3.90 +	STAssertEquals(
    3.91 +		version.development, (u_int32_t)1,
    3.92 +		@"Development component was %u, not %u",
    3.93 +		version.development, (u_int32_t)1);
    3.94 +}
    3.95 +- (void) testParseTwoComponentBetaVersion {
    3.96 +	struct Version version;
    3.97 +	NSString *string = @"1.3b1";
    3.98 +	STAssertTrue(parseVersionString(string, &version), @"Parse of %@ failed", string);
    3.99 +	STAssertEquals(
   3.100 +		version.major, (u_int16_t)1,
   3.101 +		@"Major component was %u, not %u",
   3.102 +		version.major, (u_int16_t)1);
   3.103 +	STAssertEquals(
   3.104 +		version.minor, (u_int16_t)3,
   3.105 +		@"Minor component was %u, not %u",
   3.106 +		version.minor, (u_int16_t)3);
   3.107 +	STAssertEquals(
   3.108 +		version.incremental, (u_int8_t)0,
   3.109 +		@"Incremental component was %u, not %u",
   3.110 +		version.incremental, (u_int8_t)0);
   3.111 +	STAssertEquals(
   3.112 +		version.releaseType, (u_int8_t)releaseType_beta,
   3.113 +		@"Release-type component was %u, not %u",
   3.114 +		version.releaseType, (u_int8_t)releaseType_beta);
   3.115 +	STAssertEquals(
   3.116 +		version.development, (u_int32_t)1,
   3.117 +		@"Development component was %u, not %u",
   3.118 +		version.development, (u_int32_t)1);
   3.119 +}
   3.120 +- (void) testParseTwoComponentReleaseVersion {
   3.121 +	struct Version version;
   3.122 +	NSString *string = @"1.3";
   3.123 +	STAssertTrue(parseVersionString(string, &version), @"Parse of %@ failed", string);
   3.124 +	STAssertEquals(
   3.125 +		version.major, (u_int16_t)1,
   3.126 +		@"Major component was %u, not %u",
   3.127 +		version.major, (u_int16_t)1);
   3.128 +	STAssertEquals(
   3.129 +		version.minor, (u_int16_t)3,
   3.130 +		@"Minor component was %u, not %u",
   3.131 +		version.minor, (u_int16_t)3);
   3.132 +	STAssertEquals(
   3.133 +		version.incremental, (u_int8_t)0,
   3.134 +		@"Incremental component was %u, not %u",
   3.135 +		version.incremental, (u_int8_t)0);
   3.136 +	STAssertEquals(
   3.137 +		version.releaseType, (u_int8_t)releaseType_release,
   3.138 +		@"Release-type component was %u, not %u",
   3.139 +		version.releaseType, (u_int8_t)releaseType_alpha);
   3.140 +	STAssertEquals(
   3.141 +		version.development, (u_int32_t)0,
   3.142 +		@"Development component was %u, not %u",
   3.143 +		version.development, (u_int32_t)0);
   3.144 +}
   3.145 +
   3.146 +- (void) testParseThreeComponentSVNVersion {
   3.147 +	struct Version version;
   3.148 +	NSString *string = @"1.3.4svn1400";
   3.149 +	STAssertTrue(parseVersionString(string, &version), @"Parse of %@ failed", string);
   3.150 +	STAssertEquals(
   3.151 +		version.major, (u_int16_t)1,
   3.152 +		@"Major component was %u, not %u",
   3.153 +		version.major, (u_int16_t)1);
   3.154 +	STAssertEquals(
   3.155 +		version.minor, (u_int16_t)3,
   3.156 +		@"Minor component was %u, not %u",
   3.157 +		version.minor, (u_int16_t)3);
   3.158 +	STAssertEquals(
   3.159 +		version.incremental, (u_int8_t)4,
   3.160 +		@"Incremental component was %u, not %u",
   3.161 +		version.incremental, (u_int8_t)4);
   3.162 +	STAssertEquals(
   3.163 +		version.releaseType, (u_int8_t)releaseType_svn,
   3.164 +		@"Release-type component was %u, not %u",
   3.165 +		version.releaseType, (u_int8_t)releaseType_svn);
   3.166 +	STAssertEquals(
   3.167 +		version.development, (u_int32_t)1400,
   3.168 +		@"Development component (SVN revision) was %u, not %u",
   3.169 +		version.development, (u_int32_t)1400);
   3.170 +}
   3.171 +- (void) testParseThreeComponentDevelopmentVersion {
   3.172 +	struct Version version;
   3.173 +	NSString *string = @"1.3.4d1";
   3.174 +	STAssertTrue(parseVersionString(string, &version), @"Parse of %@ failed", string);
   3.175 +	STAssertEquals(
   3.176 +		version.major, (u_int16_t)1,
   3.177 +		@"Major component was %u, not %u",
   3.178 +		version.major, (u_int16_t)1);
   3.179 +	STAssertEquals(
   3.180 +		version.minor, (u_int16_t)3,
   3.181 +		@"Minor component was %u, not %u",
   3.182 +		version.minor, (u_int16_t)3);
   3.183 +	STAssertEquals(
   3.184 +		version.incremental, (u_int8_t)4,
   3.185 +		@"Incremental component was %u, not %u",
   3.186 +		version.incremental, (u_int8_t)4);
   3.187 +	STAssertEquals(
   3.188 +		version.releaseType, (u_int8_t)releaseType_development,
   3.189 +		@"Release-type component was %u, not %u",
   3.190 +		version.releaseType, (u_int8_t)releaseType_development);
   3.191 +	STAssertEquals(
   3.192 +		version.development, (u_int32_t)1,
   3.193 +		@"Development component was %u, not %u",
   3.194 +		version.development, (u_int32_t)1);
   3.195 +}
   3.196 +- (void) testParseThreeComponentAlphaVersion {
   3.197 +	struct Version version;
   3.198 +	NSString *string = @"1.3.4a1";
   3.199 +	STAssertTrue(parseVersionString(string, &version), @"Parse of %@ failed", string);
   3.200 +	STAssertEquals(
   3.201 +		version.major, (u_int16_t)1,
   3.202 +		@"Major component was %u, not %u",
   3.203 +		version.major, (u_int16_t)1);
   3.204 +	STAssertEquals(
   3.205 +		version.minor, (u_int16_t)3,
   3.206 +		@"Minor component was %u, not %u",
   3.207 +		version.minor, (u_int16_t)3);
   3.208 +	STAssertEquals(
   3.209 +		version.incremental, (u_int8_t)4,
   3.210 +		@"Incremental component was %u, not %u",
   3.211 +		version.incremental, (u_int8_t)4);
   3.212 +	STAssertEquals(
   3.213 +		version.releaseType, (u_int8_t)releaseType_alpha,
   3.214 +		@"Release-type component was %u, not %u",
   3.215 +		version.releaseType, (u_int8_t)releaseType_alpha);
   3.216 +	STAssertEquals(
   3.217 +		version.development, (u_int32_t)1,
   3.218 +		@"Development component was %u, not %u",
   3.219 +		version.development, (u_int32_t)1);
   3.220 +}
   3.221 +- (void) testParseThreeComponentBetaVersion {
   3.222 +	struct Version version;
   3.223 +	NSString *string = @"1.3.4b1";
   3.224 +	STAssertTrue(parseVersionString(string, &version), @"Parse of %@ failed", string);
   3.225 +	STAssertEquals(
   3.226 +		version.major, (u_int16_t)1,
   3.227 +		@"Major component was %u, not %u",
   3.228 +		version.major, (u_int16_t)1);
   3.229 +	STAssertEquals(
   3.230 +		version.minor, (u_int16_t)3,
   3.231 +		@"Minor component was %u, not %u",
   3.232 +		version.minor, (u_int16_t)3);
   3.233 +	STAssertEquals(
   3.234 +		version.incremental, (u_int8_t)4,
   3.235 +		@"Incremental component was %u, not %u",
   3.236 +		version.incremental, (u_int8_t)4);
   3.237 +	STAssertEquals(
   3.238 +		version.releaseType, (u_int8_t)releaseType_beta,
   3.239 +		@"Release-type component was %u, not %u",
   3.240 +		version.releaseType, (u_int8_t)releaseType_beta);
   3.241 +	STAssertEquals(
   3.242 +		version.development, (u_int32_t)1,
   3.243 +		@"Development component was %u, not %u",
   3.244 +		version.development, (u_int32_t)1);
   3.245 +}
   3.246 +- (void) testParseThreeComponentReleaseVersion {
   3.247 +	struct Version version;
   3.248 +	NSString *string = @"1.3.4";
   3.249 +	STAssertTrue(parseVersionString(string, &version), @"Parse of %@ failed", string);
   3.250 +	STAssertEquals(
   3.251 +		version.major, (u_int16_t)1,
   3.252 +		@"Major component was %u, not %u",
   3.253 +		version.major, (u_int16_t)1);
   3.254 +	STAssertEquals(
   3.255 +		version.minor, (u_int16_t)3,
   3.256 +		@"Minor component was %u, not %u",
   3.257 +		version.minor, (u_int16_t)3);
   3.258 +	STAssertEquals(
   3.259 +		version.incremental, (u_int8_t)4,
   3.260 +		@"Incremental component was %u, not %u",
   3.261 +		version.incremental, (u_int8_t)4);
   3.262 +	STAssertEquals(
   3.263 +		version.releaseType, (u_int8_t)releaseType_release,
   3.264 +		@"Release-type component was %u, not %u",
   3.265 +		version.releaseType, (u_int8_t)releaseType_alpha);
   3.266 +	STAssertEquals(
   3.267 +		version.development, (u_int32_t)0,
   3.268 +		@"Development component was %u, not %u",
   3.269 +		version.development, (u_int32_t)0);
   3.270 +}
   3.271 +
   3.272 +#pragma mark Things that should not work
   3.273 +
   3.274 +- (void) testParseNil {
   3.275 +	struct Version version;
   3.276 +	NSString *string = nil;
   3.277 +	STAssertFalse(parseVersionString(string, &version), @"Successfully parsed nil");
   3.278 +}
   3.279 +- (void) testParseWord {
   3.280 +	struct Version version;
   3.281 +	NSString *string = @"atychiphobia";
   3.282 +	STAssertFalse(parseVersionString(string, &version), @"Successfully parsed a word (%@); output version was %@", string, [NSMakeCollectable(createVersionDescription(version)) autorelease]);
   3.283 +}
   3.284 +- (void) testParseWordFollowedByReleaseVersion {
   3.285 +	struct Version version;
   3.286 +	NSString *string = @"Final 1.3";
   3.287 +	STAssertFalse(parseVersionString(string, &version), @"Successfully parsed a word followed by a version (%@) - this should have failed. Output version was %@", string, [NSMakeCollectable(createVersionDescription(version)) autorelease]);
   3.288 +}
   3.289 +- (void) testParseReleaseVersionFollowedByWord {
   3.290 +	struct Version version;
   3.291 +	NSString *string = @"1.3 final";
   3.292 +	STAssertFalse(parseVersionString(string, &version), @"Successfully parsed a version followed by a word (%@) - this should have failed. Output version was %@", string, [NSMakeCollectable(createVersionDescription(version)) autorelease]);
   3.293 +}
   3.294 +
   3.295 +@end
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/Unit tests/Unit tests-Info.plist	Tue Oct 13 02:32:55 2009 -0700
     4.3 @@ -0,0 +1,22 @@
     4.4 +<?xml version="1.0" encoding="UTF-8"?>
     4.5 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
     4.6 +<plist version="1.0">
     4.7 +<dict>
     4.8 +	<key>CFBundleDevelopmentRegion</key>
     4.9 +	<string>English</string>
    4.10 +	<key>CFBundleExecutable</key>
    4.11 +	<string>${EXECUTABLE_NAME}</string>
    4.12 +	<key>CFBundleIdentifier</key>
    4.13 +	<string>info.growl.growl.unittests</string>
    4.14 +	<key>CFBundleInfoDictionaryVersion</key>
    4.15 +	<string>6.0</string>
    4.16 +	<key>CFBundlePackageType</key>
    4.17 +	<string>BNDL</string>
    4.18 +	<key>CFBundleShortVersionString</key>
    4.19 +	<string>1.0</string>
    4.20 +	<key>CFBundleSignature</key>
    4.21 +	<string>GrUT</string>
    4.22 +	<key>CFBundleVersion</key>
    4.23 +	<string>1</string>
    4.24 +</dict>
    4.25 +</plist>
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/Unit tests/UnitTests-Prefix.pch	Tue Oct 13 02:32:55 2009 -0700
     5.3 @@ -0,0 +1,3 @@
     5.4 +#ifdef __OBJC__
     5.5 +#	import <Cocoa/Cocoa.h>
     5.6 +#endif