X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Ffseek.c;h=c8427f8c9a32b418c0d1364bb7592ac437c58bfb;hb=d865c4403fc91d1f1ac95ba76febcee9f429bb97;hp=d74d55292279cd03f4bdc9a7129d0751b66d9f4a;hpb=dc0120b7aacb31723bdfe3a385b2247ce7fee145;p=pdclib diff --git a/functions/stdio/fseek.c b/functions/stdio/fseek.c index d74d552..c8427f8 100644 --- a/functions/stdio/fseek.c +++ b/functions/stdio/fseek.c @@ -1,6 +1,4 @@ -/* $Id$ */ - -/* fseek( FILE *, long offset, int ) +/* fseek( FILE *, long, int ) This file is part of the Public Domain C Library (PDCLib). Permission is granted to use, modify, and / or redistribute at will. @@ -10,7 +8,7 @@ #ifndef REGTEST -#include <_PDCLIB_glue.h> +#include "_PDCLIB_glue.h" int fseek( struct _PDCLIB_file_t * stream, long offset, int whence ) { @@ -32,13 +30,15 @@ int fseek( struct _PDCLIB_file_t * stream, long offset, int whence ) #endif #ifdef TEST -#include <_PDCLIB_test.h> + +#include "_PDCLIB_test.h" + #include int main( void ) { FILE * fh; - TESTCASE( ( fh = fopen( testfile, "wb+" ) ) != NULL ); + TESTCASE( ( fh = tmpfile() ) != NULL ); TESTCASE( fwrite( teststring, 1, strlen( teststring ), fh ) == strlen( teststring ) ); /* General functionality */ TESTCASE( fseek( fh, -1, SEEK_END ) == 0 ); @@ -79,9 +79,7 @@ int main( void ) TESTCASE( fseek( fh, -5, SEEK_SET ) == -1 ); TESTCASE( fseek( fh, 0, SEEK_END ) == 0 ); TESTCASE( fclose( fh ) == 0 ); - remove( testfile ); return TEST_RESULTS; } #endif -