Uncomment fflush

This commit is contained in:
flysand7 2023-06-24 16:10:27 +11:00
parent c8bee66744
commit b5a44c37ee
2 changed files with 2 additions and 1 deletions

View File

@ -67,6 +67,7 @@
#define WINT_MIN INT_MIN #define WINT_MIN INT_MIN
#define WINT_MAX INT_MAX #define WINT_MAX INT_MAX
#define CHAR_WIDTH 8
#define WCHAR_WIDTH USHORT_WIDTH #define WCHAR_WIDTH USHORT_WIDTH
#if !defined(WCHAR_MIN) #if !defined(WCHAR_MIN)

View File

@ -578,8 +578,8 @@ int main(int argc, char **argv) {
FILE *file = fopen("test_folder/seek", "wb"); FILE *file = fopen("test_folder/seek", "wb");
TEST(file != NULL, "Created file is NULL"); TEST(file != NULL, "Created file is NULL");
TEST(fwrite(numbers, sizeof(int), 10, file) == 10, "fwrite didn't write all 10 objects"); TEST(fwrite(numbers, sizeof(int), 10, file) == 10, "fwrite didn't write all 10 objects");
TEST(fflush(file) == 0, "fflush failed");
TEST(fseek(file, 4*sizeof(int), SEEK_SET) == 0, "fseek couldn't seek to offset 4"); TEST(fseek(file, 4*sizeof(int), SEEK_SET) == 0, "fseek couldn't seek to offset 4");
// TEST(fflush(file) == 0, "fflush failed");
int num; int num;
TEST(fread(&num, sizeof(int), 1, file) == 1, "fread didn't read the int"); TEST(fread(&num, sizeof(int), 1, file) == 1, "fread didn't read the int");
TEST(num == 4, "Wrong value read at offset 4"); TEST(num == 4, "Wrong value read at offset 4");