From 6005763f4345360aff7628f2fef1c93c85c3edbd Mon Sep 17 00:00:00 2001 From: solar Date: Fri, 23 Dec 2005 10:42:25 +0000 Subject: [PATCH] Improved "expected assertion failure" message in testdriver. --- functions/assert.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/functions/assert.c b/functions/assert.c index cf3afb9..349570c 100644 --- a/functions/assert.c +++ b/functions/assert.c @@ -35,6 +35,7 @@ void _PDCLIB_assert( char const * const message ) static int rc = 0; static int EXPECTED_ABORT = 0; +static int UNEXPECTED_ABORT = 1; void aborthandler( int signal ) { @@ -58,12 +59,10 @@ int disabled_test() int main() { - int i = 0; BEGIN_TESTS; TESTCASE( signal( SIGABRT, &aborthandler ) != SIG_ERR ); - assert( i == 0 ); /* NDEBUG not set, condition met */ - puts( "Expecting failed assert() message here:" ); - assert( i == 1 ); /* NDEBUG not set, condition fails - should abort */ + assert( UNEXPECTED_ABORT ); /* NDEBUG not set, condition met */ + assert( EXPECTED_ABORT ); /* NDEBUG not set, condition fails - should abort */ return TEST_RESULTS; } -- 2.40.0