fix: make tests work with new trie

This commit is contained in:
Jef Roosens 2022-12-08 12:12:29 +01:00
parent 0c742f45b0
commit d7d4821b66
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
4 changed files with 71 additions and 55 deletions

View file

@ -81,6 +81,18 @@ TrieExitCode trie_search(Trie *trie, void **data_ptr, const char *key);
TrieExitCode trie_add(Trie *trie, const char *key, void *data,
uint64_t data_len);
/**
* Same as trie_add, but copy the data instead of taking over ownership of the
* pointer.
*
* @param trie
* @param key key to represent entry with
* @param entry entry to add
* @return 0 if added, 1 if already in trie, something else if other errors
*/
TrieExitCode trie_add_copy(Trie *trie, const char *key, void *data,
uint64_t data_len);
/**
* Add an entry by generating a random string as the key.
*