Created
September 27, 2013 03:29
-
-
Save kognate/6723771 to your computer and use it in GitHub Desktop.
Great bug. I think?
This file contains 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
#import <XCTest/XCTest.h> | |
@interface RadarReport_Tests : XCTestCase | |
@property (strong) NSMapTable *mt; | |
@end | |
@implementation RadarReport_Tests | |
- (void)setUp | |
{ | |
self.mt = [[NSMapTable alloc] init]; | |
[self.mt setObject:@"hello" forKey:@20]; | |
[self.mt setObject:@"world" forKey:@"twenty"]; | |
[self.mt setObject:@20 forKey:self.mt]; | |
} | |
- (void)testWorkingCondition | |
{ | |
[self.mt setObject:[NSData dataWithBytes:"one" length:3] forKey:[NSValue valueWithPoint:NSMakePoint(10, 20)]]; | |
NSNumber *n = [self.mt objectForKey:self.mt]; | |
XCTAssertNotNil(n, @"This should not be nil"); | |
} | |
- (void) testBadCondition | |
{ | |
NSNumber *n = [self.mt objectForKey:self.mt]; | |
XCTAssertNil(n, @"But this IS nil"); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment