Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: third_party/ocmock/ocmock_extensions.h

Issue 7004036: Added some enhancements to OCMock. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed up protocol stuff Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/ocmock/ocmock.gyp ('k') | third_party/ocmock/ocmock_extensions.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/ocmock/ocmock_extensions.h
diff --git a/third_party/ocmock/ocmock_extensions.h b/third_party/ocmock/ocmock_extensions.h
new file mode 100644
index 0000000000000000000000000000000000000000..53e0c15fac5c5be2d26d10705a3b9d684abece23
--- /dev/null
+++ b/third_party/ocmock/ocmock_extensions.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef THIRD_PARTY_OCMOCK_OCMOCK_EXTENSIONS_H_
+#define THIRD_PARTY_OCMOCK_OCMOCK_EXTENSIONS_H_
+
+#import <Foundation/Foundation.h>
+
+#import "third_party/ocmock/OCMock/OCMock.h"
+
+// Some enhancements to OCMock to make it easier to write mocks.
+// Pointers to objects still have to be handled with
+// - (id)andReturnValue:OCMOCK_VALUE(blah)
+// to keep the types working correctly.
+@interface OCMockRecorder(CrExtensions)
+- (id)andReturnChar:(char)value;
+- (id)andReturnUnsignedChar:(unsigned char)value;
+- (id)andReturnShort:(short)value;
+- (id)andReturnUnsignedShort:(unsigned short)value;
+- (id)andReturnInt:(int)value;
+- (id)andReturnUnsignedInt:(unsigned int)value;
+- (id)andReturnLong:(long)value;
+- (id)andReturnUnsignedLong:(unsigned long)value;
+- (id)andReturnLongLong:(long long)value;
+- (id)andReturnUnsignedLongLong:(unsigned long long)value;
+- (id)andReturnFloat:(float)value;
+- (id)andReturnDouble:(double)value;
+- (id)andReturnBool:(BOOL)value;
+- (id)andReturnInteger:(NSInteger)value;
+- (id)andReturnUnsignedInteger:(NSUInteger)value;
+- (id)andReturnNSRect:(NSRect)rect;
+- (id)andReturnCGRect:(CGRect)rect;
+- (id)andReturnNSPoint:(NSPoint)point;
+- (id)andReturnCGPoint:(CGPoint)point;
+@end
+
+// A constraint for verifying that something conforms to a protocol.
+@interface cr_OCMConformToProtocolConstraint : OCMConstraint {
+ @private
+ Protocol* protocol_;
+}
+- (id)initWithProtocol:(Protocol*)protocol;
+@end
+
+@interface OCMArg(CrExtensions)
++ (id)conformsToProtocol:(Protocol*)protocol;
+@end
+
+#endif // THIRD_PARTY_OCMOCK_OCMOCK_EXTENSIONS_H_
« no previous file with comments | « third_party/ocmock/ocmock.gyp ('k') | third_party/ocmock/ocmock_extensions.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698