Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2-stdio checker fixes #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assignments/2-stdio/checker-lin/_test/src/test_fflush.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion assignments/2-stdio/checker-win/_test/src/test_fflush.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down