mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
make tests pass on os-x 14.5
This commit is contained in:
parent
1a1e7f7fc5
commit
a0a62fbde4
4 changed files with 12 additions and 6 deletions
|
@ -25,8 +25,8 @@ int main()
|
|||
|
||||
[obj addObject: (void*)@"hello"];
|
||||
PASS([obj count] == 1, "-addObject: increments count");
|
||||
PASS_EXCEPTION([obj addObject: nil];,
|
||||
NSInvalidArgumentException, "-addObject: raises with nil");
|
||||
PASS_RUNS([obj addObject: nil], "-addObject: accepts nil");
|
||||
PASS([obj count] == 1, "-addObject: nil does not increment count");
|
||||
|
||||
[arp release]; arp = nil;
|
||||
return 0;
|
||||
|
|
|
@ -8,12 +8,14 @@
|
|||
int main()
|
||||
{
|
||||
START_SET("NSHashTable weak objects")
|
||||
#if !__APPLE__ // We assume that apple systems support zeroing weak pointers
|
||||
#ifdef OBJC_CAP_ARC
|
||||
if (!objc_test_capability(OBJC_CAP_ARC))
|
||||
#endif
|
||||
{
|
||||
SKIP("ARC support unavailable")
|
||||
}
|
||||
#endif
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSHashTable *hashTable = [NSHashTable weakObjectsHashTable];
|
||||
|
||||
|
|
|
@ -25,10 +25,12 @@ int main()
|
|||
|
||||
[obj setObject: val1 forKey: @"Key1"];
|
||||
PASS([obj count] == 1, "-setObject:forKey increments count");
|
||||
[obj setObject: nil forKey: @"Key2"];
|
||||
PASS([obj count] == 2, "-setObject:forKey: works with nil value");
|
||||
PASS_EXCEPTION([obj setObject: val1 forKey: nil];,
|
||||
NSInvalidArgumentException, "-setObject:forKey: raises with nil key");
|
||||
PASS_RUNS([obj setObject: nil forKey: @"Key2"],
|
||||
"-setObject:forKey: accepts nil value");
|
||||
PASS([obj count] == 1, "-setObject:forKey: is no-op with nil value");
|
||||
PASS_RUNS([obj setObject: val1 forKey: nil],
|
||||
"-setObject:forKey: accepts nil key");
|
||||
PASS([obj count] == 1, "-setObject:forKey: is no-op with nil key");
|
||||
|
||||
[arp release]; arp = nil;
|
||||
return 0;
|
||||
|
|
|
@ -8,12 +8,14 @@
|
|||
int main()
|
||||
{
|
||||
START_SET("NSMapTable weak objects")
|
||||
#if !__APPLE__ // We assume that apple systems support zeroing weak pointers
|
||||
#ifdef OBJC_CAP_ARC
|
||||
if (!objc_test_capability(OBJC_CAP_ARC))
|
||||
#endif
|
||||
{
|
||||
SKIP("ARC support unavailable")
|
||||
}
|
||||
#endif
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSMapTable *mapTable = [NSMapTable strongToWeakObjectsMapTable];
|
||||
|
||||
|
|
Loading…
Reference in a new issue