-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* $Id$ */
-void abort( void ) { /* TODO */ };
+/* abort( void )
-/* PDPC code - unreviewed
+ This file is part of the Public Domain C Library (PDCLib).
+ Permission is granted to use, modify, and / or redistribute at will.
+*/
+
+#include <stdlib.h>
+#include <signal.h>
+
+#ifndef REGTEST
+
+void abort( void )
{
- raise(SIGABRT);
- exit(EXIT_FAILURE);
+ raise( SIGABRT );
+ exit( EXIT_FAILURE );
}
-*/
\ No newline at end of file
+
+#endif
+
+#ifdef TEST
+#include <_PDCLIB_test.h>
+
+#include <stdio.h>
+
+static void aborthandler( int sig )
+{
+ exit( 0 );
+}
+
+int main( void )
+{
+ int UNEXPECTED_RETURN_FROM_ABORT = 0;
+ TESTCASE( signal( SIGABRT, &aborthandler ) != SIG_ERR );
+ abort();
+ TESTCASE( UNEXPECTED_RETURN_FROM_ABORT );
+ return TEST_RESULTS;
+}
+
+#endif