8 e = hsearch((ENTRY){.key = k, .data = (void*)v}, ENTER); \
9 if (!e || strcmp(e->key, k) != 0) \
10 t_error("hsearch ENTER %s %d failed\n", k, v); \
13 #define get(k) hsearch((ENTRY){.key = k, .data = 0}, FIND)
19 if (hcreate(-1) || errno != ENOMEM)
20 t_error("hcreate((size_t)-1) should fail with ENOMEM got %s\n", strerror(errno));
22 t_error("hcreate(13) failed\n");
34 t_error("hsearch FIND a failed\n");
36 t_error("hsearch FIND c should fail\n");
38 if (e && (int)(e->data) != 7)
39 t_error("hsearch ENTER g 10 returned data %d, wanted 7\n", (int)(e->data));
41 if (e && (int)(e->data) != 7)
42 t_error("hsearch ENTER g 10 returned data %d, wanted 7\n", (int)(e->data));
44 if (e && (int)(e->data) != 10)
45 t_error("hsearch ENTER j 10 returned data %d, wanted 10\n", (int)(e->data));