Mercurial > hg > octave-nkf > gnulib-hg
changeset 17512:7e6249070ccc
tests: improve diagnostic when an assertion fails
* tests/macros.h (ASSERT): Report the assertion that failed.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Sun, 06 Oct 2013 14:10:29 -0700 |
parents | bb2ac7cd22c1 |
children | 94372321dd20 |
files | ChangeLog tests/macros.h |
diffstat | 2 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-10-06 Paul Eggert <eggert@cs.ucla.edu> + + tests: improve diagnostic when an assertion fails + * tests/macros.h (ASSERT): Report the assertion that failed. + 2013-10-02 Paul Eggert <eggert@cs.ucla.edu> verify: new macro 'assume'
--- 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 (); \ } \