diff options
Diffstat (limited to 'tests/trie.c')
-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); |