Created
September 5, 2013 09:33
-
-
Save pita5/6448009 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)testWeakAssign | |
{ | |
SingleThreadLock* condition = [[SingleThreadLock alloc]init]; | |
__block AXProductDescription *p1; | |
[AXProductDescription getHeroesWithCompletionHandler:^(NSArray *products, NSError *error) { | |
p1 = [products objectAtIndex:0]; | |
[condition signal]; | |
}]; | |
STAssertTrue([condition waitWithTimeout:200], @"Timeout"); | |
@autoreleasepool | |
{ | |
condition = [[SingleThreadLock alloc] init]; | |
[p1 getProductWithCompletionHandler:^(AXProduct *p2, NSError *error) { | |
[condition signal]; | |
}]; | |
STAssertTrue([condition waitWithTimeout:200], @"Timeout"); | |
} | |
@autoreleasepool | |
{ | |
condition = [[SingleThreadLock alloc]init]; | |
[p1 getProductWithCompletionHandler:^(AXProduct *p2, NSError *error) { | |
[condition signal]; | |
}]; | |
STAssertTrue([condition waitWithTimeout:200], @"Timeout"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment