7#include "tests/vm/sample.inc"
11#define ACTUAL ((void *) 0x10000000)
22 CHECK ((handle =
open (
"sample.txt")) > 1,
"open \"sample.txt\"");
30 "compare read data against written data");
static char buf[BUF_SIZE]
mapid_t mmap(int fd, void *addr)
Project 3 and optionally project 4.
bool create(const char *file, unsigned initial_size)
int open(const char *file)
int read(int fd, void *buffer, unsigned size)
void munmap(mapid_t mapid)
int mapid_t
Map region identifier.
#define CHECK(SUCCESS,...)
Takes an expression to test for SUCCESS and a message, which may include printf-style arguments.
#define ACTUAL
Writes to a file through a mapping, and unmaps the file, then reads the data in the file back using t...
void test_main(void)
tests/main.h
int memcmp(const void *a_, const void *b_, size_t size)
Find the first differing byte in the two blocks of SIZE bytes at A and B.
size_t strlen(const char *string)
Returns the length of STRING.
void * memcpy(void *dst_, const void *src_, size_t size)
Copies SIZE bytes from SRC to DST, which must not overlap.