diff --git a/assignments/2-stdio/checker-lin/_test/src/test_fflush.c b/assignments/2-stdio/checker-lin/_test/src/test_fflush.c index bca61303..6111e37f 100644 --- a/assignments/2-stdio/checker-lin/_test/src/test_fflush.c +++ b/assignments/2-stdio/checker-lin/_test/src/test_fflush.c @@ -68,7 +68,7 @@ int main(int argc, char *argv[]) FAIL_IF(ret != 0, "Incorrect return value for so_fflush, got %d, expected %d\n", ret, 0); // one write syscall - FAIL_IF(num_sys_write != 1, "Incorrect number of write syscalls: got %d, expected %d\n", num_sys_write, 0); + FAIL_IF(num_sys_write != 1, "Incorrect number of write syscalls: got %d, expected %d\n", num_sys_write, 1); // data should be in the file FAIL_IF(!compare_file(fpath, buf, 2048), "Incorrect data in file\n"); diff --git a/assignments/2-stdio/checker-lin/_test/src/test_fread_huge_chunked.c b/assignments/2-stdio/checker-lin/_test/src/test_fread_huge_chunked.c index 8ce40388..7b097757 100644 --- a/assignments/2-stdio/checker-lin/_test/src/test_fread_huge_chunked.c +++ b/assignments/2-stdio/checker-lin/_test/src/test_fread_huge_chunked.c @@ -52,15 +52,14 @@ int main(int argc, char *argv[]) install_hooks("libso_stdio.so", hooks, 1); - if (argc == 2) - test_work_dir = argv[1]; - else - test_work_dir = "_test"; - - if (argc == 3) - size_member = atoi(argv[2]); - else - size_member = 1; + test_work_dir = "_test"; + size_member = 1; + + if (argc >= 2) + test_work_dir = argv[1]; + + if (argc == 3) + size_member = atoi(argv[2]); sprintf(fpath, "%s/huge_file", test_work_dir); diff --git a/assignments/2-stdio/checker-lin/_test/src/test_fwrite_huge_chunked.c b/assignments/2-stdio/checker-lin/_test/src/test_fwrite_huge_chunked.c index 8c02b94f..9c86599b 100644 --- a/assignments/2-stdio/checker-lin/_test/src/test_fwrite_huge_chunked.c +++ b/assignments/2-stdio/checker-lin/_test/src/test_fwrite_huge_chunked.c @@ -48,15 +48,14 @@ int main(int argc, char *argv[]) install_hooks("libso_stdio.so", hooks, 1); - if (argc == 2) - test_work_dir = argv[1]; - else - test_work_dir = "_test"; - - if (argc == 3) - size_member = atoi(argv[2]); - else - size_member = 1; + test_work_dir = "_test"; + size_member = 1; + + if (argc >= 2) + test_work_dir = argv[1]; + + if (argc == 3) + size_member = atoi(argv[2]); sprintf(fpath, "%s/huge_file", test_work_dir); diff --git a/assignments/2-stdio/checker-win/_test/src/test_fflush.c b/assignments/2-stdio/checker-win/_test/src/test_fflush.c index 5424e745..4a392f6f 100644 --- a/assignments/2-stdio/checker-win/_test/src/test_fflush.c +++ b/assignments/2-stdio/checker-win/_test/src/test_fflush.c @@ -69,7 +69,7 @@ int main(int argc, char *argv[]) FAIL_IF(ret != 0, "Incorrect return value for so_fflush, got %d, expected %d\n", ret, 0); // one write syscall - FAIL_IF(num_WriteFile != 1, "Incorrect number of write syscalls: got %d, expected %d\n", num_WriteFile, 0); + FAIL_IF(num_WriteFile != 1, "Incorrect number of write syscalls: got %d, expected %d\n", num_WriteFile, 1); // data should be in the file FAIL_IF(!compare_file(fpath, buf, 2048), "Incorrect data in file\n"); diff --git a/assignments/2-stdio/checker-win/_test/src/test_fread_huge_chunked.c b/assignments/2-stdio/checker-win/_test/src/test_fread_huge_chunked.c index c57c6e95..119c4fa4 100644 --- a/assignments/2-stdio/checker-win/_test/src/test_fread_huge_chunked.c +++ b/assignments/2-stdio/checker-win/_test/src/test_fread_huge_chunked.c @@ -53,15 +53,14 @@ int main(int argc, char *argv[]) install_hooks("so_stdio.dll", hooks, 1); - if (argc == 2) - test_work_dir = argv[1]; - else - test_work_dir = "_test"; - - if (argc == 3) - size_member = atoi(argv[2]); - else - size_member = 1; + test_work_dir = "_test"; + size_member = 1; + + if (argc >= 2) + test_work_dir = argv[1]; + + if (argc == 3) + size_member = atoi(argv[2]); sprintf(fpath, "%s/huge_file", test_work_dir); diff --git a/assignments/2-stdio/checker-win/_test/src/test_fwrite_huge_chunked.c b/assignments/2-stdio/checker-win/_test/src/test_fwrite_huge_chunked.c index af9c45aa..d719558a 100644 --- a/assignments/2-stdio/checker-win/_test/src/test_fwrite_huge_chunked.c +++ b/assignments/2-stdio/checker-win/_test/src/test_fwrite_huge_chunked.c @@ -49,15 +49,14 @@ int main(int argc, char *argv[]) install_hooks("so_stdio.dll", hooks, 1); - if (argc == 2) - test_work_dir = argv[1]; - else - test_work_dir = "_test"; - - if (argc == 3) - size_member = atoi(argv[2]); - else - size_member = 1; + test_work_dir = "_test"; + size_member = 1; + + if (argc >= 2) + test_work_dir = argv[1]; + + if (argc == 3) + size_member = atoi(argv[2]); sprintf(fpath, "%s/huge_file", test_work_dir);