| 31 | } |
| 32 | |
| 33 | static struct test_entry *alloc_test_entry(unsigned int hash, |
| 34 | const char *key, |
| 35 | const char *value) |
| 36 | { |
| 37 | size_t klen = strlen(key); |
| 38 | size_t vlen = strlen(value); |
| 39 | struct test_entry *entry = xmalloc(st_add4(sizeof(*entry), klen, vlen, 2)); |
| 40 | hashmap_entry_init(&entry->ent, hash); |
| 41 | memcpy(entry->key, key, klen + 1); |
| 42 | memcpy(entry->key + klen + 1, value, vlen + 1); |
| 43 | return entry; |
| 44 | } |
| 45 | |
| 46 | #define HASH_METHOD_FNV 0 |
| 47 | #define HASH_METHOD_I 1 |
no test coverage detected