X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Fvprintf.c;h=6eba229114e8fb9eb530c60a15df22b92f477da5;hb=3fc6b339325dcf3f49c90a0fa76a45e438aff79c;hp=a02c625670582f208e5d6b1a2092818bf4da06e5;hpb=92177644f19b596c593293cb20c4f6677186f3b6;p=pdclib diff --git a/functions/stdio/vprintf.c b/functions/stdio/vprintf.c index a02c625..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,12 @@ int vprintf( const char * _PDCLIB_restrict format, _PDCLIB_va_list arg ) #endif #ifdef TEST -#include -#include +#define _PDCLIB_FILEID "stdio/vprintf.c" +#define _PDCLIB_FILEIO + #include <_PDCLIB_test.h> -static int testprintf( FILE * stream, size_t n, const char * format, ... ) +static int testprintf( FILE * stream, const char * format, ... ) { int i; va_list arg; @@ -33,15 +40,12 @@ static int testprintf( FILE * stream, size_t n, const char * format, ... ) return i; } -#define TESTCASE_SPRINTF( x ) - int main( void ) { - FILE * buffer; - TESTCASE( ( buffer = freopen( testfile, "wb", stdout ) ) != NULL ); -#include "printf_testcases.incl" - TESTCASE( fclose( buffer ) == 0 ); -#include "fprintf_reftest.incl" + FILE * target; + TESTCASE( ( target = freopen( testfile, "wb+", stdout ) ) != NULL ); +#include "printf_testcases.h" + TESTCASE( fclose( target ) == 0 ); TESTCASE( remove( testfile ) == 0 ); return TEST_RESULTS; }