Skip to content

Commit

Permalink
Returned back original object emulation with retain/release in CDRSpy.
Browse files Browse the repository at this point in the history
This prevent crashes when running tests on with CEDAR_SDK_RUNTIME_VERSION < 7.0
  • Loading branch information
PaulTaykalo committed Jan 18, 2014
1 parent 6c318c1 commit be9b966
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Source/Doubles/CDRSpy.mm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,38 @@ + (void)stopInterceptingMessagesForInstance:(id)instance {

#pragma mark - Emulating the original object

- (id)retain {
__block id that = self;
[self as_spied_class:^{
[that retain];
}];
return self;
}

- (oneway void)release {
__block id that = self;
[self as_spied_class:^{
[that release];
}];
}

- (id)autorelease {
__block id that = self;
[self as_spied_class:^{
[that autorelease];
}];
return self;
}

- (NSUInteger)retainCount {
__block id that = self;
__block NSUInteger count;
[self as_spied_class:^{
count = [that retainCount];
}];
return count;
}

- (NSString *)description {
__block id that = self;
__block NSString *description = nil;
Expand Down

0 comments on commit be9b966

Please sign in to comment.