| 33 | } |
| 34 | |
| 35 | static struct test_entry *alloc_test_entry(const char *key, const char *value, |
| 36 | unsigned int ignore_case) |
| 37 | { |
| 38 | size_t klen = strlen(key); |
| 39 | size_t vlen = strlen(value); |
| 40 | unsigned int hash = ignore_case ? strihash(key) : strhash(key); |
| 41 | struct test_entry *entry = xmalloc(st_add4(sizeof(*entry), klen, vlen, 2)); |
| 42 | |
| 43 | hashmap_entry_init(&entry->ent, hash); |
| 44 | memcpy(entry->key, key, klen + 1); |
| 45 | memcpy(entry->key + klen + 1, value, vlen + 1); |
| 46 | return entry; |
| 47 | } |
| 48 | |
| 49 | static struct test_entry *get_test_entry(struct hashmap *map, const char *key, |
| 50 | unsigned int ignore_case) |