]> git.ozlabs.org Git - ccan/blob - ccan/tcon/test/run-wrap.c
tcon: Add an alternate way of building type canaries
[ccan] / ccan / tcon / test / run-wrap.c
1 #include <ccan/tcon/tcon.h>
2 #include <ccan/tap/tap.h>
3 #include <stdlib.h>
4
5 typedef TCON_WRAP(int, char *canary) canaried_int;
6
7 int main(int argc, char *argv[])
8 {
9         canaried_int ci = TCON_WRAP_INIT(0);
10
11         plan_tests(2);
12
13         ok1(*tcon_unwrap(&ci) == 0);
14         *tcon_unwrap(&ci) = 17;
15         ok1(*tcon_unwrap(&ci) == 17);
16
17         return exit_status();
18 }