X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=testing%2F_PDCLIB_iotest.h;h=f0b425ddf31683f4b1083e3638add93c6dd1564a;hb=e1c526e9bad3f6e69391e94059096145390508d3;hp=134a4446809447c1acd1890834d1023cdb97c93e;hpb=a8f00dc2dd2bf633c0153be954906b9040afe481;p=pdclib diff --git a/testing/_PDCLIB_iotest.h b/testing/_PDCLIB_iotest.h index 134a444..f0b425d 100644 --- a/testing/_PDCLIB_iotest.h +++ b/testing/_PDCLIB_iotest.h @@ -1,5 +1,3 @@ -/* $Id$ */ - /* PDCLib testing suite <_PDCLIB_test.h> This file is part of the Public Domain C Library (PDCLib). @@ -32,6 +30,7 @@ #define PREP_RESULT_BUFFER #endif +#define GETFMT( fmt, ... ) (fmt) #define PRINTF_TEST( expected_rc, expected_string, ... ) do { \ PREP_RESULT_BUFFER \ int actual_rc = testprintf( target, __VA_ARGS__ ); \ @@ -40,7 +39,13 @@ ( RESULT_MISMATCH( target, expected_string ) ) ) \ { \ ++TEST_RESULTS; \ - fprintf( stderr, "FAILED: " __FILE__ " (" _PDCLIB_FILEID "), line %d\n expected %2d, \"%s\"\n actual %2d, \"%s\"\n", __LINE__, expected_rc, expected_string, actual_rc, RESULT_STRING( target ) ); \ + fprintf( stderr, \ + "FAILED: " __FILE__ " (" _PDCLIB_FILEID "), line %d\n" \ + " format string \"%s\"\n" \ + " expected %2d, \"%s\"\n" \ + " actual %2d, \"%s\"\n", \ + __LINE__, GETFMT(__VA_ARGS__, 0), expected_rc, \ + expected_string, actual_rc, RESULT_STRING( target ) ); \ } \ } while ( 0 )