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

Side by Side Diff: third_party/ocmock/OCMock/NSInvocation+OCMAdditions.m

Issue 177373009: Compatibility fix for arm64 on iOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ocmock.0
Patch Set: Rebase Created 6 years, 9 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
« no previous file with comments | « no previous file | third_party/ocmock/OCMock/OCMBoxedReturnValueProvider.m » ('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) 2006-2009 by Mulle Kybernetik. See License file for details. 3 // Copyright (c) 2006-2009 by Mulle Kybernetik. See License file for details.
4 //------------------------------------------------------------------------------ --------- 4 //------------------------------------------------------------------------------ ---------
5 5
6 #import "NSInvocation+OCMAdditions.h" 6 #import "NSInvocation+OCMAdditions.h"
7 7
8 8
9 @implementation NSInvocation(OCMAdditions) 9 @implementation NSInvocation(OCMAdditions)
10 10
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 - (NSString *)argumentDescriptionAtIndex:(int)argIndex 155 - (NSString *)argumentDescriptionAtIndex:(int)argIndex
156 { 156 {
157 const char *argType = [[self methodSignature] getArgumentTypeAtIndex:arg Index]; 157 const char *argType = [[self methodSignature] getArgumentTypeAtIndex:arg Index];
158 if(strchr("rnNoORV", argType[0]) != NULL) 158 if(strchr("rnNoORV", argType[0]) != NULL)
159 argType += 1; 159 argType += 1;
160 160
161 switch(*argType) 161 switch(*argType)
162 { 162 {
163 case '@': return [self objectDescriptionAtIndex:argIndex]; 163 case '@': return [self objectDescriptionAtIndex:argIndex];
164 case 'B': return [self boolDescriptionAtIndex:argIndex];
164 case 'c': return [self charDescriptionAtIndex:argIndex]; 165 case 'c': return [self charDescriptionAtIndex:argIndex];
165 case 'C': return [self unsignedCharDescriptionAtIndex:argI ndex]; 166 case 'C': return [self unsignedCharDescriptionAtIndex:argI ndex];
166 case 'i': return [self intDescriptionAtIndex:argIndex]; 167 case 'i': return [self intDescriptionAtIndex:argIndex];
167 case 'I': return [self unsignedIntDescriptionAtIndex:argIn dex]; 168 case 'I': return [self unsignedIntDescriptionAtIndex:argIn dex];
168 case 's': return [self shortDescriptionAtIndex:argIndex]; 169 case 's': return [self shortDescriptionAtIndex:argIndex];
169 case 'S': return [self unsignedShortDescriptionAtIndex:arg Index]; 170 case 'S': return [self unsignedShortDescriptionAtIndex:arg Index];
170 case 'l': return [self longDescriptionAtIndex:argIndex]; 171 case 'l': return [self longDescriptionAtIndex:argIndex];
171 case 'L': return [self unsignedLongDescriptionAtIndex:argI ndex]; 172 case 'L': return [self unsignedLongDescriptionAtIndex:argI ndex];
172 case 'q': return [self longLongDescriptionAtIndex:argIndex ]; 173 case 'q': return [self longLongDescriptionAtIndex:argIndex ];
173 case 'Q': return [self unsignedLongLongDescriptionAtIndex: argIndex]; 174 case 'Q': return [self unsignedLongLongDescriptionAtIndex: argIndex];
(...skipping 16 matching lines...) Expand all
190 191
191 [self getArgument:&object atIndex:anInt]; 192 [self getArgument:&object atIndex:anInt];
192 if (object == nil) 193 if (object == nil)
193 return @"nil"; 194 return @"nil";
194 else if(![object isProxy] && [object isKindOfClass:[NSString class]]) 195 else if(![object isProxy] && [object isKindOfClass:[NSString class]])
195 return [NSString stringWithFormat:@"@\"%@\"", [object descriptio n]]; 196 return [NSString stringWithFormat:@"@\"%@\"", [object descriptio n]];
196 else 197 else
197 return [object description]; 198 return [object description];
198 } 199 }
199 200
201 - (NSString *)boolDescriptionAtIndex:(int)anInt
202 {
203 bool value;
204
205 [self getArgument:&value atIndex:anInt];
206 return value ? @"YES" : @"NO";
207 }
208
200 - (NSString *)charDescriptionAtIndex:(int)anInt 209 - (NSString *)charDescriptionAtIndex:(int)anInt
201 { 210 {
202 unsigned char buffer[128]; 211 unsigned char buffer[128];
203 memset(buffer, 0x0, 128); 212 memset(buffer, 0x0, 128);
204 213
205 [self getArgument:&buffer atIndex:anInt]; 214 [self getArgument:&buffer atIndex:anInt];
206 215
207 // If there's only one character in the buffer, and it's 0 or 1, then we have a BOOL 216 // If there's only one character in the buffer, and it's 0 or 1, then we have a BOOL
208 if (buffer[1] == '\0' && (buffer[0] == 0 || buffer[0] == 1)) 217 if (buffer[1] == '\0' && (buffer[0] == 0 || buffer[0] == 1))
209 return [NSString stringWithFormat:@"%@", (buffer[0] == 1 ? @"YES " : @"NO")]; 218 return [NSString stringWithFormat:@"%@", (buffer[0] == 1 ? @"YES " : @"NO")];
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 337
329 - (NSString *)selectorDescriptionAtIndex:(int)anInt 338 - (NSString *)selectorDescriptionAtIndex:(int)anInt
330 { 339 {
331 SEL selectorValue; 340 SEL selectorValue;
332 341
333 [self getArgument:&selectorValue atIndex:anInt]; 342 [self getArgument:&selectorValue atIndex:anInt];
334 return [NSString stringWithFormat:@"@selector(%@)", NSStringFromSelector (selectorValue)]; 343 return [NSString stringWithFormat:@"@selector(%@)", NSStringFromSelector (selectorValue)];
335 } 344 }
336 345
337 @end 346 @end
OLDNEW
« no previous file with comments | « no previous file | third_party/ocmock/OCMock/OCMBoxedReturnValueProvider.m » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698