20
20
#import " NSInvocation+OCMAdditions.h"
21
21
#import " OCMFunctionsPrivate.h"
22
22
#import " NSMethodSignature+OCMAdditions.h"
23
-
23
+ # import " OCMArg.h "
24
24
25
25
#if (TARGET_OS_OSX && (!defined(__MAC_10_10) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_10)) || \
26
26
(TARGET_OS_IPHONE && (!defined(__IPHONE_8_0) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0))
@@ -30,6 +30,8 @@ static BOOL OCMObjectIsClass(id object) {
30
30
#define object_isClass OCMObjectIsClass
31
31
#endif
32
32
33
+ static NSString *const OCMArgAnyPointerDescription = @" <[OCMArg anyPointer]>" ;
34
+
33
35
34
36
@implementation NSInvocation (OCMAdditions)
35
37
@@ -331,6 +333,7 @@ - (id)getArgumentAtIndexAsObject:(NSInteger)argIndex
331
333
return nil ;
332
334
}
333
335
336
+
334
337
- (NSString *)invocationDescription
335
338
{
336
339
NSMethodSignature *methodSignature = [self methodSignature ];
@@ -381,7 +384,6 @@ - (NSString *)argumentDescriptionAtIndex:(NSInteger)argIndex
381
384
382
385
}
383
386
384
-
385
387
- (NSString *)objectDescriptionAtIndex : (NSInteger )anInt
386
388
{
387
389
id object;
@@ -524,18 +526,30 @@ - (NSString *)pointerDescriptionAtIndex:(NSInteger)anInt
524
526
void *buffer;
525
527
526
528
[self getArgument: &buffer atIndex: anInt];
527
- return [NSString stringWithFormat: @" %p " , buffer];
529
+
530
+ if (buffer == [OCMArg anyPointer ])
531
+ return OCMArgAnyPointerDescription;
532
+ else
533
+ return [NSString stringWithFormat: @" %p " , buffer];
528
534
}
529
535
530
536
- (NSString *)cStringDescriptionAtIndex : (NSInteger )anInt
531
537
{
532
- char buffer[104 ];
533
538
char *cStringPtr;
534
539
535
540
[self getArgument: &cStringPtr atIndex: anInt];
536
- strlcpy (buffer, cStringPtr, sizeof (buffer));
537
- strlcpy (buffer + 100 , " ..." , (sizeof (buffer) - 100 ));
538
- return [NSString stringWithFormat: @" \" %s \" " , buffer];
541
+
542
+ if (cStringPtr == [OCMArg anyPointer ])
543
+ {
544
+ return OCMArgAnyPointerDescription;
545
+ }
546
+ else
547
+ {
548
+ char buffer[104 ];
549
+ strlcpy (buffer, cStringPtr, sizeof (buffer));
550
+ strlcpy (buffer + 100 , " ..." , (sizeof (buffer) - 100 ));
551
+ return [NSString stringWithFormat: @" \" %s \" " , buffer];
552
+ }
539
553
}
540
554
541
555
- (NSString *)selectorDescriptionAtIndex : (NSInteger )anInt
0 commit comments