Added a test app for setjmp() - doesn't work yet - strangely enough, the test
environment where I wrote our setjmp() in does work perfectly. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14897 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
8b794301de
commit
2cdc02b945
@ -4,12 +4,14 @@ UsePrivateHeaders syslog_daemon ;
|
||||
|
||||
SimpleTest SyslogTest
|
||||
: SyslogTest.cpp syslog.cpp
|
||||
: libroot.so
|
||||
;
|
||||
|
||||
SimpleTest flock_test
|
||||
: flock_test.cpp
|
||||
: libroot.so
|
||||
;
|
||||
|
||||
SimpleTest setjmp_test
|
||||
: setjmp_test.c
|
||||
;
|
||||
|
||||
# Tell Jam where to find these sources
|
||||
|
27
src/tests/kernel/libroot/posix/setjmp_test.c
Normal file
27
src/tests/kernel/libroot/posix/setjmp_test.c
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2005, Axel Dörfler, axeld@pinc-software.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <setjmp.h>
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
jmp_buf state;
|
||||
int value;
|
||||
|
||||
if (value = setjmp(state)) {
|
||||
printf("failed with: %d!\n", value);
|
||||
} else {
|
||||
printf("here I am: %d\n", value);
|
||||
longjmp(state, 42);
|
||||
printf("you won't see me!\n");
|
||||
}
|
||||
|
||||
puts("done.");
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user