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

Function main

ccan/ccan/take/test/run-debug.c:9–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#include <ccan/tap/tap.h>
8
9int main(void)
10{
11 const char *p = "hi";
12
13 plan_tests(14);
14
15 /* We can take NULL. */
16 ok1(take(NULL) == NULL);
17 ok1(is_taken(NULL));
18 ok1(strstr(taken_any(), "run-debug.c:16:"));
19 ok1(taken(NULL)); /* Undoes take() */
20 ok1(!is_taken(NULL));
21 ok1(!taken(NULL));
22 ok1(!taken_any());
23
24 /* We can take a real pointer. */
25 ok1(take(p) == p);
26 ok1(is_taken(p));
27 ok1(strends(taken_any(), "run-debug.c:25:p"));
28 ok1(taken(p)); /* Undoes take() */
29 ok1(!is_taken(p));
30 ok1(!taken(p));
31 ok1(!taken_any());
32
33 return exit_status();
34}

Callers

nothing calls this directly

Calls 4

is_takenFunction · 0.85
taken_anyFunction · 0.85
takenFunction · 0.85
strendsFunction · 0.85

Tested by

no test coverage detected