X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=grading%2Fuserprog%2Fread-normal.c;h=9a63083b890f16cb8c40fecf45b085e42b650da3;hb=2b9737aa0756ce44b2f97ca3aa348a496c8769a9;hp=4bb7679ad39486a305079551a9a957515fde7868;hpb=ae20a83cc5ed14f276f2292d99079370562addc9;p=pintos-anon diff --git a/grading/userprog/read-normal.c b/grading/userprog/read-normal.c index 4bb7679..9a63083 100644 --- a/grading/userprog/read-normal.c +++ b/grading/userprog/read-normal.c @@ -1,15 +1,9 @@ #include #include #include +#include "sample.inc" -char expected[] = { - "Amazing Electronic Fact: If you scuffed your feet long enough without\n" - "touching anything, you would build up so many electrons that your\n" - "finger would explode! But this is nothing to worry about unless you\n" - "have carpeting.\n" -}; - -char actual[sizeof expected]; +char actual[sizeof sample]; int main (void) @@ -23,9 +17,9 @@ main (void) byte_cnt = read (handle, actual, sizeof actual - 1); if (byte_cnt != sizeof actual - 1) - printf ("(read-normal) fail: read() returned %d instead of %d\n", + printf ("(read-normal) fail: read() returned %d instead of %zu\n", byte_cnt, sizeof actual - 1); - else if (strcmp (expected, actual)) + else if (strcmp (sample, actual)) printf ("(read-normal) fail: expected text differs from actual:\n%s", actual);