Hi,
On 06/13/14 01:27, Grazvydas Ignotas wrote:
+static void test_write_flush(void) +{
- char iobuf[1024];
- char *tempf;
- FILE *file;
- tempf = _tempnam(".","wne");
- file = fopen(tempf, "wb+");
- ok(file != NULL, "unable to create test file\n");
- /* the default should be 4K */
- test_write_flush_size(file, 4096);
It would be nice to read the size from the file->_bufsiz instead of hard-coding 4096. This value is not initialized while the file is opened so you will need to call something before reading it's value.
- setvbuf(file, iobuf, _IOFBF, sizeof(iobuf));
- test_write_flush_size(file, sizeof(iobuf));
- fclose(file);
Current implemententation of setvbuf is broken in wine. This code will cause free(iobuf) to be called. I think that setvbuf needs to be fixed before this test can be added.
- unlink(tempf);
- free(tempf);
_tempnam returns internal buffer, free should not be called on it.
Thanks, Piotr