Reworked scanf() testing. General cleanups.
[fw/pdclib] / functions / stdio / snprintf.c
index 851aefb5b699ccc859909ab6937e4b40755b6ff6..6dd39671fdf33647fb4b5d97f9022c3dad547372 100644 (file)
@@ -24,20 +24,17 @@ int snprintf( char * _PDCLIB_restrict s, size_t n, const char * _PDCLIB_restrict
 #endif
 
 #ifdef TEST
-#include <_PDCLIB_test.h>
+#define _PDCLIB_FILEID "stdio/snprintf.c"
+#define _PDCLIB_STRINGIO
 
-#include <string.h>
-#include <limits.h>
+#include <_PDCLIB_test.h>
 
 #define testprintf( s, format, ... ) snprintf( s, 100, format, __VA_ARGS__ )
 
-#define TESTCASE_SPRINTF( x ) if ( strcmp( target, x ) == 0 ) {} \
-                              else { TEST_RESULTS += 1; printf( "FAILED: " __FILE__ ", line %d - \"%s\" != %s\n", __LINE__, target, #x ); }
-
 int main( void )
 {
     char target[100];
-#include "printf_testcases.incl"
+#include "printf_testcases.h"
     return TEST_RESULTS;
 }