mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
add some notification tests
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36488 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6b1db47da3
commit
0c977df4a7
3 changed files with 171 additions and 0 deletions
39
Tests/base/NSNotification/basic.m
Normal file
39
Tests/base/NSNotification/basic.m
Normal file
|
@ -0,0 +1,39 @@
|
|||
#import <Foundation/NSNotification.h>
|
||||
#import <Foundation/NSAutoreleasePool.h>
|
||||
#import "ObjectTesting.h"
|
||||
|
||||
@implementation NSNotification (Testing)
|
||||
- (BOOL) isEqualForTestcase: (id)other
|
||||
{
|
||||
if (NO == [other isKindOfClass: [NSNotification class]])
|
||||
return NO;
|
||||
if ([self name] != [other name]
|
||||
&& NO == [[self name] isEqual: [other name]])
|
||||
return NO;
|
||||
if ([self object] != [other object]
|
||||
&& NO == [[self object] isEqual: [other object]])
|
||||
return NO;
|
||||
if ([self userInfo] != [other userInfo]
|
||||
&& NO == [[self userInfo] isEqual: [other userInfo]])
|
||||
return NO;
|
||||
return YES;
|
||||
}
|
||||
@end
|
||||
|
||||
int main()
|
||||
{
|
||||
NSNotification *obj;
|
||||
NSMutableArray *testObjs = [[NSMutableArray alloc] init];
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
|
||||
test_alloc(@"NSNotification");
|
||||
obj = [NSNotification new];
|
||||
[testObjs addObject: obj];
|
||||
test_NSObject(@"NSNotification", testObjs);
|
||||
test_NSCoding(testObjs);
|
||||
test_keyed_NSCoding(testObjs);
|
||||
test_NSCopying(@"NSNotification",@"NSNotification",testObjs,NO,NO);
|
||||
|
||||
[arp release]; arp = nil;
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue