summaryrefslogtreecommitdiffstats
path: root/tests/libdimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-10-09 05:18:04 +0000
committerTavian Barnes <tavianator@gmail.com>2009-10-09 05:18:04 +0000
commitb8d713bbecb7ed54c78d37eb4ec1414a15bfbf6b (patch)
tree80dce70188c9af9ad4a193149e16f2e89d8f0171 /tests/libdimension
parenta9c5e1caf089c8b6fd77beb4452fbb6049fc8d9e (diff)
downloaddimension-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.c18
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;
}