Better error reporting on printf's.
[fw/pdclib] / testing / _PDCLIB_test.h
index 7a7ff0504961624accc330f593a196051d5d4253..4eaa9d284333531d824f39c824d462cc03840efe 100644 (file)
@@ -26,6 +26,9 @@ static int TEST_RESULTS = 0;
 #define TESTCASE( x ) if ( x ) {} \
                       else { TEST_RESULTS += 1; printf( "FAILED: " __FILE__ ", line %d - %s\n", __LINE__, #x ); }
 
+#define TESTCASE_SPRINTF( x ) if ( strcmp( target, x ) == 0 ) {} \
+                              else { TEST_RESULTS += 1; printf( "FAILED: " __FILE__ " (" _PDCLIB_FILEID "), line %d - \"%s\" != \"%s\"\n", __LINE__, target, x ); }
+
 #ifndef REGTEST
 #define TESTCASE_NOREG( x ) TESTCASE( x )
 #else