From 2c5d2d7c475c15b5c5a80fc928ae4c3061e5d214 Mon Sep 17 00:00:00 2001 From: drx777 Date: Mon, 3 May 2010 19:18:20 +0000 Subject: - Added OCMock.framework for unittests using mock objects --- Frameworks/OCMock.framework/Headers | 1 + Frameworks/OCMock.framework/OCMock | 1 + Frameworks/OCMock.framework/Resources | 1 + .../A/Headers/NSNotificationCenter+OCMAdditions.h | 15 +++++++ .../OCMock.framework/Versions/A/Headers/OCMArg.h | 30 +++++++++++++ .../Versions/A/Headers/OCMConstraint.h | 48 +++++++++++++++++++++ .../OCMock.framework/Versions/A/Headers/OCMock.h | 10 +++++ .../Versions/A/Headers/OCMockObject.h | 41 ++++++++++++++++++ .../Versions/A/Headers/OCMockRecorder.h | 28 ++++++++++++ Frameworks/OCMock.framework/Versions/A/OCMock | Bin 0 -> 291796 bytes .../Versions/A/Resources/Info.plist | 26 +++++++++++ .../Versions/A/Resources/License.txt | 15 +++++++ Frameworks/OCMock.framework/Versions/Current | 1 + 13 files changed, 217 insertions(+) create mode 120000 Frameworks/OCMock.framework/Headers create mode 120000 Frameworks/OCMock.framework/OCMock create mode 120000 Frameworks/OCMock.framework/Resources create mode 100644 Frameworks/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h create mode 100644 Frameworks/OCMock.framework/Versions/A/Headers/OCMArg.h create mode 100644 Frameworks/OCMock.framework/Versions/A/Headers/OCMConstraint.h create mode 100644 Frameworks/OCMock.framework/Versions/A/Headers/OCMock.h create mode 100644 Frameworks/OCMock.framework/Versions/A/Headers/OCMockObject.h create mode 100644 Frameworks/OCMock.framework/Versions/A/Headers/OCMockRecorder.h create mode 100755 Frameworks/OCMock.framework/Versions/A/OCMock create mode 100644 Frameworks/OCMock.framework/Versions/A/Resources/Info.plist create mode 100644 Frameworks/OCMock.framework/Versions/A/Resources/License.txt create mode 120000 Frameworks/OCMock.framework/Versions/Current (limited to 'Frameworks/OCMock.framework') diff --git a/Frameworks/OCMock.framework/Headers b/Frameworks/OCMock.framework/Headers new file mode 120000 index 00000000..a177d2a6 --- /dev/null +++ b/Frameworks/OCMock.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/Frameworks/OCMock.framework/OCMock b/Frameworks/OCMock.framework/OCMock new file mode 120000 index 00000000..c388ea8d --- /dev/null +++ b/Frameworks/OCMock.framework/OCMock @@ -0,0 +1 @@ +Versions/Current/OCMock \ No newline at end of file diff --git a/Frameworks/OCMock.framework/Resources b/Frameworks/OCMock.framework/Resources new file mode 120000 index 00000000..953ee36f --- /dev/null +++ b/Frameworks/OCMock.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h b/Frameworks/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h new file mode 100644 index 00000000..ae2e37d0 --- /dev/null +++ b/Frameworks/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h @@ -0,0 +1,15 @@ +//--------------------------------------------------------------------------------------- +// $Id: NSNotificationCenter+OCMAdditions.h$ +// Copyright (c) 2009 by Mulle Kybernetik. See License file for details. +//--------------------------------------------------------------------------------------- + +#import + +@class OCMockObserver; + + +@interface NSNotificationCenter(OCMAdditions) + +- (void)addMockObserver:(OCMockObserver *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; + +@end diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/OCMArg.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMArg.h new file mode 100644 index 00000000..a775f39f --- /dev/null +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMArg.h @@ -0,0 +1,30 @@ +//--------------------------------------------------------------------------------------- +// $Id$ +// Copyright (c) 2009 by Mulle Kybernetik. See License file for details. +//--------------------------------------------------------------------------------------- + +#import + +@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/Frameworks/OCMock.framework/Versions/A/Headers/OCMConstraint.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMConstraint.h new file mode 100644 index 00000000..0bab7775 --- /dev/null +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMConstraint.h @@ -0,0 +1,48 @@ +//--------------------------------------------------------------------------------------- +// $Id$ +// Copyright (c) 2007-2009 by Mulle Kybernetik. See License file for details. +//--------------------------------------------------------------------------------------- + +#import + +@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/Frameworks/OCMock.framework/Versions/A/Headers/OCMock.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMock.h new file mode 100644 index 00000000..e18de58a --- /dev/null +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMock.h @@ -0,0 +1,10 @@ +//--------------------------------------------------------------------------------------- +// $Id$ +// Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details. +//--------------------------------------------------------------------------------------- + +#import +#import +#import +#import +#import diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/OCMockObject.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMockObject.h new file mode 100644 index 00000000..87e7b82e --- /dev/null +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMockObject.h @@ -0,0 +1,41 @@ +//--------------------------------------------------------------------------------------- +// $Id$ +// Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details. +//--------------------------------------------------------------------------------------- + +#import + +@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/Frameworks/OCMock.framework/Versions/A/Headers/OCMockRecorder.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMockRecorder.h new file mode 100644 index 00000000..7463a3f4 --- /dev/null +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMockRecorder.h @@ -0,0 +1,28 @@ +//--------------------------------------------------------------------------------------- +// $Id$ +// Copyright (c) 2004-2009 by Mulle Kybernetik. See License file for details. +//--------------------------------------------------------------------------------------- + +#import + +@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/Frameworks/OCMock.framework/Versions/A/OCMock b/Frameworks/OCMock.framework/Versions/A/OCMock new file mode 100755 index 00000000..303e9337 Binary files /dev/null and b/Frameworks/OCMock.framework/Versions/A/OCMock differ diff --git a/Frameworks/OCMock.framework/Versions/A/Resources/Info.plist b/Frameworks/OCMock.framework/Versions/A/Resources/Info.plist new file mode 100644 index 00000000..4634d14c --- /dev/null +++ b/Frameworks/OCMock.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + OCMock + CFBundleIdentifier + com.mulle-kybernetik.OCMock + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + OCMock + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.29 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSHumanReadableCopyright + Copyright © 2004-2009 Mulle Kybernetik. + + diff --git a/Frameworks/OCMock.framework/Versions/A/Resources/License.txt b/Frameworks/OCMock.framework/Versions/A/Resources/License.txt new file mode 100644 index 00000000..e2c13960 --- /dev/null +++ b/Frameworks/OCMock.framework/Versions/A/Resources/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/Frameworks/OCMock.framework/Versions/Current b/Frameworks/OCMock.framework/Versions/Current new file mode 120000 index 00000000..8c7e5a66 --- /dev/null +++ b/Frameworks/OCMock.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file -- cgit v1.2.3