Lines Matching refs:file
64 print_test_name ("Testing file open") ;
69 /* Ensure that the file doesn't already exist. */
75 psf->file.mode = SFM_READ ;
76 snprintf (psf->file.path, sizeof (psf->file.path), "%s", filename) ;
78 /* Test that open for read fails if the file doesn't exist. */
88 /* Test file open in write mode. */
89 psf->file.mode = SFM_WRITE ;
94 unlink (psf->file.path) ;
96 /* Test file open in read/write mode for a non-existant file. */
97 psf->file.mode = SFM_RDWR ;
102 /* Test file open in read/write mode for an existing file. */
103 psf->file.mode = SFM_RDWR ;
108 unlink (psf->file.path) ;
121 ** Open a new file and write two blocks of data to the file. After each
125 print_test_name ("Testing file write") ;
129 snprintf (psf->file.path, sizeof (psf->file.path), "%s", filename) ;
131 /* Test file open in write mode. */
132 psf->file.mode = SFM_WRITE ;
139 { printf ("\n\nLine %d: file length after write is not correct (%" PRId64 " should be %zd).\n\n", __LINE__, retval, sizeof (data_out)) ;
149 { printf ("\n\nLine %d: file length after write is not correct. (%" PRId64 " should be %zd)\n\n", __LINE__, retval, 2 * sizeof (data_out)) ;
157 ** Now open the file in read mode, check the file length and check
161 print_test_name ("Testing file read") ;
163 /* Test file open in write mode. */
164 psf->file.mode = SFM_READ ;
180 ** Open the file in read/write mode, seek around a bit and then seek to
181 ** the end of the file and write another block of data (3rd block). Then
185 print_test_name ("Testing file seek") ;
187 /* Test file open in read/write mode. */
188 psf->file.mode = SFM_RDWR ;
219 ** sets an artificial file start positions so that a seek to the start of
220 ** the file will actually be a seek to the value given by psf->fileoffset.
223 print_test_name ("Testing file offset") ;
225 /* Test file open in read/write mode. */
226 psf->file.mode = SFM_RDWR ;
231 { printf ("\n\nLine %d: file length after write is not correct. (%" PRId64 " should be %zd)\n\n", __LINE__, retval, 3 * sizeof (data_out)) ;
242 psf->file.mode = SFM_RDWR ;
247 { printf ("\n\nLine %d: file length after write is not correct. (%" PRId64 " should be %zd)\n\n", __LINE__, retval, 3 * sizeof (data_out)) ;
275 ** Open a new file and write two blocks of data to the file. After each
279 print_test_name ("Testing file truncate") ;
285 snprintf (psf->file.path, sizeof (psf->file.path), "%s", filename) ;
288 ** Open the file write mode, write 0xEE data and then extend the file
291 psf->file.mode = SFM_WRITE ;
297 /* Open the file in read mode and check the data. */
298 psf->file.mode = SFM_READ ;
315 /* Open the file in read/write and shorten the file using truncate. */
316 psf->file.mode = SFM_RDWR ;
321 /* Check the file length. */
322 psf->file.mode = SFM_READ ;
338 /* Open the file created by the previous test for reading. */
341 psf->file.mode = SFM_READ ;
342 snprintf (psf->file.path, sizeof (psf->file.path), "%s", filename) ;
374 /* Test that open for read fails if the file doesn't exist. */
388 { printf ("\n\nLine %d: psf->file.filedes should not be valid.\n\n", linenum) ;
405 { printf ("\n\nLine %d: file length after write is not correct. (%" PRId64 " should be %" PRId64 ")\n\n", linenum, retval, new_position) ;
423 { printf ("\n\nLine %d: file length after write is not correct. (%" PRId64 " should be %" PRId64 ")\n\n", linenum, retval, new_position) ;