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

Side by Side Diff: third_party/ocmock/OCMock/OCPartialMockObject.m

Issue 9293037: Roll OCMock to dbdb233ae84498077f7e946abb49731968333f0b. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/ocmock/Changes.txt ('k') | third_party/ocmock/README.chromium » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //------------------------------------------------------------------------------ --------- 1 //------------------------------------------------------------------------------ ---------
2 // $Id$ 2 // $Id$
3 // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 3 // Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
4 //------------------------------------------------------------------------------ --------- 4 //------------------------------------------------------------------------------ ---------
5 5
6 #import <objc/runtime.h> 6 #import <objc/runtime.h>
7 #import "OCPartialMockRecorder.h" 7 #import "OCPartialMockRecorder.h"
8 #import "OCPartialMockObject.h" 8 #import "OCPartialMockObject.h"
9 9
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 realObject = nil; 84 realObject = nil;
85 } 85 }
86 86
87 87
88 #pragma mark Subclass management 88 #pragma mark Subclass management
89 89
90 - (void)setupSubclassForObject:(id)anObject 90 - (void)setupSubclassForObject:(id)anObject
91 { 91 {
92 Class realClass = [anObject class]; 92 Class realClass = [anObject class];
93 double timestamp = [NSDate timeIntervalSinceReferenceDate]; 93 double timestamp = [NSDate timeIntervalSinceReferenceDate];
94 » const char *className = [[NSString stringWithFormat:@"%@-%p-%f", realCla ss, anObject, timestamp] cString]; 94 » const char *className = [[NSString stringWithFormat:@"%@-%p-%f", realCla ss, anObject, timestamp] UTF8String];
95 Class subclass = objc_allocateClassPair(realClass, className, 0); 95 Class subclass = objc_allocateClassPair(realClass, className, 0);
96 objc_registerClassPair(subclass); 96 objc_registerClassPair(subclass);
97 object_setClass(anObject, subclass); 97 object_setClass(anObject, subclass);
98 98
99 Method forwardInvocationMethod = class_getInstanceMethod([self class], @ selector(forwardInvocationForRealObject:)); 99 Method forwardInvocationMethod = class_getInstanceMethod([self class], @ selector(forwardInvocationForRealObject:));
100 IMP forwardInvocationImp = method_getImplementation(forwardInvocationMet hod); 100 IMP forwardInvocationImp = method_getImplementation(forwardInvocationMet hod);
101 const char *forwardInvocationTypes = method_getTypeEncoding(forwardInvoc ationMethod); 101 const char *forwardInvocationTypes = method_getTypeEncoding(forwardInvoc ationMethod);
102 class_addMethod(subclass, @selector(forwardInvocation:), forwardInvocati onImp, forwardInvocationTypes); 102 class_addMethod(subclass, @selector(forwardInvocation:), forwardInvocati onImp, forwardInvocationTypes);
103 } 103 }
104 104
(...skipping 28 matching lines...) Expand all
133 return [[[OCPartialMockRecorder alloc] initWithSignatureResolver:self] a utorelease]; 133 return [[[OCPartialMockRecorder alloc] initWithSignatureResolver:self] a utorelease];
134 } 134 }
135 135
136 - (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation 136 - (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation
137 { 137 {
138 [anInvocation invokeWithTarget:realObject]; 138 [anInvocation invokeWithTarget:realObject];
139 } 139 }
140 140
141 141
142 @end 142 @end
OLDNEW
« no previous file with comments | « third_party/ocmock/Changes.txt ('k') | third_party/ocmock/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698