diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-11-02 11:18:37 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-11-04 12:26:38 -0500 |
commit | 7841bfe55d4b5aa85e6d6f661f30f9eecbc84374 (patch) | |
tree | f2fd3375c3760e0aaffb1d839227b999c686fb9b /tests | |
parent | f9731a2ee6917ce5c389444e52cfa99bea873edb (diff) | |
download | bfs-slab-bitmaps.tar.xz |
trie: Get rid of the linked list of leavesslab-bitmaps
Diffstat (limited to 'tests')
-rw-r--r-- | tests/trie.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/trie.c b/tests/trie.c index 6e6024a..d69f37e 100644 --- a/tests/trie.c +++ b/tests/trie.c @@ -71,15 +71,14 @@ void check_trie(void) { bfs_verify(leaf); bfs_check(strcmp(keys[i], leaf->key) == 0); bfs_check(leaf->length == strlen(keys[i]) + 1); + leaf->value = (void *)keys[i]; } { size_t i = 0; for_trie (leaf, &trie) { - bfs_check(leaf == trie_find_str(&trie, keys[i])); - bfs_check(leaf == trie_insert_str(&trie, keys[i])); - bfs_check(!leaf->prev || leaf->prev->next == leaf); - bfs_check(!leaf->next || leaf->next->prev == leaf); + bfs_check(strcmp(leaf->value, leaf->key) == 0); + leaf->value = NULL; ++i; } bfs_check(i == nkeys); |