summaryrefslogtreecommitdiffstats
path: root/test/btree2.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-02-17 20:40:13 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-02-17 20:40:13 (GMT)
commit45f2b1102643829180f81297faec88cc903414c7 (patch)
tree708bbf9d150b23595cddd5723d6c7829577eeb08 /test/btree2.c
parent1a2bdd1cf66e320954f1e1504249734c97730992 (diff)
downloadhdf5-45f2b1102643829180f81297faec88cc903414c7.zip
hdf5-45f2b1102643829180f81297faec88cc903414c7.tar.gz
hdf5-45f2b1102643829180f81297faec88cc903414c7.tar.bz2
[svn-r10034] Purpose:
New test Description: Add extra tests for v2 B-tree iterator Platforms tested: FreeBSD 4.11 (sleipnir) w/parallel Too minor to require h5committest
Diffstat (limited to 'test/btree2.c')
-rw-r--r--test/btree2.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/btree2.c b/test/btree2.c
index 9593dc9..3283ff2 100644
--- a/test/btree2.c
+++ b/test/btree2.c
@@ -262,6 +262,9 @@ test_insert_split_root(hid_t fapl)
goto error;
}
+ /* Make certain that the index is correct */
+ if(idx != (INSERT_SPLIT_ROOT_NREC+2)) TEST_ERROR;
+
PASSED();
if (H5Fclose(file)<0) TEST_ERROR;
@@ -551,6 +554,7 @@ test_insert_level1_3leaf_redistrib(hid_t fapl)
H5F_t *f=NULL;
hsize_t record; /* Record to insert into tree */
haddr_t bt2_addr; /* Address of B-tree created */
+ hsize_t idx; /* Index within B-tree, for iterator */
unsigned u; /* Local index variable */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
@@ -597,6 +601,18 @@ test_insert_level1_3leaf_redistrib(hid_t fapl)
goto error;
}
}
+
+ /* Iterate over B-tree to check records have been inserted correctly */
+ idx = 0;
+ if(H5B2_iterate(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, iter_cb, &idx)<0) {
+ H5_FAILED();
+ H5Eprint_stack(H5E_DEFAULT, stdout);
+ goto error;
+ }
+
+ /* Make certain that the index is correct */
+ if(idx != (INSERT_SPLIT_ROOT_NREC*2)) TEST_ERROR;
+
PASSED();
if (H5Fclose(file)<0) TEST_ERROR;
@@ -725,6 +741,7 @@ test_insert_make_level2(hid_t fapl)
H5F_t *f=NULL;
hsize_t record; /* Record to insert into tree */
haddr_t bt2_addr; /* Address of B-tree created */
+ hsize_t idx; /* Index within B-tree, for iterator */
unsigned u; /* Local index variable */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
@@ -761,6 +778,18 @@ test_insert_make_level2(hid_t fapl)
goto error;
}
}
+
+ /* Iterate over B-tree to check records have been inserted correctly */
+ idx = 0;
+ if(H5B2_iterate(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, iter_cb, &idx)<0) {
+ H5_FAILED();
+ H5Eprint_stack(H5E_DEFAULT, stdout);
+ goto error;
+ }
+
+ /* Make certain that the index is correct */
+ if(idx != (INSERT_SPLIT_ROOT_NREC*11)) TEST_ERROR;
+
PASSED();
if (H5Fclose(file)<0) TEST_ERROR;