Add tests for notification equality

This commit is contained in:
Richard Frith-Macdonald 2020-04-21 09:02:34 +01:00
parent 132729e6e0
commit cd68b7e4da

View file

@ -26,7 +26,19 @@ int main()
NSMutableArray *testObjs = [[NSMutableArray alloc] init];
NSAutoreleasePool *arp = [NSAutoreleasePool new];
NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:
@"obj", @"key", nil];
NSNotification *o1 = [NSNotification notificationWithName: @"hello"
object: @"there"
userInfo: info];
NSNotification *o2 = [NSNotification notificationWithName: @"hello"
object: @"there"
userInfo: info];
PASS([o1 hash] == [o2 hash], "equal notification hashes")
PASS_EQUAL(o1, o2, "equal notifications")
test_alloc(@"NSNotification");
obj = [NSNotification new];
[testObjs addObject: obj];
test_NSObject(@"NSNotification", testObjs);