3 This file is part of the Public Domain C Library (PDCLib).
4 Permission is granted to use, modify, and / or redistribute at will.
11 struct _PDCLIB_file_t * tmpfile( void )
20 #include <_PDCLIB_test.h>
25 char filename[ L_tmpnam ];
27 TESTCASE( ( fh = tmpfile() ) != NULL );
28 TESTCASE( fputc( 'x', fh ) == 'x' );
29 /* Checking that file is actually there */
30 TESTCASE_NOREG( strcpy( filename, fh->filename ) == filename );
31 TESTCASE_NOREG( ( fhtest = fopen( filename, "r" ) ) != NULL );
32 TESTCASE_NOREG( fclose( fhtest ) == 0 );
34 TESTCASE( fclose( fh ) == 0 );
35 /* Checking that file was deleted */
36 TESTCASE_NOREG( fopen( filename, "r" ) == NULL );