mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Fixup bad function calls.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32356 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e6dc5a58b6
commit
13b140a5be
2 changed files with 18 additions and 16 deletions
|
@ -151,7 +151,9 @@ int main()
|
|||
#else
|
||||
int main(int argc,char **argv)
|
||||
{
|
||||
unsupported("GSXML support unavailable");
|
||||
START_SET("GSXML")
|
||||
SKIP("GSXML support unavailable");
|
||||
END_SET("GSXML")
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -3,25 +3,25 @@
|
|||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
START_SET("NSBlock")
|
||||
#if __has_feature(blocks)
|
||||
BOOL (^hello)(void) = ^() { return YES; };
|
||||
PASS(hello(), "Calling a block");
|
||||
BOOL (^helloCopy)(void) = Block_copy(hello);
|
||||
Block_release(hello);
|
||||
PASS(helloCopy(), "Calling a copy of a block");
|
||||
NSArray *blockArr = [NSArray arrayWithObject:helloCopy];
|
||||
PASS([blockArr count] == 1, "Block used as object in an array");
|
||||
void (^helloArr)(void) = [blockArr objectAtIndex:0];
|
||||
PASS(helloCopy(), "Block successfully retrived from array");
|
||||
Block_release(helloCopy);
|
||||
BOOL (^hello)(void) = ^() { return YES; };
|
||||
PASS(hello(), "Calling a block");
|
||||
BOOL (^helloCopy)(void) = Block_copy(hello);
|
||||
Block_release(hello);
|
||||
PASS(helloCopy(), "Calling a copy of a block");
|
||||
NSArray *blockArr = [NSArray arrayWithObject:helloCopy];
|
||||
PASS([blockArr count] == 1, "Block used as object in an array");
|
||||
void (^helloArr)(void) = [blockArr objectAtIndex:0];
|
||||
PASS(helloCopy(), "Block successfully retrived from array");
|
||||
Block_release(helloCopy);
|
||||
#elif defined(__clang__)
|
||||
unsupported("Your compiler supports blocks, but this support was disabled for some reason.");
|
||||
SKIP("Your compiler supports blocks, but this support was disabled for some reason.")
|
||||
#else
|
||||
unsupported("Your compiler does not support blocks.");
|
||||
SKIP("Your compiler does not support blocks.")
|
||||
#endif
|
||||
[pool drain];
|
||||
END_SET("NSBlock")
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue