1 /* Reads data spanning two pages in virtual address space,
6 #include "tests/userprog/boundary.h"
7 #include "tests/userprog/sample.inc"
9 #include "tests/main.h"
18 CHECK ((handle = open ("sample.txt")) > 1, "open \"sample.txt\"");
20 buffer = get_boundary_area () - sizeof sample / 2;
21 byte_cnt = read (handle, buffer, sizeof sample - 1);
22 if (byte_cnt != sizeof sample - 1)
23 fail ("read() returned %d instead of %zu", byte_cnt, sizeof sample - 1);
24 else if (strcmp (sample, buffer))
26 msg ("expected text:\n%s", sample);
27 msg ("text actually read:\n%s", buffer);
28 fail ("expected text differs from actual");