diff --git a/src/tests/system/libroot/posix/Jamfile b/src/tests/system/libroot/posix/Jamfile index 07b899e9d9..a1d15d5534 100644 --- a/src/tests/system/libroot/posix/Jamfile +++ b/src/tests/system/libroot/posix/Jamfile @@ -2,6 +2,10 @@ SubDir HAIKU_TOP src tests system libroot posix ; UsePrivateHeaders libroot syslog_daemon ; +SimpleTest abort_test + : abort_test.cpp +; + SimpleTest SyslogTest : SyslogTest.cpp syslog.cpp ; diff --git a/src/tests/system/libroot/posix/abort_test.cpp b/src/tests/system/libroot/posix/abort_test.cpp new file mode 100644 index 0000000000..ad56a60a51 --- /dev/null +++ b/src/tests/system/libroot/posix/abort_test.cpp @@ -0,0 +1,36 @@ +/* + * Copyright 2009, Axel Dörfler, axeld@pinc-software.de. + * Distributed under the terms of the MIT License. + */ + + +#include + +#include +#include +#include + + +static status_t +abort_thread(void*) +{ + snooze(50000); + abort(); + return 0; +} + + +int +main(int argc, char** argv) +{ + thread_id thread = spawn_thread(&abort_thread, "abort test", + B_NORMAL_PRIORITY, NULL); + resume_thread(thread); + + status_t status = wait_for_thread(thread, NULL); + fprintf(stderr, "abort thread aborted: %s\n", strerror(status)); + + snooze(1000000LL); + fprintf(stderr, "main exiting\n"); + return 0; +}