3 #include "tests/userprog/boundary.h"
4 #include "tests/userprog/sample.inc"
6 #include "tests/main.h"
15 CHECK ((handle = open ("sample.txt")) > 1, "open \"sample.txt\"");
17 buffer = get_boundary_area () - sizeof sample / 2;
18 byte_cnt = read (handle, buffer, sizeof sample - 1);
19 if (byte_cnt != sizeof sample - 1)
20 fail ("read() returned %d instead of %zu", byte_cnt, sizeof sample - 1);
21 else if (strcmp (sample, buffer))
23 msg ("expected text:\n%s", sample);
24 msg ("text actually read:\n%s", buffer);
25 fail ("expected text differs from actual");