]> pd.if.org Git - pdclib/blobdiff - functions/stdio/printf.c
Some cleanups and corrected typos.
[pdclib] / functions / stdio / printf.c
index c3c46cf2c344868114c7bc3f624261a9d4c2c19a..aa772ec140d6d8b6647ba52c8346d7e37e45cc2c 100644 (file)
@@ -24,11 +24,21 @@ int printf( const char * _PDCLIB_restrict format, ... )
 #endif
 
 #ifdef TEST
+#define _PDCLIB_FILEID "stdio/printf.c"
+#define FPRINTF_FUNCTION
+#include <limits.h>
+#include <string.h>
 #include <_PDCLIB_test.h>
 
+#define testprintf( stream, format, ... ) printf( format, __VA_ARGS__ )
+
 int main( void )
 {
-    TESTCASE( printf( "SUCCESS testing printf().\n" ) == 26 );
+    FILE * target;
+    TESTCASE( ( target = freopen( testfile, "wb+", stdout ) ) != NULL );
+#include "printf_testcases.incl"
+    TESTCASE( fclose( target ) == 0 );
+    TESTCASE( remove( testfile ) == 0 );
     return TEST_RESULTS;
 }