summaryrefslogtreecommitdiffstats
path: root/third_party/ocmock/OCMock
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/ocmock/OCMock')
-rw-r--r--third_party/ocmock/OCMock/Changes.txt179
-rw-r--r--third_party/ocmock/OCMock/Frameworks/hamcrest.tar.bz2bin0 -> 101587 bytes
-rw-r--r--third_party/ocmock/OCMock/Info.plist30
-rw-r--r--third_party/ocmock/OCMock/License.txt15
-rw-r--r--third_party/ocmock/OCMock/NSInvocation+OCMAdditions.h34
-rw-r--r--third_party/ocmock/OCMock/NSInvocation+OCMAdditions.m337
-rw-r--r--third_party/ocmock/OCMock/NSInvocationOCMAdditionsTests.h12
-rw-r--r--third_party/ocmock/OCMock/NSInvocationOCMAdditionsTests.m346
-rw-r--r--third_party/ocmock/OCMock/NSMethodSignature+OCMAdditions.h18
-rw-r--r--third_party/ocmock/OCMock/NSMethodSignature+OCMAdditions.m19
-rw-r--r--third_party/ocmock/OCMock/NSNotificationCenter+OCMAdditions.h15
-rw-r--r--third_party/ocmock/OCMock/NSNotificationCenter+OCMAdditions.m16
-rw-r--r--third_party/ocmock/OCMock/OCClassMockObject.h17
-rw-r--r--third_party/ocmock/OCMock/OCClassMockObject.m43
-rw-r--r--third_party/ocmock/OCMock/OCMArg.h30
-rw-r--r--third_party/ocmock/OCMock/OCMArg.m63
-rw-r--r--third_party/ocmock/OCMock/OCMBoxedReturnValueProvider.h12
-rw-r--r--third_party/ocmock/OCMock/OCMBoxedReturnValueProvider.m21
-rw-r--r--third_party/ocmock/OCMock/OCMConstraint.h48
-rw-r--r--third_party/ocmock/OCMock/OCMConstraint.m114
-rw-r--r--third_party/ocmock/OCMock/OCMConstraintTests.h14
-rw-r--r--third_party/ocmock/OCMock/OCMConstraintTests.m97
-rw-r--r--third_party/ocmock/OCMock/OCMExceptionReturnValueProvider.h12
-rw-r--r--third_party/ocmock/OCMock/OCMExceptionReturnValueProvider.m16
-rw-r--r--third_party/ocmock/OCMock/OCMIndirectReturnValueProvider.h16
-rw-r--r--third_party/ocmock/OCMock/OCMIndirectReturnValueProvider.m33
-rw-r--r--third_party/ocmock/OCMock/OCMNotificationPoster.h17
-rw-r--r--third_party/ocmock/OCMock/OCMNotificationPoster.m30
-rw-r--r--third_party/ocmock/OCMock/OCMObserverRecorder.h19
-rw-r--r--third_party/ocmock/OCMock/OCMObserverRecorder.m75
-rw-r--r--third_party/ocmock/OCMock/OCMPassByRefSetter.h17
-rw-r--r--third_party/ocmock/OCMock/OCMPassByRefSetter.m29
-rw-r--r--third_party/ocmock/OCMock/OCMReturnValueProvider.h17
-rw-r--r--third_party/ocmock/OCMock/OCMReturnValueProvider.m33
-rw-r--r--third_party/ocmock/OCMock/OCMock.h10
-rw-r--r--third_party/ocmock/OCMock/OCMock.xcodeproj/project.pbxproj795
-rw-r--r--third_party/ocmock/OCMock/OCMockObject.h41
-rw-r--r--third_party/ocmock/OCMock/OCMockObject.m229
-rw-r--r--third_party/ocmock/OCMock/OCMockObjectHamcrestTests.h13
-rw-r--r--third_party/ocmock/OCMock/OCMockObjectHamcrestTests.mm31
-rw-r--r--third_party/ocmock/OCMock/OCMockObjectTests.h13
-rw-r--r--third_party/ocmock/OCMock/OCMockObjectTests.m692
-rw-r--r--third_party/ocmock/OCMock/OCMockRecorder.h28
-rw-r--r--third_party/ocmock/OCMock/OCMockRecorder.m162
-rw-r--r--third_party/ocmock/OCMock/OCMockRecorderTests.h13
-rw-r--r--third_party/ocmock/OCMock/OCMockRecorderTests.m81
-rw-r--r--third_party/ocmock/OCMock/OCMock_Prefix.pch7
-rw-r--r--third_party/ocmock/OCMock/OCObserverMockObject.h20
-rw-r--r--third_party/ocmock/OCMock/OCObserverMockObject.m83
-rw-r--r--third_party/ocmock/OCMock/OCObserverMockObjectTest.h16
-rw-r--r--third_party/ocmock/OCMock/OCObserverMockObjectTest.m127
-rw-r--r--third_party/ocmock/OCMock/OCPartialMockObject.h20
-rw-r--r--third_party/ocmock/OCMock/OCPartialMockObject.m124
-rw-r--r--third_party/ocmock/OCMock/OCPartialMockRecorder.h12
-rw-r--r--third_party/ocmock/OCMock/OCPartialMockRecorder.m19
-rw-r--r--third_party/ocmock/OCMock/OCProtocolMockObject.h16
-rw-r--r--third_party/ocmock/OCMock/OCProtocolMockObject.m56
-rw-r--r--third_party/ocmock/OCMock/Test-Info.plist20
-rw-r--r--third_party/ocmock/OCMock/version.plist16
59 files changed, 4438 insertions, 0 deletions
diff --git a/third_party/ocmock/OCMock/Changes.txt b/third_party/ocmock/OCMock/Changes.txt
new file mode 100644
index 0000000..e304b41
--- /dev/null
+++ b/third_party/ocmock/OCMock/Changes.txt
@@ -0,0 +1,179 @@
+Chronological listing of changes. If a particular SVN revision has no entry, that
+check-in did not involve any code or feature changes.
+
+
+2009-08-18 (r54)
+
+* OnCall methods now have same signature as replaced ones.
+
+
+2009-08-14 (r53)
+
+* Fixed possible retain bug (Daniel Eggert)
+
+
+2009-08-14 (r52)
+
+* Added feature that allows to verify expectations are called in sequence.
+* Improved detection of unqualified method return type.
+
+
+2009-08-13 (r51)
+
+* Fixed bug that caused crash when using method swizzling with void return type.
+
+
+2009-07-14 (r49)
+
+* Added support for calling arbitrary methods when stubbed methods are invoked.
+
+
+2009-07-14 (r48)
+
+* Added support for posting notifications (based on Jean-Francois Dontigny's code)
+
+
+2009-07-14 (r46)
+
+* Fixed bug around complex type encodings (Jean-Francois Dontigny)
+
+
+2009-05-26 (r45)
+
+* Partial mocks now work on object reference and self (thanks to Mike Mangino)
+
+
+2009-04-24 (r43)
+
+* Added partial mocks (calls to the original object reference cannot be mocked)
+
+
+2009-04-17 (r42)
+
+* Mock observers now handle user infos on notifications.
+
+
+2009-04-09 (r39)
+
+* Added inital support for mock observers (loosely based on Dave Dribbin's idea)
+
+
+2009-04-08 (r38)
+
+* Moved factory methods from OCMConstraint to OCMArg
+
+
+2009-03-13 (r37)
+
+* Added pass by ref argument setters
+
+
+2009-03-11 (r34)
+
+* Linked install name now uses @rpath (Dave Dribbin)
+
+
+2009-02-22 (r32)
+
+* Added support for respondsToSelector (Dave Dribin)
+* Added constraint for any pointer
+* Now comparing selectors as strings (Dado Colussi)
+
+
+2008-07-07 (r28)
+
+* Resetting invocation target in recorder to avoid retain cycles.
+
+
+2008-06-19 (r27)
+
+* Added optional integration with hamcrest for constraints
+
+
+2008-05-08 (r24)
+
+* Now building quad-fat; the 64-bit versions are somewhat experimental though
+
+
+2008-02-28 (r22)
+
+* Using new functions to deal with protocols (Evan Doll)
+
+
+2007-11-22 (r20)
+
+* Added support for void* parameters (Tuukka Norri)
+* Fixed a bug that could caused crashes when non-char const pointers were described
+
+
+2007-11-22 (r19)
+
+* Fixed bug to allow mocking of methods with type qualifieres (Nikita Zhuk)
+
+
+2007-10-22 (r18)
+
+* Added a simple constraint implementation.
+
+
+2007-06-04 (r15)
+
+* Now re-throwing fail-fast exceptions, for unexpected invocations for example, when
+ verify is called; in case the first throw is ignored by a framework.
+
+
+2007-04-23 (r14)
+
+* Added nice mocks, i.e. mocks that don't raise on unknown methods (Mark Thomas)
+
+* Fixed bug that prevented expectations after invocations (M. Scott Ford)
+
+
+2006-06-11 (r12)
+
+* Added possibility to throw an exception, based on code by Justin DeWind
+
+* Added Evan Doll's bugfix, which forwards conformsToProtocol: methods when necessary
+
+* Added the ability to match struct arguments, based on code contributed by Daniel Eggert
+
+* Better description of arguments, based on code contributed by Jeremy Higgs
+
+* Added the ability to create multiple identical expectations on the mock object (Jeremy Higgs)
+
+* Added the ability to mock out nil arguments (Jeremy Higgs)
+
+
+2005-12-11 (r11)
+
+* Added slightly modified version of Jon Reid's contribution, which adds the possibility to stub
+ primitive return values.
+
+* Added Jon Reid's bugfix that prevents a crash when trying to stub an unknown method on a
+ protocol.
+
+
+2005-10-03 (r10)
+
+* Upgraded to build and run tests using the OCUnit that is now part of XCode.
+
+
+2005-10-03 (r9)
+
+* Added XCdoe 2.1 project
+
+
+2005-02-16 (r8)
+
+* Added Richard Clark's contribution, which provides support for scalar arguments.
+
+
+2005-02-13 (r7)
+
+* Added support for mocking formal protocols
+
+
+2004-08-26 (r6)
+
+* MockObject and Recorder now inherit from NSProxy.
+
diff --git a/third_party/ocmock/OCMock/Frameworks/hamcrest.tar.bz2 b/third_party/ocmock/OCMock/Frameworks/hamcrest.tar.bz2
new file mode 100644
index 0000000..006a5b0
--- /dev/null
+++ b/third_party/ocmock/OCMock/Frameworks/hamcrest.tar.bz2
Binary files differ
diff --git a/third_party/ocmock/OCMock/Info.plist b/third_party/ocmock/OCMock/Info.plist
new file mode 100644
index 0000000..2105497
--- /dev/null
+++ b/third_party/ocmock/OCMock/Info.plist
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleName</key>
+ <string>OCMock</string>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>OCMock</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.mulle-kybernetik.OCMock</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.29</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright © 2004-2009 Mulle Kybernetik.</string>
+ <key>NSPrincipalClass</key>
+ <string></string>
+</dict>
+</plist>
diff --git a/third_party/ocmock/OCMock/License.txt b/third_party/ocmock/OCMock/License.txt
new file mode 100644
index 0000000..e2c1396
--- /dev/null
+++ b/third_party/ocmock/OCMock/License.txt
@@ -0,0 +1,15 @@
+
+ Copyright (c) 2004-2009 by Mulle Kybernetik. All rights reserved.
+
+ Permission to use, copy, modify and distribute this software and its documentation
+ is hereby granted, provided that both the copyright notice and this permission
+ notice appear in all copies of the software, derivative works or modified versions,
+ and any portions thereof, and that both notices appear in supporting documentation,
+ and that credit is given to Mulle Kybernetik in all documents and publicity
+ pertaining to direct or indirect use of this code or its derivatives.
+
+ THIS IS EXPERIMENTAL SOFTWARE AND IT IS KNOWN TO HAVE BUGS, SOME OF WHICH MAY HAVE
+ SERIOUS CONSEQUENCES. THE COPYRIGHT HOLDER ALLOWS FREE USE OF THIS SOFTWARE IN ITS
+ "AS IS" CONDITION. THE COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY
+ DAMAGES WHATSOEVER RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE
+ OR OF ANY DERIVATIVE WORK. \ No newline at end of file
diff --git a/third_party/ocmock/OCMock/NSInvocation+OCMAdditions.h b/third_party/ocmock/OCMock/NSInvocation+OCMAdditions.h
new file mode 100644
index 0000000..ced6d9f
--- /dev/null
+++ b/third_party/ocmock/OCMock/NSInvocation+OCMAdditions.h
@@ -0,0 +1,34 @@
+//---------------------------------------------------------------------------------------
+// $Id: NSInvocation+OCMAdditions.h 50 2009-07-16 06:48:19Z erik $
+// Copyright (c) 2006-2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <Foundation/Foundation.h>
+
+@interface NSInvocation(OCMAdditions)
+
+- (id)getArgumentAtIndexAsObject:(int)index;
+
+- (NSString *)invocationDescription;
+
+- (NSString *)argumentDescriptionAtIndex:(int)index;
+
+- (NSString *)objectDescriptionAtIndex:(int)anInt;
+- (NSString *)charDescriptionAtIndex:(int)anInt;
+- (NSString *)unsignedCharDescriptionAtIndex:(int)anInt;
+- (NSString *)intDescriptionAtIndex:(int)anInt;
+- (NSString *)unsignedIntDescriptionAtIndex:(int)anInt;
+- (NSString *)shortDescriptionAtIndex:(int)anInt;
+- (NSString *)unsignedShortDescriptionAtIndex:(int)anInt;
+- (NSString *)longDescriptionAtIndex:(int)anInt;
+- (NSString *)unsignedLongDescriptionAtIndex:(int)anInt;
+- (NSString *)longLongDescriptionAtIndex:(int)anInt;
+- (NSString *)unsignedLongLongDescriptionAtIndex:(int)anInt;
+- (NSString *)doubleDescriptionAtIndex:(int)anInt;
+- (NSString *)floatDescriptionAtIndex:(int)anInt;
+- (NSString *)structDescriptionAtIndex:(int)anInt;
+- (NSString *)pointerDescriptionAtIndex:(int)anInt;
+- (NSString *)cStringDescriptionAtIndex:(int)anInt;
+- (NSString *)selectorDescriptionAtIndex:(int)anInt;
+
+@end
diff --git a/third_party/ocmock/OCMock/NSInvocation+OCMAdditions.m b/third_party/ocmock/OCMock/NSInvocation+OCMAdditions.m
new file mode 100644
index 0000000..fa0e483
--- /dev/null
+++ b/third_party/ocmock/OCMock/NSInvocation+OCMAdditions.m
@@ -0,0 +1,337 @@
+//---------------------------------------------------------------------------------------
+// $Id: NSInvocation+OCMAdditions.m 50 2009-07-16 06:48:19Z erik $
+// Copyright (c) 2006-2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import "NSInvocation+OCMAdditions.h"
+
+
+@implementation NSInvocation(OCMAdditions)
+
+- (id)getArgumentAtIndexAsObject:(int)index
+{
+ const char* argType;
+
+ argType = [[self methodSignature] getArgumentTypeAtIndex:index];
+ while(strchr("rnNoORV", argType[0]) != NULL)
+ argType += 1;
+
+ if((strlen(argType) > 1) && (strchr("{^", argType[0]) == NULL))
+ [NSException raise:NSInvalidArgumentException format:@"Cannot handle argument type '%s'.", argType];
+
+ switch (argType[0])
+ {
+ case '#':
+ case '@':
+ {
+ id value;
+ [self getArgument:&value atIndex:index];
+ return value;
+ }
+ case ':':
+ {
+ SEL s = (SEL)0;
+ [self getArgument:&s atIndex:index];
+ id value = NSStringFromSelector(s);
+ return value;
+ }
+ case 'i':
+ {
+ int value;
+ [self getArgument:&value atIndex:index];
+ return [NSNumber numberWithInt:value];
+ }
+ case 's':
+ {
+ short value;
+ [self getArgument:&value atIndex:index];
+ return [NSNumber numberWithShort:value];
+ }
+ case 'l':
+ {
+ long value;
+ [self getArgument:&value atIndex:index];
+ return [NSNumber numberWithLong:value];
+ }
+ case 'q':
+ {
+ long long value;
+ [self getArgument:&value atIndex:index];
+ return [NSNumber numberWithLongLong:value];
+ }
+ case 'c':
+ {
+ char value;
+ [self getArgument:&value atIndex:index];
+ return [NSNumber numberWithChar:value];
+ }
+ case 'C':
+ {
+ unsigned char value;
+ [self getArgument:&value atIndex:index];
+ return [NSNumber numberWithUnsignedChar:value];
+ }
+ case 'I':
+ {
+ unsigned int value;
+ [self getArgument:&value atIndex:index];
+ return [NSNumber numberWithUnsignedInt:value];
+ }
+ case 'S':
+ {
+ unsigned short value;
+ [self getArgument:&value atIndex:index];
+ return [NSNumber numberWithUnsignedShort:value];
+ }
+ case 'L':
+ {
+ unsigned long value;
+ [self getArgument:&value atIndex:index];
+ return [NSNumber numberWithUnsignedLong:value];
+ }
+ case 'Q':
+ {
+ unsigned long long value;
+ [self getArgument:&value atIndex:index];
+ return [NSNumber numberWithUnsignedLongLong:value];
+ }
+ case 'f':
+ {
+ float value;
+ [self getArgument:&value atIndex:index];
+ return [NSNumber numberWithFloat:value];
+ }
+ case 'd':
+ {
+ double value;
+ [self getArgument:&value atIndex:index];
+ return [NSNumber numberWithDouble:value];
+ }
+ case 'B':
+ {
+ bool value;
+ [self getArgument:&value atIndex:index];
+ return [NSNumber numberWithBool:value];
+ }
+ case '^':
+ {
+ void *value = NULL;
+ [self getArgument:&value atIndex:index];
+ return [NSValue valueWithPointer:value];
+ }
+ case '{': // structure
+ {
+ unsigned maxSize = [[self methodSignature] frameLength];
+ NSMutableData *argumentData = [[[NSMutableData alloc] initWithLength:maxSize] autorelease];
+ [self getArgument:[argumentData mutableBytes] atIndex:index];
+ return [NSValue valueWithBytes:[argumentData bytes] objCType:argType];
+ }
+
+ }
+ [NSException raise:NSInvalidArgumentException format:@"Argument type '%s' not supported", argType];
+ return nil;
+}
+
+- (NSString *)invocationDescription
+{
+ NSMethodSignature *methodSignature = [self methodSignature];
+ unsigned int numberOfArgs = [methodSignature numberOfArguments];
+
+ if (numberOfArgs == 2)
+ return NSStringFromSelector([self selector]);
+
+ NSArray *selectorParts = [NSStringFromSelector([self selector]) componentsSeparatedByString:@":"];
+ NSMutableString *description = [[NSMutableString alloc] init];
+ int i;
+ for(i = 2; i < numberOfArgs; i++)
+ {
+ [description appendFormat:@"%@%@:", (i > 2 ? @" " : @""), [selectorParts objectAtIndex:(i - 2)]];
+ [description appendString:[self argumentDescriptionAtIndex:i]];
+ }
+
+ return [description autorelease];
+}
+
+- (NSString *)argumentDescriptionAtIndex:(int)index
+{
+ const char *argType = [[self methodSignature] getArgumentTypeAtIndex:index];
+ if(strchr("rnNoORV", argType[0]) != NULL)
+ argType += 1;
+
+ switch(*argType)
+ {
+ case '@': return [self objectDescriptionAtIndex:index];
+ case 'c': return [self charDescriptionAtIndex:index];
+ case 'C': return [self unsignedCharDescriptionAtIndex:index];
+ case 'i': return [self intDescriptionAtIndex:index];
+ case 'I': return [self unsignedIntDescriptionAtIndex:index];
+ case 's': return [self shortDescriptionAtIndex:index];
+ case 'S': return [self unsignedShortDescriptionAtIndex:index];
+ case 'l': return [self longDescriptionAtIndex:index];
+ case 'L': return [self unsignedLongDescriptionAtIndex:index];
+ case 'q': return [self longLongDescriptionAtIndex:index];
+ case 'Q': return [self unsignedLongLongDescriptionAtIndex:index];
+ case 'd': return [self doubleDescriptionAtIndex:index];
+ case 'f': return [self floatDescriptionAtIndex:index];
+ // Why does this throw EXC_BAD_ACCESS when appending the string?
+ // case NSObjCStructType: return [self structDescriptionAtIndex:index];
+ case '^': return [self pointerDescriptionAtIndex:index];
+ case '*': return [self cStringDescriptionAtIndex:index];
+ case ':': return [self selectorDescriptionAtIndex:index];
+ default: return [@"<??" stringByAppendingString:@">"]; // avoid confusion with trigraphs...
+ }
+
+}
+
+
+- (NSString *)objectDescriptionAtIndex:(int)anInt
+{
+ id object;
+
+ [self getArgument:&object atIndex:anInt];
+ if (object == nil)
+ return @"nil";
+ else if([object isKindOfClass:[NSString class]])
+ return [NSString stringWithFormat:@"@\"%@\"", [object description]];
+ else
+ return [object description];
+}
+
+- (NSString *)charDescriptionAtIndex:(int)anInt
+{
+ unsigned char buffer[128];
+ memset(buffer, 0x0, 128);
+
+ [self getArgument:&buffer atIndex:anInt];
+
+ // If there's only one character in the buffer, and it's 0 or 1, then we have a BOOL
+ if (buffer[1] == '\0' && (buffer[0] == 0 || buffer[0] == 1))
+ return [NSString stringWithFormat:@"%@", (buffer[0] == 1 ? @"YES" : @"NO")];
+ else
+ return [NSString stringWithFormat:@"'%c'", *buffer];
+}
+
+- (NSString *)unsignedCharDescriptionAtIndex:(int)anInt
+{
+ unsigned char buffer[128];
+ memset(buffer, 0x0, 128);
+
+ [self getArgument:&buffer atIndex:anInt];
+ return [NSString stringWithFormat:@"'%c'", *buffer];
+}
+
+- (NSString *)intDescriptionAtIndex:(int)anInt
+{
+ int intValue;
+
+ [self getArgument:&intValue atIndex:anInt];
+ return [NSString stringWithFormat:@"%d", intValue];
+}
+
+- (NSString *)unsignedIntDescriptionAtIndex:(int)anInt
+{
+ unsigned int intValue;
+
+ [self getArgument:&intValue atIndex:anInt];
+ return [NSString stringWithFormat:@"%d", intValue];
+}
+
+- (NSString *)shortDescriptionAtIndex:(int)anInt
+{
+ short shortValue;
+
+ [self getArgument:&shortValue atIndex:anInt];
+ return [NSString stringWithFormat:@"%hi", shortValue];
+}
+
+- (NSString *)unsignedShortDescriptionAtIndex:(int)anInt
+{
+ unsigned short shortValue;
+
+ [self getArgument:&shortValue atIndex:anInt];
+ return [NSString stringWithFormat:@"%hu", shortValue];
+}
+
+- (NSString *)longDescriptionAtIndex:(int)anInt
+{
+ long longValue;
+
+ [self getArgument:&longValue atIndex:anInt];
+ return [NSString stringWithFormat:@"%d", longValue];
+}
+
+- (NSString *)unsignedLongDescriptionAtIndex:(int)anInt
+{
+ unsigned long longValue;
+
+ [self getArgument:&longValue atIndex:anInt];
+ return [NSString stringWithFormat:@"%u", longValue];
+}
+
+- (NSString *)longLongDescriptionAtIndex:(int)anInt
+{
+ long long longLongValue;
+
+ [self getArgument:&longLongValue atIndex:anInt];
+ return [NSString stringWithFormat:@"%qi", longLongValue];
+}
+
+- (NSString *)unsignedLongLongDescriptionAtIndex:(int)anInt
+{
+ unsigned long long longLongValue;
+
+ [self getArgument:&longLongValue atIndex:anInt];
+ return [NSString stringWithFormat:@"%qu", longLongValue];
+}
+
+- (NSString *)doubleDescriptionAtIndex:(int)anInt;
+{
+ double doubleValue;
+
+ [self getArgument:&doubleValue atIndex:anInt];
+ return [NSString stringWithFormat:@"%f", doubleValue];
+}
+
+- (NSString *)floatDescriptionAtIndex:(int)anInt
+{
+ float floatValue;
+
+ [self getArgument:&floatValue atIndex:anInt];
+ return [NSString stringWithFormat:@"%f", floatValue];
+}
+
+- (NSString *)structDescriptionAtIndex:(int)anInt;
+{
+ void *buffer;
+
+ [self getArgument:&buffer atIndex:anInt];
+ return [NSString stringWithFormat:@":(struct)%p", buffer];
+}
+
+- (NSString *)pointerDescriptionAtIndex:(int)anInt
+{
+ void *buffer;
+
+ [self getArgument:&buffer atIndex:anInt];
+ return [NSString stringWithFormat:@"%p", buffer];
+}
+
+- (NSString *)cStringDescriptionAtIndex:(int)anInt
+{
+ char buffer[128];
+
+ memset(buffer, 0x0, 128);
+
+ [self getArgument:&buffer atIndex:anInt];
+ return [NSString stringWithFormat:@"\"%S\"", buffer];
+}
+
+- (NSString *)selectorDescriptionAtIndex:(int)anInt
+{
+ SEL selectorValue;
+
+ [self getArgument:&selectorValue atIndex:anInt];
+ return [NSString stringWithFormat:@"@selector(%@)", NSStringFromSelector(selectorValue)];
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/NSInvocationOCMAdditionsTests.h b/third_party/ocmock/OCMock/NSInvocationOCMAdditionsTests.h
new file mode 100644
index 0000000..3cc5d99
--- /dev/null
+++ b/third_party/ocmock/OCMock/NSInvocationOCMAdditionsTests.h
@@ -0,0 +1,12 @@
+//---------------------------------------------------------------------------------------
+// $Id: NSInvocationOCMAdditionsTests.h 21 2008-01-24 18:59:39Z erik $
+// Copyright (c) 2006-2008 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <SenTestingKit/SenTestingKit.h>
+
+@interface NSInvocationOCMAdditionsTests : SenTestCase
+{
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/NSInvocationOCMAdditionsTests.m b/third_party/ocmock/OCMock/NSInvocationOCMAdditionsTests.m
new file mode 100644
index 0000000..3b549c4
--- /dev/null
+++ b/third_party/ocmock/OCMock/NSInvocationOCMAdditionsTests.m
@@ -0,0 +1,346 @@
+//---------------------------------------------------------------------------------------
+// $Id: NSInvocationOCMAdditionsTests.m 26 2008-05-08 17:06:47Z erik $
+// Copyright (c) 2006-2008 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import "NSInvocationOCMAdditionsTests.h"
+#import "NSInvocation+OCMAdditions.h"
+
+#define TestString @"foo"
+#define TestInt 1
+
+@implementation NSInvocationOCMAdditionsTests
+
+- (void)testInvocationDescriptionWithNoArguments
+{
+ SEL selector = @selector(lowercaseString);
+ NSMethodSignature *signature = [[NSString string] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+
+ STAssertEqualObjects(@"lowercaseString", [invocation invocationDescription], @"");
+}
+
+- (void)testInvocationDescriptionWithObjectArgument
+{
+ SEL selector = @selector(isEqualToNumber:);
+ NSMethodSignature *signature = [[NSNumber alloc] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it one argument (starts at index 2)
+ NSNumber *argument = [NSNumber numberWithInt:TestInt];
+ [invocation setArgument:&argument atIndex:2];
+
+ NSString *expected = [NSString stringWithFormat:@"isEqualToNumber:%d", TestInt];
+ STAssertEqualObjects(expected, [invocation invocationDescription], @"");
+}
+
+- (void)testInvocationDescriptionWithNSStringArgument
+{
+ SEL selector = @selector(isEqualToString:);
+ NSMethodSignature *signature = [[NSString string] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it one argument (starts at index 2)
+ NSString *argument = [NSString stringWithString:TestString];
+ [invocation setArgument:&argument atIndex:2];
+
+ NSString *expected = [NSString stringWithFormat:@"isEqualToString:@\"%@\"", TestString];
+ STAssertEqualObjects(expected, [invocation invocationDescription], @"");
+}
+
+- (void)testInvocationDescriptionWithObjectArguments
+{
+ SEL selector = @selector(setValue:forKey:);
+ NSMethodSignature *signature = [[NSArray array] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it two arguments
+ NSNumber *argumentOne = [NSNumber numberWithInt:TestInt];
+ NSString *argumentTwo = [NSString stringWithString:TestString];
+ [invocation setArgument:&argumentOne atIndex:2];
+ [invocation setArgument:&argumentTwo atIndex:3];
+
+ NSString *expected = [NSString stringWithFormat:@"setValue:%d forKey:@\"%@\"", TestInt, TestString];
+ STAssertEqualObjects(expected, [invocation invocationDescription], @"");
+}
+
+- (void)testInvocationDescriptionWithArrayArgument
+{
+ SEL selector = @selector(addObjectsFromArray:);
+ NSMethodSignature *signature = [[NSArray array] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it one argument (starts at index 2)
+ NSArray *argument = [NSArray arrayWithObject:TestString];
+ [invocation setArgument:&argument atIndex:2];
+
+ NSString *expected = [NSString stringWithFormat:@"addObjectsFromArray:%@", [argument description]];
+ STAssertEqualObjects(expected, [invocation invocationDescription], @"");
+}
+
+- (void)testInvocationDescriptionWithIntArgument
+{
+ SEL selector = @selector(initWithInt:);
+ NSMethodSignature *signature = [[NSNumber alloc] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it an argument
+ int argumentOne = TestInt;
+ [invocation setArgument:&argumentOne atIndex:2];
+
+ NSString *expected = [NSString stringWithFormat:@"initWithInt:%d", TestInt];
+ STAssertEqualObjects(expected, [invocation invocationDescription], @"");
+}
+
+- (void)testInvocationDescriptionWithUnsignedIntArgument
+{
+ SEL selector = @selector(initWithUnsignedInt:);
+ NSMethodSignature *signature = [[NSNumber alloc] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it an argument
+ unsigned int argumentOne = TestInt;
+ [invocation setArgument:&argumentOne atIndex:2];
+
+ NSString *expected = [NSString stringWithFormat:@"initWithUnsignedInt:%d", TestInt];
+ STAssertEqualObjects(expected, [invocation invocationDescription], @"");
+}
+
+- (void)testInvocationDescriptionWithBoolArgument
+{
+ SEL selector = @selector(initWithBool:);
+ NSMethodSignature *signature = [[NSNumber alloc] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it an argument
+ BOOL argumentOne = TRUE;
+ [invocation setArgument:&argumentOne atIndex:2];
+
+ NSString *expected = [NSString stringWithFormat:@"initWithBool:YES"];
+ STAssertEqualObjects(expected, [invocation invocationDescription], @"");
+}
+
+- (void)testInvocationDescriptionWithCharArgument
+{
+ SEL selector = @selector(initWithChar:);
+ NSMethodSignature *signature = [[NSNumber alloc] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it an argument
+ char argumentOne = 'd';
+ [invocation setArgument:&argumentOne atIndex:2];
+
+ NSString *expected = [NSString stringWithFormat:@"initWithChar:'%c'", argumentOne];
+ STAssertEqualObjects(expected, [invocation invocationDescription], @"");
+}
+
+- (void)testInvocationDescriptionWithUnsignedCharArgument
+{
+ NSNumber *dummyNumber = [NSNumber alloc];
+
+ SEL selector = @selector(initWithUnsignedChar:);
+ NSMethodSignature *signature = [dummyNumber methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it an argument
+ unsigned char argumentOne = 'd';
+ [invocation setArgument:&argumentOne atIndex:2];
+
+ NSString *expected = [NSString stringWithFormat:@"initWithUnsignedChar:'%c'", argumentOne];
+ STAssertEqualObjects(expected, [invocation invocationDescription], @"");
+}
+
+- (void)testInvocationDescriptionWithDoubleArgument
+{
+ SEL selector = @selector(initWithDouble:);
+ NSMethodSignature *signature = [[NSNumber alloc] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it an argument
+ double argumentOne = 1;
+ [invocation setArgument:&argumentOne atIndex:2];
+
+ NSString *expected = [NSString stringWithFormat:@"initWithDouble:%f", argumentOne];
+ STAssertEqualObjects(expected, [invocation invocationDescription], @"");
+}
+
+- (void)testInvocationDescriptionWithFloatArgument
+{
+ SEL selector = @selector(initWithFloat:);
+ NSMethodSignature *signature = [[NSNumber alloc] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it an argument
+ float argumentOne = 1;
+ [invocation setArgument:&argumentOne atIndex:2];
+
+ NSString *expected = [NSString stringWithFormat:@"initWithFloat:%f", argumentOne];
+ STAssertEqualObjects(expected, [invocation invocationDescription], @"");
+}
+
+- (void)testInvocationDescriptionWithLongArgument
+{
+ SEL selector = @selector(initWithLong:);
+ NSMethodSignature *signature = [[NSNumber alloc] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it an argument
+ long argumentOne = 1;
+ [invocation setArgument:&argumentOne atIndex:2];
+
+ NSString *expected = [NSString stringWithFormat:@"initWithLong:%d", argumentOne];
+ STAssertEqualObjects(expected, [invocation invocationDescription], @"");
+}
+
+- (void)testInvocationDescriptionWithUnsignedLongArgument
+{
+ SEL selector = @selector(initWithUnsignedLong:);
+ NSMethodSignature *signature = [[NSNumber alloc] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it an argument
+ unsigned long argumentOne = 1;
+ [invocation setArgument:&argumentOne atIndex:2];
+
+ NSString *expected = [NSString stringWithFormat:@"initWithUnsignedLong:%u", argumentOne];
+ STAssertEqualObjects(expected, [invocation invocationDescription], @"");
+}
+
+- (void)testInvocationDescriptionWithLongLongArgument
+{
+ SEL selector = @selector(initWithLongLong:);
+ NSMethodSignature *signature = [[NSNumber alloc] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it an argument
+ long long argumentOne = 1;
+ [invocation setArgument:&argumentOne atIndex:2];
+
+ NSString *expected = [NSString stringWithFormat:@"initWithLongLong:%qi", argumentOne];
+ STAssertEqualObjects(expected, [invocation invocationDescription], @"");
+}
+
+- (void)testInvocationDescriptionWithUnsignedLongLongArgument
+{
+ SEL selector = @selector(initWithUnsignedLongLong:);
+ NSMethodSignature *signature = [[NSNumber alloc] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it an argument
+ unsigned long long argumentOne = 1;
+ [invocation setArgument:&argumentOne atIndex:2];
+
+ NSString *expected = [NSString stringWithFormat:@"initWithUnsignedLongLong:%qu", argumentOne];
+ STAssertEqualObjects(expected, [invocation invocationDescription], @"");
+}
+
+- (void)testInvocationDescriptionWithShortArgument
+{
+ SEL selector = @selector(initWithShort:);
+ NSMethodSignature *signature = [[NSNumber alloc] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it an argument
+ short argumentOne = 1;
+ [invocation setArgument:&argumentOne atIndex:2];
+
+ NSString *expected = [NSString stringWithFormat:@"initWithShort:%hi", argumentOne];
+ STAssertEqualObjects(expected, [invocation invocationDescription], @"");
+}
+
+- (void)testInvocationDescriptionWithUnsignedShortArgument
+{
+ SEL selector = @selector(initWithUnsignedShort:);
+ NSMethodSignature *signature = [[NSNumber alloc] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it an argument
+ unsigned short argumentOne = 1;
+ [invocation setArgument:&argumentOne atIndex:2];
+
+ NSString *expected = [NSString stringWithFormat:@"initWithUnsignedShort:%hu", argumentOne];
+ STAssertEqualObjects(expected, [invocation invocationDescription], @"");
+}
+/*
+- (void)testInvocationDescriptionWithStructArgument
+{
+ SEL selector = @selector(setFrameSize:);
+ NSMethodSignature *signature = [[[NSView alloc] init] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it an argument
+ NSSize size;
+ size.width = 1;
+ size.height = 1;
+ [invocation setArgument:&size atIndex:2];
+
+ NSString *expected = [NSString stringWithFormat:@"setFrameSize:(struct)"];
+ STAssertTrue(expected, [[invocation invocationDescription] rangeOfString:description].length > 0, @"");
+}
+*/
+/*
+- (void)testInvocationDescriptionWithCStringArgument
+{
+ SEL selector = @selector(initWithUTF8String:);
+ NSMethodSignature *signature = [[NSString alloc] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it an argument
+ NSString *string = [NSString stringWithString:@"foo"];
+ const char *cString = [string UTF8String];
+ [invocation setArgument:&cString atIndex:2];
+
+ NSString *expected = @"initWithUTF8String:\"foo\"";
+ STAssertEqualObjects(expected, [invocation invocationDescription], @"");
+}
+*/
+- (void)testInvocationDescriptionWithSelectorArgument
+{
+ SEL selector = @selector(respondsToSelector:);
+ NSMethodSignature *signature = [[NSString alloc] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it an argument
+ SEL selectorValue = @selector(foo);
+ [invocation setArgument:&selectorValue atIndex:2];
+
+ NSString *expected = [NSString stringWithFormat:@"respondsToSelector:@selector(%@)", NSStringFromSelector(selectorValue)];
+ STAssertEqualObjects(expected, [invocation invocationDescription], @"");
+}
+
+- (void)testInvocationDescriptionWithPointerArgument
+{
+ SEL selector = @selector(initWithBytes:length:);
+ NSMethodSignature *signature = [[NSData alloc] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it an argument
+ NSData *data = [@"foo" dataUsingEncoding:NSUTF8StringEncoding];
+ const void *bytes = [[@"foo" dataUsingEncoding:NSUTF8StringEncoding] bytes];
+ NSUInteger length = [data length];
+ [invocation setArgument:&bytes atIndex:2];
+ [invocation setArgument:&length atIndex:3];
+
+ NSString *expected1 = [NSString stringWithFormat:@"initWithBytes:"];
+ NSString *expected2 = [NSString stringWithFormat:@"length:%d", length];
+ NSString *invocationDescription = [invocation invocationDescription];
+ STAssertTrue([invocationDescription rangeOfString:expected1].length > 0, @"");
+ STAssertTrue([invocationDescription rangeOfString:expected2].length > 0, @"");
+}
+
+- (void)testInvocationDescriptionWithNilArgument
+{
+ SEL selector = @selector(initWithString:);
+ NSMethodSignature *signature = [[NSString alloc] methodSignatureForSelector:selector];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:selector];
+ // Give it an argument
+ NSString *argString = nil;
+ [invocation setArgument:&argString atIndex:2];
+
+ NSString *expected = [NSString stringWithFormat:@"initWithString:nil"];
+ STAssertEqualObjects(expected, [invocation invocationDescription], @"");
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/NSMethodSignature+OCMAdditions.h b/third_party/ocmock/OCMock/NSMethodSignature+OCMAdditions.h
new file mode 100644
index 0000000..23741e3
--- /dev/null
+++ b/third_party/ocmock/OCMock/NSMethodSignature+OCMAdditions.h
@@ -0,0 +1,18 @@
+//---------------------------------------------------------------------------------------
+// $Id$
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <Foundation/Foundation.h>
+
+@interface NSMethodSignature(PrivateAPI)
+
++ (id)signatureWithObjCTypes:(const char *)types;
+
+@end
+
+@interface NSMethodSignature(OCMAdditions)
+
+- (const char *)methodReturnTypeWithoutQualifiers;
+
+@end
diff --git a/third_party/ocmock/OCMock/NSMethodSignature+OCMAdditions.m b/third_party/ocmock/OCMock/NSMethodSignature+OCMAdditions.m
new file mode 100644
index 0000000..a69bb14
--- /dev/null
+++ b/third_party/ocmock/OCMock/NSMethodSignature+OCMAdditions.m
@@ -0,0 +1,19 @@
+//---------------------------------------------------------------------------------------
+// $Id$
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import "NSMethodSignature+OCMAdditions.h"
+
+
+@implementation NSMethodSignature(OCMAdditions)
+
+- (const char *)methodReturnTypeWithoutQualifiers
+{
+ const char *returnType = [self methodReturnType];
+ while(strchr("rnNoORV", returnType[0]) != NULL)
+ returnType += 1;
+ return returnType;
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/NSNotificationCenter+OCMAdditions.h b/third_party/ocmock/OCMock/NSNotificationCenter+OCMAdditions.h
new file mode 100644
index 0000000..ae2e37d
--- /dev/null
+++ b/third_party/ocmock/OCMock/NSNotificationCenter+OCMAdditions.h
@@ -0,0 +1,15 @@
+//---------------------------------------------------------------------------------------
+// $Id: NSNotificationCenter+OCMAdditions.h$
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <Foundation/Foundation.h>
+
+@class OCMockObserver;
+
+
+@interface NSNotificationCenter(OCMAdditions)
+
+- (void)addMockObserver:(OCMockObserver *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender;
+
+@end
diff --git a/third_party/ocmock/OCMock/NSNotificationCenter+OCMAdditions.m b/third_party/ocmock/OCMock/NSNotificationCenter+OCMAdditions.m
new file mode 100644
index 0000000..68bc0be
--- /dev/null
+++ b/third_party/ocmock/OCMock/NSNotificationCenter+OCMAdditions.m
@@ -0,0 +1,16 @@
+//---------------------------------------------------------------------------------------
+// $Id: NSNotificationCenter+OCMAdditions.m$
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import "NSNotificationCenter+OCMAdditions.h"
+
+
+@implementation NSNotificationCenter(OCMAdditions)
+
+- (void)addMockObserver:(OCMockObserver *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender
+{
+ [self addObserver:notificationObserver selector:@selector(handleNotification:) name:notificationName object:notificationSender];
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/OCClassMockObject.h b/third_party/ocmock/OCMock/OCClassMockObject.h
new file mode 100644
index 0000000..439d7dd
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCClassMockObject.h
@@ -0,0 +1,17 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCClassMockObject.h 44 2009-05-08 23:20:16Z erik $
+// Copyright (c) 2005-2008 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <OCMock/OCMockObject.h>
+
+@interface OCClassMockObject : OCMockObject
+{
+ Class mockedClass;
+}
+
+- (id)initWithClass:(Class)aClass;
+
+- (Class)mockedClass;
+
+@end
diff --git a/third_party/ocmock/OCMock/OCClassMockObject.m b/third_party/ocmock/OCMock/OCClassMockObject.m
new file mode 100644
index 0000000..69a122a
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCClassMockObject.m
@@ -0,0 +1,43 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCClassMockObject.m 45 2009-05-26 18:32:21Z erik $
+// Copyright (c) 2005-2008 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import "OCClassMockObject.h"
+
+
+@implementation OCClassMockObject
+
+#pragma mark Initialisers, description, accessors, etc.
+
+- (id)initWithClass:(Class)aClass
+{
+ [super init];
+ mockedClass = aClass;
+ return self;
+}
+
+- (NSString *)description
+{
+ return [NSString stringWithFormat:@"OCMockObject[%@]", NSStringFromClass(mockedClass)];
+}
+
+- (Class)mockedClass
+{
+ return mockedClass;
+}
+
+
+#pragma mark Proxy API
+
+- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector
+{
+ return [mockedClass instanceMethodSignatureForSelector:aSelector];
+}
+
+- (BOOL)respondsToSelector:(SEL)selector
+{
+ return [mockedClass instancesRespondToSelector:selector];
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMArg.h b/third_party/ocmock/OCMock/OCMArg.h
new file mode 100644
index 0000000..b327512
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMArg.h
@@ -0,0 +1,30 @@
+//---------------------------------------------------------------------------------------
+// $Id: $
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <Foundation/Foundation.h>
+
+@interface OCMArg : NSObject
+
+// constraining arguments
+
++ (id)any;
++ (void *)anyPointer;
++ (id)isNil;
++ (id)isNotNil;
++ (id)isNotEqual:(id)value;
++ (id)checkWithSelector:(SEL)selector onObject:(id)anObject;
+
+// manipulating arguments
+
++ (id *)setTo:(id)value;
+
+// internal use only
+
++ (id)resolveSpecialValues:(NSValue *)value;
+
+@end
+
+#define OCMOCK_ANY [OCMArg any]
+#define OCMOCK_VALUE(variable) [NSValue value:&variable withObjCType:@encode(typeof(variable))]
diff --git a/third_party/ocmock/OCMock/OCMArg.m b/third_party/ocmock/OCMock/OCMArg.m
new file mode 100644
index 0000000..f8778bf
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMArg.m
@@ -0,0 +1,63 @@
+//---------------------------------------------------------------------------------------
+// $Id: $
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <OCMock/OCMArg.h>
+#import <OCMock/OCMConstraint.h>
+#import "OCMPassByRefSetter.h"
+
+@implementation OCMArg
+
++ (id)any
+{
+ return [OCMAnyConstraint constraint];
+}
+
++ (void *)anyPointer
+{
+ return (void *)0x01234567;
+}
+
++ (id)isNil
+{
+ return [OCMIsNilConstraint constraint];
+}
+
++ (id)isNotNil
+{
+ return [OCMIsNotNilConstraint constraint];
+}
+
++ (id)isNotEqual:(id)value
+{
+ OCMIsNotEqualConstraint *constraint = [OCMIsNotEqualConstraint constraint];
+ constraint->testValue = value;
+ return constraint;
+}
+
++ (id)checkWithSelector:(SEL)selector onObject:(id)anObject
+{
+ return [OCMConstraint constraintWithSelector:selector onObject:anObject];
+}
+
++ (id *)setTo:(id)value;
+{
+ return (id *)[[OCMPassByRefSetter alloc] initWithValue:value];
+}
+
++ (id)resolveSpecialValues:(NSValue *)value
+{
+ const char *type = [value objCType];
+ if(type[0] == '^')
+ {
+ void *pointer = [value pointerValue];
+ if(pointer == (void *)0x01234567)
+ return [OCMArg any];
+ if((pointer != NULL) && (((id)pointer)->isa == [OCMPassByRefSetter class]))
+ return (id)pointer;
+ }
+ return value;
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMBoxedReturnValueProvider.h b/third_party/ocmock/OCMock/OCMBoxedReturnValueProvider.h
new file mode 100644
index 0000000..3f13530
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMBoxedReturnValueProvider.h
@@ -0,0 +1,12 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMBoxedReturnValueProvider.h 50 2009-07-16 06:48:19Z erik $
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import "OCMReturnValueProvider.h"
+
+@interface OCMBoxedReturnValueProvider : OCMReturnValueProvider
+{
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMBoxedReturnValueProvider.m b/third_party/ocmock/OCMock/OCMBoxedReturnValueProvider.m
new file mode 100644
index 0000000..04831af
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMBoxedReturnValueProvider.m
@@ -0,0 +1,21 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMBoxedReturnValueProvider.m 50 2009-07-16 06:48:19Z erik $
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import "OCMBoxedReturnValueProvider.h"
+
+
+@implementation OCMBoxedReturnValueProvider
+
+- (void)handleInvocation:(NSInvocation *)anInvocation
+{
+ if(strcmp([[anInvocation methodSignature] methodReturnType], [(NSValue *)returnValue objCType]) != 0)
+ @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"Return value does not match method signature." userInfo:nil];
+ void *buffer = malloc([[anInvocation methodSignature] methodReturnLength]);
+ [returnValue getValue:buffer];
+ [anInvocation setReturnValue:buffer];
+ free(buffer);
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMConstraint.h b/third_party/ocmock/OCMock/OCMConstraint.h
new file mode 100644
index 0000000..8381dab
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMConstraint.h
@@ -0,0 +1,48 @@
+//---------------------------------------------------------------------------------------
+// $Id: $
+// Copyright (c) 2007-2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <Foundation/Foundation.h>
+
+@interface OCMConstraint : NSObject
+
++ (id)constraint;
+- (BOOL)evaluate:(id)value;
+
+// if you are looking for any, isNil, etc, they have moved to OCMArg
+
++ (id)constraintWithSelector:(SEL)aSelector onObject:(id)anObject;
++ (id)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue;
+
+// try to use [OCMArg checkWith...] instead of constraintWithSelector in here
+
+@end
+
+@interface OCMAnyConstraint : OCMConstraint
+@end
+
+@interface OCMIsNilConstraint : OCMConstraint
+@end
+
+@interface OCMIsNotNilConstraint : OCMConstraint
+@end
+
+@interface OCMIsNotEqualConstraint : OCMConstraint
+{
+ @public
+ id testValue;
+}
+
+@end
+
+@interface OCMInvocationConstraint : OCMConstraint
+{
+ @public
+ NSInvocation *invocation;
+}
+
+@end
+
+#define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self]
+#define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)]
diff --git a/third_party/ocmock/OCMock/OCMConstraint.m b/third_party/ocmock/OCMock/OCMConstraint.m
new file mode 100644
index 0000000..d04c9ce
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMConstraint.m
@@ -0,0 +1,114 @@
+//---------------------------------------------------------------------------------------
+// $Id: $
+// Copyright (c) 2007-2008 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <OCMock/OCMConstraint.h>
+
+
+@implementation OCMConstraint
+
++ (id)constraint
+{
+ return [[[self alloc] init] autorelease];
+}
+
+- (BOOL)evaluate:(id)value
+{
+ return NO;
+}
+
+
++ (id)constraintWithSelector:(SEL)aSelector onObject:(id)anObject
+{
+ OCMInvocationConstraint *constraint = [OCMInvocationConstraint constraint];
+ NSMethodSignature *signature = [anObject methodSignatureForSelector:aSelector];
+ if(signature == nil)
+ [NSException raise:NSInvalidArgumentException format:@"Unkown selector %@ used in constraint.", NSStringFromSelector(aSelector)];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setTarget:anObject];
+ [invocation setSelector:aSelector];
+ constraint->invocation = invocation;
+ return constraint;
+}
+
++ (id)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue
+{
+ OCMInvocationConstraint *constraint = [self constraintWithSelector:aSelector onObject:anObject];
+ if([[constraint->invocation methodSignature] numberOfArguments] < 4)
+ [NSException raise:NSInvalidArgumentException format:@"Constraint with value requires selector with two arguments."];
+ [constraint->invocation setArgument:&aValue atIndex:3];
+ return constraint;
+}
+
+@end
+
+
+
+#pragma mark -
+
+@implementation OCMAnyConstraint
+
+- (BOOL)evaluate:(id)value
+{
+ return YES;
+}
+
+@end
+
+
+
+#pragma mark -
+
+@implementation OCMIsNilConstraint
+
+- (BOOL)evaluate:(id)value
+{
+ return value == nil;
+}
+
+@end
+
+
+
+#pragma mark -
+
+@implementation OCMIsNotNilConstraint
+
+- (BOOL)evaluate:(id)value
+{
+ return value != nil;
+}
+
+@end
+
+
+
+#pragma mark -
+
+@implementation OCMIsNotEqualConstraint
+
+- (BOOL)evaluate:(id)value
+{
+ return ![value isEqualTo:testValue];
+}
+
+@end
+
+
+
+#pragma mark -
+
+@implementation OCMInvocationConstraint
+
+- (BOOL)evaluate:(id)value
+{
+ [invocation setArgument:&value atIndex:2]; // should test if constraint takes arg
+ [invocation invoke];
+ BOOL returnValue;
+ [invocation getReturnValue:&returnValue];
+ return returnValue;
+}
+
+@end
+
diff --git a/third_party/ocmock/OCMock/OCMConstraintTests.h b/third_party/ocmock/OCMock/OCMConstraintTests.h
new file mode 100644
index 0000000..ce5822f
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMConstraintTests.h
@@ -0,0 +1,14 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMockRecorderTests.h 2 2004-08-24 17:00:05Z erik $
+// Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <SenTestingKit/SenTestingKit.h>
+
+
+@interface OCMConstraintTests : SenTestCase
+{
+ BOOL didCallCustomConstraint;
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMConstraintTests.m b/third_party/ocmock/OCMock/OCMConstraintTests.m
new file mode 100644
index 0000000..b3a04e8
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMConstraintTests.m
@@ -0,0 +1,97 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMockRecorderTests.m 12 2006-06-11 02:41:31Z erik $
+// Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import "OCMConstraintTests.h"
+#import <OCMock/OCMConstraint.h>
+
+
+@implementation OCMConstraintTests
+
+- (void)setUp
+{
+ didCallCustomConstraint = NO;
+}
+
+- (void)testAnyAcceptsAnything
+{
+ OCMConstraint *constraint = [OCMAnyConstraint constraint];
+
+ STAssertTrue([constraint evaluate:@"foo"], @"Should have accepted a value.");
+ STAssertTrue([constraint evaluate:@"foo"], @"Should have accepted another value.");
+ STAssertTrue([constraint evaluate:@"foo"], @"Should have accepted nil.");
+}
+
+- (void)testIsNilAcceptsOnlyNil
+{
+ OCMConstraint *constraint = [OCMIsNilConstraint constraint];
+
+ STAssertFalse([constraint evaluate:@"foo"], @"Should not have accepted a value.");
+ STAssertTrue([constraint evaluate:nil], @"Should have accepted nil.");
+}
+
+- (void)testIsNotNilAcceptsAnythingButNil
+{
+ OCMConstraint *constraint = [OCMIsNotNilConstraint constraint];
+
+ STAssertTrue([constraint evaluate:@"foo"], @"Should have accepted a value.");
+ STAssertFalse([constraint evaluate:nil], @"Should not have accepted nil.");
+}
+
+- (void)testNotEqualAcceptsAnythingButValue
+{
+ OCMIsNotEqualConstraint *constraint = [OCMIsNotEqualConstraint constraint];
+ constraint->testValue = @"foo";
+
+ STAssertFalse([constraint evaluate:@"foo"], @"Should not have accepted value.");
+ STAssertTrue([constraint evaluate:@"bar"], @"Should have accepted other value.");
+ STAssertTrue([constraint evaluate:nil], @"Should have accepted nil.");
+}
+
+
+- (BOOL)checkArg:(id)theArg
+{
+ didCallCustomConstraint = YES;
+ return [theArg isEqualToString:@"foo"];
+}
+
+- (void)testUsesPlainMethod
+{
+ OCMConstraint *constraint = CONSTRAINT(@selector(checkArg:));
+
+ STAssertTrue([constraint evaluate:@"foo"], @"Should have accepted foo.");
+ STAssertTrue(didCallCustomConstraint, @"Should have used custom method.");
+ STAssertFalse([constraint evaluate:@"bar"], @"Should not have accepted bar.");
+}
+
+
+- (BOOL)checkArg:(id)theArg withValue:(id)value
+{
+ didCallCustomConstraint = YES;
+ return [theArg isEqualTo:value];
+}
+
+- (void)testUsesMethodWithValue
+{
+ OCMConstraint *constraint = CONSTRAINTV(@selector(checkArg:withValue:), @"foo");
+
+ STAssertTrue([constraint evaluate:@"foo"], @"Should have accepted foo.");
+ STAssertTrue(didCallCustomConstraint, @"Should have used custom method.");
+ STAssertFalse([constraint evaluate:@"bar"], @"Should not have accepted bar.");
+}
+
+
+- (void)testRaisesExceptionWhenConstraintMethodDoesNotTakeArgument
+{
+ STAssertThrows(CONSTRAINTV(@selector(checkArg:), @"bar"), @"Should have thrown for invalid constraint method.");
+}
+
+
+- (void)testRaisesExceptionOnUnknownSelector
+{
+ STAssertThrows(CONSTRAINTV(@selector(checkArgXXX:), @"bar"), @"Should have thrown for unknown constraint method.");
+}
+
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMExceptionReturnValueProvider.h b/third_party/ocmock/OCMock/OCMExceptionReturnValueProvider.h
new file mode 100644
index 0000000..b50ca07
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMExceptionReturnValueProvider.h
@@ -0,0 +1,12 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMExceptionReturnValueProvider.h 50 2009-07-16 06:48:19Z erik $
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import "OCMReturnValueProvider.h"
+
+@interface OCMExceptionReturnValueProvider : OCMReturnValueProvider
+{
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMExceptionReturnValueProvider.m b/third_party/ocmock/OCMock/OCMExceptionReturnValueProvider.m
new file mode 100644
index 0000000..60d901c
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMExceptionReturnValueProvider.m
@@ -0,0 +1,16 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMExceptionReturnValueProvider.m 50 2009-07-16 06:48:19Z erik $
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import "OCMExceptionReturnValueProvider.h"
+
+
+@implementation OCMExceptionReturnValueProvider
+
+- (void)handleInvocation:(NSInvocation *)anInvocation
+{
+ @throw returnValue;
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMIndirectReturnValueProvider.h b/third_party/ocmock/OCMock/OCMIndirectReturnValueProvider.h
new file mode 100644
index 0000000..8fe8747
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMIndirectReturnValueProvider.h
@@ -0,0 +1,16 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMIndirectReturnValueProvider.h 54 2009-08-18 06:27:36Z erik $
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <Foundation/Foundation.h>
+
+@interface OCMIndirectReturnValueProvider : NSObject
+{
+ id provider;
+ SEL selector;
+}
+
+- (id)initWithProvider:(id)aProvider andSelector:(SEL)aSelector;
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMIndirectReturnValueProvider.m b/third_party/ocmock/OCMock/OCMIndirectReturnValueProvider.m
new file mode 100644
index 0000000..f936950d
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMIndirectReturnValueProvider.m
@@ -0,0 +1,33 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMIndirectReturnValueProvider.m 54 2009-08-18 06:27:36Z erik $
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import "NSMethodSignature+OCMAdditions.h"
+#import "OCMIndirectReturnValueProvider.h"
+
+
+@implementation OCMIndirectReturnValueProvider
+
+- (id)initWithProvider:(id)aProvider andSelector:(SEL)aSelector
+{
+ [super init];
+ provider = [aProvider retain];
+ selector = aSelector;
+ return self;
+}
+
+- (void)dealloc
+{
+ [provider release];
+ [super dealloc];
+}
+
+- (void)handleInvocation:(NSInvocation *)anInvocation
+{
+ [anInvocation setTarget:provider];
+ [anInvocation setSelector:selector];
+ [anInvocation invoke];
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMNotificationPoster.h b/third_party/ocmock/OCMock/OCMNotificationPoster.h
new file mode 100644
index 0000000..fd7f05d
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMNotificationPoster.h
@@ -0,0 +1,17 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMNotificationPoster.h 50 2009-07-16 06:48:19Z erik $
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <Foundation/Foundation.h>
+
+@interface OCMNotificationPoster : NSObject
+{
+ NSNotification *notification;
+}
+
+- (id)initWithNotification:(id)aNotification;
+
+- (void)handleInvocation:(NSInvocation *)anInvocation;
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMNotificationPoster.m b/third_party/ocmock/OCMock/OCMNotificationPoster.m
new file mode 100644
index 0000000..f4a18b8
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMNotificationPoster.m
@@ -0,0 +1,30 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMNotificationPoster.m 50 2009-07-16 06:48:19Z erik $
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import "OCMNotificationPoster.h"
+
+
+@implementation OCMNotificationPoster
+
+- (id)initWithNotification:(id)aNotification
+{
+ [super init];
+ notification = [aNotification retain];
+ return self;
+}
+
+- (void)dealloc
+{
+ [notification release];
+ [super dealloc];
+}
+
+- (void)handleInvocation:(NSInvocation *)anInvocation
+{
+ [[NSNotificationCenter defaultCenter] postNotification:notification];
+}
+
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMObserverRecorder.h b/third_party/ocmock/OCMock/OCMObserverRecorder.h
new file mode 100644
index 0000000..556da3c
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMObserverRecorder.h
@@ -0,0 +1,19 @@
+//---------------------------------------------------------------------------------------
+// $Id$
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <Foundation/Foundation.h>
+
+@interface OCMObserverRecorder : NSObject
+{
+ NSNotification *recordedNotification;
+}
+
+- (void)notificationWithName:(NSString *)name object:(id)sender;
+
+- (BOOL)matchesNotification:(NSNotification *)aNotification;
+
+- (BOOL)argument:(id)expectedArg matchesArgument:(id)observedArg;
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMObserverRecorder.m b/third_party/ocmock/OCMock/OCMObserverRecorder.m
new file mode 100644
index 0000000..e50be50
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMObserverRecorder.m
@@ -0,0 +1,75 @@
+//---------------------------------------------------------------------------------------
+// $Id$
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <objc/runtime.h>
+#import <OCMock/OCMConstraint.h>
+#import "NSInvocation+OCMAdditions.h"
+#import "OCMObserverRecorder.h"
+
+@interface NSObject(HCMatcherDummy)
+- (BOOL)matches:(id)item;
+@end
+
+#pragma mark -
+
+
+@implementation OCMObserverRecorder
+
+#pragma mark Initialisers, description, accessors, etc.
+
+- (void)dealloc
+{
+ [recordedNotification release];
+ [super dealloc];
+}
+
+
+#pragma mark Recording
+
+- (void)notificationWithName:(NSString *)name object:(id)sender
+{
+ recordedNotification = [[NSNotification notificationWithName:name object:sender] retain];
+}
+
+- (void)notificationWithName:(NSString *)name object:(id)sender userInfo:(NSDictionary *)userInfo
+{
+ recordedNotification = [[NSNotification notificationWithName:name object:sender userInfo:userInfo] retain];
+}
+
+
+#pragma mark Verification
+
+- (BOOL)matchesNotification:(NSNotification *)aNotification
+{
+ return [self argument:[recordedNotification name] matchesArgument:[aNotification name]] &&
+ [self argument:[recordedNotification object] matchesArgument:[aNotification object]] &&
+ [self argument:[recordedNotification userInfo] matchesArgument:[aNotification userInfo]];
+}
+
+- (BOOL)argument:(id)expectedArg matchesArgument:(id)observedArg
+{
+ if([expectedArg isKindOfClass:[OCMConstraint class]])
+ {
+ if([expectedArg evaluate:observedArg] == NO)
+ return NO;
+ }
+ else if([expectedArg conformsToProtocol:objc_getProtocol("HCMatcher")])
+ {
+ if([expectedArg matches:observedArg] == NO)
+ return NO;
+ }
+ else
+ {
+ if([expectedArg class] != [observedArg class])
+ return NO;
+ if(([expectedArg isEqual:observedArg] == NO) &&
+ !((expectedArg == nil) && (observedArg == nil)))
+ return NO;
+ }
+ return YES;
+}
+
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMPassByRefSetter.h b/third_party/ocmock/OCMock/OCMPassByRefSetter.h
new file mode 100644
index 0000000..3934c1a
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMPassByRefSetter.h
@@ -0,0 +1,17 @@
+//---------------------------------------------------------------------------------------
+// $Id: $
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <Foundation/Foundation.h>
+
+@interface OCMPassByRefSetter : NSObject
+{
+ id value;
+}
+
+- (id)initWithValue:(id)value;
+
+- (id)value;
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMPassByRefSetter.m b/third_party/ocmock/OCMock/OCMPassByRefSetter.m
new file mode 100644
index 0000000..aae3cf3
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMPassByRefSetter.m
@@ -0,0 +1,29 @@
+//---------------------------------------------------------------------------------------
+// $Id: $
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import "OCMPassByRefSetter.h"
+
+
+@implementation OCMPassByRefSetter
+
+- (id)initWithValue:(id)aValue
+{
+ [super init];
+ value = [aValue retain];
+ return self;
+}
+
+- (void)dealloc
+{
+ [value release];
+ [super dealloc];
+}
+
+- (id)value
+{
+ return value;
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMReturnValueProvider.h b/third_party/ocmock/OCMock/OCMReturnValueProvider.h
new file mode 100644
index 0000000..5554ebd
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMReturnValueProvider.h
@@ -0,0 +1,17 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMReturnValueProvider.h 50 2009-07-16 06:48:19Z erik $
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <Foundation/Foundation.h>
+
+@interface OCMReturnValueProvider : NSObject
+{
+ id returnValue;
+}
+
+- (id)initWithValue:(id)aValue;
+
+- (void)handleInvocation:(NSInvocation *)anInvocation;
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMReturnValueProvider.m b/third_party/ocmock/OCMock/OCMReturnValueProvider.m
new file mode 100644
index 0000000..601b773
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMReturnValueProvider.m
@@ -0,0 +1,33 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMReturnValueProvider.m 52 2009-08-14 07:21:10Z erik $
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import "NSMethodSignature+OCMAdditions.h"
+#import "OCMReturnValueProvider.h"
+
+
+@implementation OCMReturnValueProvider
+
+- (id)initWithValue:(id)aValue
+{
+ [super init];
+ returnValue = [aValue retain];
+ return self;
+}
+
+- (void)dealloc
+{
+ [returnValue release];
+ [super dealloc];
+}
+
+- (void)handleInvocation:(NSInvocation *)anInvocation
+{
+ const char *returnType = [[anInvocation methodSignature] methodReturnTypeWithoutQualifiers];
+ if(strcmp(returnType, @encode(id)) != 0)
+ @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"Expected invocation with object return type." userInfo:nil];
+ [anInvocation setReturnValue:&returnValue];
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMock.h b/third_party/ocmock/OCMock/OCMock.h
new file mode 100644
index 0000000..892b3cc
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMock.h
@@ -0,0 +1,10 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMock.h 39 2009-04-09 05:31:28Z erik $
+// Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <OCMock/OCMockObject.h>
+#import <OCMock/OCMockRecorder.h>
+#import <OCMock/OCMConstraint.h>
+#import <OCMock/OCMArg.h>
+#import <OCMock/NSNotificationCenter+OCMAdditions.h>
diff --git a/third_party/ocmock/OCMock/OCMock.xcodeproj/project.pbxproj b/third_party/ocmock/OCMock/OCMock.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..aeb167b
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMock.xcodeproj/project.pbxproj
@@ -0,0 +1,795 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 44;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 030106730A3B9B240049FED7 /* NSInvocationOCMAdditionsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 030106470A3B99F20049FED7 /* NSInvocationOCMAdditionsTests.m */; };
+ 032797870E09F40E006CA665 /* hamcrest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 032797860E09F40E006CA665 /* hamcrest.framework */; };
+ 032798030E09F8B7006CA665 /* OCMockObjectHamcrestTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 032798020E09F8B7006CA665 /* OCMockObjectHamcrestTests.mm */; };
+ 0338A99807BE7C100066DE8A /* OCClassMockObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 0338A99607BE7C100066DE8A /* OCClassMockObject.h */; };
+ 0338A99907BE7C100066DE8A /* OCClassMockObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 0338A99707BE7C100066DE8A /* OCClassMockObject.m */; };
+ 0338A9F007BE83B50066DE8A /* OCProtocolMockObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 0338A9EE07BE83B50066DE8A /* OCProtocolMockObject.h */; settings = {ATTRIBUTES = (); }; };
+ 0338A9F107BE83B50066DE8A /* OCProtocolMockObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 0338A9EF07BE83B50066DE8A /* OCProtocolMockObject.m */; };
+ 0343133E0CCA771800A2E080 /* OCMConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0343133B0CCA771800A2E080 /* OCMConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 0343133F0CCA771800A2E080 /* OCMConstraint.m in Sources */ = {isa = PBXBuildFile; fileRef = 0343133C0CCA771800A2E080 /* OCMConstraint.m */; };
+ 034313EA0CCA7BC700A2E080 /* OCMConstraintTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 034313E90CCA7BC700A2E080 /* OCMConstraintTests.m */; };
+ 0378606E0F6A32F800A4D9A0 /* OCMArg.h in Headers */ = {isa = PBXBuildFile; fileRef = 0378606B0F6A32F800A4D9A0 /* OCMArg.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 0378606F0F6A32F800A4D9A0 /* OCMArg.m in Sources */ = {isa = PBXBuildFile; fileRef = 0378606C0F6A32F800A4D9A0 /* OCMArg.m */; };
+ 037860E20F6A3D4600A4D9A0 /* OCMPassByRefSetter.m in Sources */ = {isa = PBXBuildFile; fileRef = 037860E10F6A3D4600A4D9A0 /* OCMPassByRefSetter.m */; };
+ 037860E30F6A3D4600A4D9A0 /* OCMPassByRefSetter.h in Headers */ = {isa = PBXBuildFile; fileRef = 037860E00F6A3D4600A4D9A0 /* OCMPassByRefSetter.h */; };
+ 037860E40F6A3D4600A4D9A0 /* OCMPassByRefSetter.m in Sources */ = {isa = PBXBuildFile; fileRef = 037860E10F6A3D4600A4D9A0 /* OCMPassByRefSetter.m */; };
+ 037C13440FCC474D00257C8C /* OCPartialMockRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 037C13430FCC474D00257C8C /* OCPartialMockRecorder.m */; };
+ 037C13450FCC474D00257C8C /* OCPartialMockRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 037C13420FCC474D00257C8C /* OCPartialMockRecorder.h */; };
+ 037C13460FCC474D00257C8C /* OCPartialMockRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 037C13430FCC474D00257C8C /* OCPartialMockRecorder.m */; };
+ 03A2D0CB09F01D13008A1AFD /* NSInvocation+OCMAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 03A2D0C909F01D13008A1AFD /* NSInvocation+OCMAdditions.h */; settings = {ATTRIBUTES = (); }; };
+ 03A2D0CC09F01D13008A1AFD /* NSInvocation+OCMAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 03A2D0CA09F01D13008A1AFD /* NSInvocation+OCMAdditions.m */; };
+ 03BF2D4008F1C6BA00978C59 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03BF2D1B08F1C26700978C59 /* SenTestingKit.framework */; };
+ 03BF2D4108F1C6BC00978C59 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03DE218F06DB91CF00E5A2A8 /* Foundation.framework */; };
+ 03BF2D5E08F1C82C00978C59 /* OCMockRecorderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 03DE1F6106DB914100E5A2A8 /* OCMockRecorderTests.m */; };
+ 03BF2D5F08F1C82D00978C59 /* OCMockObjectTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 03DE1F5F06DB914100E5A2A8 /* OCMockObjectTests.m */; };
+ 03C36703100D69EB00BE9731 /* OCMReturnValueProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 03C36701100D69EB00BE9731 /* OCMReturnValueProvider.h */; };
+ 03C36704100D69EB00BE9731 /* OCMReturnValueProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 03C36702100D69EB00BE9731 /* OCMReturnValueProvider.m */; };
+ 03C36705100D69EB00BE9731 /* OCMReturnValueProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 03C36702100D69EB00BE9731 /* OCMReturnValueProvider.m */; };
+ 03C36724100D6B9600BE9731 /* OCMBoxedReturnValueProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 03C36722100D6B9600BE9731 /* OCMBoxedReturnValueProvider.h */; };
+ 03C36725100D6B9600BE9731 /* OCMBoxedReturnValueProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 03C36723100D6B9600BE9731 /* OCMBoxedReturnValueProvider.m */; };
+ 03C36726100D6B9600BE9731 /* OCMBoxedReturnValueProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 03C36723100D6B9600BE9731 /* OCMBoxedReturnValueProvider.m */; };
+ 03C36729100D6C7D00BE9731 /* OCMExceptionReturnValueProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 03C36727100D6C7D00BE9731 /* OCMExceptionReturnValueProvider.h */; };
+ 03C3672A100D6C7D00BE9731 /* OCMExceptionReturnValueProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 03C36728100D6C7D00BE9731 /* OCMExceptionReturnValueProvider.m */; };
+ 03C3672B100D6C7D00BE9731 /* OCMExceptionReturnValueProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 03C36728100D6C7D00BE9731 /* OCMExceptionReturnValueProvider.m */; };
+ 03C3672E100D6D0F00BE9731 /* OCMIndirectReturnValueProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 03C3672C100D6D0F00BE9731 /* OCMIndirectReturnValueProvider.h */; };
+ 03C3672F100D6D0F00BE9731 /* OCMIndirectReturnValueProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 03C3672D100D6D0F00BE9731 /* OCMIndirectReturnValueProvider.m */; };
+ 03C36730100D6D0F00BE9731 /* OCMIndirectReturnValueProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 03C3672D100D6D0F00BE9731 /* OCMIndirectReturnValueProvider.m */; };
+ 03C36775100D744700BE9731 /* OCMNotificationPoster.h in Headers */ = {isa = PBXBuildFile; fileRef = 03C36773100D744700BE9731 /* OCMNotificationPoster.h */; };
+ 03C36776100D744700BE9731 /* OCMNotificationPoster.m in Sources */ = {isa = PBXBuildFile; fileRef = 03C36774100D744700BE9731 /* OCMNotificationPoster.m */; };
+ 03C36777100D744700BE9731 /* OCMNotificationPoster.m in Sources */ = {isa = PBXBuildFile; fileRef = 03C36774100D744700BE9731 /* OCMNotificationPoster.m */; };
+ 03D880550F8C75980087D071 /* OCObserverMockObjectTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 03D880540F8C75980087D071 /* OCObserverMockObjectTest.m */; };
+ 03D880600F8C81DE0087D071 /* OCObserverMockObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 03D8805F0F8C81DE0087D071 /* OCObserverMockObject.m */; };
+ 03D880610F8C81DE0087D071 /* OCObserverMockObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 03D8805E0F8C81DE0087D071 /* OCObserverMockObject.h */; };
+ 03D880620F8C81DE0087D071 /* OCObserverMockObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 03D8805F0F8C81DE0087D071 /* OCObserverMockObject.m */; };
+ 03D880690F8C84480087D071 /* OCMockObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 03DE1F5506DB911300E5A2A8 /* OCMockObject.m */; };
+ 03D8806A0F8C84490087D071 /* OCClassMockObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 0338A99707BE7C100066DE8A /* OCClassMockObject.m */; };
+ 03D8806B0F8C844A0087D071 /* OCProtocolMockObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 0338A9EF07BE83B50066DE8A /* OCProtocolMockObject.m */; };
+ 03D8806C0F8C844B0087D071 /* OCMockRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 03DE1F5706DB911300E5A2A8 /* OCMockRecorder.m */; };
+ 03D8806D0F8C844C0087D071 /* OCMArg.m in Sources */ = {isa = PBXBuildFile; fileRef = 0378606C0F6A32F800A4D9A0 /* OCMArg.m */; };
+ 03D8806E0F8C844C0087D071 /* OCMConstraint.m in Sources */ = {isa = PBXBuildFile; fileRef = 0343133C0CCA771800A2E080 /* OCMConstraint.m */; };
+ 03D880700F8C84560087D071 /* NSInvocation+OCMAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 03A2D0CA09F01D13008A1AFD /* NSInvocation+OCMAdditions.m */; };
+ 03D880D50F8DA4750087D071 /* NSNotificationCenter+OCMAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 03D880D30F8DA4750087D071 /* NSNotificationCenter+OCMAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 03D880D60F8DA4750087D071 /* NSNotificationCenter+OCMAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 03D880D40F8DA4750087D071 /* NSNotificationCenter+OCMAdditions.m */; };
+ 03D880D70F8DA4750087D071 /* NSNotificationCenter+OCMAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 03D880D40F8DA4750087D071 /* NSNotificationCenter+OCMAdditions.m */; };
+ 03D881090F8DB0BB0087D071 /* OCMObserverRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 03D881070F8DB0BB0087D071 /* OCMObserverRecorder.h */; };
+ 03D8815B0F8DB37B0087D071 /* OCMObserverRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 03D8815A0F8DB37B0087D071 /* OCMObserverRecorder.m */; };
+ 03D8815C0F8DB37B0087D071 /* OCMObserverRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 03D8815A0F8DB37B0087D071 /* OCMObserverRecorder.m */; };
+ 03D8822F0FA151E20087D071 /* OCPartialMockObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 03D8822D0FA151E10087D071 /* OCPartialMockObject.h */; };
+ 03D882300FA151E20087D071 /* OCPartialMockObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 03D8822E0FA151E20087D071 /* OCPartialMockObject.m */; };
+ 03D882310FA151E20087D071 /* OCPartialMockObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 03D8822E0FA151E20087D071 /* OCPartialMockObject.m */; };
+ 03DE1F5806DB911300E5A2A8 /* OCMockObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 03DE1F5406DB911300E5A2A8 /* OCMockObject.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 03DE1F5906DB911300E5A2A8 /* OCMockObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 03DE1F5506DB911300E5A2A8 /* OCMockObject.m */; };
+ 03DE1F5A06DB911300E5A2A8 /* OCMockRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 03DE1F5606DB911300E5A2A8 /* OCMockRecorder.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 03DE1F5B06DB911300E5A2A8 /* OCMockRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 03DE1F5706DB911300E5A2A8 /* OCMockRecorder.m */; };
+ 03DE219006DB91CF00E5A2A8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03DE218F06DB91CF00E5A2A8 /* Foundation.framework */; };
+ 03DE21B306DB95C500E5A2A8 /* OCMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 03DE21B206DB95C500E5A2A8 /* OCMock.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 03DE221706DB97DA00E5A2A8 /* License.txt in Resources */ = {isa = PBXBuildFile; fileRef = 03DE221606DB97DA00E5A2A8 /* License.txt */; };
+ 03F1FE8910353A5F00E4962C /* NSMethodSignature+OCMAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 03F1FE8810353A5F00E4962C /* NSMethodSignature+OCMAdditions.m */; };
+ 03F1FE8A10353A5F00E4962C /* NSMethodSignature+OCMAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 03F1FE8710353A5F00E4962C /* NSMethodSignature+OCMAdditions.h */; };
+ 03F1FE8B10353A5F00E4962C /* NSMethodSignature+OCMAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 03F1FE8810353A5F00E4962C /* NSMethodSignature+OCMAdditions.m */; };
+ 8DC2EF510486A6940098B216 /* OCMock_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 32DBCF5E0370ADEE00C91783 /* OCMock_Prefix.pch */; };
+ 9F35D3DC0D349E7E00C05E52 /* OCMock.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* OCMock.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 9F35D3D40D349B5300C05E52 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
+ remoteInfo = OCMock;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+ 030106470A3B99F20049FED7 /* NSInvocationOCMAdditionsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSInvocationOCMAdditionsTests.m; sourceTree = "<group>"; };
+ 032797860E09F40E006CA665 /* hamcrest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = hamcrest.framework; path = "${TEMP_ROOT}/Frameworks/hamcrest.framework"; sourceTree = "<absolute>"; };
+ 032798010E09F8B7006CA665 /* OCMockObjectHamcrestTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMockObjectHamcrestTests.h; sourceTree = "<group>"; };
+ 032798020E09F8B7006CA665 /* OCMockObjectHamcrestTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = OCMockObjectHamcrestTests.mm; sourceTree = "<group>"; };
+ 0338A99607BE7C100066DE8A /* OCClassMockObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCClassMockObject.h; sourceTree = "<group>"; };
+ 0338A99707BE7C100066DE8A /* OCClassMockObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OCClassMockObject.m; sourceTree = "<group>"; };
+ 0338A9EE07BE83B50066DE8A /* OCProtocolMockObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCProtocolMockObject.h; sourceTree = "<group>"; };
+ 0338A9EF07BE83B50066DE8A /* OCProtocolMockObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OCProtocolMockObject.m; sourceTree = "<group>"; };
+ 0343133B0CCA771800A2E080 /* OCMConstraint.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = OCMConstraint.h; sourceTree = "<group>"; };
+ 0343133C0CCA771800A2E080 /* OCMConstraint.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = OCMConstraint.m; sourceTree = "<group>"; };
+ 034313E80CCA7BC700A2E080 /* OCMConstraintTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMConstraintTests.h; sourceTree = "<group>"; };
+ 034313E90CCA7BC700A2E080 /* OCMConstraintTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OCMConstraintTests.m; sourceTree = "<group>"; };
+ 0378606B0F6A32F800A4D9A0 /* OCMArg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMArg.h; sourceTree = "<group>"; };
+ 0378606C0F6A32F800A4D9A0 /* OCMArg.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OCMArg.m; sourceTree = "<group>"; };
+ 037860E00F6A3D4600A4D9A0 /* OCMPassByRefSetter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMPassByRefSetter.h; sourceTree = "<group>"; };
+ 037860E10F6A3D4600A4D9A0 /* OCMPassByRefSetter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OCMPassByRefSetter.m; sourceTree = "<group>"; };
+ 037C13420FCC474D00257C8C /* OCPartialMockRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCPartialMockRecorder.h; sourceTree = "<group>"; };
+ 037C13430FCC474D00257C8C /* OCPartialMockRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OCPartialMockRecorder.m; sourceTree = "<group>"; };
+ 03A2D0C909F01D13008A1AFD /* NSInvocation+OCMAdditions.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = "NSInvocation+OCMAdditions.h"; sourceTree = "<group>"; };
+ 03A2D0CA09F01D13008A1AFD /* NSInvocation+OCMAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSInvocation+OCMAdditions.m"; sourceTree = "<group>"; };
+ 03A2D1F809F1533C008A1AFD /* NSInvocationOCMAdditionsTests.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NSInvocationOCMAdditionsTests.h; sourceTree = "<group>"; };
+ 03BF2D1B08F1C26700978C59 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
+ 03BF2D3708F1C69500978C59 /* OCMockTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = OCMockTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
+ 03BF2D3808F1C69500978C59 /* Test-Info.plist */ = {isa = PBXFileReference; explicitFileType = text.plist.xml; path = "Test-Info.plist"; sourceTree = "<group>"; };
+ 03C36701100D69EB00BE9731 /* OCMReturnValueProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMReturnValueProvider.h; sourceTree = "<group>"; };
+ 03C36702100D69EB00BE9731 /* OCMReturnValueProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OCMReturnValueProvider.m; sourceTree = "<group>"; };
+ 03C36722100D6B9600BE9731 /* OCMBoxedReturnValueProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMBoxedReturnValueProvider.h; sourceTree = "<group>"; };
+ 03C36723100D6B9600BE9731 /* OCMBoxedReturnValueProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OCMBoxedReturnValueProvider.m; sourceTree = "<group>"; };
+ 03C36727100D6C7D00BE9731 /* OCMExceptionReturnValueProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMExceptionReturnValueProvider.h; sourceTree = "<group>"; };
+ 03C36728100D6C7D00BE9731 /* OCMExceptionReturnValueProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OCMExceptionReturnValueProvider.m; sourceTree = "<group>"; };
+ 03C3672C100D6D0F00BE9731 /* OCMIndirectReturnValueProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMIndirectReturnValueProvider.h; sourceTree = "<group>"; };
+ 03C3672D100D6D0F00BE9731 /* OCMIndirectReturnValueProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OCMIndirectReturnValueProvider.m; sourceTree = "<group>"; };
+ 03C36773100D744700BE9731 /* OCMNotificationPoster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMNotificationPoster.h; sourceTree = "<group>"; };
+ 03C36774100D744700BE9731 /* OCMNotificationPoster.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OCMNotificationPoster.m; sourceTree = "<group>"; };
+ 03D65B47094CA23B00DF6687 /* Changes.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Changes.txt; sourceTree = "<group>"; };
+ 03D880530F8C75980087D071 /* OCObserverMockObjectTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCObserverMockObjectTest.h; sourceTree = "<group>"; };
+ 03D880540F8C75980087D071 /* OCObserverMockObjectTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OCObserverMockObjectTest.m; sourceTree = "<group>"; };
+ 03D8805E0F8C81DE0087D071 /* OCObserverMockObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCObserverMockObject.h; sourceTree = "<group>"; };
+ 03D8805F0F8C81DE0087D071 /* OCObserverMockObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OCObserverMockObject.m; sourceTree = "<group>"; };
+ 03D880D30F8DA4750087D071 /* NSNotificationCenter+OCMAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSNotificationCenter+OCMAdditions.h"; sourceTree = "<group>"; };
+ 03D880D40F8DA4750087D071 /* NSNotificationCenter+OCMAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSNotificationCenter+OCMAdditions.m"; sourceTree = "<group>"; };
+ 03D881070F8DB0BB0087D071 /* OCMObserverRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMObserverRecorder.h; sourceTree = "<group>"; };
+ 03D8815A0F8DB37B0087D071 /* OCMObserverRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OCMObserverRecorder.m; sourceTree = "<group>"; };
+ 03D8822D0FA151E10087D071 /* OCPartialMockObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCPartialMockObject.h; sourceTree = "<group>"; };
+ 03D8822E0FA151E20087D071 /* OCPartialMockObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OCPartialMockObject.m; sourceTree = "<group>"; };
+ 03DE1F5406DB911300E5A2A8 /* OCMockObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = OCMockObject.h; sourceTree = "<group>"; };
+ 03DE1F5506DB911300E5A2A8 /* OCMockObject.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = OCMockObject.m; sourceTree = "<group>"; };
+ 03DE1F5606DB911300E5A2A8 /* OCMockRecorder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = OCMockRecorder.h; sourceTree = "<group>"; };
+ 03DE1F5706DB911300E5A2A8 /* OCMockRecorder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = OCMockRecorder.m; sourceTree = "<group>"; };
+ 03DE1F5E06DB914100E5A2A8 /* OCMockObjectTests.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = OCMockObjectTests.h; sourceTree = "<group>"; };
+ 03DE1F5F06DB914100E5A2A8 /* OCMockObjectTests.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = OCMockObjectTests.m; sourceTree = "<group>"; };
+ 03DE1F6006DB914100E5A2A8 /* OCMockRecorderTests.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = OCMockRecorderTests.h; sourceTree = "<group>"; };
+ 03DE1F6106DB914100E5A2A8 /* OCMockRecorderTests.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = OCMockRecorderTests.m; sourceTree = "<group>"; };
+ 03DE218F06DB91CF00E5A2A8 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+ 03DE21B206DB95C500E5A2A8 /* OCMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMock.h; sourceTree = "<group>"; };
+ 03DE221606DB97DA00E5A2A8 /* License.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = License.txt; sourceTree = "<group>"; };
+ 03F1FE8710353A5F00E4962C /* NSMethodSignature+OCMAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMethodSignature+OCMAdditions.h"; sourceTree = "<group>"; };
+ 03F1FE8810353A5F00E4962C /* NSMethodSignature+OCMAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMethodSignature+OCMAdditions.m"; sourceTree = "<group>"; };
+ 32DBCF5E0370ADEE00C91783 /* OCMock_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMock_Prefix.pch; sourceTree = "<group>"; };
+ 8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; explicitFileType = text.plist.xml; fileEncoding = 4; path = Info.plist; sourceTree = "<group>"; };
+ 8DC2EF5B0486A6940098B216 /* OCMock.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OCMock.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 03BF2D3408F1C69500978C59 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 03BF2D4008F1C6BA00978C59 /* SenTestingKit.framework in Frameworks */,
+ 03BF2D4108F1C6BC00978C59 /* Foundation.framework in Frameworks */,
+ 9F35D3DC0D349E7E00C05E52 /* OCMock.framework in Frameworks */,
+ 032797870E09F40E006CA665 /* hamcrest.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 8DC2EF560486A6940098B216 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 03DE219006DB91CF00E5A2A8 /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 034768DFFF38A50411DB9C8B /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8DC2EF5B0486A6940098B216 /* OCMock.framework */,
+ 03BF2D3708F1C69500978C59 /* OCMockTests.octest */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 037C13470FCC475500257C8C /* Core Mocks */ = {
+ isa = PBXGroup;
+ children = (
+ 03DE1F5406DB911300E5A2A8 /* OCMockObject.h */,
+ 03DE1F5506DB911300E5A2A8 /* OCMockObject.m */,
+ 0338A99607BE7C100066DE8A /* OCClassMockObject.h */,
+ 0338A99707BE7C100066DE8A /* OCClassMockObject.m */,
+ 0338A9EE07BE83B50066DE8A /* OCProtocolMockObject.h */,
+ 0338A9EF07BE83B50066DE8A /* OCProtocolMockObject.m */,
+ 03DE1F5606DB911300E5A2A8 /* OCMockRecorder.h */,
+ 03DE1F5706DB911300E5A2A8 /* OCMockRecorder.m */,
+ 03C366FB100D68F100BE9731 /* Invocation Handler */,
+ );
+ name = "Core Mocks";
+ sourceTree = "<group>";
+ };
+ 037C13480FCC478500257C8C /* Partial Mocks */ = {
+ isa = PBXGroup;
+ children = (
+ 03D8822D0FA151E10087D071 /* OCPartialMockObject.h */,
+ 03D8822E0FA151E20087D071 /* OCPartialMockObject.m */,
+ 037C13420FCC474D00257C8C /* OCPartialMockRecorder.h */,
+ 037C13430FCC474D00257C8C /* OCPartialMockRecorder.m */,
+ );
+ name = "Partial Mocks";
+ sourceTree = "<group>";
+ };
+ 037C13490FCC479D00257C8C /* Observer Mocks */ = {
+ isa = PBXGroup;
+ children = (
+ 03D8805E0F8C81DE0087D071 /* OCObserverMockObject.h */,
+ 03D8805F0F8C81DE0087D071 /* OCObserverMockObject.m */,
+ 03D881070F8DB0BB0087D071 /* OCMObserverRecorder.h */,
+ 03D8815A0F8DB37B0087D071 /* OCMObserverRecorder.m */,
+ );
+ name = "Observer Mocks";
+ sourceTree = "<group>";
+ };
+ 037C134A0FCC47B500257C8C /* Argument Handling */ = {
+ isa = PBXGroup;
+ children = (
+ 0378606B0F6A32F800A4D9A0 /* OCMArg.h */,
+ 0378606C0F6A32F800A4D9A0 /* OCMArg.m */,
+ 0343133B0CCA771800A2E080 /* OCMConstraint.h */,
+ 0343133C0CCA771800A2E080 /* OCMConstraint.m */,
+ 037860E00F6A3D4600A4D9A0 /* OCMPassByRefSetter.h */,
+ 037860E10F6A3D4600A4D9A0 /* OCMPassByRefSetter.m */,
+ );
+ name = "Argument Handling";
+ sourceTree = "<group>";
+ };
+ 037C134B0FCC47CA00257C8C /* Foundation Additions */ = {
+ isa = PBXGroup;
+ children = (
+ 03A2D0C909F01D13008A1AFD /* NSInvocation+OCMAdditions.h */,
+ 03A2D0CA09F01D13008A1AFD /* NSInvocation+OCMAdditions.m */,
+ 03D880D30F8DA4750087D071 /* NSNotificationCenter+OCMAdditions.h */,
+ 03D880D40F8DA4750087D071 /* NSNotificationCenter+OCMAdditions.m */,
+ 03F1FE8710353A5F00E4962C /* NSMethodSignature+OCMAdditions.h */,
+ 03F1FE8810353A5F00E4962C /* NSMethodSignature+OCMAdditions.m */,
+ );
+ name = "Foundation Additions";
+ sourceTree = "<group>";
+ };
+ 03C366FB100D68F100BE9731 /* Invocation Handler */ = {
+ isa = PBXGroup;
+ children = (
+ 03C36701100D69EB00BE9731 /* OCMReturnValueProvider.h */,
+ 03C36702100D69EB00BE9731 /* OCMReturnValueProvider.m */,
+ 03C36722100D6B9600BE9731 /* OCMBoxedReturnValueProvider.h */,
+ 03C36723100D6B9600BE9731 /* OCMBoxedReturnValueProvider.m */,
+ 03C36727100D6C7D00BE9731 /* OCMExceptionReturnValueProvider.h */,
+ 03C36728100D6C7D00BE9731 /* OCMExceptionReturnValueProvider.m */,
+ 03C3672C100D6D0F00BE9731 /* OCMIndirectReturnValueProvider.h */,
+ 03C3672D100D6D0F00BE9731 /* OCMIndirectReturnValueProvider.m */,
+ 03C36773100D744700BE9731 /* OCMNotificationPoster.h */,
+ 03C36774100D744700BE9731 /* OCMNotificationPoster.m */,
+ );
+ name = "Invocation Handler";
+ sourceTree = "<group>";
+ };
+ 03DE1F5D06DB911C00E5A2A8 /* Tests */ = {
+ isa = PBXGroup;
+ children = (
+ 03DE1F5E06DB914100E5A2A8 /* OCMockObjectTests.h */,
+ 03DE1F5F06DB914100E5A2A8 /* OCMockObjectTests.m */,
+ 032798010E09F8B7006CA665 /* OCMockObjectHamcrestTests.h */,
+ 032798020E09F8B7006CA665 /* OCMockObjectHamcrestTests.mm */,
+ 03D880530F8C75980087D071 /* OCObserverMockObjectTest.h */,
+ 03D880540F8C75980087D071 /* OCObserverMockObjectTest.m */,
+ 03DE1F6006DB914100E5A2A8 /* OCMockRecorderTests.h */,
+ 03DE1F6106DB914100E5A2A8 /* OCMockRecorderTests.m */,
+ 034313E80CCA7BC700A2E080 /* OCMConstraintTests.h */,
+ 034313E90CCA7BC700A2E080 /* OCMConstraintTests.m */,
+ 03A2D1F809F1533C008A1AFD /* NSInvocationOCMAdditionsTests.h */,
+ 030106470A3B99F20049FED7 /* NSInvocationOCMAdditionsTests.m */,
+ 32C88DFF0371C24200C91783 /* Other Sources */,
+ );
+ name = Tests;
+ sourceTree = "<group>";
+ };
+ 03DE21B506DB95CB00E5A2A8 /* Public Headers */ = {
+ isa = PBXGroup;
+ children = (
+ 03DE21B206DB95C500E5A2A8 /* OCMock.h */,
+ );
+ name = "Public Headers";
+ sourceTree = "<group>";
+ };
+ 0867D691FE84028FC02AAC07 /* OCMock */ = {
+ isa = PBXGroup;
+ children = (
+ 03DE21B506DB95CB00E5A2A8 /* Public Headers */,
+ 08FB77AEFE84172EC02AAC07 /* Implementation */,
+ 03DE1F5D06DB911C00E5A2A8 /* Tests */,
+ 089C1665FE841158C02AAC07 /* Resources */,
+ 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */,
+ 034768DFFF38A50411DB9C8B /* Products */,
+ );
+ name = OCMock;
+ sourceTree = "<group>";
+ };
+ 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = {
+ isa = PBXGroup;
+ children = (
+ 1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */,
+ 1058C7B2FEA5585E11CA2CBB /* Other Frameworks */,
+ );
+ name = "External Frameworks and Libraries";
+ sourceTree = "<group>";
+ };
+ 089C1665FE841158C02AAC07 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 03DE221606DB97DA00E5A2A8 /* License.txt */,
+ 03D65B47094CA23B00DF6687 /* Changes.txt */,
+ 03BF2D3808F1C69500978C59 /* Test-Info.plist */,
+ 8DC2EF5A0486A6940098B216 /* Info.plist */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 08FB77AEFE84172EC02AAC07 /* Implementation */ = {
+ isa = PBXGroup;
+ children = (
+ 037C13470FCC475500257C8C /* Core Mocks */,
+ 037C13480FCC478500257C8C /* Partial Mocks */,
+ 037C13490FCC479D00257C8C /* Observer Mocks */,
+ 037C134A0FCC47B500257C8C /* Argument Handling */,
+ 037C134B0FCC47CA00257C8C /* Foundation Additions */,
+ );
+ name = Implementation;
+ sourceTree = "<group>";
+ };
+ 1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 032797860E09F40E006CA665 /* hamcrest.framework */,
+ 03DE218F06DB91CF00E5A2A8 /* Foundation.framework */,
+ 03BF2D1B08F1C26700978C59 /* SenTestingKit.framework */,
+ );
+ name = "Linked Frameworks";
+ sourceTree = "<group>";
+ };
+ 1058C7B2FEA5585E11CA2CBB /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 32C88DFF0371C24200C91783 /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 32DBCF5E0370ADEE00C91783 /* OCMock_Prefix.pch */,
+ );
+ name = "Other Sources";
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ 8DC2EF500486A6940098B216 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8DC2EF510486A6940098B216 /* OCMock_Prefix.pch in Headers */,
+ 03DE1F5806DB911300E5A2A8 /* OCMockObject.h in Headers */,
+ 03DE1F5A06DB911300E5A2A8 /* OCMockRecorder.h in Headers */,
+ 03DE21B306DB95C500E5A2A8 /* OCMock.h in Headers */,
+ 0338A99807BE7C100066DE8A /* OCClassMockObject.h in Headers */,
+ 0338A9F007BE83B50066DE8A /* OCProtocolMockObject.h in Headers */,
+ 03A2D0CB09F01D13008A1AFD /* NSInvocation+OCMAdditions.h in Headers */,
+ 0343133E0CCA771800A2E080 /* OCMConstraint.h in Headers */,
+ 0378606E0F6A32F800A4D9A0 /* OCMArg.h in Headers */,
+ 037860E30F6A3D4600A4D9A0 /* OCMPassByRefSetter.h in Headers */,
+ 03D880610F8C81DE0087D071 /* OCObserverMockObject.h in Headers */,
+ 03D880D50F8DA4750087D071 /* NSNotificationCenter+OCMAdditions.h in Headers */,
+ 03D881090F8DB0BB0087D071 /* OCMObserverRecorder.h in Headers */,
+ 03D8822F0FA151E20087D071 /* OCPartialMockObject.h in Headers */,
+ 037C13450FCC474D00257C8C /* OCPartialMockRecorder.h in Headers */,
+ 03C36703100D69EB00BE9731 /* OCMReturnValueProvider.h in Headers */,
+ 03C36724100D6B9600BE9731 /* OCMBoxedReturnValueProvider.h in Headers */,
+ 03C36729100D6C7D00BE9731 /* OCMExceptionReturnValueProvider.h in Headers */,
+ 03C3672E100D6D0F00BE9731 /* OCMIndirectReturnValueProvider.h in Headers */,
+ 03C36775100D744700BE9731 /* OCMNotificationPoster.h in Headers */,
+ 03F1FE8A10353A5F00E4962C /* NSMethodSignature+OCMAdditions.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ 03BF2D3608F1C69500978C59 /* OCMockTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 03BF2D3B08F1C69600978C59 /* Build configuration list for PBXNativeTarget "OCMockTests" */;
+ buildPhases = (
+ 032798EB0E0A0583006CA665 /* ShellScript */,
+ 03BF2D3208F1C69500978C59 /* Resources */,
+ 03BF2D3308F1C69500978C59 /* Sources */,
+ 03BF2D3408F1C69500978C59 /* Frameworks */,
+ 03BF2D3508F1C69500978C59 /* ShellScript */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 9F35D3D50D349B5300C05E52 /* PBXTargetDependency */,
+ );
+ name = OCMockTests;
+ productName = Test;
+ productReference = 03BF2D3708F1C69500978C59 /* OCMockTests.octest */;
+ productType = "com.apple.product-type.bundle";
+ };
+ 8DC2EF4F0486A6940098B216 /* OCMock */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 03DFEE0808F04987002E8661 /* Build configuration list for PBXNativeTarget "OCMock" */;
+ buildPhases = (
+ 8DC2EF500486A6940098B216 /* Headers */,
+ 8DC2EF520486A6940098B216 /* Resources */,
+ 8DC2EF540486A6940098B216 /* Sources */,
+ 8DC2EF560486A6940098B216 /* Frameworks */,
+ 8DC2EF580486A6940098B216 /* Rez */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = OCMock;
+ productInstallPath = "$(HOME)/Library/Frameworks";
+ productName = OCMock;
+ productReference = 8DC2EF5B0486A6940098B216 /* OCMock.framework */;
+ productType = "com.apple.product-type.framework";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 0867D690FE84028FC02AAC07 /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = 03DFEE1208F04987002E8661 /* Build configuration list for PBXProject "OCMock" */;
+ compatibilityVersion = "Xcode 3.0";
+ hasScannedForEncodings = 1;
+ mainGroup = 0867D691FE84028FC02AAC07 /* OCMock */;
+ productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8DC2EF4F0486A6940098B216 /* OCMock */,
+ 03BF2D3608F1C69500978C59 /* OCMockTests */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 03BF2D3208F1C69500978C59 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 8DC2EF520486A6940098B216 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 03DE221706DB97DA00E5A2A8 /* License.txt in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXRezBuildPhase section */
+ 8DC2EF580486A6940098B216 /* Rez */ = {
+ isa = PBXRezBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXRezBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ 032798EB0E0A0583006CA665 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "# Unpack frameworks required for this target\npushd \"${TEMP_ROOT}\"\nif [ ! -d Frameworks ]; then\n\tmkdir Frameworks\nfi\ncd Frameworks\nif [ ! -d hamcrest.framework ]; then\n gnutar xjf \"${PROJECT_DIR}/Frameworks/hamcrest.tar.bz2\"\nfi\npopd\n";
+ };
+ 03BF2D3508F1C69500978C59 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "# Run the unit tests in this test bundle.\nexport DYLD_FRAMEWORK_PATH=\"${TEMP_ROOT}/Frameworks\"\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 03BF2D3308F1C69500978C59 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 03BF2D5E08F1C82C00978C59 /* OCMockRecorderTests.m in Sources */,
+ 03BF2D5F08F1C82D00978C59 /* OCMockObjectTests.m in Sources */,
+ 030106730A3B9B240049FED7 /* NSInvocationOCMAdditionsTests.m in Sources */,
+ 034313EA0CCA7BC700A2E080 /* OCMConstraintTests.m in Sources */,
+ 032798030E09F8B7006CA665 /* OCMockObjectHamcrestTests.mm in Sources */,
+ 037860E20F6A3D4600A4D9A0 /* OCMPassByRefSetter.m in Sources */,
+ 03D880550F8C75980087D071 /* OCObserverMockObjectTest.m in Sources */,
+ 03D880600F8C81DE0087D071 /* OCObserverMockObject.m in Sources */,
+ 03D880690F8C84480087D071 /* OCMockObject.m in Sources */,
+ 03D8806A0F8C84490087D071 /* OCClassMockObject.m in Sources */,
+ 03D8806B0F8C844A0087D071 /* OCProtocolMockObject.m in Sources */,
+ 03D8806C0F8C844B0087D071 /* OCMockRecorder.m in Sources */,
+ 03D8806D0F8C844C0087D071 /* OCMArg.m in Sources */,
+ 03D8806E0F8C844C0087D071 /* OCMConstraint.m in Sources */,
+ 03D880700F8C84560087D071 /* NSInvocation+OCMAdditions.m in Sources */,
+ 03D880D70F8DA4750087D071 /* NSNotificationCenter+OCMAdditions.m in Sources */,
+ 03D8815C0F8DB37B0087D071 /* OCMObserverRecorder.m in Sources */,
+ 03D882310FA151E20087D071 /* OCPartialMockObject.m in Sources */,
+ 037C13440FCC474D00257C8C /* OCPartialMockRecorder.m in Sources */,
+ 03C36705100D69EB00BE9731 /* OCMReturnValueProvider.m in Sources */,
+ 03C36726100D6B9600BE9731 /* OCMBoxedReturnValueProvider.m in Sources */,
+ 03C3672B100D6C7D00BE9731 /* OCMExceptionReturnValueProvider.m in Sources */,
+ 03C36730100D6D0F00BE9731 /* OCMIndirectReturnValueProvider.m in Sources */,
+ 03C36777100D744700BE9731 /* OCMNotificationPoster.m in Sources */,
+ 03F1FE8910353A5F00E4962C /* NSMethodSignature+OCMAdditions.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 8DC2EF540486A6940098B216 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 03DE1F5906DB911300E5A2A8 /* OCMockObject.m in Sources */,
+ 03DE1F5B06DB911300E5A2A8 /* OCMockRecorder.m in Sources */,
+ 0338A99907BE7C100066DE8A /* OCClassMockObject.m in Sources */,
+ 0338A9F107BE83B50066DE8A /* OCProtocolMockObject.m in Sources */,
+ 03A2D0CC09F01D13008A1AFD /* NSInvocation+OCMAdditions.m in Sources */,
+ 0343133F0CCA771800A2E080 /* OCMConstraint.m in Sources */,
+ 0378606F0F6A32F800A4D9A0 /* OCMArg.m in Sources */,
+ 037860E40F6A3D4600A4D9A0 /* OCMPassByRefSetter.m in Sources */,
+ 03D880620F8C81DE0087D071 /* OCObserverMockObject.m in Sources */,
+ 03D880D60F8DA4750087D071 /* NSNotificationCenter+OCMAdditions.m in Sources */,
+ 03D8815B0F8DB37B0087D071 /* OCMObserverRecorder.m in Sources */,
+ 03D882300FA151E20087D071 /* OCPartialMockObject.m in Sources */,
+ 037C13460FCC474D00257C8C /* OCPartialMockRecorder.m in Sources */,
+ 03C36704100D69EB00BE9731 /* OCMReturnValueProvider.m in Sources */,
+ 03C36725100D6B9600BE9731 /* OCMBoxedReturnValueProvider.m in Sources */,
+ 03C3672A100D6C7D00BE9731 /* OCMExceptionReturnValueProvider.m in Sources */,
+ 03C3672F100D6D0F00BE9731 /* OCMIndirectReturnValueProvider.m in Sources */,
+ 03C36776100D744700BE9731 /* OCMNotificationPoster.m in Sources */,
+ 03F1FE8B10353A5F00E4962C /* NSMethodSignature+OCMAdditions.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 9F35D3D50D349B5300C05E52 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 8DC2EF4F0486A6940098B216 /* OCMock */;
+ targetProxy = 9F35D3D40D349B5300C05E52 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin XCBuildConfiguration section */
+ 03BF2D3C08F1C69600978C59 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(value)",
+ "$(DEVELOPER_FRAMEWORKS_DIR_QUOTED)",
+ );
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = OCMock_Prefix.pch;
+ INFOPLIST_FILE = "Test-Info.plist";
+ INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles";
+ LIBRARY_STYLE = BUNDLE;
+ OTHER_CFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PREBINDING = NO;
+ PRODUCT_NAME = OCMockTests;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = (
+ "-Wmost",
+ "-Wno-four-char-constants",
+ "-Wno-unknown-pragmas",
+ );
+ WRAPPER_EXTENSION = octest;
+ };
+ name = Debug;
+ };
+ 03BF2D3D08F1C69600978C59 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(value)",
+ "$(DEVELOPER_FRAMEWORKS_DIR_QUOTED)",
+ );
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = OCMock_Prefix.pch;
+ INFOPLIST_FILE = "Test-Info.plist";
+ INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles";
+ LIBRARY_STYLE = BUNDLE;
+ OTHER_CFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PREBINDING = NO;
+ PRODUCT_NAME = OCMockTests;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = (
+ "-Wmost",
+ "-Wno-four-char-constants",
+ "-Wno-unknown-pragmas",
+ );
+ WRAPPER_EXTENSION = octest;
+ };
+ name = Release;
+ };
+ 03DFEE0908F04987002E8661 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ DEBUGGING_SYMBOLS = YES;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ FRAMEWORK_SEARCH_PATHS = /Library/Frameworks;
+ FRAMEWORK_VERSION = A;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_ENABLE_TRIGRAPHS = NO;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = OCMock_Prefix.pch;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
+ GCC_WARN_UNKNOWN_PRAGMAS = NO;
+ HEADER_SEARCH_PATHS = "";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = /Library/Frameworks;
+ LIBRARY_SEARCH_PATHS = "";
+ LIBRARY_STYLE = Dynamic;
+ MACH_O_TYPE = mh_dylib;
+ OTHER_CFLAGS = "-fobjc-exceptions";
+ OTHER_LDFLAGS = "";
+ PRODUCT_NAME = OCMock;
+ SECTORDER_FLAGS = "";
+ TEST_AFTER_BUILD = YES;
+ WARNING_CFLAGS = (
+ "-Wmost",
+ "-Wno-four-char-constants",
+ "-Wno-unknown-pragmas",
+ );
+ WRAPPER_EXTENSION = framework;
+ ZERO_LINK = YES;
+ };
+ name = Debug;
+ };
+ 03DFEE0A08F04987002E8661 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ FRAMEWORK_SEARCH_PATHS = /Library/Frameworks;
+ FRAMEWORK_VERSION = A;
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_ENABLE_TRIGRAPHS = NO;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = OCMock_Prefix.pch;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
+ GCC_WARN_UNKNOWN_PRAGMAS = NO;
+ HEADER_SEARCH_PATHS = "";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = /Library/Frameworks;
+ LIBRARY_SEARCH_PATHS = "";
+ LIBRARY_STYLE = Dynamic;
+ MACH_O_TYPE = mh_dylib;
+ OTHER_CFLAGS = "-fobjc-exceptions";
+ OTHER_LDFLAGS = "";
+ PRODUCT_NAME = OCMock;
+ SECTORDER_FLAGS = "";
+ TEST_AFTER_BUILD = YES;
+ WARNING_CFLAGS = (
+ "-Wmost",
+ "-Wno-four-char-constants",
+ "-Wno-unknown-pragmas",
+ );
+ WRAPPER_EXTENSION = framework;
+ ZERO_LINK = NO;
+ };
+ name = Release;
+ };
+ 03DFEE1308F04987002E8661 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(NATIVE_ARCH_32_BIT)";
+ FRAMEWORK_SEARCH_PATHS = "$(TEMP_ROOT)/Frameworks";
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_INPUT_FILETYPE = automatic;
+ LD_DYLIB_INSTALL_NAME = "@rpath/$(EXECUTABLE_PATH)";
+ LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
+ };
+ name = Debug;
+ };
+ 03DFEE1408F04987002E8661 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = (
+ i386,
+ ppc,
+ ppc64,
+ x86_64,
+ );
+ FRAMEWORK_SEARCH_PATHS = "$(TEMP_ROOT)/Frameworks";
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_INPUT_FILETYPE = automatic;
+ LD_DYLIB_INSTALL_NAME = "@rpath/$(EXECUTABLE_PATH)";
+ LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 03BF2D3B08F1C69600978C59 /* Build configuration list for PBXNativeTarget "OCMockTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 03BF2D3C08F1C69600978C59 /* Debug */,
+ 03BF2D3D08F1C69600978C59 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 03DFEE0808F04987002E8661 /* Build configuration list for PBXNativeTarget "OCMock" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 03DFEE0908F04987002E8661 /* Debug */,
+ 03DFEE0A08F04987002E8661 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 03DFEE1208F04987002E8661 /* Build configuration list for PBXProject "OCMock" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 03DFEE1308F04987002E8661 /* Debug */,
+ 03DFEE1408F04987002E8661 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
+}
diff --git a/third_party/ocmock/OCMock/OCMockObject.h b/third_party/ocmock/OCMock/OCMockObject.h
new file mode 100644
index 0000000..a334b57
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMockObject.h
@@ -0,0 +1,41 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMockObject.h 52 2009-08-14 07:21:10Z erik $
+// Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <Foundation/Foundation.h>
+
+@interface OCMockObject : NSProxy
+{
+ BOOL isNice;
+ BOOL expectationOrderMatters;
+ NSMutableArray *recorders;
+ NSMutableArray *expectations;
+ NSMutableArray *exceptions;
+}
+
++ (id)mockForClass:(Class)aClass;
++ (id)mockForProtocol:(Protocol *)aProtocol;
++ (id)partialMockForObject:(NSObject *)anObject;
+
++ (id)niceMockForClass:(Class)aClass;
++ (id)niceMockForProtocol:(Protocol *)aProtocol;
+
++ (id)observerMock;
+
+- (id)init;
+
+- (void)setExpectationOrderMatters:(BOOL)flag;
+
+- (id)stub;
+- (id)expect;
+
+- (void)verify;
+
+// internal use only
+
+- (id)getNewRecorder;
+- (BOOL)handleInvocation:(NSInvocation *)anInvocation;
+- (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation;
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMockObject.m b/third_party/ocmock/OCMock/OCMockObject.m
new file mode 100644
index 0000000..930216d
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMockObject.m
@@ -0,0 +1,229 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMockObject.m 53 2009-08-14 07:37:55Z erik $
+// Copyright (c) 2004-2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <OCMock/OCMockObject.h>
+#import "OCClassMockObject.h"
+#import "OCProtocolMockObject.h"
+#import "OCPartialMockObject.h"
+#import "OCObserverMockObject.h"
+#import <OCMock/OCMockRecorder.h>
+#import "NSInvocation+OCMAdditions.h"
+
+@interface OCMockObject(Private)
++ (id)_makeNice:(OCMockObject *)mock;
+- (NSString *)_recorderDescriptions:(BOOL)onlyExpectations;
+@end
+
+#pragma mark -
+
+
+
+@implementation OCMockObject
+
+#pragma mark Factory methods
+
++ (id)mockForClass:(Class)aClass
+{
+ return [[[OCClassMockObject alloc] initWithClass:aClass] autorelease];
+}
+
++ (id)mockForProtocol:(Protocol *)aProtocol
+{
+ return [[[OCProtocolMockObject alloc] initWithProtocol:aProtocol] autorelease];
+}
+
++ (id)partialMockForObject:(NSObject *)anObject
+{
+ return [[[OCPartialMockObject alloc] initWithObject:anObject] autorelease];
+}
+
+
++ (id)niceMockForClass:(Class)aClass
+{
+ return [self _makeNice:[self mockForClass:aClass]];
+}
+
++ (id)niceMockForProtocol:(Protocol *)aProtocol
+{
+ return [self _makeNice:[self mockForProtocol:aProtocol]];
+}
+
+
++ (id)_makeNice:(OCMockObject *)mock
+{
+ mock->isNice = YES;
+ return mock;
+}
+
+
++ (id)observerMock
+{
+ return [[[OCObserverMockObject alloc] init] autorelease];
+}
+
+
+
+#pragma mark Initialisers, description, accessors, etc.
+
+- (id)init
+{
+ // no [super init], we're inheriting from NSProxy
+ expectationOrderMatters = NO;
+ recorders = [[NSMutableArray alloc] init];
+ expectations = [[NSMutableArray alloc] init];
+ exceptions = [[NSMutableArray alloc] init];
+ return self;
+}
+
+- (void)dealloc
+{
+ [recorders release];
+ [expectations release];
+ [exceptions release];
+ [super dealloc];
+}
+
+- (NSString *)description
+{
+ return @"OCMockObject";
+}
+
+
+- (void)setExpectationOrderMatters:(BOOL)flag
+{
+ expectationOrderMatters = flag;
+}
+
+
+#pragma mark Public API
+
+- (id)stub
+{
+ OCMockRecorder *recorder = [self getNewRecorder];
+ [recorders addObject:recorder];
+ return recorder;
+}
+
+
+- (id)expect
+{
+ OCMockRecorder *recorder = [self stub];
+ [expectations addObject:recorder];
+ return recorder;
+}
+
+
+- (void)verify
+{
+ if([expectations count] == 1)
+ {
+ [NSException raise:NSInternalInconsistencyException format:@"%@: expected method was not invoked: %@",
+ [self description], [[expectations objectAtIndex:0] description]];
+ }
+ if([expectations count] > 0)
+ {
+ [NSException raise:NSInternalInconsistencyException format:@"%@ : %d expected methods were not invoked: %@",
+ [self description], [expectations count], [self _recorderDescriptions:YES]];
+ }
+ if([exceptions count] > 0)
+ {
+ [[exceptions objectAtIndex:0] raise];
+ }
+}
+
+
+
+#pragma mark Handling invocations
+
+- (void)forwardInvocation:(NSInvocation *)anInvocation
+{
+ if([self handleInvocation:anInvocation] == NO)
+ [self handleUnRecordedInvocation:anInvocation];
+}
+
+- (BOOL)handleInvocation:(NSInvocation *)anInvocation
+{
+ OCMockRecorder *recorder = nil;
+ int i;
+
+ for(i = 0; i < [recorders count]; i++)
+ {
+ recorder = [recorders objectAtIndex:i];
+ if([recorder matchesInvocation:anInvocation])
+ break;
+ }
+
+ if(i == [recorders count])
+ return NO;
+
+ if([expectations containsObject:recorder])
+ {
+ if(expectationOrderMatters && ([expectations objectAtIndex:0] != recorder))
+ {
+ [NSException raise:NSInternalInconsistencyException format:@"%@: unexpected method invoked: %@\n\texpected:\t%@",
+ [self description], [recorder description], [[expectations objectAtIndex:0] description]];
+
+ }
+ [[recorder retain] autorelease];
+ [expectations removeObject:recorder];
+ [recorders removeObjectAtIndex:i];
+ }
+ [[recorder invocationHandlers] makeObjectsPerformSelector:@selector(handleInvocation:) withObject:anInvocation];
+
+ return YES;
+}
+
+- (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation
+{
+ if(isNice == NO)
+ {
+ NSException *exception = [NSException exceptionWithName:NSInternalInconsistencyException reason:
+ [NSString stringWithFormat:@"%@: unexpected method invoked: %@ %@", [self description],
+ [anInvocation invocationDescription], [self _recorderDescriptions:NO]] userInfo:nil];
+ [exceptions addObject:exception];
+ [exception raise];
+ }
+}
+
+
+#pragma mark Helper methods
+
+- (id)getNewRecorder
+{
+ return [[[OCMockRecorder alloc] initWithSignatureResolver:self] autorelease];
+}
+
+
+- (NSString *)_recorderDescriptions:(BOOL)onlyExpectations
+{
+ NSMutableString *outputString = [NSMutableString string];
+
+ OCMockRecorder *currentObject;
+ NSEnumerator *recorderEnumerator = [recorders objectEnumerator];
+ while((currentObject = [recorderEnumerator nextObject]) != nil)
+ {
+ NSString *prefix;
+
+ if(onlyExpectations)
+ {
+ if(![expectations containsObject:currentObject])
+ continue;
+ prefix = @" ";
+ }
+ else
+ {
+ if ([expectations containsObject:currentObject])
+ prefix = @"expected: ";
+ else
+ prefix = @"stubbed: ";
+ }
+ [outputString appendFormat:@"\n\t%@\t%@", prefix, [currentObject description]];
+ }
+
+ return outputString;
+}
+
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMockObjectHamcrestTests.h b/third_party/ocmock/OCMock/OCMockObjectHamcrestTests.h
new file mode 100644
index 0000000..fe494ed
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMockObjectHamcrestTests.h
@@ -0,0 +1,13 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMockObjectTests.h 21 2008-01-24 18:59:39Z erik $
+// Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <SenTestingKit/SenTestingKit.h>
+
+
+@interface OCMockObjectHamcrestTests : SenTestCase
+{
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMockObjectHamcrestTests.mm b/third_party/ocmock/OCMock/OCMockObjectHamcrestTests.mm
new file mode 100644
index 0000000..8059deb
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMockObjectHamcrestTests.mm
@@ -0,0 +1,31 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMockObjectTests.m 21 2008-01-24 18:59:39Z erik $
+// Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <OCMock/OCMock.h>
+#import "OCMockObjectHamcrestTests.h"
+
+#define HC_SHORTHAND
+#import <hamcrest/hamcrest.h>
+
+
+@implementation OCMockObjectHamcrestTests
+
+- (void)testAcceptsStubbedMethodWithHamcrestConstraint
+{
+ id mock = [OCMockObject mockForClass:[NSString class]];
+ [[mock stub] hasSuffix:(id)startsWith(@"foo")];
+ [mock hasSuffix:@"foobar"];
+}
+
+
+- (void)testRejectsUnstubbedMethodWithHamcrestConstraint
+{
+ id mock = [OCMockObject mockForClass:[NSString class]];
+ [[mock stub] hasSuffix:(id)anyOf(equalTo(@"foo"), equalTo(@"bar"), NULL)];
+ STAssertThrows([mock hasSuffix:@"foobar"], @"Should have raised an exception.");
+}
+
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMockObjectTests.h b/third_party/ocmock/OCMock/OCMockObjectTests.h
new file mode 100644
index 0000000..a9e36e9
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMockObjectTests.h
@@ -0,0 +1,13 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMockObjectTests.h 21 2008-01-24 18:59:39Z erik $
+// Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <SenTestingKit/SenTestingKit.h>
+
+@interface OCMockObjectTests : SenTestCase
+{
+ id mock;
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMockObjectTests.m b/third_party/ocmock/OCMock/OCMockObjectTests.m
new file mode 100644
index 0000000..942cffd
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMockObjectTests.m
@@ -0,0 +1,692 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMockObjectTests.m 54 2009-08-18 06:27:36Z erik $
+// Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <OCMock/OCMock.h>
+#import "OCMockObjectTests.h"
+
+// --------------------------------------------------------------------------------------
+// Helper classes and protocols for testing
+// --------------------------------------------------------------------------------------
+
+@protocol TestProtocol
+- (int)primitiveValue;
+@optional
+- (id)objectValue;
+@end
+
+@protocol ProtocolWithTypeQualifierMethod
+- (void)aSpecialMethod:(byref in void *)someArg;
+@end
+
+@interface TestClassThatCallsSelf : NSObject
+- (NSString *)method1;
+- (NSString *)method2;
+@end
+
+@implementation TestClassThatCallsSelf
+
+- (NSString *)method1
+{
+ id retVal = [self method2];
+ return retVal;
+}
+
+- (NSString *)method2
+{
+ return @"Foo";
+}
+
+@end
+
+@interface TestObserver : NSObject
+{
+ @public
+ NSNotification *notification;
+}
+
+@end
+
+@implementation TestObserver
+
+- (void)dealloc
+{
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+ [notification release];
+ [super dealloc];
+}
+
+- (void)receiveNotification:(NSNotification *)aNotification
+{
+ notification = [aNotification retain];
+}
+
+@end
+
+static NSString *TestNotification = @"TestNotification";
+
+
+// --------------------------------------------------------------------------------------
+// setup
+// --------------------------------------------------------------------------------------
+
+
+@implementation OCMockObjectTests
+
+- (void)setUp
+{
+ mock = [OCMockObject mockForClass:[NSString class]];
+}
+
+
+// --------------------------------------------------------------------------------------
+// accepting stubbed methods / rejecting methods not stubbed
+// --------------------------------------------------------------------------------------
+
+- (void)testAcceptsStubbedMethod
+{
+ [[mock stub] lowercaseString];
+ [mock lowercaseString];
+}
+
+- (void)testRaisesExceptionWhenUnknownMethodIsCalled
+{
+ [[mock stub] lowercaseString];
+ STAssertThrows([mock uppercaseString], @"Should have raised an exception.");
+}
+
+
+- (void)testAcceptsStubbedMethodWithSpecificArgument
+{
+ [[mock stub] hasSuffix:@"foo"];
+ [mock hasSuffix:@"foo"];
+}
+
+
+- (void)testAcceptsStubbedMethodWithConstraint
+{
+ [[mock stub] hasSuffix:[OCMArg any]];
+ [mock hasSuffix:@"foo"];
+ [mock hasSuffix:@"bar"];
+}
+
+
+- (void)testAcceptsStubbedMethodWithNilArgument
+{
+ [[mock stub] hasSuffix:nil];
+
+ [mock hasSuffix:nil];
+}
+
+- (void)testRaisesExceptionWhenMethodWithWrongArgumentIsCalled
+{
+ [[mock stub] hasSuffix:@"foo"];
+ STAssertThrows([mock hasSuffix:@"xyz"], @"Should have raised an exception.");
+}
+
+
+- (void)testAcceptsStubbedMethodWithScalarArgument
+{
+ [[mock stub] stringByPaddingToLength:20 withString:@"foo" startingAtIndex:5];
+ [mock stringByPaddingToLength:20 withString:@"foo" startingAtIndex:5];
+}
+
+
+- (void)testRaisesExceptionWhenMethodWithOneWrongScalarArgumentIsCalled
+{
+ [[mock stub] stringByPaddingToLength:20 withString:@"foo" startingAtIndex:5];
+ STAssertThrows([mock stringByPaddingToLength:20 withString:@"foo" startingAtIndex:3], @"Should have raised an exception.");
+}
+
+- (void)testAcceptsStubbedMethodWithPointerArgument
+{
+ NSError *error;
+ BOOL yes = YES;
+ [[[mock stub] andReturnValue:OCMOCK_VALUE(yes)] writeToFile:OCMOCK_ANY atomically:YES encoding:NSMacOSRomanStringEncoding error:&error];
+
+ STAssertTrue([mock writeToFile:@"foo" atomically:YES encoding:NSMacOSRomanStringEncoding error:&error], nil);
+}
+
+- (void)testAcceptsStubbedMethodWithAnyPointerArgument
+{
+ BOOL yes = YES;
+ NSError *error;
+ [[[mock stub] andReturnValue:OCMOCK_VALUE(yes)] writeToFile:OCMOCK_ANY atomically:YES encoding:NSMacOSRomanStringEncoding error:[OCMArg anyPointer]];
+
+ STAssertTrue([mock writeToFile:@"foo" atomically:YES encoding:NSMacOSRomanStringEncoding error:&error], nil);
+}
+
+- (void)testRaisesExceptionWhenMethodWithWrongPointerArgumentIsCalled
+{
+ NSString *string;
+ NSString *anotherString;
+ NSArray *array;
+
+ [[mock stub] completePathIntoString:&string caseSensitive:YES matchesIntoArray:&array filterTypes:OCMOCK_ANY];
+
+ STAssertThrows([mock completePathIntoString:&anotherString caseSensitive:YES matchesIntoArray:&array filterTypes:OCMOCK_ANY], nil);
+}
+
+- (void)testAcceptsStubbedMethodWithVoidPointerArgument
+{
+ mock = [OCMockObject mockForClass:[NSMutableData class]];
+ [[mock stub] appendBytes:NULL length:0];
+ [mock appendBytes:NULL length:0];
+}
+
+
+- (void)testRaisesExceptionWhenMethodWithWrongVoidPointerArgumentIsCalled
+{
+ mock = [OCMockObject mockForClass:[NSMutableData class]];
+ [[mock stub] appendBytes:"foo" length:3];
+ STAssertThrows([mock appendBytes:"bar" length:3], @"Should have raised an exception.");
+}
+
+
+- (void)testAcceptsStubbedMethodWithPointerPointerArgument
+{
+ NSError *error = nil;
+ [[mock stub] initWithContentsOfFile:@"foo.txt" encoding:NSASCIIStringEncoding error:&error];
+ [mock initWithContentsOfFile:@"foo.txt" encoding:NSASCIIStringEncoding error:&error];
+}
+
+
+- (void)testRaisesExceptionWhenMethodWithWrongPointerPointerArgumentIsCalled
+{
+ NSError *error = nil, *error2;
+ [[mock stub] initWithContentsOfFile:@"foo.txt" encoding:NSASCIIStringEncoding error:&error];
+ STAssertThrows([mock initWithContentsOfFile:@"foo.txt" encoding:NSASCIIStringEncoding error:&error2], @"Should have raised.");
+}
+
+
+- (void)testAcceptsStubbedMethodWithStructArgument
+{
+ NSRange range = NSMakeRange(0,20);
+ [[mock stub] substringWithRange:range];
+ [mock substringWithRange:range];
+}
+
+
+- (void)testRaisesExceptionWhenMethodWithWrongStructArgumentIsCalled
+{
+ NSRange range = NSMakeRange(0,20);
+ NSRange otherRange = NSMakeRange(0,10);
+ [[mock stub] substringWithRange:range];
+ STAssertThrows([mock substringWithRange:otherRange], @"Should have raised an exception.");
+}
+
+
+// --------------------------------------------------------------------------------------
+// returning values from stubbed methods
+// --------------------------------------------------------------------------------------
+
+- (void)testReturnsStubbedReturnValue
+{
+ id returnValue;
+
+ [[[mock stub] andReturn:@"megamock"] lowercaseString];
+ returnValue = [mock lowercaseString];
+
+ STAssertEqualObjects(@"megamock", returnValue, @"Should have returned stubbed value.");
+
+}
+
+- (void)testReturnsStubbedIntReturnValue
+{
+ int expectedValue = 42;
+ [[[mock stub] andReturnValue:OCMOCK_VALUE(expectedValue)] intValue];
+ int returnValue = [mock intValue];
+
+ STAssertEquals(expectedValue, returnValue, @"Should have returned stubbed value.");
+}
+
+- (void)testRaisesWhenBoxedValueTypesDoNotMatch
+{
+ double expectedValue = 42;
+ [[[mock stub] andReturnValue:OCMOCK_VALUE(expectedValue)] intValue];
+
+ STAssertThrows([mock intValue], @"Should have raised an exception.");
+}
+
+- (void)testReturnsStubbedNilReturnValue
+{
+ [[[mock stub] andReturn:nil] uppercaseString];
+
+ id returnValue = [mock uppercaseString];
+
+ STAssertNil(returnValue, @"Should have returned stubbed value, which is nil.");
+}
+
+
+// --------------------------------------------------------------------------------------
+// raising exceptions, posting notifications, etc.
+// --------------------------------------------------------------------------------------
+
+- (void)testRaisesExceptionWhenAskedTo
+{
+ NSException *exception = [NSException exceptionWithName:@"TestException" reason:@"test" userInfo:nil];
+ [[[mock expect] andThrow:exception] lowercaseString];
+
+ STAssertThrows([mock lowercaseString], @"Should have raised an exception.");
+}
+
+- (void)testPostsNotificationWhenAskedTo
+{
+ TestObserver *observer = [[[TestObserver alloc] init] autorelease];
+ [[NSNotificationCenter defaultCenter] addObserver:observer selector:@selector(receiveNotification:) name:TestNotification object:nil];
+
+ NSNotification *notification = [NSNotification notificationWithName:TestNotification object:self];
+ [[[mock stub] andPost:notification] lowercaseString];
+
+ [mock lowercaseString];
+
+ STAssertNotNil(observer->notification, @"Should have sent a notification.");
+ STAssertEqualObjects(TestNotification, [observer->notification name], @"Name should match posted one.");
+ STAssertEqualObjects(self, [observer->notification object], @"Object should match posted one.");
+}
+
+- (void)testPostsNotificationInAddtionToReturningValue
+{
+ TestObserver *observer = [[[TestObserver alloc] init] autorelease];
+ [[NSNotificationCenter defaultCenter] addObserver:observer selector:@selector(receiveNotification:) name:TestNotification object:nil];
+
+ NSNotification *notification = [NSNotification notificationWithName:TestNotification object:self];
+ [[[[mock stub] andReturn:@"foo"] andPost:notification] lowercaseString];
+
+ STAssertEqualObjects(@"foo", [mock lowercaseString], @"Should have returned stubbed value.");
+ STAssertNotNil(observer->notification, @"Should have sent a notification.");
+}
+
+
+- (NSString *)valueForString:(NSString *)aString andMask:(NSStringCompareOptions)mask
+{
+ return [NSString stringWithFormat:@"[%@, %d]", aString, mask];
+}
+
+- (void)testCallsAlternativeMethodAndPassesOriginalArgumentsAndReturnsValue
+{
+ [[[mock stub] andCall:@selector(valueForString:andMask:) onObject:self] commonPrefixWithString:@"FOO" options:NSCaseInsensitiveSearch];
+
+ NSString *returnValue = [mock commonPrefixWithString:@"FOO" options:NSCaseInsensitiveSearch];
+
+ STAssertEqualObjects(@"[FOO, 1]", returnValue, @"Should have passed and returned invocation.");
+}
+
+
+// --------------------------------------------------------------------------------------
+// returning values in pass-by-reference arguments
+// --------------------------------------------------------------------------------------
+
+- (void)testReturnsValuesInPassByReferenceArguments
+{
+ NSString *expectedName = [NSString stringWithString:@"Test"];
+ NSArray *expectedArray = [NSArray array];
+
+ [[mock expect] completePathIntoString:[OCMArg setTo:expectedName] caseSensitive:YES
+ matchesIntoArray:[OCMArg setTo:expectedArray] filterTypes:OCMOCK_ANY];
+
+ NSString *actualName = nil;
+ NSArray *actualArray = nil;
+ [mock completePathIntoString:&actualName caseSensitive:YES matchesIntoArray:&actualArray filterTypes:nil];
+
+ STAssertNoThrow([mock verify], @"An unexpected exception was thrown");
+ STAssertEqualObjects(expectedName, actualName, @"The two string objects should be equal");
+ STAssertEqualObjects(expectedArray, actualArray, @"The two array objects should be equal");
+}
+
+
+// --------------------------------------------------------------------------------------
+// accepting expected methods
+// --------------------------------------------------------------------------------------
+
+- (void)testAcceptsExpectedMethod
+{
+ [[mock expect] lowercaseString];
+ [mock lowercaseString];
+}
+
+
+- (void)testAcceptsExpectedMethodAndReturnsValue
+{
+ id returnValue;
+
+ [[[mock expect] andReturn:@"Objective-C"] lowercaseString];
+ returnValue = [mock lowercaseString];
+
+ STAssertEqualObjects(@"Objective-C", returnValue, @"Should have returned stubbed value.");
+}
+
+
+- (void)testAcceptsExpectedMethodsInRecordedSequence
+{
+ [[mock expect] lowercaseString];
+ [[mock expect] uppercaseString];
+
+ [mock lowercaseString];
+ [mock uppercaseString];
+}
+
+
+- (void)testAcceptsExpectedMethodsInDifferentSequence
+{
+ [[mock expect] lowercaseString];
+ [[mock expect] uppercaseString];
+
+ [mock uppercaseString];
+ [mock lowercaseString];
+}
+
+
+// --------------------------------------------------------------------------------------
+// verifying expected methods
+// --------------------------------------------------------------------------------------
+
+- (void)testAcceptsAndVerifiesExpectedMethods
+{
+ [[mock expect] lowercaseString];
+ [[mock expect] uppercaseString];
+
+ [mock lowercaseString];
+ [mock uppercaseString];
+
+ [mock verify];
+}
+
+
+- (void)testRaisesExceptionOnVerifyWhenNotAllExpectedMethodsWereCalled
+{
+ [[mock expect] lowercaseString];
+ [[mock expect] uppercaseString];
+
+ [mock lowercaseString];
+
+ STAssertThrows([mock verify], @"Should have raised an exception.");
+}
+
+- (void)testAcceptsAndVerifiesTwoExpectedInvocationsOfSameMethod
+{
+ [[mock expect] lowercaseString];
+ [[mock expect] lowercaseString];
+
+ [mock lowercaseString];
+ [mock lowercaseString];
+
+ [mock verify];
+}
+
+
+- (void)testAcceptsAndVerifiesTwoExpectedInvocationsOfSameMethodAndReturnsCorrespondingValues
+{
+ [[[mock expect] andReturn:@"foo"] lowercaseString];
+ [[[mock expect] andReturn:@"bar"] lowercaseString];
+
+ STAssertEqualObjects(@"foo", [mock lowercaseString], @"Should have returned first stubbed value");
+ STAssertEqualObjects(@"bar", [mock lowercaseString], @"Should have returned seconds stubbed value");
+
+ [mock verify];
+}
+
+- (void)testReturnsStubbedValuesIndependentOfExpectations
+{
+ [[mock stub] hasSuffix:@"foo"];
+ [[mock expect] hasSuffix:@"bar"];
+
+ [mock hasSuffix:@"foo"];
+ [mock hasSuffix:@"bar"];
+ [mock hasSuffix:@"foo"]; // Since it's a stub, shouldn't matter how many times we call this
+
+ [mock verify];
+}
+
+-(void)testAcceptsAndVerifiesMethodsWithSelectorArgument
+{
+ [[mock expect] performSelector:@selector(lowercaseString)];
+ [mock performSelector:@selector(lowercaseString)];
+ [mock verify];
+}
+
+
+// --------------------------------------------------------------------------------------
+// ordered expectations
+// --------------------------------------------------------------------------------------
+
+- (void)testAcceptsExpectedMethodsInRecordedSequenceWhenOrderMatters
+{
+ [mock setExpectationOrderMatters:YES];
+
+ [[mock expect] lowercaseString];
+ [[mock expect] uppercaseString];
+
+ STAssertNoThrow([mock lowercaseString], @"Should have accepted expected method in sequence.");
+ STAssertNoThrow([mock uppercaseString], @"Should have accepted expected method in sequence.");
+}
+
+- (void)testRaisesExceptionWhenSequenceIsWrongAndOrderMatters
+{
+ [mock setExpectationOrderMatters:YES];
+
+ [[mock expect] lowercaseString];
+ [[mock expect] uppercaseString];
+
+ STAssertThrows([mock uppercaseString], @"Should have complained about wrong sequence.");
+}
+
+
+// --------------------------------------------------------------------------------------
+// protocol mocks
+// --------------------------------------------------------------------------------------
+
+- (void)testCanMockFormalProtocol
+{
+ mock = [OCMockObject mockForProtocol:@protocol(NSLocking)];
+ [[mock expect] lock];
+
+ [mock lock];
+
+ [mock verify];
+}
+
+- (void)testRaisesWhenUnknownMethodIsCalledOnProtocol
+{
+ mock = [OCMockObject mockForProtocol:@protocol(NSLocking)];
+ STAssertThrows([mock lowercaseString], @"Should have raised an exception.");
+}
+
+- (void)testConformsToMockedProtocol
+{
+ mock = [OCMockObject mockForProtocol:@protocol(NSLocking)];
+ STAssertTrue([mock conformsToProtocol:@protocol(NSLocking)], nil);
+}
+
+- (void)testRespondsToValidProtocolRequiredSelector
+{
+ mock = [OCMockObject mockForProtocol:@protocol(TestProtocol)];
+ STAssertTrue([mock respondsToSelector:@selector(primitiveValue)], nil);
+}
+
+- (void)testRespondsToValidProtocolOptionalSelector
+{
+ mock = [OCMockObject mockForProtocol:@protocol(TestProtocol)];
+ STAssertTrue([mock respondsToSelector:@selector(objectValue)], nil);
+}
+
+- (void)testDoesNotRespondToInvalidProtocolSelector
+{
+ mock = [OCMockObject mockForProtocol:@protocol(TestProtocol)];
+ STAssertFalse([mock respondsToSelector:@selector(fooBar)], nil);
+}
+
+
+// --------------------------------------------------------------------------------------
+// nice mocks don't complain about unknown methods
+// --------------------------------------------------------------------------------------
+
+- (void)testReturnsDefaultValueWhenUnknownMethodIsCalledOnNiceClassMock
+{
+ mock = [OCMockObject niceMockForClass:[NSString class]];
+ STAssertNil([mock lowercaseString], @"Should return nil on unexpected method call (for nice mock).");
+ [mock verify];
+}
+
+- (void)testRaisesAnExceptionWhenAnExpectedMethodIsNotCalledOnNiceClassMock
+{
+ mock = [OCMockObject niceMockForClass:[NSString class]];
+ [[[mock expect] andReturn:@"HELLO!"] uppercaseString];
+ STAssertThrows([mock verify], @"Should have raised an exception because method was not called.");
+}
+
+- (void)testReturnDefaultValueWhenUnknownMethodIsCalledOnProtocolMock
+{
+ mock = [OCMockObject niceMockForProtocol:@protocol(TestProtocol)];
+ STAssertTrue(0 == [mock primitiveValue], @"Should return 0 on unexpected method call (for nice mock).");
+ [mock verify];
+}
+
+- (void)testRaisesAnExceptionWenAnExpectedMethodIsNotCalledOnNiceProtocolMock
+{
+ mock = [OCMockObject niceMockForProtocol:@protocol(TestProtocol)];
+ [[mock expect] primitiveValue];
+ STAssertThrows([mock verify], @"Should have raised an exception because method was not called.");
+}
+
+
+// --------------------------------------------------------------------------------------
+// partial mocks forward unknown methods to a real instance
+// --------------------------------------------------------------------------------------
+
+- (void)testStubsMethodsOnPartialMock
+{
+ TestClassThatCallsSelf *foo = [[[TestClassThatCallsSelf alloc] init] autorelease];
+ mock = [OCMockObject partialMockForObject:foo];
+ [[[mock stub] andReturn:@"hi"] method1];
+ STAssertEqualObjects(@"hi", [mock method1], @"Should have returned stubbed value");
+}
+
+
+//- (void)testStubsMethodsOnPartialMockForTollFreeBridgedClasses
+//{
+// mock = [OCMockObject partialMockForObject:[NSString stringWithString:@"hello"]];
+// [[[mock stub] andReturn:@"hi"] uppercaseString];
+// STAssertEqualObjects(@"hi", [mock uppercaseString], @"Should have returned stubbed value");
+//}
+
+- (void)testForwardsUnstubbedMethodsCallsToRealObjectOnPartialMock
+{
+ TestClassThatCallsSelf *foo = [[[TestClassThatCallsSelf alloc] init] autorelease];
+ mock = [OCMockObject partialMockForObject:foo];
+ STAssertEqualObjects(@"Foo", [mock method2], @"Should have returned value from real object.");
+}
+
+//- (void)testForwardsUnstubbedMethodsCallsToRealObjectOnPartialMockForTollFreeBridgedClasses
+//{
+// mock = [OCMockObject partialMockForObject:[NSString stringWithString:@"hello2"]];
+// STAssertEqualObjects(@"HELLO2", [mock uppercaseString], @"Should have returned value from real object.");
+//}
+
+- (void)testStubsMethodOnRealObjectReference
+{
+ TestClassThatCallsSelf *realObject = [[[TestClassThatCallsSelf alloc] init] autorelease];
+ mock = [OCMockObject partialMockForObject:realObject];
+ [[[mock stub] andReturn:@"FooFoo"] method1];
+ STAssertEqualObjects(@"FooFoo", [realObject method1], @"Should have stubbed method.");
+}
+
+- (void)testCallsToSelfInRealObjectAreShadowedByPartialMock
+{
+ TestClassThatCallsSelf *foo = [[[TestClassThatCallsSelf alloc] init] autorelease];
+ mock = [OCMockObject partialMockForObject:foo];
+ [[[mock stub] andReturn:@"FooFoo"] method2];
+ STAssertEqualObjects(@"FooFoo", [mock method1], @"Should have called through to stubbed method.");
+}
+
+
+- (NSString *)differentMethodInDifferentClass
+{
+ return @"swizzled!";
+}
+
+- (void)testImplementsMethodSwizzling
+{
+ // using partial mocks and the indirect return value provider
+ TestClassThatCallsSelf *foo = [[[TestClassThatCallsSelf alloc] init] autorelease];
+ mock = [OCMockObject partialMockForObject:foo];
+ [[[mock stub] andCall:@selector(differentMethodInDifferentClass) onObject:self] method1];
+ STAssertEqualObjects(@"swizzled!", [foo method1], @"Should have returned value from different method");
+}
+
+
+- (void)aMethodWithVoidReturn
+{
+}
+
+- (void)testMethodSwizzlingWorksForVoidReturns
+{
+ TestClassThatCallsSelf *foo = [[[TestClassThatCallsSelf alloc] init] autorelease];
+ mock = [OCMockObject partialMockForObject:foo];
+ [[[mock stub] andCall:@selector(aMethodWithVoidReturn) onObject:self] method1];
+ STAssertNoThrow([foo method1], @"Should have worked.");
+}
+
+
+// --------------------------------------------------------------------------------------
+// mocks should honour the NSObject contract, etc.
+// --------------------------------------------------------------------------------------
+
+- (void)testRespondsToValidSelector
+{
+ STAssertTrue([mock respondsToSelector:@selector(lowercaseString)], nil);
+}
+
+- (void)testDoesNotRespondToInvalidSelector
+{
+ STAssertFalse([mock respondsToSelector:@selector(fooBar)], nil);
+}
+
+- (void)testCanStubValueForKeyMethod
+{
+ id returnValue;
+
+ mock = [OCMockObject mockForClass:[NSObject class]];
+ [[[mock stub] andReturn:@"SomeValue"] valueForKey:@"SomeKey"];
+
+ returnValue = [mock valueForKey:@"SomeKey"];
+
+ STAssertEqualObjects(@"SomeValue", returnValue, @"Should have returned value that was set up.");
+}
+
+- (void)testWorksWithTypeQualifiers
+{
+ id myMock = [OCMockObject mockForProtocol:@protocol(ProtocolWithTypeQualifierMethod)];
+
+ STAssertNoThrow([[myMock expect] aSpecialMethod:"foo"], @"Should not complain about method with type qualifiers.");
+ STAssertNoThrow([myMock aSpecialMethod:"foo"], @"Should not complain about method with type qualifiers.");
+}
+
+
+// --------------------------------------------------------------------------------------
+// some internal tests
+// --------------------------------------------------------------------------------------
+
+- (void)testReRaisesFailFastExceptionsOnVerify
+{
+ @try
+ {
+ [mock lowercaseString];
+ }
+ @catch(NSException *exception)
+ {
+ // expected
+ }
+ STAssertThrows([mock verify], @"Should have reraised the exception.");
+}
+
+
+- (void)testCanCreateExpectationsAfterInvocations
+{
+ [[mock expect] lowercaseString];
+ [mock lowercaseString];
+ [mock expect];
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMockRecorder.h b/third_party/ocmock/OCMock/OCMockRecorder.h
new file mode 100644
index 0000000..fea7b86
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMockRecorder.h
@@ -0,0 +1,28 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMockRecorder.h 50 2009-07-16 06:48:19Z erik $
+// Copyright (c) 2004-2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <Foundation/Foundation.h>
+
+@interface OCMockRecorder : NSProxy
+{
+ id signatureResolver;
+ NSInvocation *recordedInvocation;
+ NSMutableArray *invocationHandlers;
+}
+
+- (id)initWithSignatureResolver:(id)anObject;
+
+- (BOOL)matchesInvocation:(NSInvocation *)anInvocation;
+- (void)releaseInvocation;
+
+- (id)andReturn:(id)anObject;
+- (id)andReturnValue:(NSValue *)aValue;
+- (id)andThrow:(NSException *)anException;
+- (id)andPost:(NSNotification *)aNotification;
+- (id)andCall:(SEL)selector onObject:(id)anObject;
+
+- (NSArray *)invocationHandlers;
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMockRecorder.m b/third_party/ocmock/OCMock/OCMockRecorder.m
new file mode 100644
index 0000000..2fc9bed
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMockRecorder.m
@@ -0,0 +1,162 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMockRecorder.m 50 2009-07-16 06:48:19Z erik $
+// Copyright (c) 2004-2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <objc/runtime.h>
+#import <OCMock/OCMockRecorder.h>
+#import <OCMock/OCMArg.h>
+#import <OCMock/OCMConstraint.h>
+#import "OCMPassByRefSetter.h"
+#import "OCMReturnValueProvider.h"
+#import "OCMBoxedReturnValueProvider.h"
+#import "OCMExceptionReturnValueProvider.h"
+#import "OCMIndirectReturnValueProvider.h"
+#import "OCMNotificationPoster.h"
+#import "NSInvocation+OCMAdditions.h"
+
+@interface NSObject(HCMatcherDummy)
+- (BOOL)matches:(id)item;
+@end
+
+#pragma mark -
+
+
+@implementation OCMockRecorder
+
+#pragma mark Initialisers, description, accessors, etc.
+
+- (id)initWithSignatureResolver:(id)anObject
+{
+ signatureResolver = anObject;
+ invocationHandlers = [[NSMutableArray alloc] init];
+ return self;
+}
+
+- (void)dealloc
+{
+ [recordedInvocation release];
+ [invocationHandlers release];
+ [super dealloc];
+}
+
+- (NSString *)description
+{
+ return [recordedInvocation invocationDescription];
+}
+
+- (void)releaseInvocation
+{
+ [recordedInvocation release];
+ recordedInvocation = nil;
+}
+
+
+#pragma mark Recording invocation handlers
+
+- (id)andReturn:(id)anObject
+{
+ [invocationHandlers addObject:[[[OCMReturnValueProvider alloc] initWithValue:anObject] autorelease]];
+ return self;
+}
+
+- (id)andReturnValue:(NSValue *)aValue
+{
+ [invocationHandlers addObject:[[[OCMBoxedReturnValueProvider alloc] initWithValue:aValue] autorelease]];
+ return self;
+}
+
+- (id)andThrow:(NSException *)anException
+{
+ [invocationHandlers addObject:[[[OCMExceptionReturnValueProvider alloc] initWithValue:anException] autorelease]];
+ return self;
+}
+
+- (id)andPost:(NSNotification *)aNotification
+{
+ [invocationHandlers addObject:[[[OCMNotificationPoster alloc] initWithNotification:aNotification] autorelease]];
+ return self;
+}
+
+- (id)andCall:(SEL)selector onObject:(id)anObject
+{
+ [invocationHandlers addObject:[[[OCMIndirectReturnValueProvider alloc] initWithProvider:anObject andSelector:selector] autorelease]];
+ return self;
+}
+
+- (NSArray *)invocationHandlers
+{
+ return invocationHandlers;
+}
+
+
+#pragma mark Recording the actual invocation
+
+- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector
+{
+ return [signatureResolver methodSignatureForSelector:aSelector];
+}
+
+- (void)forwardInvocation:(NSInvocation *)anInvocation
+{
+ if(recordedInvocation != nil)
+ [NSException raise:NSInternalInconsistencyException format:@"Recorder received two methods to record."];
+ [anInvocation setTarget:nil];
+ [anInvocation retainArguments];
+ recordedInvocation = [anInvocation retain];
+}
+
+
+
+#pragma mark Checking the invocation
+
+- (BOOL)matchesInvocation:(NSInvocation *)anInvocation
+{
+ id recordedArg, passedArg;
+ int i, n;
+
+ if([anInvocation selector] != [recordedInvocation selector])
+ return NO;
+
+ n = [[recordedInvocation methodSignature] numberOfArguments];
+ for(i = 2; i < n; i++)
+ {
+ recordedArg = [recordedInvocation getArgumentAtIndexAsObject:i];
+ if([recordedArg isKindOfClass:[NSValue class]])
+ recordedArg = [OCMArg resolveSpecialValues:recordedArg];
+ passedArg = [anInvocation getArgumentAtIndexAsObject:i];
+
+ if([recordedArg isKindOfClass:[OCMConstraint class]])
+ {
+ if([recordedArg evaluate:passedArg] == NO)
+ return NO;
+ }
+ else if([recordedArg isKindOfClass:[OCMPassByRefSetter class]])
+ {
+ // side effect but easier to do here than in handleInvocation
+ *(id *)[passedArg pointerValue] = [(OCMPassByRefSetter *)recordedArg value];
+ }
+ else if([recordedArg conformsToProtocol:objc_getProtocol("HCMatcher")])
+ {
+ if([recordedArg matches:passedArg] == NO)
+ return NO;
+ }
+ else
+ {
+ if([recordedArg class] != [passedArg class])
+ return NO;
+ if(([recordedArg class] == [NSNumber class]) &&
+ ([(NSNumber*)recordedArg compare:(NSNumber*)passedArg] != NSOrderedSame))
+ return NO;
+ if(([recordedArg isEqual:passedArg] == NO) &&
+ !((recordedArg == nil) && (passedArg == nil)))
+ return NO;
+ }
+ }
+ return YES;
+}
+
+
+
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMockRecorderTests.h b/third_party/ocmock/OCMock/OCMockRecorderTests.h
new file mode 100644
index 0000000..f0783e1
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMockRecorderTests.h
@@ -0,0 +1,13 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMockRecorderTests.h 21 2008-01-24 18:59:39Z erik $
+// Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <SenTestingKit/SenTestingKit.h>
+
+@interface OCMockRecorderTests : SenTestCase
+{
+ NSInvocation *testInvocation;
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMockRecorderTests.m b/third_party/ocmock/OCMock/OCMockRecorderTests.m
new file mode 100644
index 0000000..8742034
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMockRecorderTests.m
@@ -0,0 +1,81 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCMockRecorderTests.m 50 2009-07-16 06:48:19Z erik $
+// Copyright (c) 2004-2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import "OCMockRecorderTests.h"
+#import <OCMock/OCMockRecorder.h>
+#import "OCMReturnValueProvider.h"
+#import "OCMExceptionReturnValueProvider.h"
+
+
+@implementation OCMockRecorderTests
+
+- (void)setUp
+{
+ NSMethodSignature *signature;
+
+ signature = [NSString instanceMethodSignatureForSelector:@selector(initWithString:)];
+ testInvocation = [NSInvocation invocationWithMethodSignature:signature];
+ [testInvocation setSelector:@selector(initWithString:)];
+}
+
+
+- (void)testStoresAndMatchesInvocation
+{
+ OCMockRecorder *recorder;
+ NSString *arg;
+
+ arg = @"I love mocks.";
+ [testInvocation setArgument:&arg atIndex:2];
+
+ recorder = [[[OCMockRecorder alloc] initWithSignatureResolver:[NSString string]] autorelease];
+ [(id)recorder initWithString:arg];
+
+ STAssertTrue([recorder matchesInvocation:testInvocation], @"Should match.");
+}
+
+
+- (void)testOnlyMatchesInvocationWithRightArguments
+{
+ OCMockRecorder *recorder;
+ NSString *arg;
+
+ arg = @"I love mocks.";
+ [testInvocation setArgument:&arg atIndex:2];
+
+ recorder = [[[OCMockRecorder alloc] initWithSignatureResolver:[NSString string]] autorelease];
+ [(id)recorder initWithString:@"whatever"];
+
+ STAssertFalse([recorder matchesInvocation:testInvocation], @"Should not match.");
+}
+
+
+- (void)testAddsReturnValueProvider
+{
+ OCMockRecorder *recorder;
+ NSArray *handlerList;
+
+ recorder = [[[OCMockRecorder alloc] initWithSignatureResolver:[NSString string]] autorelease];
+ [recorder andReturn:@"foo"];
+ handlerList = [recorder invocationHandlers];
+
+ STAssertEquals(1u, [handlerList count], @"Should have added one handler.");
+ STAssertEqualObjects([OCMReturnValueProvider class], [[handlerList objectAtIndex:0] class], @"Should have added correct handler.");
+}
+
+- (void)testAddsExceptionReturnValueProvider
+{
+ OCMockRecorder *recorder;
+ NSArray *handlerList;
+
+ recorder = [[[OCMockRecorder alloc] initWithSignatureResolver:[NSString string]] autorelease];
+ [recorder andThrow:[NSException exceptionWithName:@"TestException" reason:@"A reason" userInfo:nil]];
+ handlerList = [recorder invocationHandlers];
+
+ STAssertEquals(1u, [handlerList count], @"Should have added one handler.");
+ STAssertEqualObjects([OCMExceptionReturnValueProvider class], [[handlerList objectAtIndex:0] class], @"Should have added correct handler.");
+
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/OCMock_Prefix.pch b/third_party/ocmock/OCMock/OCMock_Prefix.pch
new file mode 100644
index 0000000..2546442
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMock_Prefix.pch
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files in the 'OCMock' project.
+//
+
+#ifdef __OBJC__
+ #import <Foundation/Foundation.h>
+#endif
diff --git a/third_party/ocmock/OCMock/OCObserverMockObject.h b/third_party/ocmock/OCMock/OCObserverMockObject.h
new file mode 100644
index 0000000..2e4398b
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCObserverMockObject.h
@@ -0,0 +1,20 @@
+//---------------------------------------------------------------------------------------
+// $Id$
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <Foundation/Foundation.h>
+
+@interface OCObserverMockObject : NSObject
+{
+ BOOL expectationOrderMatters;
+ NSMutableArray *recorders;
+}
+
+- (void)setExpectationOrderMatters:(BOOL)flag;
+
+- (id)expect;
+
+- (void)verify;
+
+@end
diff --git a/third_party/ocmock/OCMock/OCObserverMockObject.m b/third_party/ocmock/OCMock/OCObserverMockObject.m
new file mode 100644
index 0000000..7e410c2
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCObserverMockObject.m
@@ -0,0 +1,83 @@
+//---------------------------------------------------------------------------------------
+// $Id$
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import "OCObserverMockObject.h"
+#import "OCMObserverRecorder.h"
+
+
+@implementation OCObserverMockObject
+
+#pragma mark Initialisers, description, accessors, etc.
+
+- (id)init
+{
+ [super init];
+ recorders = [[NSMutableArray alloc] init];
+ return self;
+}
+
+- (void)dealloc
+{
+ [recorders release];
+ [super dealloc];
+}
+
+- (NSString *)description
+{
+ return @"OCMockObserver";
+}
+
+- (void)setExpectationOrderMatters:(BOOL)flag
+{
+ expectationOrderMatters = flag;
+}
+
+
+#pragma mark Public API
+
+- (id)expect
+{
+ OCMObserverRecorder *recorder = [[[OCMObserverRecorder alloc] init] autorelease];
+ [recorders addObject:recorder];
+ return recorder;
+}
+
+- (void)verify
+{
+ if([recorders count] == 1)
+ {
+ [NSException raise:NSInternalInconsistencyException format:@"%@: expected notification was not observed: %@",
+ [self description], [[recorders lastObject] description]];
+ }
+ if([recorders count] > 0)
+ {
+ [NSException raise:NSInternalInconsistencyException format:@"%@ : %d expected notifications were not observed.",
+ [self description], [recorders count]];
+ }
+}
+
+
+
+#pragma mark Receiving notifications
+
+- (void)handleNotification:(NSNotification *)aNotification
+{
+ int i, limit;
+
+ limit = expectationOrderMatters ? 1 : [recorders count];
+ for(i = 0; i < limit; i++)
+ {
+ if([[recorders objectAtIndex:i] matchesNotification:aNotification])
+ {
+ [recorders removeObjectAtIndex:i];
+ return;
+ }
+ }
+ [NSException raise:NSInternalInconsistencyException format:@"%@: unexpected notification observed: %@", [self description],
+ [aNotification description]];
+}
+
+
+@end
diff --git a/third_party/ocmock/OCMock/OCObserverMockObjectTest.h b/third_party/ocmock/OCMock/OCObserverMockObjectTest.h
new file mode 100644
index 0000000..2ed46c3
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCObserverMockObjectTest.h
@@ -0,0 +1,16 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCObserverMockObject.h $
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <SenTestingKit/SenTestingKit.h>
+
+
+@interface OCObserverMockObjectTest : SenTestCase
+{
+ NSNotificationCenter *center;
+
+ id mock;
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/OCObserverMockObjectTest.m b/third_party/ocmock/OCMock/OCObserverMockObjectTest.m
new file mode 100644
index 0000000..0399807
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCObserverMockObjectTest.m
@@ -0,0 +1,127 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCObserverMockObjectTest.m $
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <OCMock/OCMock.h>
+#import "OCObserverMockObjectTest.h"
+
+static NSString *TestNotificationOne = @"TestNotificationOne";
+
+
+@implementation OCObserverMockObjectTest
+
+- (void)setUp
+{
+ center = [[[NSNotificationCenter alloc] init] autorelease];
+ mock = [OCMockObject observerMock];
+}
+
+- (void)testAcceptsExpectedNotification
+{
+ [center addMockObserver:mock name:TestNotificationOne object:nil];
+ [[mock expect] notificationWithName:TestNotificationOne object:[OCMArg any]];
+
+ [center postNotificationName:TestNotificationOne object:self];
+
+ [mock verify];
+}
+
+- (void)testAcceptsExpectedNotificationWithSpecifiedObjectAndUserInfo
+{
+ [center addMockObserver:mock name:TestNotificationOne object:nil];
+ NSDictionary *info = [NSDictionary dictionaryWithObject:@"foo" forKey:@"key"];
+ [[mock expect] notificationWithName:TestNotificationOne object:self userInfo:info];
+
+ [center postNotificationName:TestNotificationOne object:self userInfo:info];
+
+ [mock verify];
+}
+
+- (void)testAcceptsNotificationsInAnyOrder
+{
+ [center addMockObserver:mock name:TestNotificationOne object:nil];
+ [[mock expect] notificationWithName:TestNotificationOne object:self];
+ [[mock expect] notificationWithName:TestNotificationOne object:[OCMArg any]];
+
+ [center postNotificationName:TestNotificationOne object:[NSString string]];
+ [center postNotificationName:TestNotificationOne object:self];
+}
+
+- (void)testAcceptsNotificationsInCorrectOrderWhenOrderMatters
+{
+ [mock setExpectationOrderMatters:YES];
+
+ [center addMockObserver:mock name:TestNotificationOne object:nil];
+ [[mock expect] notificationWithName:TestNotificationOne object:self];
+ [[mock expect] notificationWithName:TestNotificationOne object:[OCMArg any]];
+
+ [center postNotificationName:TestNotificationOne object:self];
+ [center postNotificationName:TestNotificationOne object:[NSString string]];
+}
+
+- (void)testRaisesExceptionWhenSequenceIsWrongAndOrderMatters
+{
+ [mock setExpectationOrderMatters:YES];
+
+ [center addMockObserver:mock name:TestNotificationOne object:nil];
+ [[mock expect] notificationWithName:TestNotificationOne object:self];
+ [[mock expect] notificationWithName:TestNotificationOne object:[OCMArg any]];
+
+ STAssertThrows([center postNotificationName:TestNotificationOne object:[NSString string]], @"Should have complained about sequence.");
+}
+
+- (void)testRaisesEvenThoughOverlappingExpectationsCouldHaveBeenSatisfied
+{
+ // this test demonstrates a shortcoming, not a feature
+ [center addMockObserver:mock name:TestNotificationOne object:nil];
+ [[mock expect] notificationWithName:TestNotificationOne object:[OCMArg any]];
+ [[mock expect] notificationWithName:TestNotificationOne object:self];
+
+ [center postNotificationName:TestNotificationOne object:self];
+ STAssertThrows([center postNotificationName:TestNotificationOne object:[NSString string]], nil);
+}
+
+- (void)testRaisesExceptionWhenUnexpectedNotificationIsReceived
+{
+ [center addMockObserver:mock name:TestNotificationOne object:nil];
+
+ STAssertThrows([center postNotificationName:TestNotificationOne object:self], nil);
+}
+
+- (void)testRaisesWhenNotificationWithWrongObjectIsReceived
+{
+ [center addMockObserver:mock name:TestNotificationOne object:nil];
+ [[mock expect] notificationWithName:TestNotificationOne object:self];
+
+ STAssertThrows([center postNotificationName:TestNotificationOne object:[NSString string]], nil);
+}
+
+- (void)testRaisesWhenNotificationWithWrongUserInfoIsReceived
+{
+ [center addMockObserver:mock name:TestNotificationOne object:nil];
+ [[mock expect] notificationWithName:TestNotificationOne object:self
+ userInfo:[NSDictionary dictionaryWithObject:@"foo" forKey:@"key"]];
+ STAssertThrows([center postNotificationName:TestNotificationOne object:[NSString string]
+ userInfo:[NSDictionary dictionaryWithObject:@"bar" forKey:@"key"]], nil);
+}
+
+- (void)testRaisesOnVerifyWhenExpectedNotificationIsNotSent
+{
+ [center addMockObserver:mock name:TestNotificationOne object:nil];
+ [[mock expect] notificationWithName:TestNotificationOne object:[OCMArg any]];
+
+ STAssertThrows([mock verify], nil);
+}
+
+- (void)testRaisesOnVerifyWhenNotAllNotificationsWereSent
+{
+ [center addMockObserver:mock name:TestNotificationOne object:nil];
+ [[mock expect] notificationWithName:TestNotificationOne object:[OCMArg any]];
+ [[mock expect] notificationWithName:TestNotificationOne object:self];
+
+ [center postNotificationName:TestNotificationOne object:self];
+ STAssertThrows([mock verify], nil);
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/OCPartialMockObject.h b/third_party/ocmock/OCMock/OCPartialMockObject.h
new file mode 100644
index 0000000..b27c938
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCPartialMockObject.h
@@ -0,0 +1,20 @@
+//---------------------------------------------------------------------------------------
+// $Id: $
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import "OCClassMockObject.h"
+
+@interface OCPartialMockObject : OCClassMockObject
+{
+ NSObject *realObject;
+}
+
+- (id)initWithObject:(NSObject *)anObject;
+
+- (NSObject *)realObject;
+
+- (void)setupSubclassForObject:(id)anObject;
+- (void)setupForwarderForSelector:(SEL)selector;
+
+@end
diff --git a/third_party/ocmock/OCMock/OCPartialMockObject.m b/third_party/ocmock/OCMock/OCPartialMockObject.m
new file mode 100644
index 0000000..4d35f13
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCPartialMockObject.m
@@ -0,0 +1,124 @@
+//---------------------------------------------------------------------------------------
+// $Id: $
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <objc/objc-runtime.h>
+#import "OCPartialMockRecorder.h"
+#import "OCPartialMockObject.h"
+
+
+@implementation OCPartialMockObject
+
+
+#pragma mark Mock table
+
+static NSMutableDictionary *mockTable;
+
++ (void)initialize
+{
+ if(self == [OCPartialMockObject class])
+ mockTable = [[NSMutableDictionary alloc] init];
+}
+
++ (void)rememberPartialMock:(OCPartialMockObject *)mock forObject:(id)anObject
+{
+ [mockTable setObject:mock forKey:[NSValue valueWithNonretainedObject:anObject]];
+}
+
++ (void)forgetPartialMockForObject:(id)anObject
+{
+ [mockTable removeObjectForKey:[NSValue valueWithNonretainedObject:anObject]];
+}
+
++ (OCPartialMockObject *)partialMockForObject:(id)anObject
+{
+ OCPartialMockObject *mock = [mockTable objectForKey:[NSValue valueWithNonretainedObject:anObject]];
+ if(mock == nil)
+ [NSException raise:NSInternalInconsistencyException format:@"No partial mock for object %p", anObject];
+ return mock;
+}
+
+
+
+#pragma mark Initialisers, description, accessors, etc.
+
+- (id)initWithObject:(NSObject *)anObject
+{
+ [super initWithClass:[anObject class]];
+ realObject = [anObject retain];
+ [[self class] rememberPartialMock:self forObject:anObject];
+ [self setupSubclassForObject:realObject];
+ return self;
+}
+
+- (void)dealloc
+{
+ object_setClass(realObject, [self mockedClass]);
+ [realObject release];
+ [[self class] forgetPartialMockForObject:realObject];
+ [super dealloc];
+}
+
+- (NSString *)description
+{
+ return [NSString stringWithFormat:@"OCPartialMockObject[%@]", NSStringFromClass(mockedClass)];
+}
+
+- (NSObject *)realObject
+{
+ return realObject;
+}
+
+
+
+#pragma mark Subclass management
+
+- (void)setupSubclassForObject:(id)anObject
+{
+ Class realClass = [anObject class];
+ const char *className = [[NSString stringWithFormat:@"%@-%p", realClass, anObject] cString];
+ NSLog(@"Creating class named %s", className);
+ Class subclass = objc_allocateClassPair(realClass, className, 0);
+ objc_registerClassPair(subclass);
+ object_setClass(anObject, subclass);
+
+ Method forwardInvocationMethod = class_getInstanceMethod([self class], @selector(forwardInvocationForRealObject:));
+ IMP forwardInvocationImp = method_getImplementation(forwardInvocationMethod);
+ const char *forwardInvocationTypes = method_getTypeEncoding(forwardInvocationMethod);
+ class_addMethod(subclass, @selector(forwardInvocation:), forwardInvocationImp, forwardInvocationTypes);
+}
+
+- (void)setupForwarderForSelector:(SEL)selector
+{
+ Class subclass = [[self realObject] class];
+ Method originalMethod = class_getInstanceMethod(subclass, selector);
+ IMP forwarderImp = [subclass instanceMethodForSelector:@selector(aMethodThatMustNotExist)];
+ class_addMethod(subclass, method_getName(originalMethod), forwarderImp, method_getTypeEncoding(originalMethod));
+}
+
+- (void)forwardInvocationForRealObject:(NSInvocation *)anInvocation
+{
+ // in here "self" is a reference to the real object, not the mock
+ OCPartialMockObject *mock = [OCPartialMockObject partialMockForObject:self];
+ if([mock handleInvocation:anInvocation] == NO)
+ [NSException raise:NSInternalInconsistencyException format:@"Ended up in subclass forwarder for %@ with unstubbed method %@",
+ [self class], NSStringFromSelector([anInvocation selector])];
+}
+
+
+
+#pragma mark Overrides
+
+- (id)getNewRecorder
+{
+ return [[[OCPartialMockRecorder alloc] initWithSignatureResolver:self] autorelease];
+}
+
+- (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation
+{
+ [anInvocation invokeWithTarget:realObject];
+}
+
+
+@end
diff --git a/third_party/ocmock/OCMock/OCPartialMockRecorder.h b/third_party/ocmock/OCMock/OCPartialMockRecorder.h
new file mode 100644
index 0000000..409a3a4
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCPartialMockRecorder.h
@@ -0,0 +1,12 @@
+//---------------------------------------------------------------------------------------
+// $Id: $
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import "OCMockRecorder.h"
+
+@interface OCPartialMockRecorder : OCMockRecorder
+{
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/OCPartialMockRecorder.m b/third_party/ocmock/OCMock/OCPartialMockRecorder.m
new file mode 100644
index 0000000..3dd4a93
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCPartialMockRecorder.m
@@ -0,0 +1,19 @@
+//---------------------------------------------------------------------------------------
+// $Id: $
+// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import "OCPartialMockObject.h"
+#import "OCPartialMockRecorder.h"
+
+
+@implementation OCPartialMockRecorder
+
+- (void)forwardInvocation:(NSInvocation *)anInvocation
+{
+ [super forwardInvocation:anInvocation];
+ // not as clean as I'd wish...
+ [(OCPartialMockObject *)signatureResolver setupForwarderForSelector:[anInvocation selector]];
+}
+
+@end
diff --git a/third_party/ocmock/OCMock/OCProtocolMockObject.h b/third_party/ocmock/OCMock/OCProtocolMockObject.h
new file mode 100644
index 0000000..66ff046
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCProtocolMockObject.h
@@ -0,0 +1,16 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCProtocolMockObject.h 21 2008-01-24 18:59:39Z erik $
+// Copyright (c) 2005-2008 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <OCMock/OCMockObject.h>
+
+@interface OCProtocolMockObject : OCMockObject
+{
+ Protocol *mockedProtocol;
+}
+
+- (id)initWithProtocol:(Protocol *)aProtocol;
+
+@end
+
diff --git a/third_party/ocmock/OCMock/OCProtocolMockObject.m b/third_party/ocmock/OCMock/OCProtocolMockObject.m
new file mode 100644
index 0000000..20d35c1
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCProtocolMockObject.m
@@ -0,0 +1,56 @@
+//---------------------------------------------------------------------------------------
+// $Id: OCProtocolMockObject.m 52 2009-08-14 07:21:10Z erik $
+// Copyright (c) 2005-2008 by Mulle Kybernetik. See License file for details.
+//---------------------------------------------------------------------------------------
+
+#import <objc/runtime.h>
+#import "NSMethodSignature+OCMAdditions.h"
+#import "OCProtocolMockObject.h"
+
+
+@implementation OCProtocolMockObject
+
+#pragma mark Initialisers, description, accessors, etc.
+
+- (id)initWithProtocol:(Protocol *)aProtocol
+{
+ [super init];
+ mockedProtocol = aProtocol;
+ return self;
+}
+
+- (NSString *)description
+{
+ return [NSString stringWithFormat:@"OCMockObject[%s]", [mockedProtocol name]];
+}
+
+
+
+#pragma mark Proxy API
+
+- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector
+{
+ struct objc_method_description methodDescription = protocol_getMethodDescription(mockedProtocol, aSelector, YES, YES);
+ if(methodDescription.name == NULL)
+ {
+ methodDescription = protocol_getMethodDescription(mockedProtocol, aSelector, NO, YES);
+ }
+ if(methodDescription.name == NULL)
+ {
+ return nil;
+ }
+ return [NSMethodSignature signatureWithObjCTypes:methodDescription.types];
+}
+
+- (BOOL)conformsToProtocol:(Protocol *)aProtocol
+{
+ return protocol_conformsToProtocol(mockedProtocol, aProtocol);
+}
+
+- (BOOL)respondsToSelector:(SEL)selector
+{
+ return ([self methodSignatureForSelector:selector] != nil);
+}
+
+
+@end
diff --git a/third_party/ocmock/OCMock/Test-Info.plist b/third_party/ocmock/OCMock/Test-Info.plist
new file mode 100644
index 0000000..e221462
--- /dev/null
+++ b/third_party/ocmock/OCMock/Test-Info.plist
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.mulle-kybernetik.${EXECUTABLE_NAME}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+</dict>
+</plist>
diff --git a/third_party/ocmock/OCMock/version.plist b/third_party/ocmock/OCMock/version.plist
new file mode 100644
index 0000000..02d7a0a
--- /dev/null
+++ b/third_party/ocmock/OCMock/version.plist
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>BuildVersion</key>
+ <string>38</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>ProjectName</key>
+ <string>DevToolsWizardTemplates</string>
+ <key>SourceVersion</key>
+ <string>2350000</string>
+</dict>
+</plist>