X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Fvprintf.c;h=6eba229114e8fb9eb530c60a15df22b92f477da5;hb=6ca24b75c75b9c6f22e1e69693d326b8e3330841;hp=a8ca45f5676beb1a3b549a0ffbee2a623361db00;hpb=b08f4b52b1cd1f7a9553c0f357a7c90859fa3e73;p=pdclib diff --git a/functions/stdio/vprintf.c b/functions/stdio/vprintf.c index a8ca45f..6eba229 100644 --- a/functions/stdio/vprintf.c +++ b/functions/stdio/vprintf.c @@ -11,6 +11,12 @@ #ifndef REGTEST +int vprintf_unlocked( const char * _PDCLIB_restrict format, + _PDCLIB_va_list arg ) +{ + return vfprintf_unlocked( stdout, format, arg ); +} + int vprintf( const char * _PDCLIB_restrict format, _PDCLIB_va_list arg ) { return vfprintf( stdout, format, arg ); @@ -19,11 +25,28 @@ int vprintf( const char * _PDCLIB_restrict format, _PDCLIB_va_list arg ) #endif #ifdef TEST +#define _PDCLIB_FILEID "stdio/vprintf.c" +#define _PDCLIB_FILEIO + #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; +} + int main( void ) { - TESTCASE( NO_TESTDRIVER ); + FILE * target; + TESTCASE( ( target = freopen( testfile, "wb+", stdout ) ) != NULL ); +#include "printf_testcases.h" + TESTCASE( fclose( target ) == 0 ); + TESTCASE( remove( testfile ) == 0 ); return TEST_RESULTS; }