Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added tests for categories

  • Loading branch information...
commit ed20d90a019c92981d0a7114d2aef157846c3e8f 1 parent 24e1d96
@soffes soffes authored
Showing with 3,742 additions and 0 deletions.
  1. +203 −0 SSToolkit.xcodeproj/project.pbxproj
  2. +21 −0 Tests/ArrayCategoryTest.m
  3. +19 −0 Tests/DataCategoryTest.m
  4. +39 −0 Tests/DateCategoryTest.m
  5. +35 −0 Tests/DictionaryCategoryTest.m
  6. +1 −0  Tests/GHUnitIOS.framework/GHUnitIOS
  7. +1 −0  Tests/GHUnitIOS.framework/Headers
  8. +1 −0  Tests/GHUnitIOS.framework/Resources
  9. BIN  Tests/GHUnitIOS.framework/Versions/A/GHUnitIOS
  10. +155 −0 Tests/GHUnitIOS.framework/Versions/A/Headers/GHAsyncTestCase.h
  11. +44 −0 Tests/GHUnitIOS.framework/Versions/A/Headers/GHTest+JUnitXML.h
  12. +184 −0 Tests/GHUnitIOS.framework/Versions/A/Headers/GHTest.h
  13. +146 −0 Tests/GHUnitIOS.framework/Versions/A/Headers/GHTestCase.h
  14. +42 −0 Tests/GHUnitIOS.framework/Versions/A/Headers/GHTestGroup+JUnitXML.h
  15. +176 −0 Tests/GHUnitIOS.framework/Versions/A/Headers/GHTestGroup.h
  16. +1,012 −0 Tests/GHUnitIOS.framework/Versions/A/Headers/GHTestMacros.h
  17. +46 −0 Tests/GHUnitIOS.framework/Versions/A/Headers/GHTestOperation.h
  18. +162 −0 Tests/GHUnitIOS.framework/Versions/A/Headers/GHTestRunner.h
  19. +118 −0 Tests/GHUnitIOS.framework/Versions/A/Headers/GHTestSuite.h
  20. +148 −0 Tests/GHUnitIOS.framework/Versions/A/Headers/GHTesting.h
  21. +590 −0 Tests/GHUnitIOS.framework/Versions/A/Headers/GHUnit.h
  22. +39 −0 Tests/GHUnitIOS.framework/Versions/A/Headers/GHUnitIPhoneAppDelegate.h
  23. +40 −0 Tests/GHUnitIOS.framework/Versions/A/Headers/GHUnitIPhoneTableViewDataSource.h
  24. +42 −0 Tests/GHUnitIOS.framework/Versions/A/Headers/GHUnitIPhoneTestViewController.h
  25. +52 −0 Tests/GHUnitIOS.framework/Versions/A/Headers/GHUnitIPhoneView.h
  26. +71 −0 Tests/GHUnitIOS.framework/Versions/A/Headers/GHUnitIPhoneViewController.h
  27. +97 −0 Tests/GHUnitIOS.framework/Versions/A/Headers/NSException+GHTestFailureExceptions.h
  28. +71 −0 Tests/GHUnitIOS.framework/Versions/A/Headers/NSValue+GHValueFormatter.h
  29. +18 −0 Tests/GHUnitIOS.framework/Versions/A/Resources/Info.plist
  30. +1 −0  Tests/GHUnitIOS.framework/Versions/Current
  31. +82 −0 Tests/GHUnitIOSTestMain.m
  32. +20 −0 Tests/SSToolkitTests-Info.plist
  33. +15 −0 Tests/SSToolkitTests_Prefix.pch
  34. +32 −0 Tests/StringCategoryTest.m
  35. +19 −0 Tests/URLCategoryTest.m
View
203 SSToolkit.xcodeproj/project.pbxproj
@@ -15,6 +15,18 @@
B21D2E00121F2FE500161E66 /* SSDrawingUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = B21D2DFF121F2FE500161E66 /* SSDrawingUtilities.m */; };
B227D2EA124931590078A059 /* NSDictionary+SSToolkitAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = B227D2E8124931590078A059 /* NSDictionary+SSToolkitAdditions.h */; };
B227D2EB124931590078A059 /* NSDictionary+SSToolkitAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = B227D2E9124931590078A059 /* NSDictionary+SSToolkitAdditions.m */; };
+ B23910571357DC7D00ADE21B /* GHUnitIOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B23910551357DC7D00ADE21B /* GHUnitIOS.framework */; };
+ B23910601357DCF700ADE21B /* libSSToolkit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D2AAC07E0554694100DB518D /* libSSToolkit.a */; };
+ B23910621357DCF700ADE21B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B23910611357DCF700ADE21B /* CoreGraphics.framework */; };
+ B23910641357DCF700ADE21B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B23910631357DCF700ADE21B /* Foundation.framework */; };
+ B23910661357DCF700ADE21B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B23910651357DCF700ADE21B /* UIKit.framework */; };
+ B23910811357DDA600ADE21B /* GHUnitIOSTestMain.m in Sources */ = {isa = PBXBuildFile; fileRef = B23910801357DDA600ADE21B /* GHUnitIOSTestMain.m */; };
+ B23910A91357DED300ADE21B /* DateCategoryTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B23910A61357DED300ADE21B /* DateCategoryTest.m */; };
+ B23910AA1357DED300ADE21B /* DictionaryCategoryTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B23910A71357DED300ADE21B /* DictionaryCategoryTest.m */; };
+ B23910AB1357DED300ADE21B /* StringCategoryTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B23910A81357DED300ADE21B /* StringCategoryTest.m */; };
+ B23910C01357E07A00ADE21B /* ArrayCategoryTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B23910BF1357E07A00ADE21B /* ArrayCategoryTest.m */; };
+ B23910C21357E08600ADE21B /* DataCategoryTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B23910C11357E08600ADE21B /* DataCategoryTest.m */; };
+ B23910C41357E08E00ADE21B /* URLCategoryTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B23910C31357E08E00ADE21B /* URLCategoryTest.m */; };
B247ABAE1300930200971EC0 /* SSSegmentedControl.h in Headers */ = {isa = PBXBuildFile; fileRef = B247ABAC1300930200971EC0 /* SSSegmentedControl.h */; };
B247ABAF1300930200971EC0 /* SSSegmentedControl.m in Sources */ = {isa = PBXBuildFile; fileRef = B247ABAD1300930200971EC0 /* SSSegmentedControl.m */; };
B24E9E43121DC29A0085F81E /* NSArray+SSToolkitAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = B24E9E05121DC29A0085F81E /* NSArray+SSToolkitAdditions.h */; };
@@ -112,6 +124,16 @@
B2FC71BB1330424F00D4FCCF /* SSCollectionViewItemInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = B2FC71BA1330424F00D4FCCF /* SSCollectionViewItemInternal.h */; };
/* End PBXBuildFile section */
+/* Begin PBXContainerItemProxy section */
+ B239105C1357DCDE00ADE21B /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = D2AAC07D0554694100DB518D /* SSToolkit */;
+ remoteInfo = SSToolkit;
+ };
+/* End PBXContainerItemProxy section */
+
/* Begin PBXFileReference section */
AACBBE490F95108600F1A2B1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
B20AC0671267988600687143 /* SSTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSTableViewController.h; sourceTree = "<group>"; };
@@ -121,6 +143,20 @@
B21D2DFF121F2FE500161E66 /* SSDrawingUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSDrawingUtilities.m; sourceTree = "<group>"; };
B227D2E8124931590078A059 /* NSDictionary+SSToolkitAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+SSToolkitAdditions.h"; sourceTree = "<group>"; };
B227D2E9124931590078A059 /* NSDictionary+SSToolkitAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+SSToolkitAdditions.m"; sourceTree = "<group>"; };
+ B239101D1357DC3E00ADE21B /* SSToolkitTests.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SSToolkitTests.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ B23910551357DC7D00ADE21B /* GHUnitIOS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = GHUnitIOS.framework; sourceTree = "<group>"; };
+ B23910561357DC7D00ADE21B /* SSToolkitTests-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "SSToolkitTests-Info.plist"; sourceTree = "<group>"; };
+ B239105B1357DCA900ADE21B /* SSToolkitTests_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSToolkitTests_Prefix.pch; sourceTree = "<group>"; };
+ B23910611357DCF700ADE21B /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = ../iphoneos3.0/System/Library/Frameworks/CoreGraphics.framework; sourceTree = "<group>"; };
+ B23910631357DCF700ADE21B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = ../iphoneos3.0/System/Library/Frameworks/Foundation.framework; sourceTree = "<group>"; };
+ B23910651357DCF700ADE21B /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = ../iphoneos3.0/System/Library/Frameworks/UIKit.framework; sourceTree = "<group>"; };
+ B23910801357DDA600ADE21B /* GHUnitIOSTestMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GHUnitIOSTestMain.m; sourceTree = "<group>"; };
+ B23910A61357DED300ADE21B /* DateCategoryTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DateCategoryTest.m; sourceTree = "<group>"; };
+ B23910A71357DED300ADE21B /* DictionaryCategoryTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DictionaryCategoryTest.m; sourceTree = "<group>"; };
+ B23910A81357DED300ADE21B /* StringCategoryTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StringCategoryTest.m; sourceTree = "<group>"; };
+ B23910BF1357E07A00ADE21B /* ArrayCategoryTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ArrayCategoryTest.m; sourceTree = "<group>"; };
+ B23910C11357E08600ADE21B /* DataCategoryTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DataCategoryTest.m; sourceTree = "<group>"; };
+ B23910C31357E08E00ADE21B /* URLCategoryTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = URLCategoryTest.m; sourceTree = "<group>"; };
B247ABAC1300930200971EC0 /* SSSegmentedControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSSegmentedControl.h; sourceTree = "<group>"; };
B247ABAD1300930200971EC0 /* SSSegmentedControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSSegmentedControl.m; sourceTree = "<group>"; };
B24E9E01121DC2910085F81E /* SSToolkit.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = SSToolkit.bundle; sourceTree = "<group>"; };
@@ -221,6 +257,18 @@
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
+ B239101B1357DC3E00ADE21B /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ B23910571357DC7D00ADE21B /* GHUnitIOS.framework in Frameworks */,
+ B23910601357DCF700ADE21B /* libSSToolkit.a in Frameworks */,
+ B23910621357DCF700ADE21B /* CoreGraphics.framework in Frameworks */,
+ B23910641357DCF700ADE21B /* Foundation.framework in Frameworks */,
+ B23910661357DCF700ADE21B /* UIKit.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
D2AAC07C0554694100DB518D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -238,6 +286,7 @@
isa = PBXGroup;
children = (
D2AAC07E0554694100DB518D /* libSSToolkit.a */,
+ B239101D1357DC3E00ADE21B /* SSToolkitTests.app */,
);
name = Products;
sourceTree = "<group>";
@@ -248,6 +297,7 @@
B24E9E04121DC29A0085F81E /* SSToolkit */,
B215045D10583A7300409ED4 /* Other Sources */,
B22A2A7F10B4908D00EA6CD9 /* Resources */,
+ B23910541357DC7D00ADE21B /* Tests */,
0867D69AFE84028FC02AAC07 /* Frameworks */,
034768DFFF38A50411DB9C8B /* Products */,
);
@@ -280,6 +330,34 @@
path = Resources;
sourceTree = "<group>";
};
+ B23910541357DC7D00ADE21B /* Tests */ = {
+ isa = PBXGroup;
+ children = (
+ B23910BF1357E07A00ADE21B /* ArrayCategoryTest.m */,
+ B23910C11357E08600ADE21B /* DataCategoryTest.m */,
+ B23910A61357DED300ADE21B /* DateCategoryTest.m */,
+ B23910A71357DED300ADE21B /* DictionaryCategoryTest.m */,
+ B23910A81357DED300ADE21B /* StringCategoryTest.m */,
+ B23910C31357E08E00ADE21B /* URLCategoryTest.m */,
+ B23910681357DD0B00ADE21B /* Frameworks */,
+ B23910801357DDA600ADE21B /* GHUnitIOSTestMain.m */,
+ B239105B1357DCA900ADE21B /* SSToolkitTests_Prefix.pch */,
+ B23910561357DC7D00ADE21B /* SSToolkitTests-Info.plist */,
+ );
+ path = Tests;
+ sourceTree = "<group>";
+ };
+ B23910681357DD0B00ADE21B /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ B23910551357DC7D00ADE21B /* GHUnitIOS.framework */,
+ B23910611357DCF700ADE21B /* CoreGraphics.framework */,
+ B23910631357DCF700ADE21B /* Foundation.framework */,
+ B23910651357DCF700ADE21B /* UIKit.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
B24E9E04121DC29A0085F81E /* SSToolkit */ = {
isa = PBXGroup;
children = (
@@ -524,6 +602,24 @@
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
+ B239101C1357DC3E00ADE21B /* SSToolkitTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = B23910221357DC3F00ADE21B /* Build configuration list for PBXNativeTarget "SSToolkitTests" */;
+ buildPhases = (
+ B23910191357DC3E00ADE21B /* Resources */,
+ B239101A1357DC3E00ADE21B /* Sources */,
+ B239101B1357DC3E00ADE21B /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ B239105D1357DCDE00ADE21B /* PBXTargetDependency */,
+ );
+ name = SSToolkitTests;
+ productName = SSToolkitTests;
+ productReference = B239101D1357DC3E00ADE21B /* SSToolkitTests.app */;
+ productType = "com.apple.product-type.application";
+ };
D2AAC07D0554694100DB518D /* SSToolkit */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "SSToolkit" */;
@@ -565,11 +661,36 @@
projectRoot = "";
targets = (
D2AAC07D0554694100DB518D /* SSToolkit */,
+ B239101C1357DC3E00ADE21B /* SSToolkitTests */,
);
};
/* End PBXProject section */
+/* Begin PBXResourcesBuildPhase section */
+ B23910191357DC3E00ADE21B /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
/* Begin PBXSourcesBuildPhase section */
+ B239101A1357DC3E00ADE21B /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ B23910811357DDA600ADE21B /* GHUnitIOSTestMain.m in Sources */,
+ B23910A91357DED300ADE21B /* DateCategoryTest.m in Sources */,
+ B23910AA1357DED300ADE21B /* DictionaryCategoryTest.m in Sources */,
+ B23910AB1357DED300ADE21B /* StringCategoryTest.m in Sources */,
+ B23910C01357E07A00ADE21B /* ArrayCategoryTest.m in Sources */,
+ B23910C21357E08600ADE21B /* DataCategoryTest.m in Sources */,
+ B23910C41357E08E00ADE21B /* URLCategoryTest.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
D2AAC07B0554694100DB518D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -626,6 +747,14 @@
};
/* End PBXSourcesBuildPhase section */
+/* Begin PBXTargetDependency section */
+ B239105D1357DCDE00ADE21B /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = D2AAC07D0554694100DB518D /* SSToolkit */;
+ targetProxy = B239105C1357DCDE00ADE21B /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
/* Begin XCBuildConfiguration section */
1DEB921F08733DC00010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
@@ -730,6 +859,71 @@
};
name = Release;
};
+ B23910201357DC3F00ADE21B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/Tests\"",
+ );
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = Tests/SSToolkitTests_Prefix.pch;
+ HEADER_SEARCH_PATHS = "\"$(SRCROOT)\"";
+ INFOPLIST_FILE = "Tests/SSToolkitTests-Info.plist";
+ INSTALL_PATH = "$(HOME)/Applications";
+ OTHER_LDFLAGS = (
+ "-framework",
+ Foundation,
+ "-framework",
+ UIKit,
+ "-all_load",
+ "-ObjC",
+ );
+ PREBINDING = NO;
+ PRODUCT_NAME = SSToolkitTests;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ B23910211357DC3F00ADE21B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/Tests\"",
+ );
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = Tests/SSToolkitTests_Prefix.pch;
+ HEADER_SEARCH_PATHS = "\"$(SRCROOT)\"";
+ INFOPLIST_FILE = "Tests/SSToolkitTests-Info.plist";
+ INSTALL_PATH = "$(HOME)/Applications";
+ OTHER_LDFLAGS = (
+ "-framework",
+ Foundation,
+ "-framework",
+ UIKit,
+ "-all_load",
+ "-ObjC",
+ );
+ PREBINDING = NO;
+ PRODUCT_NAME = SSToolkitTests;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ ZERO_LINK = NO;
+ };
+ name = Release;
+ };
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@@ -751,6 +945,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
+ B23910221357DC3F00ADE21B /* Build configuration list for PBXNativeTarget "SSToolkitTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ B23910201357DC3F00ADE21B /* Debug */,
+ B23910211357DC3F00ADE21B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
/* End XCConfigurationList section */
};
rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
View
21 Tests/ArrayCategoryTest.m
@@ -0,0 +1,21 @@
+//
+// ArrayCategoryTest.m
+// SSToolkit
+//
+// Created by Sam Soffes on 4/14/11.
+// Copyright 2011 Sam Soffes. All rights reserved.
+//
+
+#import <SSToolkit/NSArray+SSToolkitAdditions.h>
+
+@interface ArrayCategoryTest : GHTestCase
+@end
+
+@implementation ArrayCategoryTest
+
+// To test:
+//- (id)firstObject;
+//- (id)randomObject;
+//- (NSArray *)shuffledArray;
+
+@end
View
19 Tests/DataCategoryTest.m
@@ -0,0 +1,19 @@
+//
+// DataCategoryTest.m
+// SSToolkit
+//
+// Created by Sam Soffes on 4/14/11.
+// Copyright 2011 Sam Soffes. All rights reserved.
+//
+
+#import <SSToolkit/NSData+SSToolkitAdditions.h>
+
+@interface DataCategoryTest : GHTestCase
+@end
+
+@implementation DataCategoryTest
+
+// To test:
+//- (NSString *)MD5Sum;
+
+@end
View
39 Tests/DateCategoryTest.m
@@ -0,0 +1,39 @@
+//
+// DateCategoryTest.m
+// SSToolkit
+//
+// Created by Sam Soffes on 4/14/11.
+// Copyright 2011 Sam Soffes. All rights reserved.
+//
+
+#import <SSToolkit/NSDate+SSToolkitAdditions.h>
+
+@interface DateCategoryTest : GHTestCase
+@end
+
+@implementation DateCategoryTest
+
+// To test:
+//+ (NSString *)timeAgoInWordsFromTimeInterval:(NSTimeInterval)intervalInSeconds includingSeconds:(BOOL)includeSeconds;
+//- (NSString *)timeAgoInWords;
+//- (NSString *)timeAgoInWordsIncludingSeconds:(BOOL)includeSeconds;
+//- (NSString *)briefTimeAgoInWords;
+
+- (void)testDateFromISO8601String {
+ NSDate *date = [NSDate dateWithTimeIntervalSince1970:1296502956];
+ NSString *string = @"2011-01-31T19:42:36Z";
+ GHAssertEqualObjects(date, [NSDate dateFromISO8601String:string], nil);
+
+ date = [NSDate dateWithTimeIntervalSince1970:1296586675];
+ string = @"2011-02-01T10:57:55-08:00";
+ GHAssertEqualObjects(date, [NSDate dateFromISO8601String:string], nil);
+}
+
+
+- (void)testISO8601String {
+ NSDate *date = [NSDate dateWithTimeIntervalSince1970:1296502956];
+ NSString *string = @"2011-01-31T19:42:36Z";
+ GHAssertEqualObjects(string, [date ISO8601String], nil);
+}
+
+@end
View
35 Tests/DictionaryCategoryTest.m
@@ -0,0 +1,35 @@
+//
+// DictionaryCategoryTest.m
+// SSToolkit
+//
+// Created by Sam Soffes on 4/14/11.
+// Copyright 2011 Sam Soffes. All rights reserved.
+//
+
+#import <SSToolkit/NSDictionary+SSToolkitAdditions.h>
+
+@interface DictionaryCategoryTest : GHTestCase
+@end
+
+@implementation DictionaryCategoryTest
+
+- (void)testURLEncoding {
+ NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
+ @"value1", @"key1",
+ @"value2", @"key2",
+ nil];
+
+ NSString *string = [dictionary stringWithFormEncodedComponents];
+ GHAssertEqualObjects([NSDictionary dictionaryWithFormEncodedString:string], dictionary, nil);
+
+ // Go nuts
+ dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
+ @"£™¢£∞¢§∞¶•§ª¶º!@#$%^&*()", @"œ∑´∞®†¥¨ˆø",
+ @"ÎÍÏ˝ÓÔÒژ¯", @"ç√≈∫˜µ≤∆˚¬˙©",
+ nil];
+
+ string = [dictionary stringWithFormEncodedComponents];
+ GHAssertEqualObjects([NSDictionary dictionaryWithFormEncodedString:string], dictionary, nil);
+}
+
+@end
View
1  Tests/GHUnitIOS.framework/GHUnitIOS
View
1  Tests/GHUnitIOS.framework/Headers
View
1  Tests/GHUnitIOS.framework/Resources
View
BIN  Tests/GHUnitIOS.framework/Versions/A/GHUnitIOS
Binary file not shown
View
155 Tests/GHUnitIOS.framework/Versions/A/Headers/GHAsyncTestCase.h
@@ -0,0 +1,155 @@
+//
+// GHAsyncTestCase.h
+// GHUnit
+//
+// Created by Gabriel Handford on 4/8/09.
+// Copyright 2009. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#import "GHTestCase.h"
+
+// Some default statuses to use; Or define and use your own
+enum {
+ kGHUnitWaitStatusUnknown = 0, //!< Unknown wait status
+ kGHUnitWaitStatusSuccess, //!< Wait status success
+ kGHUnitWaitStatusFailure, //!< Wait status failure
+ kGHUnitWaitStatusCancelled //!< Wait status cancelled
+};
+
+/*!
+ Asynchronous test case with wait and notify.
+
+ If notify occurs before wait has started (if it was a synchronous call), this test
+ case will still work.
+
+ Be sure to call prepare before the asynchronous method (otherwise an exception will raise).
+
+ @code
+
+ @interface MyAsyncTest : GHAsyncTestCase { }
+ @end
+
+ @implementation MyAsyncTest
+
+ - (void)testSuccess {
+ [self prepare];
+
+ // Do asynchronous task here
+ [self performSelector:@selector(_succeed) withObject:nil afterDelay:0.1];
+
+ [self waitForStatus:kGHUnitWaitStatusSuccess timeout:1.0];
+ }
+
+ - (void)_succeed {
+ // Notice the forSelector points to the test above. This is so that
+ // stray notifies don't error or falsely succeed other tests.
+ // To ignore the check, forSelector can be NULL.
+ [self notify:kGHUnitWaitStatusSuccess forSelector:@selector(testSuccess)];
+ }
+
+ @end
+ @endcode
+ */
+@interface GHAsyncTestCase : GHTestCase {
+
+ NSInteger waitForStatus_;
+ NSInteger notifiedStatus_;
+
+ BOOL prepared_; // Whether prepared was called before waitForStatus:timeout:
+ NSRecursiveLock *lock_; // Lock to synchronize on
+ SEL waitSelector_; // The selector we are waiting on
+
+ NSArray *_runLoopModes;
+}
+
+/*!
+ Run loop modes to run while waiting;
+ Defaults to NSDefaultRunLoopMode, NSRunLoopCommonModes, NSConnectionReplyMode
+ */
+@property (retain, nonatomic) NSArray *runLoopModes;
+
+/*!
+ Prepare before calling the asynchronous method.
+ */
+- (void)prepare;
+
+/*!
+ Prepare and specify the selector we will use in notify.
+ @param selector
+ */
+- (void)prepare:(SEL)selector;
+
+/*!
+ Wait for notification of status or timeout.
+
+ Be sure to prepare before calling your asynchronous method.
+ For example,
+
+ @code
+ - (void)testFoo {
+ [self prepare];
+ // Do asynchronous task here
+ [self waitForStatus:kGHUnitWaitStatusSuccess timeout:1.0];
+ }
+ @endcode
+
+ @param status kGHUnitWaitStatusSuccess, kGHUnitWaitStatusFailure or custom status
+ @param timeout Timeout in seconds
+ */
+- (void)waitForStatus:(NSInteger)status timeout:(NSTimeInterval)timeout;
+
+/*!
+ @deprecated
+ */
+- (void)waitFor:(NSInteger)status timeout:(NSTimeInterval)timeout;
+
+/*!
+ Wait for timeout to occur.
+ Fails if we did _NOT_ timeout.
+ @param timeout
+ */
+- (void)waitForTimeout:(NSTimeInterval)timeout;
+
+/*!
+ Notify waiting of status for test selector.
+ @param status Status, for example, kGHUnitWaitStatusSuccess
+ @param selector If not NULL, then will verify this selector is where we are waiting.
+ This prevents stray asynchronous callbacks to fail a later test
+ */
+- (void)notify:(NSInteger)status forSelector:(SEL)selector;
+
+/*!
+ Notify waiting of status for any selector.
+ @param status Status, for example, kGHUnitWaitStatusSuccess
+ */
+- (void)notify:(NSInteger)status;
+
+/*!
+ Run the run loops for the specified interval.
+ @param interval
+ @author Adapted from Robert Palmer, pauseForTimeout
+ */
+- (void)runForInterval:(NSTimeInterval)interval;
+
+@end
View
44 Tests/GHUnitIOS.framework/Versions/A/Headers/GHTest+JUnitXML.h
@@ -0,0 +1,44 @@
+//
+// GHTest+JUnitXML.h
+// GHUnit
+//
+// Created by Gabriel Handford on 6/4/10.
+// Copyright 2010. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+//! @cond DEV
+
+#import "GHTest.h"
+
+@interface GHTest(JUnitXML)
+
+/*!
+ Return test results in JUnit XML format for external parsing use
+ (such as a Continuous Integration system like Hudson)
+ */
+- (NSString *)JUnitXML;
+
+@end
+
+//! @endcond
View
184 Tests/GHUnitIOS.framework/Versions/A/Headers/GHTest.h
@@ -0,0 +1,184 @@
+//
+// GHTest.h
+// GHUnit
+//
+// Created by Gabriel Handford on 1/18/09.
+// Copyright 2009. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+//! @cond DEV
+
+/*!
+ Test status.
+ */
+typedef enum {
+ GHTestStatusNone = 0,
+ GHTestStatusRunning, // Test is running
+ GHTestStatusCancelling, // Test is being cancelled
+ GHTestStatusCancelled, // Test was cancelled
+ GHTestStatusSucceeded, // Test finished and succeeded
+ GHTestStatusErrored, // Test finished and errored
+} GHTestStatus;
+
+enum {
+ GHTestOptionReraiseExceptions = 1 << 0, // Allows exceptions to be raised (so you can trigger the debugger)
+ GHTestOptionForceSetUpTearDownClass = 1 << 1, // Runs setUpClass/tearDownClass for this (each) test; Used when re-running a single test in a group
+};
+typedef NSInteger GHTestOptions;
+
+/*!
+ Generate string from GHTestStatus
+ @param status
+ */
+extern NSString* NSStringFromGHTestStatus(GHTestStatus status);
+
+/*!
+ Check if test is running (or trying to cancel).
+ */
+extern BOOL GHTestStatusIsRunning(GHTestStatus status);
+
+/*!
+ Check if test has succeeded, errored or cancelled.
+ */
+extern BOOL GHTestStatusEnded(GHTestStatus status);
+
+/*!
+ Test stats.
+ */
+typedef struct {
+ NSInteger succeedCount; // Number of succeeded tests
+ NSInteger failureCount; // Number of failed tests
+ NSInteger cancelCount; // Number of aborted tests
+ NSInteger testCount; // Total number of tests
+} GHTestStats;
+
+/*!
+ Create GHTestStats.
+ */
+extern GHTestStats GHTestStatsMake(NSInteger succeedCount, NSInteger failureCount, NSInteger cancelCount, NSInteger testCount);
+
+extern const GHTestStats GHTestStatsEmpty;
+
+extern NSString *NSStringFromGHTestStats(GHTestStats stats);
+
+@protocol GHTestDelegate;
+
+/*!
+ The base interface for a runnable test.
+ A runnable with a unique identifier, display name, stats, timer, delegate, log and error handling.
+ */
+@protocol GHTest <NSObject, NSCoding, NSCopying>
+
+- (void)run:(GHTestOptions)options;
+
+@property (readonly, nonatomic) NSString *identifier; // Unique identifier for test
+@property (readonly, nonatomic) NSString *name;
+@property (assign, nonatomic) NSTimeInterval interval;
+@property (assign, nonatomic) GHTestStatus status;
+@property (readonly, nonatomic) GHTestStats stats;
+@property (retain, nonatomic) NSException *exception;
+@property (assign, nonatomic, getter=isDisabled) BOOL disabled;
+@property (assign, nonatomic, getter=isHidden) BOOL hidden;
+@property (assign, nonatomic) id<GHTestDelegate> delegate; // weak
+
+- (NSArray *)log;
+
+- (void)reset;
+- (void)cancel;
+
+- (NSInteger)disabledCount;
+
+@end
+
+/*!
+ Test delegate for notification when a test starts and ends.
+ */
+@protocol GHTestDelegate <NSObject>
+- (void)testDidStart:(id<GHTest>)test source:(id<GHTest>)source;
+- (void)testDidUpdate:(id<GHTest>)test source:(id<GHTest>)source;
+- (void)testDidEnd:(id<GHTest>)test source:(id<GHTest>)source;
+- (void)test:(id<GHTest>)test didLog:(NSString *)message source:(id<GHTest>)source;
+@end
+
+/*!
+ Delegate which is notified of log messages from inside GHTestCase.
+ */
+@protocol GHTestCaseLogWriter <NSObject>
+- (void)log:(NSString *)message testCase:(id)testCase;
+@end
+
+/*!
+ Default test implementation with a target/selector pair.
+ - Tests a target and selector
+ - Notifies a test delegate
+ - Keeps track of status, running time and failures
+ - Stores any test specific logging
+ */
+@interface GHTest : NSObject <GHTest, GHTestCaseLogWriter> {
+
+ NSObject<GHTestDelegate> *delegate_; // weak
+
+ id target_;
+ SEL selector_;
+
+ NSString *identifier_;
+ NSString *name_;
+ GHTestStatus status_;
+ NSTimeInterval interval_;
+ BOOL disabled_;
+ BOOL hidden_;
+ NSException *exception_; // If failed
+
+ NSMutableArray *log_;
+
+}
+
+@property (readonly, nonatomic) id target;
+@property (readonly, nonatomic) SEL selector;
+@property (readonly, nonatomic) NSArray *log;
+
+/*!
+ Create test with identifier, name.
+ @param identifier Unique identifier
+ @param name Name
+ */
+- (id)initWithIdentifier:(NSString *)identifier name:(NSString *)name;
+
+/*!
+ Create test with target/selector.
+ @param target Target (usually a test case)
+ @param selector Selector (usually a test method)
+ */
+- (id)initWithTarget:(id)target selector:(SEL)selector;
+
+/*!
+ Create autoreleased test with target/selector.
+ @param target Target (usually a test case)
+ @param selector Selector (usually a test method)
+ */
++ (id)testWithTarget:(id)target selector:(SEL)selector;
+
+@end
+
+//! @endcond
View
146 Tests/GHUnitIOS.framework/Versions/A/Headers/GHTestCase.h
@@ -0,0 +1,146 @@
+//
+// GHTestCase.h
+// GHUnit
+//
+// Created by Gabriel Handford on 1/21/09.
+// Copyright 2009. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+//
+// Portions of this file fall under the following license, marked with:
+// GTM_BEGIN : GTM_END
+//
+// Copyright 2008 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy
+// of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+//
+
+#import "GHTestMacros.h"
+#import "GHTest.h"
+
+/*!
+ Log to your test case logger.
+ For example,
+ @code
+ GHTestLog(@"Some debug info, %@", obj);
+ @endcode
+ */
+#define GHTestLog(...) [self log:[NSString stringWithFormat:__VA_ARGS__, nil]]
+
+/*!
+ The base class for a test case.
+
+ @code
+ @interface MyTest : GHTestCase {}
+ @end
+
+ @implementation MyTest
+
+ // Run before each test method
+ - (void)setUp { }
+
+ // Run after each test method
+ - (void)tearDown { }
+
+ // Run before the tests are run for this class
+ - (void)setUpClass { }
+
+ // Run before the tests are run for this class
+ - (void)tearDownClass { }
+
+ // Tests are prefixed by 'test' and contain no arguments and no return value
+ - (void)testA {
+ GHTestLog(@"Log with a test with the GHTestLog(...) for test specific logging.");
+ }
+
+ // Another test; Tests are run in lexical order
+ - (void)testB { }
+
+ // Override any exceptions; By default exceptions are raised, causing a test failure
+ - (void)failWithException:(NSException *)exception { }
+
+ @end
+ @endcode
+
+ */
+@interface GHTestCase : NSObject {
+ id<GHTestCaseLogWriter> logWriter_; // weak
+
+ SEL currentSelector_;
+}
+
+//! The current test selector
+@property (assign, nonatomic) SEL currentSelector;
+@property (assign, nonatomic) id<GHTestCaseLogWriter> logWriter;
+
+// GTM_BEGIN
+//! Run before each test method
+- (void)setUp;
+
+//! Run after each test method
+- (void)tearDown;
+
+/*!
+ By default exceptions are raised, causing a test failure
+ @brief Override any exceptions
+ @param exception Exception that was raised by test
+ */
+- (void)failWithException:(NSException*)exception;
+// GTM_END
+
+//! Run before the tests (once per test case)
+- (void)setUpClass;
+
+//! Run after the tests (once per test case)
+- (void)tearDownClass;
+
+/*!
+ Whether to run the tests on a separate thread. Override this method in your
+ test case to override the default.
+ Default is NO, tests are run on a separate thread by default.
+ @result If YES runs on the main thread
+ */
+- (BOOL)shouldRunOnMainThread;
+
+//! Any special handling of exceptions after they are thrown; By default logs stack trace to standard out.
+- (void)handleException:(NSException *)exception;
+
+/*!
+ Log a message, which notifies the log delegate.
+ This is not meant to be used directly, see GHTestLog(...) macro.
+ @param message
+ */
+- (void)log:(NSString *)message;
+
+@end
View
42 Tests/GHUnitIOS.framework/Versions/A/Headers/GHTestGroup+JUnitXML.h
@@ -0,0 +1,42 @@
+//
+// GHTestGroup+JUnitXML.h
+// GHUnit
+//
+// Created by Gabriel Handford on 6/4/10.
+// Copyright 2010. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+//! @cond DEV
+
+#import "GHTestGroup.h"
+
+@interface GHTestGroup(JUnitXML)
+
+- (NSString *)JUnitXML;
+
+- (BOOL)writeJUnitXMLAtPath:(NSString *)documentsPath error:(NSError **)error;
+
+@end
+
+//! @endcond
View
176 Tests/GHUnitIOS.framework/Versions/A/Headers/GHTestGroup.h
@@ -0,0 +1,176 @@
+//
+// GHTestGroup.h
+//
+// Created by Gabriel Handford on 1/16/09.
+// Copyright 2009. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+//! @cond DEV
+
+#import "GHTest.h"
+#import "GHTestCase.h"
+
+/*!
+ @brief Interface for a group of tests.
+
+ This group conforms to the GHTest protocol as well (see Composite pattern).
+ */
+@protocol GHTestGroup <GHTest>
+- (NSString *)name;
+- (id<GHTestGroup>)parent;
+- (NSArray *)children;
+@end
+
+/*!
+ @brief A collection of tests (or test groups).
+
+ A test group is a collection of id<GHTest>, that may represent a set of test case methods.
+
+ For example, if you had the following GHTestCase.
+
+ @code
+ @interface FooTest : GHTestCase {}
+ - (void)testFoo;
+ - (void)testBar;
+ @end
+ @endcode
+
+ The GHTestGroup would consist of and array of GHTest, [FooTest#testFoo and FooTest#testBar],
+ each test being a target and selector pair.
+
+ A test group may also consist of a group of groups (since GHTestGroup conforms to GHTest),
+ and this might represent a GHTestSuite.
+ */
+@interface GHTestGroup : NSObject <GHTestDelegate, GHTestGroup> {
+
+ NSObject<GHTestDelegate> *delegate_; // weak
+ id<GHTestGroup> parent_; // weak
+
+ NSMutableArray */*of id<GHTest>*/children_;
+
+ NSString *name_; // The name of the test group (usually the class name of the test case
+ NSTimeInterval interval_; // Total time of child tests
+ GHTestStatus status_; // Current status of the group (current status of running or completed child tests)
+ GHTestStats stats_; // Current stats for the group (aggregate of child test stats)
+
+ BOOL didSetUpClass_;
+
+ GHTestOptions options_;
+
+ // Set if test is created from initWithTestCase:delegate:
+ // Allows use to perform setUpClass and tearDownClass (once per test case run)
+ id testCase_;
+
+ NSException *exception_; // If exception happens in group setUpClass/tearDownClass
+}
+
+@property (readonly, nonatomic) NSArray */*of id<GHTest>*/children;
+@property (assign, nonatomic) id<GHTestGroup> parent;
+@property (readonly, nonatomic) id testCase;
+@property (assign, nonatomic) GHTestOptions options;
+
+/*!
+ Create an empty test group.
+ @param name The name of the test group
+ @param delegate Delegate, notifies of test start and end
+ @result New test group
+ */
+- (id)initWithName:(NSString *)name delegate:(id<GHTestDelegate>)delegate;
+
+/*!
+ Create test group from a test case.
+ @param testCase Test case, could be a subclass of SenTestCase or GHTestCase
+ @param delegate Delegate, notifies of test start and end
+ @result New test group
+ */
+- (id)initWithTestCase:(id)testCase delegate:(id<GHTestDelegate>)delegate;
+
+/*!
+ Create test group from a single test.
+ @param testCase
+ @param selector Test to run
+ @param delegate
+ */
+- (id)initWithTestCase:(id)testCase selector:(SEL)selector delegate:(id<GHTestDelegate>)delegate;
+
+/*!
+ Create test group from a test case.
+ @param testCase Test case, could be a subclass of SenTestCase or GHTestCase
+ @param delegate Delegate, notifies of test start and end
+ @result New test group
+ */
++ (GHTestGroup *)testGroupFromTestCase:(id)testCase delegate:(id<GHTestDelegate>)delegate;
+
+/*!
+ Add a test case (or test group) to this test group.
+ @param testCase Test case, could be a subclass of SenTestCase or GHTestCase
+ */
+- (void)addTestCase:(id)testCase;
+
+/*!
+ Add a test group to this test group.
+ @param testGroup Test group to add
+ */
+- (void)addTestGroup:(GHTestGroup *)testGroup;
+
+/*!
+ Add tests to this group.
+ @param tests Tests to add
+ */
+- (void)addTests:(NSArray */*of id<GHTest>*/)tests;
+
+/*!
+ Add test to this group.
+ @param test Test to add
+ */
+- (void)addTest:(id<GHTest>)test;
+
+/*!
+ Whether the test group should run on the main thread.
+ Call passes to test case instance if enabled.
+ */
+- (BOOL)shouldRunOnMainThread;
+
+/*!
+ @result YES if we have any enabled chilren, NO if all children have been disabled.
+ */
+- (BOOL)hasEnabledChildren;
+
+/*!
+ Get list of failed tests.
+ @result Failed tests
+ */
+- (NSArray */*of id<GHTest>*/)failedTests;
+
+/*!
+ Run in operation queue.
+ Tests from the group are added and will block until they have completed.
+ @param operationQueue If nil, then runs as is
+ @param options Options
+ */
+- (void)runInOperationQueue:(NSOperationQueue *)operationQueue options:(GHTestOptions)options;
+
+@end
+
+//! @endcond
View
1,012 Tests/GHUnitIOS.framework/Versions/A/Headers/GHTestMacros.h
@@ -0,0 +1,1012 @@
+//
+// GHTestMacros.h
+//
+// Created by Gabriel Handford on 1/17/09.
+// Copyright 2009. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+//
+// Portions of this file fall under the following license, marked with
+// SENTE_BEGIN - SENTE_END
+//
+// Copyright (c) 1997-2005, Sen:te (Sente SA). All rights reserved.
+//
+// Use of this source code is governed by the following license:
+//
+// Redistribution and use in source and binary forms, with or without modification,
+// are permitted provided that the following conditions are met:
+//
+// (1) Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+//
+// (2) Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+// IN NO EVENT SHALL Sente SA OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+// OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Note: this license is equivalent to the FreeBSD license.
+//
+// This notice may not be removed from this file.
+
+//
+// Portions of this file fall under the following license, marked with:
+// GTM_BEGIN : GTM_END
+//
+// Copyright 2008 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy
+// of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+//
+
+/*!
+ @file GHTestMacros.h
+ @brief Assert macros for testing.
+ */
+
+#import "NSException+GHTestFailureExceptions.h"
+#import "NSValue+GHValueFormatter.h"
+
+// GTM_BEGIN
+
+extern NSString *const GHTestFilenameKey;
+extern NSString *const GHTestLineNumberKey;
+extern NSString *const GHTestFailureException;
+
+#if defined(__cplusplus)
+extern "C"
+#endif
+
+NSString *GHComposeString(NSString *, ...);
+
+
+/*!
+ Generates a failure when a1 != noErr
+ @param a1 Should be either an OSErr or an OSStatus
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ...: A variable number of arguments to the format string. Can be absent.
+ */
+#define GHAssertNoErr(a1, description, ...) \
+do { \
+@try {\
+OSStatus a1value = (a1); \
+if (a1value != noErr) { \
+NSString *_expression = [NSString stringWithFormat:@"Expected noErr, got %ld for (%s)", a1value, #a1]; \
+if (description) { \
+_expression = [NSString stringWithFormat:@"%@: %@", _expression, GHComposeString(description, ##__VA_ARGS__)]; \
+} \
+[self failWithException:[NSException ghu_failureInFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:_expression]]; \
+} \
+}\
+@catch (id anException) {\
+[self failWithException:[NSException ghu_failureInRaise:[NSString stringWithFormat:@"(%s) == noErr fails", #a1] \
+exception:anException \
+inFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+} while(0)
+
+/*!
+ Generates a failure when a1 != a2
+ @param a1 Rreceived value. Should be either an OSErr or an OSStatus
+ @param a2 Expected value. Should be either an OSErr or an OSStatus
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
+#define GHAssertErr(a1, a2, description, ...) \
+do { \
+@try {\
+OSStatus a1value = (a1); \
+OSStatus a2value = (a2); \
+if (a1value != a2value) { \
+NSString *_expression = [NSString stringWithFormat:@"Expected %s(%ld) but got %ld for (%s)", #a2, a2value, a1value, #a1]; \
+if (description) { \
+_expression = [NSString stringWithFormat:@"%@: %@", _expression, GHComposeString(description, ##__VA_ARGS__)]; \
+} \
+[self failWithException:[NSException ghu_failureInFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:_expression]]; \
+} \
+}\
+@catch (id anException) {\
+[self failWithException:[NSException ghu_failureInRaise:[NSString stringWithFormat:@"(%s) == (%s) fails", #a1, #a2] \
+exception:anException \
+inFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+} while(0)
+
+
+/*!
+ Generates a failure when a1 is NULL
+ @param a1 Should be a pointer (use GHAssertNotNil for an object)
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
+#define GHAssertNotNULL(a1, description, ...) \
+do { \
+@try {\
+const void* a1value = (a1); \
+if (a1value == NULL) { \
+NSString *_expression = [NSString stringWithFormat:@"(%s) != NULL", #a1]; \
+if (description) { \
+_expression = [NSString stringWithFormat:@"%@: %@", _expression, GHComposeString(description, ##__VA_ARGS__)]; \
+} \
+[self failWithException:[NSException ghu_failureInFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:_expression]]; \
+} \
+}\
+@catch (id anException) {\
+[self failWithException:[NSException ghu_failureInRaise:[NSString stringWithFormat:@"(%s) != NULL fails", #a1] \
+exception:anException \
+inFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+} while(0)
+
+/*!
+ Generates a failure when a1 is not NULL
+ @param a1 should be a pointer (use GHAssertNil for an object)
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
+#define GHAssertNULL(a1, description, ...) \
+do { \
+@try {\
+const void* a1value = (a1); \
+if (a1value != NULL) { \
+NSString *_expression = [NSString stringWithFormat:@"(%s) == NULL", #a1]; \
+if (description) { \
+_expression = [NSString stringWithFormat:@"%@: %@", _expression, GHComposeString(description, ##__VA_ARGS__)]; \
+} \
+[self failWithException:[NSException ghu_failureInFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:_expression]]; \
+} \
+}\
+@catch (id anException) {\
+[self failWithException:[NSException ghu_failureInRaise:[NSString stringWithFormat:@"(%s) == NULL fails", #a1] \
+exception:anException \
+inFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+} while(0)
+
+/*!
+ Generates a failure when a1 is equal to a2. This test is for C scalars, structs and unions.
+ @param a1 Argument 1
+ @param a2 Argument 2
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
+#define GHAssertNotEquals(a1, a2, description, ...) \
+do { \
+@try {\
+if (strcmp(@encode(__typeof__(a1)), @encode(__typeof__(a2))) != 0) { \
+[self failWithException:[NSException ghu_failureInFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:[@"Type mismatch -- " stringByAppendingString:GHComposeString(description, ##__VA_ARGS__)]]]; \
+} else { \
+__typeof__(a1) a1value = (a1); \
+__typeof__(a2) a2value = (a2); \
+NSValue *a1encoded = [NSValue value:&a1value withObjCType:@encode(__typeof__(a1))]; \
+NSValue *a2encoded = [NSValue value:&a2value withObjCType:@encode(__typeof__(a2))]; \
+if ([a1encoded isEqualToValue:a2encoded]) { \
+NSString *_expression = [NSString stringWithFormat:@"(%s) != (%s)", #a1, #a2]; \
+if (description) { \
+_expression = [NSString stringWithFormat:@"%@: %@", _expression, GHComposeString(description, ##__VA_ARGS__)]; \
+} \
+[self failWithException:[NSException ghu_failureInFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:_expression]]; \
+} \
+} \
+} \
+@catch (id anException) {\
+[self failWithException:[NSException ghu_failureInRaise:[NSString stringWithFormat:@"(%s) != (%s)", #a1, #a2] \
+exception:anException \
+inFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+} while(0)
+
+/*!
+ Generates a failure when a1 is equal to a2. This test is for objects.
+ @param a1 Argument 1. object.
+ @param a2 Argument 2. object.
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
+#define GHAssertNotEqualObjects(a1, a2, desc, ...) \
+do { \
+@try {\
+id a1value = (a1); \
+id a2value = (a2); \
+if ( (strcmp(@encode(__typeof__(a1value)), @encode(id)) == 0) && \
+(strcmp(@encode(__typeof__(a2value)), @encode(id)) == 0) && \
+![(id)a1value isEqual:(id)a2value] ) continue; \
+NSString *_expression = [NSString stringWithFormat:@"%s('%@') != %s('%@')", #a1, [a1 description], #a2, [a2 description]]; \
+if (desc) { \
+_expression = [NSString stringWithFormat:@"%@: %@", _expression, GHComposeString(desc, ##__VA_ARGS__)]; \
+} \
+[self failWithException:[NSException ghu_failureInFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:_expression]]; \
+}\
+@catch (id anException) {\
+[self failWithException:[NSException ghu_failureInRaise:[NSString stringWithFormat: @"(%s) != (%s)", #a1, #a2] \
+exception:anException \
+inFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:GHComposeString(desc, ##__VA_ARGS__)]]; \
+}\
+} while(0)
+
+/*!
+ Generates a failure when a1 is not 'op' to a2. This test is for C scalars.
+ @param a1 Argument 1
+ @param a2 Argument 2
+ @param op Operation
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
+#define GHAssertOperation(a1, a2, op, description, ...) \
+do { \
+@try {\
+if (strcmp(@encode(__typeof__(a1)), @encode(__typeof__(a2))) != 0) { \
+[self failWithException:[NSException ghu_failureInFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:[@"Type mismatch -- " stringByAppendingString:GHComposeString(description, ##__VA_ARGS__)]]]; \
+} else { \
+__typeof__(a1) a1value = (a1); \
+__typeof__(a2) a2value = (a2); \
+if (!(a1value op a2value)) { \
+double a1DoubleValue = a1value; \
+double a2DoubleValue = a2value; \
+NSString *_expression = [NSString stringWithFormat:@"%s (%lg) %s %s (%lg)", #a1, a1DoubleValue, #op, #a2, a2DoubleValue]; \
+if (description) { \
+_expression = [NSString stringWithFormat:@"%@: %@", _expression, GHComposeString(description, ##__VA_ARGS__)]; \
+} \
+[self failWithException:[NSException ghu_failureInFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:_expression]]; \
+} \
+} \
+} \
+@catch (id anException) {\
+[self failWithException:[NSException \
+ghu_failureInRaise:[NSString stringWithFormat:@"(%s) %s (%s)", #a1, #op, #a2] \
+exception:anException \
+inFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+} while(0)
+
+/*!
+ Generates a failure when a1 is not > a2. This test is for C scalars.
+ @param a1 argument 1
+ @param a2 argument 2
+ @param op operation
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
+#define GHAssertGreaterThan(a1, a2, description, ...) \
+GHAssertOperation(a1, a2, >, description, ##__VA_ARGS__)
+
+/*!
+ Generates a failure when a1 is not >= a2. This test is for C scalars.
+ @param a1 argument 1
+ @param a2 argument 2
+ @param op operation
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
+#define GHAssertGreaterThanOrEqual(a1, a2, description, ...) \
+GHAssertOperation(a1, a2, >=, description, ##__VA_ARGS__)
+
+/*!
+ Generates a failure when a1 is not < a2. This test is for C scalars.
+ @param a1 argument 1
+ @param a2 argument 2
+ @param op operation
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
+#define GHAssertLessThan(a1, a2, description, ...) \
+GHAssertOperation(a1, a2, <, description, ##__VA_ARGS__)
+
+/*! Generates a failure when a1 is not <= a2. This test is for C scalars.
+ @param a1 argument 1
+ @param a2 argument 2
+ @param op operation
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
+#define GHAssertLessThanOrEqual(a1, a2, description, ...) \
+GHAssertOperation(a1, a2, <=, description, ##__VA_ARGS__)
+
+/*!
+ Generates a failure when string a1 is not equal to string a2. This call
+ differs from GHAssertEqualObjects in that strings that are different in
+ composition (precomposed vs decomposed) will compare equal if their final
+ representation is equal.
+ ex O + umlaut decomposed is the same as O + umlaut composed.
+ @param a1 string 1
+ @param a2 string 2
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
+#define GHAssertEqualStrings(a1, a2, description, ...) \
+do { \
+@try {\
+id a1value = (a1); \
+id a2value = (a2); \
+if (a1value == a2value) continue; \
+if ([a1value isKindOfClass:[NSString class]] && \
+[a2value isKindOfClass:[NSString class]] && \
+[a1value compare:a2value options:0] == NSOrderedSame) continue; \
+[self failWithException:[NSException ghu_failureInEqualityBetweenObject: a1value \
+andObject: a2value \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+@catch (id anException) {\
+[self failWithException:[NSException ghu_failureInRaise:[NSString stringWithFormat: @"(%s) == (%s)", #a1, #a2] \
+exception:anException \
+inFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+} while(0)
+
+/*!
+ Generates a failure when string a1 is equal to string a2. This call
+ differs from GHAssertEqualObjects in that strings that are different in
+ composition (precomposed vs decomposed) will compare equal if their final
+ representation is equal.
+ ex O + umlaut decomposed is the same as O + umlaut composed.
+ @param a1 string 1
+ @param a2 string 2
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
+#define GHAssertNotEqualStrings(a1, a2, description, ...) \
+do { \
+@try {\
+id a1value = (a1); \
+id a2value = (a2); \
+if (([a1value isKindOfClass:[NSString class]] && \
+[a2value isKindOfClass:[NSString class]] && \
+[a1value compare:a2value options:0] != NSOrderedSame) || \
+(a1value == nil && [a2value isKindOfClass:[NSString class]]) || \
+(a2value == nil && [a1value isKindOfClass:[NSString class]]) \
+) continue; \
+[self failWithException:[NSException ghu_failureInInequalityBetweenObject: a1value \
+andObject: a2value \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+@catch (id anException) {\
+[self failWithException:[NSException ghu_failureInRaise:[NSString stringWithFormat: @"(%s) != (%s)", #a1, #a2] \
+exception:anException \
+inFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+} while(0)
+
+/*!
+ Generates a failure when c-string a1 is not equal to c-string a2.
+ @param a1 string 1
+ @param a2 string 2
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
+#define GHAssertEqualCStrings(a1, a2, description, ...) \
+do { \
+@try {\
+const char* a1value = (a1); \
+const char* a2value = (a2); \
+if (a1value == a2value) continue; \
+if (strcmp(a1value, a2value) == 0) continue; \
+[self failWithException:[NSException ghu_failureInEqualityBetweenObject: [NSString stringWithUTF8String:a1value] \
+andObject: [NSString stringWithUTF8String:a2value] \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+@catch (id anException) {\
+[self failWithException:[NSException ghu_failureInRaise:[NSString stringWithFormat: @"(%s) == (%s)", #a1, #a2] \
+exception:anException \
+inFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+} while(0)
+
+/*!
+ Generates a failure when c-string a1 is equal to c-string a2.
+ @param a1 string 1
+ @param a2 string 2
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
+#define GHAssertNotEqualCStrings(a1, a2, description, ...) \
+do { \
+@try {\
+const char* a1value = (a1); \
+const char* a2value = (a2); \
+if (strcmp(a1value, a2value) != 0) continue; \
+[self failWithException:[NSException ghu_failureInEqualityBetweenObject: [NSString stringWithUTF8String:a1value] \
+andObject: [NSString stringWithUTF8String:a2value] \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+@catch (id anException) {\
+[self failWithException:[NSException ghu_failureInRaise:[NSString stringWithFormat: @"(%s) != (%s)", #a1, #a2] \
+exception:anException \
+inFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+} while(0)
+
+// GTM_END
+
+// SENTE_BEGIN
+/*! Generates a failure when !{ [a1 isEqualTo:a2] } is false
+ (or one is nil and the other is not).
+ @param a1 The object on the left
+ @param a2 The object on the right
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
+#define GHAssertEqualObjects(a1, a2, description, ...) \
+do { \
+@try {\
+id a1value = (a1); \
+id a2value = (a2); \
+if (a1value == a2value) continue; \
+if ( (strcmp(@encode(__typeof__(a1value)), @encode(id)) == 0) && \
+(strcmp(@encode(__typeof__(a2value)), @encode(id)) == 0) && \
+[(id)a1value isEqual: (id)a2value] ) continue; \
+[self failWithException:[NSException ghu_failureInEqualityBetweenObject: a1value \
+andObject: a2value \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+@catch (id anException) {\
+[self failWithException:[NSException ghu_failureInRaise:[NSString stringWithFormat: @"(%s) == (%s)", #a1, #a2] \
+exception:anException \
+inFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+} while(0)
+
+
+/*! Generates a failure when a1 is not equal to a2. This test is for
+ C scalars, structs and unions.
+ @param a1 The argument on the left
+ @param a2 The argument on the right
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
+#define GHAssertEquals(a1, a2, description, ...) \
+do { \
+@try {\
+if ( strcmp(@encode(__typeof__(a1)), @encode(__typeof__(a2))) != 0 ) { \
+[self failWithException:[NSException ghu_failureInFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:[@"Type mismatch -- " stringByAppendingString:GHComposeString(description, ##__VA_ARGS__)]]]; \
+} else { \
+__typeof__(a1) a1value = (a1); \
+__typeof__(a2) a2value = (a2); \
+NSValue *a1encoded = [NSValue value:&a1value withObjCType: @encode(__typeof__(a1))]; \
+NSValue *a2encoded = [NSValue value:&a2value withObjCType: @encode(__typeof__(a2))]; \
+if (![a1encoded isEqualToValue:a2encoded]) { \
+[self failWithException:[NSException ghu_failureInEqualityBetweenValue: a1encoded \
+andValue: a2encoded \
+withAccuracy: nil \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
+} \
+} \
+} \
+@catch (id anException) {\
+[self failWithException:[NSException ghu_failureInRaise:[NSString stringWithFormat: @"(%s) == (%s)", #a1, #a2] \
+exception:anException \
+inFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+} while(0)
+
+//! Absolute difference
+#define GHAbsoluteDifference(left,right) (MAX(left,right)-MIN(left,right))
+
+
+/*!
+ Generates a failure when a1 is not equal to a2 within + or - accuracy is false.
+ This test is for scalars such as floats and doubles where small differences
+ could make these items not exactly equal, but also works for all scalars.
+ @param a1 The scalar on the left
+ @param a2 The scalar on the right
+ @param accuracy The maximum difference between a1 and a2 for these values to be considered equal
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
+#define GHAssertEqualsWithAccuracy(a1, a2, accuracy, description, ...) \
+do { \
+@try {\
+if (strcmp(@encode(__typeof__(a1)), @encode(__typeof__(a2))) != 0) { \
+[self failWithException:[NSException ghu_failureInFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:[@"Type mismatch -- " stringByAppendingString:GHComposeString(description, ##__VA_ARGS__)]]]; \
+} else { \
+__typeof__(a1) a1value = (a1); \
+__typeof__(a2) a2value = (a2); \
+__typeof__(accuracy) accuracyvalue = (accuracy); \
+if (GHAbsoluteDifference(a1value, a2value) > accuracyvalue) { \
+NSValue *a1encoded = [NSValue value:&a1value withObjCType:@encode(__typeof__(a1))]; \
+NSValue *a2encoded = [NSValue value:&a2value withObjCType:@encode(__typeof__(a2))]; \
+NSValue *accuracyencoded = [NSValue value:&accuracyvalue withObjCType:@encode(__typeof__(accuracy))]; \
+[self failWithException:[NSException ghu_failureInEqualityBetweenValue: a1encoded \
+andValue: a2encoded \
+withAccuracy: accuracyencoded \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
+} \
+} \
+} \
+@catch (id anException) {\
+[self failWithException:[NSException ghu_failureInRaise:[NSString stringWithFormat: @"(%s) == (%s)", #a1, #a2] \
+exception:anException \
+inFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+} while(0)
+
+
+
+/*! Generates a failure unconditionally.
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
+#define GHFail(description, ...) \
+[self failWithException:[NSException ghu_failureInFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(description, ##__VA_ARGS__)]]
+
+
+
+/*! Generates a failure when a1 is not nil.
+ @param a1 An object
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
+#define GHAssertNil(a1, description, ...) \
+do { \
+@try {\
+id a1value = (a1); \
+if (a1value != nil) { \
+NSString *_a1 = [NSString stringWithUTF8String: #a1]; \
+NSString *_expression = [NSString stringWithFormat:@"((%@) == nil)", _a1]; \
+[self failWithException:[NSException ghu_failureInCondition: _expression \
+isTrue: NO \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
+} \
+}\
+@catch (id anException) {\
+[self failWithException:[NSException ghu_failureInRaise:[NSString stringWithFormat: @"(%s) == nil fails", #a1] \
+exception:anException \
+inFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+} while(0)
+
+
+/*! Generates a failure when a1 is nil.
+ @param a1 An object
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
+#define GHAssertNotNil(a1, description, ...) \
+do { \
+@try {\
+id a1value = (a1); \
+if (a1value == nil) { \
+NSString *_a1 = [NSString stringWithUTF8String: #a1]; \
+NSString *_expression = [NSString stringWithFormat:@"((%@) != nil)", _a1]; \
+[self failWithException:[NSException ghu_failureInCondition: _expression \
+isTrue: NO \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
+} \
+}\
+@catch (id anException) {\
+[self failWithException:[NSException ghu_failureInRaise:[NSString stringWithFormat: @"(%s) != nil fails", #a1] \
+exception:anException \
+inFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+} while(0)
+
+
+/*!
+ Generates a failure when expression evaluates to false.
+ @param expr The expression that is tested
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
+#define GHAssertTrue(expr, description, ...) \
+do { \
+BOOL _evaluatedExpression = (expr);\
+if (!_evaluatedExpression) {\
+NSString *_expression = [NSString stringWithUTF8String: #expr];\
+[self failWithException:[NSException ghu_failureInCondition: _expression \
+isTrue: YES \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
+} \
+} while (0)
+
+
+/*!
+ Generates a failure when expression evaluates to false and in addition will
+ generate error messages if an exception is encountered.
+
+ @param expr The expression that is tested
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
+#define GHAssertTrueNoThrow(expr, description, ...) \
+do { \
+@try {\
+BOOL _evaluatedExpression = (expr);\
+if (!_evaluatedExpression) {\
+NSString *_expression = [NSString stringWithUTF8String: #expr];\
+[self failWithException:[NSException ghu_failureInCondition: _expression \
+isTrue: NO \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
+} \
+} \
+@catch (id anException) {\
+[self failWithException:[NSException ghu_failureInRaise:[NSString stringWithFormat: @"(%s) ", #expr] \
+exception:anException \
+inFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+} while (0)
+
+
+/*! Generates a failure when the expression evaluates to true.
+ @param expr The expression that is tested
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
+#define GHAssertFalse(expr, description, ...) \
+do { \
+BOOL _evaluatedExpression = (expr);\
+if (_evaluatedExpression) {\
+NSString *_expression = [NSString stringWithUTF8String: #expr];\
+[self failWithException:[NSException ghu_failureInCondition: _expression \
+isTrue: NO \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
+} \
+} while (0)
+
+
+/*! Generates a failure when the expression evaluates to true and in addition
+ will generate error messages if an exception is encountered.
+ @param expr The expression that is tested
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
+#define GHAssertFalseNoThrow(expr, description, ...) \
+do { \
+@try {\
+BOOL _evaluatedExpression = (expr);\
+if (_evaluatedExpression) {\
+NSString *_expression = [NSString stringWithUTF8String: #expr];\
+[self failWithException:[NSException ghu_failureInCondition: _expression \
+isTrue: YES \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
+} \
+} \
+@catch (id anException) {\
+[self failWithException:[NSException ghu_failureInRaise:[NSString stringWithFormat: @"!(%s) ", #expr] \
+exception:anException \
+inFile:[NSString stringWithUTF8String:__FILE__] \
+atLine:__LINE__ \
+withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+} while (0)
+
+
+/*! Generates a failure when expression does not throw an exception.
+ @param expression The expression that is evaluated
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
+#define GHAssertThrows(expr, description, ...) \
+do { \
+@try { \
+(expr);\
+} \
+@catch (id anException) { \
+continue; \
+}\
+[self failWithException:[NSException ghu_failureInRaise: [NSString stringWithUTF8String:#expr] \
+exception: nil \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
+} while (0)
+
+
+/*! Generates a failure when expression does not throw an exception of a
+ specific class.
+ @param expression The expression that is evaluated
+ @param specificException The specified class of the exception
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
+#define GHAssertThrowsSpecific(expr, specificException, description, ...) \
+do { \
+@try { \
+(expr);\
+} \
+@catch (specificException *anException) { \
+continue; \
+}\
+@catch (id anException) {\
+NSString *_descrip = GHComposeString(@"(Expected exception: %@) %@", NSStringFromClass([specificException class]), description);\
+[self failWithException:[NSException ghu_failureInRaise: [NSString stringWithUTF8String:#expr] \
+exception: anException \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(_descrip, ##__VA_ARGS__)]]; \
+continue; \
+}\
+NSString *_descrip = GHComposeString(@"(Expected exception: %@) %@", NSStringFromClass([specificException class]), description);\
+[self failWithException:[NSException ghu_failureInRaise: [NSString stringWithUTF8String:#expr] \
+exception: nil \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(_descrip, ##__VA_ARGS__)]]; \
+} while (0)
+
+
+/*! Generates a failure when expression does not throw an exception of a
+ specific class with a specific name. Useful for those frameworks like
+ AppKit or Foundation that throw generic NSException w/specific names
+ (NSInvalidArgumentException, etc).
+ @param expression The expression that is evaluated
+ @param specificException The specified class of the exception
+ @param aName The name of the specified exception
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
+#define GHAssertThrowsSpecificNamed(expr, specificException, aName, description, ...) \
+do { \
+@try { \
+(expr);\
+} \
+@catch (specificException *anException) { \
+if ([aName isEqualToString: [anException name]]) continue; \
+NSString *_descrip = GHComposeString(@"(Expected exception: %@ (name: %@)) %@", NSStringFromClass([specificException class]), aName, description);\
+[self failWithException: \
+[NSException ghu_failureInRaise: [NSString stringWithUTF8String:#expr] \
+exception: anException \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(_descrip, ##__VA_ARGS__)]]; \
+continue; \
+}\
+@catch (id anException) {\
+NSString *_descrip = GHComposeString(@"(Expected exception: %@) %@", NSStringFromClass([specificException class]), description);\
+[self failWithException: \
+[NSException ghu_failureInRaise: [NSString stringWithUTF8String:#expr] \
+exception: anException \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(_descrip, ##__VA_ARGS__)]]; \
+continue; \
+}\
+NSString *_descrip = GHComposeString(@"(Expected exception: %@) %@", NSStringFromClass([specificException class]), description);\
+[self failWithException: \
+[NSException ghu_failureInRaise: [NSString stringWithUTF8String:#expr] \
+exception: nil \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(_descrip, ##__VA_ARGS__)]]; \
+} while (0)
+
+
+/*! Generates a failure when expression does throw an exception.
+ @param expression The expression that is evaluated
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
+#define GHAssertNoThrow(expr, description, ...) \
+do { \
+@try { \
+(expr);\
+} \
+@catch (id anException) { \
+[self failWithException:[NSException ghu_failureInRaise: [NSString stringWithUTF8String:#expr] \
+exception: anException \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+} while (0)
+
+
+/*! Generates a failure when expression does throw an exception of the specitied
+ class. Any other exception is okay (i.e. does not generate a failure).
+ @param expression The expression that is evaluated
+ @param specificException The specified class of the exception
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
+#define GHAssertNoThrowSpecific(expr, specificException, description, ...) \
+do { \
+@try { \
+(expr);\
+} \
+@catch (specificException *anException) { \
+[self failWithException:[NSException ghu_failureInRaise: [NSString stringWithUTF8String:#expr] \
+exception: anException \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
+}\
+@catch (id anythingElse) {\
+; \
+}\
+} while (0)
+
+
+/*! Generates a failure when expression does throw an exception of a
+ specific class with a specific name. Useful for those frameworks like
+ AppKit or Foundation that throw generic NSException w/specific names
+ (NSInvalidArgumentException, etc).
+ @param expression The expression that is evaluated.
+ @param specificException The specified class of the exception
+ @param aName The name of the specified exception
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
+#define GHAssertNoThrowSpecificNamed(expr, specificException, aName, description, ...) \
+do { \
+@try { \
+(expr);\
+} \
+@catch (specificException *anException) { \
+if ([aName isEqualToString: [anException name]]) { \
+NSString *_descrip = GHComposeString(@"(Expected exception: %@ (name: %@)) %@", NSStringFromClass([specificException class]), aName, description);\
+[self failWithException: \
+[NSException ghu_failureInRaise: [NSString stringWithUTF8String:#expr] \
+exception: anException \
+inFile: [NSString stringWithUTF8String:__FILE__] \
+atLine: __LINE__ \
+withDescription: GHComposeString(_descrip, ##__VA_ARGS__)]]; \
+} \
+continue; \
+}\
+@catch (id anythingElse) {\
+; \
+}\
+} while (0)
+
+
+//! @cond DEV
+
+@interface NSException(GHTestMacros_GTMSenTestAdditions)
++ (NSException *)ghu_failureInFile:(NSString *)filename
+ atLine:(int)lineNumber
+ withDescription:(NSString *)formatString, ...;
++ (NSException *)ghu_failureInCondition:(NSString *)condition
+ isTrue:(BOOL)isTrue
+ inFile:(NSString *)filename
+ atLine:(int)lineNumber
+ withDescription:(NSString *)formatString, ...;
++ (NSException *)ghu_failureInEqualityBetweenObject:(id)left
+ andObject:(id)right
+ inFile:(NSString *)filename
+ atLine:(int)lineNumber
+ withDescription:(NSString *)formatString, ...;
++ (NSException *)ghu_failureInInequalityBetweenObject:(id)left
+ andObject:(id)right
+ inFile:(NSString *)filename
+ atLine:(int)lineNumber
+ withDescription:(NSString *)formatString, ...;
++ (NSException *)ghu_failureInEqualityBetweenValue:(NSValue *)left
+ andValue:(NSValue *)right
+ withAccuracy:(NSValue *)accuracy
+ inFile:(NSString *)filename
+ atLine:(int) ineNumber
+ withDescription:(NSString *)formatString, ...;
++ (NSException *)ghu_failureInRaise:(NSString *)expression
+ inFile:(NSString *)filename
+ atLine:(int)lineNumber
+ withDescription:(NSString *)formatString, ...;
++ (NSException *)ghu_failureInRaise:(NSString *)expression
+ exception:(NSException *)exception
+ inFile:(NSString *)filename
+ atLine:(int)lineNumber
+ withDescription:(NSString *)formatString, ...;
+@end
+
+//! @endcond
+
+// SENTE_END
View
46 Tests/GHUnitIOS.framework/Versions/A/Headers/GHTestOperation.h
@@ -0,0 +1,46 @@
+//
+// GHTestOperation.h
+// GHUnit
+//
+// Created by Gabriel Handford on 6/4/10.
+// Copyright 2010. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+//! @cond DEV
+
+#import "GHTest.h"
+
+/*!
+ Test for running in the context of an NSOperationQueue.
+ */
+@interface GHTestOperation : NSOperation {
+ id<GHTest> test_;
+ GHTestOptions options_;
+}
+
+- (id)initWithTest:(id<GHTest>)test options:(GHTestOptions)options;
+
+@end
+
+//! @endcond
View
162 Tests/GHUnitIOS.framework/Versions/A/Headers/GHTestRunner.h
@@ -0,0 +1,162 @@
+//
+// GHTestRunner.h
+//
+// Created by Gabriel Handford on 1/16/09.
+// Copyright 2008 Gabriel Handford
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+//! @cond DEV
+
+//
+// Portions of this file fall under the following license, marked with:
+// GTM_BEGIN : GTM_END
+//
+// Copyright 2008 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy
+// of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+//
+
+#import "GHTestGroup.h"
+#import "GHTestSuite.h"
+
+@class GHTestRunner;
+
+// Delegates can be guaranteed to be notified on the main thread (using #delegateOnMainThread)
+@protocol GHTestRunnerDelegate <NSObject>
+@optional
+- (void)testRunnerDidStart:(GHTestRunner *)runner;
+- (void)testRunner:(GHTestRunner *)runner didStartTest:(id<GHTest>)test; // Test started
+- (void)testRunner:(GHTestRunner *)runner didUpdateTest:(id<GHTest>)test; // Test changed
+- (void)testRunner:(GHTestRunner *)runner didEndTest:(id<GHTest>)test; // Test finished
+- (void)testRunnerDidCancel:(GHTestRunner *)runner;
+- (void)testRunnerDidEnd:(GHTestRunner *)runner;
+
+- (void)testRunner:(GHTestRunner *)runner didLog:(NSString *)message; // Runner logged message
+- (void)testRunner:(GHTestRunner *)runner test:(id<GHTest>)test didLog:(NSString *)message; // Test logged message
+@end
+
+/*!
+ Runs the tests.
+ Tests are run a separate thread though delegates are called on the
+ main thread by default (see #delegateOnMainThread).
+ */
+@interface GHTestRunner : NSObject <GHTestDelegate> {
+
+ id<GHTest> test_; // The test to run; Could be a GHTestGroup (suite), GHTestGroup (test case), or GHTest (target/selector)
+
+ NSObject<GHTestRunnerDelegate> *delegate_; // weak
+
+ GHTestOptions options_;
+
+ BOOL running_;
+ BOOL cancelling_;
+
+ NSTimeInterval startInterval_;
+
+ NSOperationQueue *operationQueue_; //! If running a suite in operation queue
+}
+
+@property (retain) id<GHTest> test;
+@property (assign) NSObject<GHTestRunnerDelegate> *delegate;
+@property (assign) GHTestOptions options;
+@property (readonly) GHTestStats stats;
+@property (readonly, getter=isRunning) BOOL running;
+@property (readonly, getter=isCancelling) BOOL cancelling;
+@property (readonly) NSTimeInterval interval;
+@property (retain, nonatomic) NSOperationQueue *operationQueue;
+
+
+/*!
+ Create runner for test.
+ @param test
+ */
+- (id)initWithTest:(id<GHTest>)test;
+
+/*!
+ Create runner for all tests.
+ @see GHTesting#loadAllTestCases.
+ @result Runner
+ */
++ (GHTestRunner *)runnerForAllTests;
+
+/*!
+ Create runner for test suite.
+ @param suite
+ @result Runner
+ */
++ (GHTestRunner *)runnerForSuite:(GHTestSuite *)suite;
+
+/*!
+ Create runner for class and method.
+ @param testClassName
+ @param methodName
+ @result Runner
+ */
++ (GHTestRunner *)runnerForTestClassName:(NSString *)testClassName methodName:(NSString *)methodName;
+
+/*!
+ Get the runner from the environment.
+ If the TEST env is set, then we will only run that test case or test method.
+ */
++ (GHTestRunner *)runnerFromEnv;
+
+/*!
+ Run the test runner. Usually called from the test main.
+ Reads the TEST environment variable and filters on that; or all tests are run.
+ @result 0 is success, otherwise the failure count
+ */
++ (int)run;
+
+- (void)runInBackground;
+
+/*!
+ Start the test runner with the default test.
+ @result 0 is success, otherwise the failure count
+ */
+- (int)runTests;
+
+- (void)cancel;
+
+- (void)setInParallel:(BOOL)inParallel;
+- (BOOL)isInParallel;
+
+/*!
+ Write message to console.
+ */
+- (void)log:(NSString *)message;
+
+@end
+
+//! @endcond
+
View
118 Tests/GHUnitIOS.framework/Versions/A/Headers/GHTestSuite.h
@@ -0,0 +1,118 @@
+//
+// GHTestSuite.h
+// GHUnit
+//
+// Created by Gabriel Handford on 1/25/09.
+// Copyright 2009. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+//! @cond DEV
+
+#import "GHTestGroup.h"
+
+/*!
+ If set, will run it as a "test filter" like the env variable TEST.
+ */
+extern NSString *GHUnitTest;
+
+
+/*!
+ Test suite is an alias for test group.
+
+ A test case is an instance of a test case class with test methods.
+ A test is a id<GHTest> which represents a target and a selector.
+ A test group is a collection of tests; A collection of id<GHTest> (GHTest or GHTestGroup).
+
+ For example, if you have 2 test cases, GHTestCase1 (with some test methods) and GHTestCase2 (with some test methods),
+ your test suite might look like:
+
+"Tests" (GHTestSuite)
+ GHTestGroup (collection of tests from GHTestCase1)
+ - (void)testA1 (GHTest with target GHTestCase1 + testA1)
+ - (void)testA2 (GHTest with target GHTestCase1 + testA2)
+ GHTestGroup (collection of tests from GHTestCase2)
+ - (void)testB1; (GHTest with target GHTestCase2 + testB1)
+ - (void)testB2; (GHTest with target GHTestCase2 + testB2)
+
+ */
+@interface GHTestSuite : GHTestGroup { }
+
+/*!
+ Create test suite with test cases.
+ @param name Label to give the suite
+ @param testCases Array of init'ed test case classes
+ @param delegate
+ */
+- (id)initWithName:(NSString *)name testCases:(NSArray *)testCases delegate:(id<GHTestDelegate>)delegate;
+
+/*!
+ Creates a suite of all tests.
+ Will load all classes that subclass from GHTestCase, SenTestCase or GTMTestCase (or register test case class).
+ @result Suite
+ */
++ (GHTestSuite *)allTests;
+
+/*!
+ Create suite of tests with filter.
+ This is useful for running a single test or all tests in a single test case.
+
+ For example,
+ 'GHSlowTest' -- Runs all test method in GHSlowTest
+ 'GHSlowTest/testSlowA -- Only runs the test method testSlowA in GHSlowTest
+
+ @param testFilter Test filter
+ @result Suite
+ */
++ (GHTestSuite *)suiteWithTestFilter:(NSString *)testFilter;
+
+/*!
+ Create suite of tests that start with prefix.
+ @param prefix If test case class starts with the prefix; If nil or empty string, returns all tests
+ @param options Compare options
+ */
++ (GHTestSuite *)suiteWithPrefix:(NSString *)prefix options:(NSStringCompareOptions)options;
+
+/*!
+ Suite for a single test/method.
+ @param testCaseClass
+ @param method
+ @result Suite
+ */
++ (GHTestSuite *)suiteWithTestCaseClass:(Class)testCaseClass method:(SEL)method;
+
+/*!
+ Return test suite based on environment (TEST=TestFoo/foo)
+ @result Suite
+ */
++ (GHTestSuite *)suiteFromEnv;
+
+@end
+
+@interface GHTestSuite (JUnitXML)
+
+- (BOOL)writeJUnitXML:(NSError **)error;
+
+@end
+
+//! @endcond
View
148 Tests/GHUnitIOS.framework/Versions/A/Headers/GHTesting.h
@@ -0,0 +1,148 @@
+//
+// GHTesting.h
+// GHUnit
+//
+// Created by Gabriel Handford on 1/30/09.
+// Copyright 2008 Gabriel Handford
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+//! @cond DEV
+
+//
+// Portions of this file fall under the following license, marked with:
+// GTM_BEGIN : GTM_END
+//
+// Copyright 2008 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy
+// of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+//
+
+#ifdef __cplusplus
+extern "C" NSString *GHUStackTraceFromException(NSException *e);
+#else
+extern NSString *GHUStackTraceFromException(NSException *e);
+#endif
+
+// GTM_BEGIN
+BOOL isTestFixtureOfClass(Class aClass, Class testCaseClass);