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

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

Issue 9240023: Roll OCMock r77:7f521db0628086185123666b0979e48d6ecaeac1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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
OLDNEW
1 //------------------------------------------------------------------------------ --------- 1 //------------------------------------------------------------------------------ ---------
2 // $Id: OCMRealObjectForwarder.m 70 2010-08-20 16:06:51Z erik $ 2 // $Id$
3 // Copyright (c) 2010 by Mulle Kybernetik. See License file for details. 3 // Copyright (c) 2010 by Mulle Kybernetik. See License file for details.
4 //------------------------------------------------------------------------------ --------- 4 //------------------------------------------------------------------------------ ---------
5 5
6 #import <objc/runtime.h> 6 #import <objc/runtime.h>
7 #import "OCPartialMockObject.h" 7 #import "OCPartialMockObject.h"
8 #import "OCMRealObjectForwarder.h" 8 #import "OCMRealObjectForwarder.h"
9 9
10 10
11 @implementation OCMRealObjectForwarder 11 @implementation OCMRealObjectForwarder
12 12
13 - (void)handleInvocation:(NSInvocation *)anInvocation 13 - (void)handleInvocation:(NSInvocation *)anInvocation
14 { 14 {
15 id invocationTarget = [anInvocation target]; 15 id invocationTarget = [anInvocation target];
16 SEL invocationSelector = [anInvocation selector]; 16 SEL invocationSelector = [anInvocation selector];
17 SEL aliasedSelector = NSSelectorFromString([OCMRealMethodAliasPrefix str ingByAppendingString:NSStringFromSelector(invocationSelector)]); 17 SEL aliasedSelector = NSSelectorFromString([OCMRealMethodAliasPrefix str ingByAppendingString:NSStringFromSelector(invocationSelector)]);
18 18
19 [anInvocation setSelector:aliasedSelector]; 19 [anInvocation setSelector:aliasedSelector];
20 if([invocationTarget isProxy] && (class_getInstanceMethod([invocationTar get class], @selector(realObject)))) 20 if([invocationTarget isProxy] && (class_getInstanceMethod([invocationTar get class], @selector(realObject))))
21 { 21 {
22 // the method has been invoked on the mock, we need to change th e target to the real object 22 // the method has been invoked on the mock, we need to change th e target to the real object
23 [anInvocation setTarget:[(OCPartialMockObject *)invocationTarget realObject]]; 23 [anInvocation setTarget:[(OCPartialMockObject *)invocationTarget realObject]];
24 } 24 }
25 [anInvocation invoke]; 25 [anInvocation invoke];
26 } 26 }
27 27
28 28
29 @end 29 @end
OLDNEW
« no previous file with comments | « third_party/ocmock/OCMock/OCMRealObjectForwarder.h ('k') | third_party/ocmock/OCMock/OCMReturnValueProvider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698