1 /* Test our access counting failures. */
2 #include <ccan/jmap/jmap.c>
3 #include <ccan/tap/tap.h>
8 int main(int argc, char *argv[])
17 ok1(jmap_error(map) == NULL);
18 ok1(jmap_add(map, 0, 1));
20 /* add while holding value. */
21 value = jmap_getval(map, 0);
28 ok1(WIFSIGNALED(status) && WTERMSIG(status) == SIGABRT);
30 jmap_putval(map, &value);
32 /* del while holding value. */
33 value = jmap_getval(map, 0);
40 ok1(WIFSIGNALED(status) && WTERMSIG(status) == SIGABRT);
42 jmap_putval(map, &value);
44 ok1(jmap_add(map, 0, 1));
46 /* set while holding value ok. */
47 value = jmap_getval(map, 0);
54 ok1(WIFEXITED(status) && WEXITSTATUS(status) == 0);
56 jmap_putval(map, &value);
58 /* FIXME: test jmap_nthval, jmap_firstval etc. */