ccanlint: handle nested modules when mentioned in examples.
[ccan] / ccan / tal / test / run-free.c
1 #include <ccan/tal/tal.h>
2 #include <ccan/tal/tal.c>
3 #include <ccan/tap/tap.h>
4
5 static void destroy_errno(char *p)
6 {
7         errno = ENOENT;
8 }
9
10 int main(void)
11 {
12         char *p;
13
14         plan_tests(2);
15
16         p = tal(NULL, char);
17         ok1(tal_add_destructor(p, destroy_errno));
18
19         /* Errno save/restored across free. */
20         errno = EINVAL;
21         tal_free(p);
22         ok1(errno == EINVAL);
23
24         return exit_status();
25 }