* A small test application that shows that our abort() implementation does not
work correctly. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33582 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2,6 +2,10 @@ SubDir HAIKU_TOP src tests system libroot posix ;
|
|||||||
|
|
||||||
UsePrivateHeaders libroot syslog_daemon ;
|
UsePrivateHeaders libroot syslog_daemon ;
|
||||||
|
|
||||||
|
SimpleTest abort_test
|
||||||
|
: abort_test.cpp
|
||||||
|
;
|
||||||
|
|
||||||
SimpleTest SyslogTest
|
SimpleTest SyslogTest
|
||||||
: SyslogTest.cpp syslog.cpp
|
: SyslogTest.cpp syslog.cpp
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2009, Axel Dörfler, [email protected].
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <OS.h>
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user