X-Git-Url: https://git.gag.com/?p=fw%2Fpdclib;a=blobdiff_plain;f=functions%2Fstdio%2Ffprintf.c;h=a7cef0bf4446df308ee039c6af9cd76b6b4debbe;hp=5dfec4d10a069d03d12234ff2ac7567e570d873b;hb=87195dbaff9d4b3827dcf3f714662b64077ddb42;hpb=7c4838d7185104993621482a799d098cab6be0f0 diff --git a/functions/stdio/fprintf.c b/functions/stdio/fprintf.c index 5dfec4d..a7cef0b 100644 --- a/functions/stdio/fprintf.c +++ b/functions/stdio/fprintf.c @@ -1,7 +1,5 @@ /* $Id$ */ -/* Release $Name$ */ - /* fprintf( FILE *, const char *, ... ) This file is part of the Public Domain C Library (PDCLib). @@ -13,21 +11,35 @@ #ifndef REGTEST -int fprintf( FILE * _PDCLIB_restrict stream, const char * _PDCLIB_restrict format, ... ) +int fprintf( struct _PDCLIB_file_t * _PDCLIB_restrict stream, const char * _PDCLIB_restrict format, ... ) { + int rc; va_list ap; va_start( ap, format ); - return vfprintf( stream, format, ap ); + rc = vfprintf( stream, format, ap ); + va_end( ap ); + return rc; } #endif #ifdef TEST +#include +#include #include <_PDCLIB_test.h> +#define testprintf( stream, n, format, ... ) fprintf( stream, format, __VA_ARGS__ ) + +#define TESTCASE_SPRINTF( x ) + int main( void ) { - TESTCASE( NO_TESTDRIVER ); + FILE * buffer; + TESTCASE( ( buffer = fopen( "testing/testfile", "wb" ) ) != NULL ); +#include "printf_testcases.incl" + TESTCASE( fclose( buffer ) == 0 ); +#include "fprintf_reftest.incl" + TESTCASE( remove( "testing/testfile" ) == 0 ); return TEST_RESULTS; }