From: Paul Eggert Date: Sun, 6 Oct 2013 21:10:29 +0000 (-0700) Subject: tests: improve diagnostic when an assertion fails X-Git-Tag: v0.1~28 X-Git-Url: http://erislabs.net/gitweb/?p=gnulib.git;a=commitdiff_plain;h=8041b27617211a5762e58670b0acf474ffcfa610 tests: improve diagnostic when an assertion fails * tests/macros.h (ASSERT): Report the assertion that failed. --- diff --git a/ChangeLog b/ChangeLog index 9eb2479ca..99357ad50 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-10-06 Paul Eggert + + tests: improve diagnostic when an assertion fails + * tests/macros.h (ASSERT): Report the assertion that failed. + 2013-10-02 Paul Eggert verify: new macro 'assume' diff --git a/tests/macros.h b/tests/macros.h index 60ba894d8..1ceb81511 100644 --- a/tests/macros.h +++ b/tests/macros.h @@ -48,8 +48,8 @@ { \ if (!(expr)) \ { \ - fprintf (ASSERT_STREAM, "%s:%d: assertion failed\n", \ - __FILE__, __LINE__); \ + fprintf (ASSERT_STREAM, "%s:%d: assertion '%s' failed\n", \ + __FILE__, __LINE__, #expr); \ fflush (ASSERT_STREAM); \ abort (); \ } \