X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Ftests%2Ffilesys%2Fextended%2Fchild-syn-rw.c;h=d456a3a5ec49991d44530f192fe064230a96b154;hb=520ff4dd2a106a4d4a21468a72ba820c8ea7d242;hp=434a542e25a58cf4491aafb1b2bcc1c72ec10b5d;hpb=3cdb3abe959f205785f0f4fc7101a48bdbc90485;p=pintos-anon diff --git a/src/tests/filesys/extended/child-syn-rw.c b/src/tests/filesys/extended/child-syn-rw.c index 434a542..d456a3a 100644 --- a/src/tests/filesys/extended/child-syn-rw.c +++ b/src/tests/filesys/extended/child-syn-rw.c @@ -13,8 +13,6 @@ #include "tests/filesys/extended/syn-rw.h" #include "tests/lib.h" -const char *test_name = "child-syn-rw"; - static char buf1[BUF_SIZE]; static char buf2[BUF_SIZE]; @@ -25,6 +23,7 @@ main (int argc, const char *argv[]) int fd; size_t ofs; + test_name = "child-syn-rw"; quiet = true; CHECK (argc == 2, "argc must be 2, actually %d", argc); @@ -33,17 +32,17 @@ main (int argc, const char *argv[]) random_init (0); random_bytes (buf1, sizeof buf1); - CHECK ((fd = open (filename)) > 1, "open \"%s\"", filename); + CHECK ((fd = open (file_name)) > 1, "open \"%s\"", file_name); ofs = 0; while (ofs < sizeof buf2) { int bytes_read = read (fd, buf2 + ofs, sizeof buf2 - ofs); CHECK (bytes_read >= -1 && bytes_read <= (int) (sizeof buf2 - ofs), "%zu-byte read on \"%s\" returned invalid value of %d", - sizeof buf2 - ofs, filename, bytes_read); + sizeof buf2 - ofs, file_name, bytes_read); if (bytes_read > 0) { - compare_bytes (buf2 + ofs, buf1 + ofs, bytes_read, ofs, filename); + compare_bytes (buf2 + ofs, buf1 + ofs, bytes_read, ofs, file_name); ofs += bytes_read; } }