X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Fvprintf.c;h=904f791e45e23aae0f0e38c9bb59a6e2d52da7c5;hb=e72505f84aa8d8730e46d955a2722af361112e4f;hp=a8ca45f5676beb1a3b549a0ffbee2a623361db00;hpb=b08f4b52b1cd1f7a9553c0f357a7c90859fa3e73;p=pdclib diff --git a/functions/stdio/vprintf.c b/functions/stdio/vprintf.c index a8ca45f..904f791 100644 --- a/functions/stdio/vprintf.c +++ b/functions/stdio/vprintf.c @@ -19,11 +19,30 @@ int vprintf( const char * _PDCLIB_restrict format, _PDCLIB_va_list arg ) #endif #ifdef TEST +#include +#include #include <_PDCLIB_test.h> +static int testprintf( FILE * stream, const char * format, ... ) +{ + int i; + va_list arg; + va_start( arg, format ); + i = vprintf( format, arg ); + va_end( arg ); + return i; +} + +#define TESTCASE_SPRINTF( x ) + int main( void ) { - TESTCASE( NO_TESTDRIVER ); + FILE * target; + TESTCASE( ( target = freopen( testfile, "wb", stdout ) ) != NULL ); +#include "printf_testcases.incl" + TESTCASE( fclose( target ) == 0 ); +#include "fprintf_reftest.incl" + TESTCASE( remove( testfile ) == 0 ); return TEST_RESULTS; }