* 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:
Axel Dörfler 2009-10-14 11:05:30 +00:00
parent d5a396a60b
commit af7fec0304
2 changed files with 40 additions and 0 deletions

View File

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

View File

@ -0,0 +1,36 @@
/*
* Copyright 2009, Axel Dörfler, axeld@pinc-software.de.
* 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;
}