1 /* Test our access counting failures. */
2 #include <ccan/jmap/jmap.c>
3 #include <ccan/tap/tap.h>
9 JMAP_MEMBERS(unsigned long, unsigned long);
12 int main(int argc, char *argv[])
20 map = jmap_new(struct map);
21 ok1(jmap_error(map) == NULL);
22 ok1(jmap_add(map, 0, 1));
24 /* add while holding value. */
25 value = jmap_getval(map, 0);
32 ok1(WIFSIGNALED(status) && WTERMSIG(status) == SIGABRT);
34 jmap_putval(map, &value);
36 /* del while holding value. */
37 value = jmap_getval(map, 0);
44 ok1(WIFSIGNALED(status) && WTERMSIG(status) == SIGABRT);
46 jmap_putval(map, &value);
48 ok1(jmap_add(map, 0, 1));
50 /* set while holding value ok. */
51 value = jmap_getval(map, 0);
58 ok1(WIFEXITED(status) && WEXITSTATUS(status) == 0);
60 jmap_putval(map, &value);
62 /* FIXME: test jmap_nthval, jmap_firstval etc. */