OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef THIRD_PARTY_OCMOCK_OCMOCK_EXTENSIONS_H_ |
| 6 #define THIRD_PARTY_OCMOCK_OCMOCK_EXTENSIONS_H_ |
| 7 |
| 8 #import <Foundation/Foundation.h> |
| 9 |
| 10 #import "third_party/ocmock/OCMock/OCMock.h" |
| 11 |
| 12 // Some enhancements to OCMock to make it easier to write mocks. |
| 13 // Pointers to objects still have to be handled with |
| 14 // - (id)andReturnValue:OCMOCK_VALUE(blah) |
| 15 // to keep the types working correctly. |
| 16 @interface OCMockRecorder(CrExtensions) |
| 17 - (id)andReturnChar:(char)value; |
| 18 - (id)andReturnUnsignedChar:(unsigned char)value; |
| 19 - (id)andReturnShort:(short)value; |
| 20 - (id)andReturnUnsignedShort:(unsigned short)value; |
| 21 - (id)andReturnInt:(int)value; |
| 22 - (id)andReturnUnsignedInt:(unsigned int)value; |
| 23 - (id)andReturnLong:(long)value; |
| 24 - (id)andReturnUnsignedLong:(unsigned long)value; |
| 25 - (id)andReturnLongLong:(long long)value; |
| 26 - (id)andReturnUnsignedLongLong:(unsigned long long)value; |
| 27 - (id)andReturnFloat:(float)value; |
| 28 - (id)andReturnDouble:(double)value; |
| 29 - (id)andReturnBool:(BOOL)value; |
| 30 - (id)andReturnInteger:(NSInteger)value; |
| 31 - (id)andReturnUnsignedInteger:(NSUInteger)value; |
| 32 - (id)andReturnNSRect:(NSRect)rect; |
| 33 - (id)andReturnCGRect:(CGRect)rect; |
| 34 - (id)andReturnNSPoint:(NSPoint)point; |
| 35 - (id)andReturnCGPoint:(CGPoint)point; |
| 36 @end |
| 37 |
| 38 // A constraint for verifying that something conforms to a protocol. |
| 39 @interface cr_OCMConformToProtocolConstraint : OCMConstraint { |
| 40 @private |
| 41 Protocol* protocol_; |
| 42 } |
| 43 - (id)initWithProtocol:(Protocol*)protocol; |
| 44 @end |
| 45 |
| 46 @interface OCMArg(CrExtensions) |
| 47 + (id)conformsToProtocol:(Protocol*)protocol; |
| 48 @end |
| 49 |
| 50 #endif // THIRD_PARTY_OCMOCK_OCMOCK_EXTENSIONS_H_ |
OLD | NEW |