X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=functions%2Fstdio%2Fvprintf.c;h=2be15c2ad402150b0cfae0fd54bc02b0436c3220;hb=a56dcde904475e5edf206353224527548c3379b7;hp=58e4748c6a1ede25bba056b5b5daaff6b4ef00cb;hpb=06f8c9dc697f4cc88f601f742ec581da79ead02f;p=fw%2Fpdclib diff --git a/functions/stdio/vprintf.c b/functions/stdio/vprintf.c index 58e4748..2be15c2 100644 --- a/functions/stdio/vprintf.c +++ b/functions/stdio/vprintf.c @@ -36,15 +36,11 @@ static int testprintf( FILE * stream, size_t n, const char * format, ... ) int main( void ) { FILE * buffer; - TESTCASE( ( buffer = freopen( "testfile", "w", stdout ) ) != NULL ); + TESTCASE( ( buffer = freopen( testfile, "wb", stdout ) ) != NULL ); #include "printf_testcases.incl" TESTCASE( fclose( buffer ) == 0 ); - char readbuffer[1000]; - TESTCASE( ( buffer = fopen( "testfile", "r" ) ) != NULL ); - TESTCASE( fread( readbuffer, 1, 1000, buffer ) == 985 ); - TESTCASE( fclose( buffer ) == 0 ); - TESTCASE( remove( "testfile" ) == 0 ); - TESTCASE( memcmp( readbuffer, "-1281270-32768327670-214748364821474836470-214748364821474836470-922337203685477580892233720368547758070255255655356553542949672954294967295429496729542949672951844674407370955161518446744073709551615FFFFFFFF0XFFFFFFFFffffffff0xffffffff37777777777037777777777%.0#o-2147483648+2147483647+042949672954294967295-2147483648 2147483647 042949672954294967295-21474836482147483647-21474836482147483647-2147483648 2147483647 -2147483648 2147483647-21474836482147483647-21474836482147483647-21474836482147483647 -2147483648 2147483647 -21474836482147483647-21474836482147483647-214748364802147483647-02147483648002147483647-21474836482147483647-21474836482147483647-21474836482147483647 -2147483648 2147483647 00000000002147483647ffffffff0xffffffff0xffffffff-2147483648-2147483648-21474836480xffffffff0xffffffff0xffffffff214748364721474836472147483647+2147483647+2147483647+2147483647+2147483647+2147483647+2147483647- 2147483647- 2147483647 % -2147483648xabcdef0xdeadbeef123456789", 985 ) == 0 ); +#include "fprintf_reftest.incl" + TESTCASE( remove( testfile ) == 0 ); return TEST_RESULTS; }