diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-10-09 05:18:04 +0000 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-10-09 05:18:04 +0000 |
commit | b8d713bbecb7ed54c78d37eb4ec1414a15bfbf6b (patch) | |
tree | 80dce70188c9af9ad4a193149e16f2e89d8f0171 /tests/libdimension | |
parent | a9c5e1caf089c8b6fd77beb4452fbb6049fc8d9e (diff) | |
download | dimension-b8d713bbecb7ed54c78d37eb4ec1414a15bfbf6b.tar.xz |
kD splay tree fixes, and new dmnsn_kD_splay_tree type.
Diffstat (limited to 'tests/libdimension')
-rw-r--r-- | tests/libdimension/kD_splay_tree.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/libdimension/kD_splay_tree.c b/tests/libdimension/kD_splay_tree.c index 76f6441..eca684b 100644 --- a/tests/libdimension/kD_splay_tree.c +++ b/tests/libdimension/kD_splay_tree.c @@ -27,7 +27,7 @@ int main() { - dmnsn_kD_splay_node *tree; + dmnsn_kD_splay_tree *tree; dmnsn_object *obj1, *obj2, *obj3; obj1 = dmnsn_new_object(); @@ -45,28 +45,28 @@ main() tree = dmnsn_new_kD_splay_tree(); - tree = dmnsn_kD_splay_insert(tree, obj1); - if (tree->object != obj1) { + dmnsn_kD_splay_insert(tree, obj1); + if (tree->root->object != obj1) { fprintf(stderr, "Wrong kD splay tree built.\n"); return EXIT_FAILURE; } - tree = dmnsn_kD_splay_insert(tree, obj2); - if (tree->object != obj2 || tree->contains->object != obj1) { + dmnsn_kD_splay_insert(tree, obj2); + if (tree->root->object != obj2 || tree->root->contains->object != obj1) { fprintf(stderr, "Wrong kD splay tree built.\n"); return EXIT_FAILURE; } - tree = dmnsn_kD_splay_insert(tree, obj3); - if (tree->object != obj3 || tree->contains->object != obj1 - || tree->container->object != obj2) { + dmnsn_kD_splay_insert(tree, obj3); + if (tree->root->object != obj3 || tree->root->contains->object != obj1 + || tree->root->container->object != obj2) { fprintf(stderr, "Wrong kD splay tree built.\n"); return EXIT_FAILURE; } + dmnsn_delete_kD_splay_tree(tree); dmnsn_delete_object(obj3); dmnsn_delete_object(obj2); dmnsn_delete_object(obj1); - dmnsn_delete_kD_splay_tree(tree); return EXIT_SUCCESS; } |