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