changeset 37192:c470b35aad12

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 2f1343191e67
children 034ed2a85037
files ChangeLog tests/macros.h
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Oct 02 21:59:38 2013 -0700
+++ b/ChangeLog	Sun Oct 06 14:10:29 2013 -0700
@@ -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	Wed Oct 02 21:59:38 2013 -0700
+++ b/tests/macros.h	Sun Oct 06 14:10:29 2013 -0700
@@ -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 ();                                                          \
         }                                                                    \