X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fassert.c;h=349570c70b5a00ee1b075c14e83ff047f26aed0c;hp=cf3afb99e74d173fbb8cfe96873642139c381869;hb=6005763f4345360aff7628f2fef1c93c85c3edbd;hpb=c297360e2e867ca1cfdd14cd11f9392ead15e581 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; }