14 CHECK ((handle =
open (
"sample.txt")) > 1,
"open \"sample.txt\"");
21 fail (
"0-byte read() modified buffer");
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 read(int fd, 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 read, which should return 0 without reading anything.