MCPcopy Create free account
hub / github.com/ElementsProject/lightning / main

Function main

ccan/ccan/read_write_all/test/run-write_all.c:45–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43#define BUFSZ 1024
44
45int main(void)
46{
47 char *buffer;
48
49 buffer = malloc(BUFSZ);
50 plan_tests(8);
51
52 write_return = -ENOSPC;
53 ok1(!write_all(100, buffer, BUFSZ));
54 ok1(errno == ENOSPC);
55
56 write_return = -EINTR;
57 ok1(write_all(100, buffer, BUFSZ));
58 ok1(errno == EINTR);
59
60 write_return = 1;
61 errno = 0;
62 ok1(write_all(100, buffer, BUFSZ));
63 ok1(errno == 0);
64
65 write_return = BUFSZ;
66 ok1(write_all(100, buffer, BUFSZ));
67 ok1(errno == 0);
68 free(buffer);
69
70 return exit_status();
71}

Callers

nothing calls this directly

Calls 1

write_allFunction · 0.50

Tested by

no test coverage detected