X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Ftests%2Ffilesys%2Fextended%2Fgrow-sparse.c;h=6eab210bd135045071b09e3f84c8aa78a433df14;hb=c0206643b024b6f0e6cde1cbb5e7d37abbc84c69;hp=11e3b6eabc34cbc455ff2bd2009edb9d9003883e;hpb=615bf3b3d2a8573ed6fb9ddc0055745e163ac999;p=pintos-anon diff --git a/src/tests/filesys/extended/grow-sparse.c b/src/tests/filesys/extended/grow-sparse.c index 11e3b6e..6eab210 100644 --- a/src/tests/filesys/extended/grow-sparse.c +++ b/src/tests/filesys/extended/grow-sparse.c @@ -1,3 +1,6 @@ +/* Tests that seeking past the end of a file and writing will + properly zero out the region in between. */ + #include #include "tests/lib.h" #include "tests/main.h" @@ -7,16 +10,16 @@ static char buf[76543]; void test_main (void) { - const char *filename = "testfile"; + const char *file_name = "testfile"; char zero = 0; int fd; - CHECK (create (filename, 0), "create \"%s\"", filename); - CHECK ((fd = open (filename)) > 1, "open \"%s\"", filename); - msg ("seek \"%s\"", filename); + CHECK (create (file_name, 0), "create \"%s\"", file_name); + CHECK ((fd = open (file_name)) > 1, "open \"%s\"", file_name); + msg ("seek \"%s\"", file_name); seek (fd, sizeof buf - 1); - CHECK (write (fd, &zero, 1) > 0, "write \"%s\"", filename); - msg ("close \"%s\"", filename); + CHECK (write (fd, &zero, 1) > 0, "write \"%s\"", file_name); + msg ("close \"%s\"", file_name); close (fd); - check_file (filename, buf, sizeof buf); + check_file (file_name, buf, sizeof buf); }