14 CHECK ((handle =
open (
"sample.txt")) > 1,
"open \"sample.txt\"");
static size_t byte_cnt(size_t bit_cnt)
Returns the number of bytes required for BIT_CNT bits.
static char buf[BUF_SIZE]
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)
Try a 0-byte write, which should return 0 without writing anything.