12 CHECK ((handle =
open (
"sample.txt")) > 1,
"open \"sample.txt\"");
14 write (handle, (
char *) 0x10123420, 123);
15 fail (
"should have exited with -1");
int open(const char *file)
int write(int fd, const void *buffer, unsigned size)
void fail(const char *format,...)
#define CHECK(SUCCESS,...)
Takes an expression to test for SUCCESS and a message, which may include printf-style arguments.
void test_main(void)
Passes an invalid pointer to the write system call.