X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=grading%2Ffilesys%2Fgrow-sparse.c;h=c8b6a8f36a6948f568e247d5a201c03762774c8f;hb=5780c9f434cca090f88463b7f0199d49b4ded288;hp=618082802748a0aee1ad0a49bfd7d67fb5f93ce7;hpb=6ebce2100b371612b554bf17a3ce613a4093df37;p=pintos-anon diff --git a/grading/filesys/grow-sparse.c b/grading/filesys/grow-sparse.c index 6180828..c8b6a8f 100644 --- a/grading/filesys/grow-sparse.c +++ b/grading/filesys/grow-sparse.c @@ -6,21 +6,19 @@ const char test_name[] = "grow-sparse"; static char buf[76543]; -int -main (void) +void +test_main (void) { + const char *filename = "testfile"; char zero = 0; int fd; - msg ("begin"); - check (create ("testfile", 0), "create \"testfile\""); - check ((fd = open ("testfile")) > 1, "open \"testfile\""); - msg ("seek \"testfile\""); + CHECK (create (filename, 0), "create \"%s\"", filename); + CHECK ((fd = open (filename)) > 1, "open \"%s\"", filename); + msg ("seek \"%s\"", filename); seek (fd, sizeof buf - 1); - check (write (fd, &zero, 1) > 0, "write \"testfile\""); - msg ("close \"testfile\""); + CHECK (write (fd, &zero, 1) > 0, "write \"%s\"", filename); + msg ("close \"%s\"", filename); close (fd); - check_file ("testfile", buf, sizeof buf); - msg ("end"); - return 0; + check_file (filename, buf, sizeof buf); }