mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Don't crash when built with gcc
This commit is contained in:
parent
d013420b24
commit
f6b8c83bd0
1 changed files with 17 additions and 1 deletions
|
@ -2,6 +2,12 @@
|
|||
|
||||
#import "Testing.h"
|
||||
|
||||
#ifndef __has_feature
|
||||
#define __has_feature(x) 0
|
||||
#endif
|
||||
|
||||
#if __has_feature(blocks)
|
||||
|
||||
BOOL
|
||||
enumerateEmptySet()
|
||||
{
|
||||
|
@ -294,11 +300,16 @@ testInvalidRangeEnumeration()
|
|||
return neverCalled;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
|
||||
START_SET("NSIndexSet BLOCKS")
|
||||
#if __has_feature(blocks)
|
||||
PASS(enumerateEmptySet(),
|
||||
"Enumeration on an empty index set should not call the block.");
|
||||
PASS(enumerateSingleRange(),
|
||||
|
@ -315,7 +326,12 @@ main(int argc, char *argv[])
|
|||
"Enumerate ranges in reverse order correctly.");
|
||||
PASS(testOutOfRangeEnumeration(), "Enumerate ranges with NSNotFound range");
|
||||
PASS(testInvalidRangeEnumeration(), "Enumerate ranges with invalid range");
|
||||
#else
|
||||
SKIP("Blocks support unavailable")
|
||||
#endif
|
||||
|
||||
END_SET("NSIndexSet BLOCKS")
|
||||
|
||||
[arp release];
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue