3 #include "tests/vm/sample.inc"
5 #include "tests/main.h"
7 #define ACTUAL ((void *) 0x10000000)
16 /* Write file via mmap. */
17 CHECK (create ("sample.txt", strlen (sample)), "create \"sample.txt\"");
18 CHECK ((handle = open ("sample.txt")) > 1, "open \"sample.txt\"");
19 CHECK ((map = mmap (handle, ACTUAL)) != MAP_FAILED, "mmap \"sample.txt\"");
20 memcpy (ACTUAL, sample, strlen (sample));
23 /* Read back via read(). */
24 read (handle, buf, strlen (sample));
25 CHECK (!memcmp (buf, sample, strlen (sample)),
26 "compare read data against written data");