CS318 - Pintos
Pintos source browser for JHU CS318 course
|
Go to the documentation of this file.
6 #include "tests/vm/sample.inc"
13 char *actual = (
char *) 0x10000000;
19 CHECK ((handle =
open (
"sample.txt")) > 1,
"open \"sample.txt\"");
24 CHECK (
remove (
"sample.txt"),
"remove \"sample.txt\"");
25 CHECK (
open (
"sample.txt") == -1,
"try to open \"sample.txt\"");
30 CHECK (
create (
"another", 4096 * 10),
"create \"another\"");
34 fail (
"read of mmap'd file reported bad data");
39 fail (
"byte %zu of mmap'd region has value %02hhx (should be 0)",
#define CHECK(SUCCESS,...)
Takes an expression to test for SUCCESS and a message, which may include printf-style arguments.
void test_main(void)
Deletes and closes file that is mapped into memory and verifies that it can still be read through the...
bool remove(const char *file)
int open(const char *file)
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.
void fail(const char *format,...)
size_t strlen(const char *string)
Returns the length of STRING.
mapid_t mmap(int fd, void *addr)
Project 3 and optionally project 4.
void munmap(mapid_t mapid)
int mapid_t
Map region identifier.
bool create(const char *file, unsigned initial_size)