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:
Axel Dörfler 2005-11-13 16:30:47 +00:00
parent 8b794301de
commit 2cdc02b945
2 changed files with 31 additions and 2 deletions

View File

@ -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

View 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;
}