X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Ffprintf_reftest.incl;fp=functions%2Fstdio%2Ffprintf_reftest.incl;h=afc89b97513c8086bd0b0cd632c31f5cad26d9ec;hb=dce3890032b066679d21ef55d00b505f90176a8b;hp=0000000000000000000000000000000000000000;hpb=66e458ce71cf70eba3cdbbace5694d3c1396f255;p=pdclib.old diff --git a/functions/stdio/fprintf_reftest.incl b/functions/stdio/fprintf_reftest.incl new file mode 100644 index 0000000..afc89b9 --- /dev/null +++ b/functions/stdio/fprintf_reftest.incl @@ -0,0 +1,13 @@ + { + char readbuffer[2000]; + char refbuffer[2000]; + size_t readcounter; + TESTCASE( ( buffer = fopen( "testfile", "r" ) ) != NULL ); + readcounter = fread( readbuffer, 1, 2000, buffer ); + TESTCASE( fclose( buffer ) == 0 ); + TESTCASE( ( buffer = fopen( "functions/stdio/printf_reference.txt", "r" ) ) != NULL ); + TESTCASE( fread( refbuffer, 1, 2000, buffer ) == readcounter ); + TESTCASE( fclose( buffer ) == 0 ); + TESTCASE( memcmp( readbuffer, refbuffer, readcounter ) == 0 ); + TESTCASE( remove( "testfile" ) == 0 ); + }