3 #include "tests/vm/sample.inc"
5 #include "tests/main.h"
10 char *actual = (char *) 0x10000000;
15 CHECK ((handle = open ("sample.txt")) > 1, "open \"sample.txt\"");
16 CHECK ((map = mmap (handle, actual)) != MAP_FAILED, "mmap \"sample.txt\"");
18 /* Check that data is correct. */
19 if (memcmp (actual, sample, strlen (sample)))
20 fail ("read of mmap'd file reported bad data");
22 /* Verify that data is followed by zeros. */
23 for (i = strlen (sample); i < 4096; i++)
25 fail ("byte %zu of mmap'd region has value %02hhx (should be 0)",