X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=testing%2Ffprintf_reftest.incl;h=3c6ae4bcc8151347a1db616a046fa281766bcfa9;hb=4ac9b504e2359481a08f0b343ac4b3ee728e77c8;hp=05c74c2025bea45929e9b022d7a4abe403ffaca7;hpb=4340db942a3f1dc39724c1f05264d38586bc062a;p=pdclib diff --git a/testing/fprintf_reftest.incl b/testing/fprintf_reftest.incl index 05c74c2..3c6ae4b 100644 --- a/testing/fprintf_reftest.incl +++ b/testing/fprintf_reftest.incl @@ -2,12 +2,11 @@ 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( "testing/printf_reference.txt", "r" ) ) != NULL ); - TESTCASE( fread( refbuffer, 1, 2000, buffer ) == readcounter ); - TESTCASE( fclose( buffer ) == 0 ); + TESTCASE( ( target = fopen( testfile, "r" ) ) != NULL ); + readcounter = fread( readbuffer, 1, 2000, target ); + TESTCASE( fclose( target ) == 0 ); + TESTCASE( ( target = fopen( "testing/printf_reference.txt", "r" ) ) != NULL ); + TESTCASE( fread( refbuffer, 1, 2000, target ) == readcounter ); + TESTCASE( fclose( target ) == 0 ); TESTCASE( memcmp( readbuffer, refbuffer, readcounter ) == 0 ); - TESTCASE( remove( "testfile" ) == 0 ); }