tests: improve diagnostic when an assertion fails
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 6 Oct 2013 21:10:29 +0000 (14:10 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 6 Oct 2013 21:11:01 +0000 (14:11 -0700)
* tests/macros.h (ASSERT): Report the assertion that failed.

ChangeLog
tests/macros.h

index 9eb2479ca6e7654d8932e28039a64a55ca434198..99357ad50732f5be2658296e018140e6b0fe3a31 100644 (file)
--- 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'
index 60ba894d89f360c133970ddd671a3af490d62731..1ceb815116980fc1a1c25176c228cfd42563e069 100644 (file)
@@ -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 ();                                                          \
         }                                                                    \