Skip to content

Commit

Permalink
[ios] Fix instance method conflicts in Showcase.
Browse files Browse the repository at this point in the history
Showcase's protocol_alerter.mm is conflicting with OCMock.  Prefixing with
crsc_ instead.

Bug: 988423
Change-Id: I542b7df1374a285b3a8ecf293b682fa922d10fde
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1724654
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Auto-Submit: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681816}
  • Loading branch information
Justin Cohen authored and Commit Bot committed Jul 29, 2019
1 parent a7ab293 commit dd41c58
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions ios/showcase/common/protocol_alerter.mm
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ - (NSString*)crsc_description {
[description appendString:@" "];
[description appendString:keyword];
[description appendString:@":"];
[description appendString:[self argumentDescriptionAtIndex:argumentIndex]];
[description
appendString:[self crsc_argumentDescriptionAtIndex:argumentIndex]];
argumentIndex++;
}

Expand All @@ -164,16 +165,16 @@ - (NSString*)crsc_description {

// Return a string describing the argument value at |index|.
// (|index| is in NSInvocation's argument array).
- (NSString*)argumentDescriptionAtIndex:(NSInteger)index {
- (NSString*)crsc_argumentDescriptionAtIndex:(NSInteger)index {
const char* type = [self.methodSignature getArgumentTypeAtIndex:index];

switch (*type) {
case '@':
return [self objectDescriptionAtIndex:index];
return [self crsc_objectDescriptionAtIndex:index];
case 'q':
return [self longLongDescriptionAtIndex:index];
return [self crsc_longLongDescriptionAtIndex:index];
case 'Q':
return [self unsignedLongLongDescriptionAtIndex:index];
return [self crsc_unsignedLongLongDescriptionAtIndex:index];
// Add cases as needed here.
default:
return [NSString stringWithFormat:@"<Unknown Type:%s>", type];
Expand All @@ -182,7 +183,7 @@ - (NSString*)argumentDescriptionAtIndex:(NSInteger)index {

// Return a string describing an argument at |index| that's known to be an
// objective-C object.
- (NSString*)objectDescriptionAtIndex:(NSInteger)index {
- (NSString*)crsc_objectDescriptionAtIndex:(NSInteger)index {
__unsafe_unretained id object;

[self getArgument:&object atIndex:index];
Expand Down Expand Up @@ -216,7 +217,7 @@ - (NSString*)objectDescriptionAtIndex:(NSInteger)index {

// Returns a string describing an argument at |index| that is known to be a long
// long.
- (NSString*)longLongDescriptionAtIndex:(NSInteger)index {
- (NSString*)crsc_longLongDescriptionAtIndex:(NSInteger)index {
long long value;

[self getArgument:&value atIndex:index];
Expand All @@ -225,7 +226,7 @@ - (NSString*)longLongDescriptionAtIndex:(NSInteger)index {

// Returns a string describing an argument at |index| that is known to be an
// unsigned long long.
- (NSString*)unsignedLongLongDescriptionAtIndex:(NSInteger)index {
- (NSString*)crsc_unsignedLongLongDescriptionAtIndex:(NSInteger)index {
unsigned long long value;

[self getArgument:&value atIndex:index];
Expand Down

0 comments on commit dd41c58

Please sign in to comment.