]> pd.if.org Git - pdclib/blobdiff - functions/stdio/vsprintf.c
Improved reporting by printf tests.
[pdclib] / functions / stdio / vsprintf.c
index 80180f57f08edf126e530c1a7227a95aaa1a485d..d3920fa5884e754ebbf49fb5721ad70e42d4fb12 100644 (file)
@@ -26,7 +26,6 @@ int vsprintf( char * _PDCLIB_restrict s, const char * _PDCLIB_restrict format, v
 #include <stdint.h>
 #include <string.h>
 
-
 static int testprintf( char * s, size_t n, const char * format, ... )
 {
     int i;
@@ -37,6 +36,9 @@ static int testprintf( char * s, size_t n, const char * format, ... )
     return i;
 }
 
+#define TESTCASE_SPRINTF( x ) if ( strcmp( buffer, x ) == 0 ) {} \
+                              else { TEST_RESULTS += 1; printf( "FAILED: " __FILE__ ", line %d - \"%s\" != %s\n", __LINE__, buffer, #x ); }
+
 int main( void )
 {
     char buffer[100];