]> pd.if.org Git - pdclib/blobdiff - functions/stdio/vsnprintf.c
Improved reporting by printf tests.
[pdclib] / functions / stdio / vsnprintf.c
index 0cccf7a0842d5814953d10c5b53d825104029a2b..9768c0a02504d45b9cf74a45b3ce51a8771c8d98 100644 (file)
@@ -54,7 +54,6 @@ int vsnprintf( char * _PDCLIB_restrict s, size_t n, const char * _PDCLIB_restric
 #include <stdint.h>
 #include <string.h>
 
-
 static int testprintf( char * s, size_t n, const char * format, ... )
 {
     int i;
@@ -65,6 +64,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];