summaryrefslogtreecommitdiffstats
path: root/test/btree2.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2022-05-04 15:49:01 (GMT)
committerGitHub <noreply@github.com>2022-05-04 15:49:01 (GMT)
commit838d050a63d310a38f92a510dc94c0656a84bb51 (patch)
tree55fe7b05c0408ebf4b28c3bfb5cd9a1d04fb2502 /test/btree2.c
parent19a59c29b93c04ae069881da2354d3d7048619b9 (diff)
downloadhdf5-838d050a63d310a38f92a510dc94c0656a84bb51.zip
hdf5-838d050a63d310a38f92a510dc94c0656a84bb51.tar.gz
hdf5-838d050a63d310a38f92a510dc94c0656a84bb51.tar.bz2
h5test.h testing macros get enclosed in do..while loops (#1721)
* h5test.h testing macros get enclosed in do..while loops * Adds missed macro in hl C++ code * Fixes macro in Windows code
Diffstat (limited to 'test/btree2.c')
-rw-r--r--test/btree2.c3050
1 files changed, 1525 insertions, 1525 deletions
diff --git a/test/btree2.c b/test/btree2.c
index 9cbb211..d72bd3d 100644
--- a/test/btree2.c
+++ b/test/btree2.c
@@ -108,15 +108,15 @@ create_file(hid_t *file, H5F_t **f, hid_t fapl)
/* Create the file to work on */
if ((*file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Get a pointer to the internal file object */
if (NULL == (*f = (H5F_t *)H5VL_object(*file)))
- STACK_ERROR
+ STACK_ERROR;
/* Ignore metadata tags in the file's cache */
if (H5AC_ignore_tags(*f) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Success */
return (0);
@@ -143,11 +143,11 @@ create_btree(H5F_t *f, const H5B2_create_t *cparam, H5B2_t **bt2, haddr_t *bt2_a
{
/* Create the v2 B-tree & get its address */
if (NULL == (*bt2 = H5B2_create(f, cparam, f)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5B2_get_addr(*bt2, bt2_addr /*out*/) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (!H5F_addr_defined(*bt2_addr))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Success */
return (0);
@@ -179,15 +179,15 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl)
/* Create the file to work on */
if ((*file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Get a pointer to the internal file object */
if (NULL == (*f = (H5F_t *)H5VL_object(*file)))
- STACK_ERROR
+ STACK_ERROR;
/* Ignore metadata tags in the file's cache */
if (H5AC_ignore_tags(*f) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Success */
return (0);
@@ -216,11 +216,11 @@ reopen_btree(H5F_t *f, H5B2_t **bt2, haddr_t bt2_addr, const bt2_test_param_t *t
if (tparam->reopen_btree) {
/* Close (empty) v2 B-tree */
if (H5B2_close(*bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Re-open v2 B-tree */
if (NULL == (*bt2 = H5B2_open(f, bt2_addr, f)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end if */
/* Success */
@@ -250,11 +250,11 @@ check_stats(H5B2_t *bt2, const H5B2_stat_t *expected)
/* Get current stats */
if (H5B2_stat_info(bt2, &actual) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (actual.depth != expected->depth)
- TEST_ERROR
+ TEST_ERROR;
if (actual.nrecords != expected->nrecords)
- TEST_ERROR
+ TEST_ERROR;
/* Success */
return (0);
@@ -282,9 +282,9 @@ check_node_depth(H5B2_t *bt2, void *record, unsigned depth)
int rec_depth; /* Depth of record in B-tree */
if ((rec_depth = H5B2__get_node_depth_test(bt2, record)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if ((unsigned)rec_depth != depth)
- TEST_ERROR
+ TEST_ERROR;
/* Success */
return (0);
@@ -312,11 +312,11 @@ check_node_info(H5B2_t *bt2, hsize_t record, H5B2_node_info_test_t *ninfo)
H5B2_node_info_test_t rec_ninfo; /* Node info for record in B-tree */
if (H5B2__get_node_info_test(bt2, &record, &rec_ninfo) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (rec_ninfo.depth != ninfo->depth)
- TEST_ERROR
+ TEST_ERROR;
if (rec_ninfo.nrec != ninfo->nrec)
- TEST_ERROR
+ TEST_ERROR;
/* Success */
return (0);
@@ -641,11 +641,11 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -656,23 +656,23 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to iterate over a B-tree with no records */
idx = 0;
if (H5B2_iterate(bt2, iter_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index hasn't changed */
if (idx != 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find record in B-tree with no records */
idx = 0;
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, NULL) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index record in B-tree with no records */
idx = 0;
@@ -683,7 +683,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -694,43 +694,43 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 42;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Attempt to find non-existent record in B-tree with 1 record */
/* (Should not be found, but not fail) */
idx = 41;
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (found)
- TEST_ERROR
+ TEST_ERROR;
/* Try again with NULL 'op' */
/* (Should not be found, but not fail) */
found = FALSE;
if (H5B2_find(bt2, &idx, &found, NULL, NULL) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in B-tree with 1 record */
idx = 42;
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Try again with NULL 'op' */
found = FALSE;
if (H5B2_find(bt2, &idx, &found, NULL, NULL) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index non-existent record in B-tree with 1 record */
idx = 0;
@@ -741,12 +741,12 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index existing record in B-tree with 1 record */
idx = 42;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -757,45 +757,45 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/*
* Test inserting second record into v2 B-tree, before all other records
*/
record = 34;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/*
* Test inserting third record into v2 B-tree, after all other records
*/
record = 56;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/*
* Test inserting fourth record into v2 B-tree, in the middle of other records
*/
record = 38;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Attempt to find non-existent record in level-0 B-tree with several records */
/* (Should not be found, but not fail) */
idx = 41;
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in level-0 B-tree with several record */
idx = 56;
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index non-existent record in B-tree with several records */
idx = 0;
@@ -806,30 +806,30 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index existing record in B-tree with several records */
idx = 34;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0)
- TEST_ERROR
+ TEST_ERROR;
idx = 38;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, find_cb, &idx) < 0)
- TEST_ERROR
+ TEST_ERROR;
idx = 42;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)2, find_cb, &idx) < 0)
- TEST_ERROR
+ TEST_ERROR;
idx = 56;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)3, find_cb, &idx) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close the file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -884,104 +884,104 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert records to fill root leaf node */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC - 1); u++) {
record = u + 2;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 0;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC - 1);
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = (hsize_t)33;
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert record to split root leaf node */
record = INSERT_SPLIT_ROOT_NREC + 1;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = (hsize_t)33;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert a couple more records, on the left side of the B-tree */
record = 0;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
record = 1;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC + 2);
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = (hsize_t)33;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
if (H5B2_iterate(bt2, iter_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index is correct */
if (idx != (INSERT_SPLIT_ROOT_NREC + 2))
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find non-existent record in level-1 B-tree */
/* (Should not be found, but not fail) */
idx = INSERT_SPLIT_ROOT_NREC + 10;
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in root of level-1 B-tree */
idx = 33;
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in leaf of level-1 B-tree */
idx = 56;
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index non-existent record in level-1 B-tree */
idx = 0;
@@ -992,30 +992,30 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index existing record in root of level-1 B-tree */
idx = 33;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)33, find_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Attempt to index existing record in left leaf of level-1 B-tree */
idx = 0;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Attempt to index existing record in right leaf of level-1 B-tree */
idx = 50;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)50, find_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -1067,51 +1067,51 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, cons
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 2 leaves */
for (u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u + (INSERT_SPLIT_ROOT_NREC / 2) + 1;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = (hsize_t)INSERT_SPLIT_ROOT_NREC;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Force redistribution from left node into right node */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2) + 1);
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = (hsize_t)((INSERT_SPLIT_ROOT_NREC / 2) + (INSERT_SPLIT_ROOT_NREC / 4) + 1);
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
PASSED();
@@ -1123,52 +1123,52 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, cons
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 2 leaves */
for (u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = (hsize_t)(INSERT_SPLIT_ROOT_NREC / 2);
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Force redistribution from left node into right node */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) {
record = u + INSERT_SPLIT_ROOT_NREC;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2) + 1;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = (hsize_t)((INSERT_SPLIT_ROOT_NREC / 2) + (INSERT_SPLIT_ROOT_NREC / 4) + 1);
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
PASSED();
@@ -1220,54 +1220,54 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, const bt2
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 2 leaves */
for (u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u + INSERT_SPLIT_ROOT_NREC;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2);
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Force left node to split */
for (u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = 2 * INSERT_SPLIT_ROOT_NREC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 31;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 63;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
PASSED();
@@ -1279,55 +1279,55 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, const bt2
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 2 leaves */
for (u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = (INSERT_SPLIT_ROOT_NREC / 2);
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Force right node to split */
for (u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u + INSERT_SPLIT_ROOT_NREC;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = 2 * INSERT_SPLIT_ROOT_NREC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 62;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 94;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
PASSED();
@@ -1382,95 +1382,95 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, cons
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 2 leaves */
for (u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u + (INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2) + 1);
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = (2 * INSERT_SPLIT_ROOT_NREC);
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Force left node to split */
for (u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = 2 * INSERT_SPLIT_ROOT_NREC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = (INSERT_SPLIT_ROOT_NREC / 2);
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = (INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2) + 1);
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert records to force middle node to redistribute */
for (u = 0; u < ((INSERT_SPLIT_ROOT_NREC / 2) + 1); u++) {
record = u + INSERT_SPLIT_ROOT_NREC;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = (2 * INSERT_SPLIT_ROOT_NREC) + (INSERT_SPLIT_ROOT_NREC / 2) + 1;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 52;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 105;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
if (H5B2_iterate(bt2, iter_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index is correct */
if (idx != ((INSERT_SPLIT_ROOT_NREC * 2) + (INSERT_SPLIT_ROOT_NREC / 2) + 1))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
PASSED();
@@ -1524,75 +1524,75 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, const b
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 2 leaves */
for (u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 2);
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = (2 * INSERT_SPLIT_ROOT_NREC) + (INSERT_SPLIT_ROOT_NREC / 2);
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Force split from left node into right node */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = 3 * INSERT_SPLIT_ROOT_NREC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 62;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 94;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 126;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
if (H5B2_iterate(bt2, iter_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index is correct */
if (idx != (INSERT_SPLIT_ROOT_NREC * 3))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- STACK_ERROR
+ STACK_ERROR;
PASSED();
@@ -1644,113 +1644,113 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 2 internal nodes */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC * 9); u++) {
record = u + 2;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
for (; u < ((INSERT_SPLIT_ROOT_NREC * 29) + 1); u++) {
record = u + 4;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 29) + 1;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 948;
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Add some extra records to left-most leaf */
record = 0;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
record = 1;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Add some extra records to middle leaf */
record = (INSERT_SPLIT_ROOT_NREC * 9) + 2;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
record = (INSERT_SPLIT_ROOT_NREC * 9) + 3;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
if (H5B2_iterate(bt2, iter_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index is correct */
if (idx != ((INSERT_SPLIT_ROOT_NREC * 29) + 5))
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find non-existent record in level-2 B-tree */
/* (Should not be found, but not fail) */
idx = INSERT_SPLIT_ROOT_NREC * 30;
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in root of level-2 B-tree */
idx = 948;
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Check with B-tree */
record = 948;
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in internal node of level-2 B-tree */
idx = 505;
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Check with B-tree */
record = 505;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in leaf of level-2 B-tree */
idx = 555;
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Check with B-tree */
record = 555;
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index non-existent record in level-2 B-tree */
idx = 0;
@@ -1761,31 +1761,31 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index existing record in root of level-2 B-tree */
idx = 948;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)948, find_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Attempt to index existing record in internal node of level-2 B-tree */
idx = 505;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)505, find_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Attempt to index existing record in leaf of level-2 B-tree */
idx = 555;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)555, find_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
PASSED();
@@ -1837,63 +1837,63 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, const
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 2 internal nodes */
/* And fill rightmost leaf */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC * 8); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC / 2) + 1;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
for (; u < ((INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2)); u++) {
record = u + INSERT_SPLIT_ROOT_NREC + 1;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2);
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1008;
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1859;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1921;
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert record to force redistribution of rightmost leaf */
record = u + INSERT_SPLIT_ROOT_NREC + 1;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2) + 1;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1008;
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1875;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1922;
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -1901,22 +1901,22 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, const
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2) + 1;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1008;
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 94;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 32;
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Add more records to left-most leaf, to force a 2->1 split and then a
* 2 node redistribution on left leaf
@@ -1924,23 +1924,23 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, const
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 30) + 1;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1008;
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 47;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 0;
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -1948,72 +1948,72 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, const
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 30) + 1;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1008;
if (check_node_depth(bt2, &record, (unsigned)2) < 0) /* Record in root node */
- TEST_ERROR
+ TEST_ERROR;
record = 535;
if (check_node_depth(bt2, &record, (unsigned)1) < 0) /* Record in middle node before insertion point */
- TEST_ERROR
+ TEST_ERROR;
record = 630;
if (check_node_depth(bt2, &record, (unsigned)1) < 0) /* Record in middle node after insertion point */
- TEST_ERROR
+ TEST_ERROR;
record = 568;
if (check_node_depth(bt2, &record, (unsigned)0) < 0) /* Record in leaf node just after insertion point */
- TEST_ERROR
+ TEST_ERROR;
/* Add more records to middle leaf, to force a split and a 3 node redistribution on middle leaf */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 8) + (INSERT_SPLIT_ROOT_NREC / 2) + 1;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 30) + (INSERT_SPLIT_ROOT_NREC / 2) + 2;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1008;
if (check_node_depth(bt2, &record, (unsigned)2) < 0) /* Record in root node */
- TEST_ERROR
+ TEST_ERROR;
record = 524;
if (check_node_depth(bt2, &record, (unsigned)1) < 0) /* Record in middle node before insertion point */
- TEST_ERROR
+ TEST_ERROR;
record = 577;
if (check_node_depth(bt2, &record, (unsigned)1) < 0) /* Record in middle node after insertion point */
- TEST_ERROR
+ TEST_ERROR;
record = 568;
if (check_node_depth(bt2, &record, (unsigned)0) < 0) /* Record in leaf node just after insertion point */
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
if (H5B2_iterate(bt2, iter_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index is correct */
if (idx != ((INSERT_SPLIT_ROOT_NREC * 30) + (INSERT_SPLIT_ROOT_NREC / 2) + 2))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- STACK_ERROR
+ STACK_ERROR;
PASSED();
@@ -2065,67 +2065,67 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, const bt2
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 2 internal nodes */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC * 8); u++) {
record = u + 1;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
for (; u < ((INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2)); u++) {
record = u + 2;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2);
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 946; /* Record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1797; /* Right-most record in right internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1859; /* Right-most record in right-most leaf */
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force right-most leaf to split */
for (u = 0; u < ((INSERT_SPLIT_ROOT_NREC / 2) + 1); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2) + 2;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC * 30;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 946; /* Record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1828; /* Next-to-right-most record in right-most internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1860; /* Right-most record in right-most internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1891; /* Right-most record in right-most leaf */
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -2133,45 +2133,45 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, const bt2
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC * 30;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 946; /* Record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 63; /* Left-most record in left-most internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1; /* Left-most record in left-most leaf */
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Add another record to left-most leaf, to force a 1->2 node split on left leaf */
record = 0;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 30) + 1;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 946; /* Record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 63; /* Left-most record in left-most internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 32; /* Left-most record in left internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 0; /* Left-most record in left-most leaf */
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -2179,73 +2179,73 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, const bt2
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 30) + 1;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 946; /* Record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 504; /* Record in internal node just before insertion point */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 568; /* Record in internal node just after insertion point */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 506; /* Record in leaf node just after insertion point */
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Add another record to middle leaf, to force a node split on middle leaf */
record = (INSERT_SPLIT_ROOT_NREC * 8) + 1;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 30) + 2;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 946; /* Record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 504; /* Left-most record of split in left internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 537; /* Middle record of split in left internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 568; /* Right-most record of split in left internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 506; /* Record in leaf node just after insertion point */
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
if (H5B2_iterate(bt2, iter_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index is correct */
if (idx != ((INSERT_SPLIT_ROOT_NREC * 30) + 2))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
PASSED();
@@ -2299,58 +2299,58 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 2 internal nodes */
/* And fill up right internal node, to just before to redistribute it */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC * 44); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 6) - 4;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC * 44;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1318; /* Record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 3114; /* Right-most record in right internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 3145; /* Right-most record in right leaf node */
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert record to redistribute right-most internal node */
record = u + (INSERT_SPLIT_ROOT_NREC * 6) - 4;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC * 44 + 1;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1822; /* Record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 3114; /* Right-most record in right internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 3146; /* Right-most record in right leaf node */
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -2358,66 +2358,66 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC * 44 + 1;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1822; /* Record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 436; /* Left-most record in left internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 374; /* Left-most record in left leaf node */
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Force left-most internal node to redistribute */
for (u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 6) - 4); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 50) - 3;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1570; /* Record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 61; /* Left-most record in left internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 0; /* Left-most record in left leaf node */
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
if (H5B2_iterate(bt2, iter_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index is correct */
if (idx != ((INSERT_SPLIT_ROOT_NREC * 50) - 3))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -2470,61 +2470,61 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, cons
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 2 internal nodes */
/* (And fill up two child internal nodes) */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC * 59); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 14) - (INSERT_SPLIT_ROOT_NREC / 4) + 3;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC * 59;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 2759; /* Record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 4555; /* Right-most record in right internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 4586; /* Right-most record in right leaf node */
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert record to split right-most internal node */
record = u + (INSERT_SPLIT_ROOT_NREC * 14) - (INSERT_SPLIT_ROOT_NREC / 4) + 3;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 59) + 1;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 2759; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 3704; /* Right record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 4555; /* Right-most record in right internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 4387; /* Right-most record in right leaf node */
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -2532,69 +2532,69 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, cons
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 59) + 1;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 2759; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 932; /* Left-most record in left internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 870; /* Left-most record in left leaf node */
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Force left-most internal node to split */
for (u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 14) - (INSERT_SPLIT_ROOT_NREC / 4) + 3); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 73) - (INSERT_SPLIT_ROOT_NREC / 4) + 4;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 870; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1814; /* Next-to-left-most record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 61; /* Left-most record in left internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 0; /* Left-most record in left leaf node */
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
if (H5B2_iterate(bt2, iter_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index is correct */
if (idx != ((INSERT_SPLIT_ROOT_NREC * 73) - (INSERT_SPLIT_ROOT_NREC / 4) + 4))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- STACK_ERROR
+ STACK_ERROR;
PASSED();
@@ -2649,130 +2649,130 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 3 internal nodes */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC * 36); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
for (; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 3;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 59) + 1;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1889; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 3703; /* Right record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 2267; /* Record to left of insertion point in middle internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 3199; /* Record to right of insertion point in middle internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 3137; /* Record just above insertion point in leaf node */
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert records to fill up middle internal node */
for (u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 2); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 36);
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 72) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 3;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1889; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 3703; /* Right record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 3104; /* Record to left of insertion point in middle internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 3137; /* Record to right of insertion point in middle internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 3135; /* Record just above insertion point in leaf node */
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert another record, forcing the middle internal node to redistribute */
record = u + (INSERT_SPLIT_ROOT_NREC * 36);
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 72) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 4;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1574; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 3104; /* Right record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
#ifdef NONE
record = 2862; /* Record to left of insertion point in right internal node (now) */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
#endif /* NONE */
record = 3137; /* Record to right of insertion point in right internal node (now) */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 3135; /* Record just above insertion point in leaf node */
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
if (H5B2_iterate(bt2, iter_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index is correct */
if (idx != ((INSERT_SPLIT_ROOT_NREC * 72) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 4))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- STACK_ERROR
+ STACK_ERROR;
PASSED();
@@ -2826,134 +2826,134 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, cons
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 3 internal nodes */
/* (and fill right internal node) */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC * 31); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
for (; u < (INSERT_SPLIT_ROOT_NREC * 74); u++) {
record = u + ((INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 3);
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC * 74;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1889; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 3703; /* Right record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1952; /* Record to left of insertion point in middle internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 2884; /* Record to right of insertion point in middle internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 2822; /* Record just after insertion point in leaf node */
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert records to fill up middle internal node */
for (u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 2); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 31);
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 87) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 2;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1889; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 3703; /* Right record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 2789; /* Record to left of insertion point in middle internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 2822; /* Record to right of insertion point in middle internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 2823; /* Record just above insertion point in leaf node */
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert record to split middle internal node */
record = u + (INSERT_SPLIT_ROOT_NREC * 31);
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 87) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 3;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1889; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 2789; /* Middle record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 3703; /* Right record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
#ifdef NONE
record = 3049; /* Record to left of insertion point in middle internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
#endif /* NONE */
record = 2822; /* Record to right of insertion point in middle internal node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 2823; /* Record just above insertion point in leaf node */
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
if (H5B2_iterate(bt2, iter_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index is correct */
if (idx != ((INSERT_SPLIT_ROOT_NREC * 87) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 3))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
PASSED();
@@ -3020,7 +3020,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
/* Allocate space for the records */
if (NULL == (records = (hsize_t *)HDmalloc(sizeof(hsize_t) * INSERT_MANY)))
- TEST_ERROR
+ TEST_ERROR;
/* Initialize record #'s */
for (u = 0; u < INSERT_MANY; u++)
@@ -3039,81 +3039,81 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
/* Create the file to work on */
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Get a pointer to the internal file object */
if (NULL == (f = (H5F_t *)H5VL_object(file)))
- STACK_ERROR
+ STACK_ERROR;
/* Ignore metadata tags in the file's cache */
if (H5AC_ignore_tags(f) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert random records */
for (u = 0; u < INSERT_MANY; u++) {
record = records[u];
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 4;
bt2_stat.nrecords = INSERT_MANY;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Re-open the file */
if ((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
if (NULL == (f = (H5F_t *)H5VL_object(file)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Ignore metadata tags in the file's cache */
if (H5AC_ignore_tags(f) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Re-open v2 B-tree */
if (NULL == (bt2 = H5B2_open(f, bt2_addr, f)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check up on B-tree after re-open */
bt2_stat.depth = 4;
bt2_stat.nrecords = INSERT_MANY;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
if (H5B2_iterate(bt2, iter_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index is correct */
if (idx != INSERT_MANY)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find non-existent record in level-4 B-tree */
/* (Should not be found, but not fail) */
idx = INSERT_MANY * 2;
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (found)
- TEST_ERROR
+ TEST_ERROR;
/* Find random records */
for (u = 0; u < FIND_MANY; u++) {
@@ -3123,9 +3123,9 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
/* Attempt to find existent record in root of level-4 B-tree */
found = FALSE;
if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
/* Attempt to index non-existent record in level-4 B-tree, in increasing & decreasing order */
@@ -3136,7 +3136,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
H5E_BEGIN_TRY
{
ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY * 3), find_cb, NULL);
@@ -3144,7 +3144,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
/* Find random records */
for (u = 0; u < FIND_MANY; u++) {
@@ -3154,12 +3154,12 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
/* Attempt to find existent record in root of level-4 B-tree */
/* (in increasing order) */
if (H5B2_index(bt2, H5_ITER_INC, idx, find_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Attempt to find existent record in root of level-4 B-tree */
/* (in decreasing order) */
if (H5B2_index(bt2, H5_ITER_DEC, idx, find_dec_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
PASSED();
@@ -3168,7 +3168,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = INSERT_MANY / 2;
H5E_BEGIN_TRY
@@ -3178,24 +3178,24 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != INSERT_MANY)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -3243,11 +3243,11 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/*
* Test insert record into empty v2 B-tree
@@ -3256,12 +3256,12 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = 42;
record.val = 72;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Attempt to find non-existent record in B-tree with 1 record */
/* (Should not be found, but not fail) */
@@ -3269,41 +3269,41 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.val != (hsize_t)-1)
- TEST_ERROR
+ TEST_ERROR;
if (found)
- TEST_ERROR
+ TEST_ERROR;
/* Try again with NULL 'op' */
/* (Should not be found, but not fail) */
found = FALSE;
if (H5B2_find(bt2, &find, &found, NULL, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.val != (hsize_t)-1)
- TEST_ERROR
+ TEST_ERROR;
if (found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in B-tree with 1 record */
find.key = 42;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.val != 72)
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Try again with NULL 'op' */
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, NULL, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.val != (hsize_t)-1)
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index non-existent record in B-tree with 1 record */
H5E_BEGIN_TRY
@@ -3313,16 +3313,16 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index existing record in B-tree with 1 record */
find.key = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.key != 42)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != 72)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -3333,12 +3333,12 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
modify.key = 42;
modify.val = 43;
if (H5B2_update(bt2, &modify, modify_rec_cb, &modify) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Attempt to find non-existent record in B-tree with 1 record */
/* (Should not be found, but not fail) */
@@ -3346,41 +3346,41 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.val != (hsize_t)-1)
- TEST_ERROR
+ TEST_ERROR;
if (found)
- TEST_ERROR
+ TEST_ERROR;
/* Try again with NULL 'op' */
/* (Should not be found, but not fail) */
found = FALSE;
if (H5B2_find(bt2, &find, &found, NULL, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.val != (hsize_t)-1)
- TEST_ERROR
+ TEST_ERROR;
if (found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find modified record in B-tree with 1 record */
find.key = 42;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.val != 43)
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Try again with NULL 'op' */
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, NULL, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.val != (hsize_t)-1)
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index non-existent record in B-tree with 1 record */
H5E_BEGIN_TRY
@@ -3390,17 +3390,17 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index existing record in B-tree with 1 record */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.key != 42)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != 43)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -3411,7 +3411,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/*
* Test inserting second record into v2 B-tree, before all other records
@@ -3419,7 +3419,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
record.key = 34;
record.val = 11;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/*
* Test inserting third record into v2 B-tree, after all other records
@@ -3427,7 +3427,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
record.key = 56;
record.val = 12;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/*
* Test inserting fourth record into v2 B-tree, in the middle of other records
@@ -3435,7 +3435,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
record.key = 38;
record.val = 13;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Attempt to find non-existent record in level-0 B-tree with several records */
/* (Should not be found, but not fail) */
@@ -3443,21 +3443,21 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != (hsize_t)-1)
- TEST_ERROR
+ TEST_ERROR;
if (found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in level-0 B-tree with several records */
find.key = 56;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != 12)
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index non-existent record in B-tree with several records */
H5E_BEGIN_TRY
@@ -3467,41 +3467,41 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index existing record in B-tree with several records */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (find.key != 34)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != 11)
- TEST_ERROR
+ TEST_ERROR;
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, &find) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (find.key != 38)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != 13)
- TEST_ERROR
+ TEST_ERROR;
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)2, index_rec_cb, &find) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (find.key != 42)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != 43)
- TEST_ERROR
+ TEST_ERROR;
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)3, index_rec_cb, &find) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (find.key != 56)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != 12)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -3514,22 +3514,22 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
modify.key = 34;
modify.val = 21;
if (H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
record.key = 38;
modify.key = 38;
modify.val = 23;
if (H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
record.key = 42;
modify.key = 42;
modify.val = 24;
if (H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
record.key = 56;
modify.key = 56;
modify.val = 22;
if (H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Attempt to find non-existent record in level-0 B-tree with several records */
/* (Should not be found, but not fail) */
@@ -3537,21 +3537,21 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != (hsize_t)-1)
- TEST_ERROR
+ TEST_ERROR;
if (found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in level-0 B-tree with several record */
find.key = 56;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != 22)
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index non-existent record in B-tree with several records */
H5E_BEGIN_TRY
@@ -3561,50 +3561,50 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index existing record in B-tree with several records */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (find.key != 34)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != 21)
- TEST_ERROR
+ TEST_ERROR;
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, &find) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (find.key != 38)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != 23)
- TEST_ERROR
+ TEST_ERROR;
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)2, index_rec_cb, &find) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (find.key != 42)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != 24)
- TEST_ERROR
+ TEST_ERROR;
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)3, index_rec_cb, &find) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (find.key != 56)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != 22)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close the file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -3661,61 +3661,61 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert records to fill root leaf node */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC - 1); u++) {
record.key = u + 2;
record.val = u * 2 + 4;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 0;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC_REC - 1);
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = 33;
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert record to split root leaf node */
record.key = INSERT_SPLIT_ROOT_NREC_REC + 1;
record.val = (INSERT_SPLIT_ROOT_NREC_REC - 1) * 2 + 4;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC_REC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = 33;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 2;
idx.val = 4;
if (H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index is correct */
if (idx.key != (INSERT_SPLIT_ROOT_NREC_REC + 2))
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Modify all records */
for (u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
@@ -3723,64 +3723,64 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p
modify.key = u + 2;
modify.val = u * 2 + 5;
if (H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC_REC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = 33;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 2;
idx.val = 5;
if (H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index is correct */
if (idx.key != (INSERT_SPLIT_ROOT_NREC_REC + 2))
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert a couple more records, on the left side of the B-tree */
record.key = 0;
record.val = 1;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
record.key = 1;
record.val = 3;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC_REC + 2);
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = 33;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 0;
idx.val = 1;
if (H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index is correct */
if (idx.key != (INSERT_SPLIT_ROOT_NREC_REC + 2))
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find non-existent record in level-1 B-tree */
/* (Should not be found, but not fail) */
@@ -3788,37 +3788,37 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != (hsize_t)-1)
- TEST_ERROR
+ TEST_ERROR;
if (found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in root of level-1 B-tree */
find.key = 33;
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.key != 33)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != 67)
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in leaf of level-1 B-tree */
find.key = 56;
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.key != 56)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != 113)
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index non-existent record in level-1 B-tree */
H5E_BEGIN_TRY
@@ -3828,45 +3828,45 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index existing record in root of level-1 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)33, index_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.key != 33)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != 67)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index existing record in left leaf of level-1 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.key != 0)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != 1)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index existing record in right leaf of level-1 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)50, index_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.key != 50)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != 101)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -3918,53 +3918,53 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, cons
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 2 leaves */
for (u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1;
record.val = u + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 10;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC_REC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = INSERT_SPLIT_ROOT_NREC_REC;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Force redistribution from left node into right node */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1; u++) {
record.key = u;
record.val = u + 9;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC_REC + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1);
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) + (INSERT_SPLIT_ROOT_NREC_REC / 4);
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
PASSED();
@@ -3976,54 +3976,54 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, cons
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 2 leaves */
for (u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u;
record.val = u + 9;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC_REC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Force redistribution from left node into right node */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1; u++) {
record.key = u + INSERT_SPLIT_ROOT_NREC_REC;
record.val = u + INSERT_SPLIT_ROOT_NREC_REC + 9;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC_REC + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) + (INSERT_SPLIT_ROOT_NREC_REC / 4) - 1;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
PASSED();
@@ -4075,56 +4075,56 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, const bt2
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 2 leaves */
for (u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u + INSERT_SPLIT_ROOT_NREC_REC;
record.val = u + INSERT_SPLIT_ROOT_NREC_REC + 10;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC_REC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = INSERT_SPLIT_ROOT_NREC_REC + (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Force left node to split */
for (u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u;
record.val = u + 10;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = 2 * INSERT_SPLIT_ROOT_NREC_REC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = 31;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = 64;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
PASSED();
@@ -4136,57 +4136,57 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, const bt2
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 2 leaves */
for (u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u;
record.val = u + 10;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC_REC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Force right node to split */
for (u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u + INSERT_SPLIT_ROOT_NREC_REC;
record.val = u + INSERT_SPLIT_ROOT_NREC_REC + 10;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = 2 * INSERT_SPLIT_ROOT_NREC_REC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = 63;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = 95;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
PASSED();
@@ -4241,99 +4241,99 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, cons
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 2 leaves */
for (u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u + (INSERT_SPLIT_ROOT_NREC_REC + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1);
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC_REC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = (2 * INSERT_SPLIT_ROOT_NREC_REC);
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Force left node to split */
for (u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u;
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = 2 * INSERT_SPLIT_ROOT_NREC_REC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = INSERT_SPLIT_ROOT_NREC_REC + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert records to force middle node to redistribute */
for (u = 0; u < ((INSERT_SPLIT_ROOT_NREC_REC / 2) + 1); u++) {
record.key = u + INSERT_SPLIT_ROOT_NREC_REC;
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = (2 * INSERT_SPLIT_ROOT_NREC_REC) + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = 52;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = 107;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 0;
idx.val = 0;
if (H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index is correct */
if (idx.key != ((INSERT_SPLIT_ROOT_NREC_REC * 2) + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
PASSED();
@@ -4387,78 +4387,78 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, const b
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 2 leaves */
for (u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u + (INSERT_SPLIT_ROOT_NREC_REC * 2);
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC_REC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = (2 * INSERT_SPLIT_ROOT_NREC_REC) + (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Force split from left node into right node */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC * 2); u++) {
record.key = u;
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 1;
bt2_stat.nrecords = 3 * INSERT_SPLIT_ROOT_NREC_REC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = 63;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = 95;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = 128;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 0;
idx.val = 0;
if (H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index is correct */
if (idx.key != (INSERT_SPLIT_ROOT_NREC_REC * 3))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- STACK_ERROR
+ STACK_ERROR;
PASSED();
@@ -4511,72 +4511,72 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 2 internal nodes */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC * 9); u++) {
record.key = u + 2; /* Leave a gap for later insertion */
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
for (; u < (INSERT_SPLIT_ROOT_NREC_REC * 41); u++) {
record.key = u + 4; /* Leave a gap for later insertion */
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC_REC * 41);
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = 1347;
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Add some extra records to left-most leaf */
record.key = 0;
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
record.key = 1;
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Add some extra records to middle leaf */
record.key = (INSERT_SPLIT_ROOT_NREC_REC * 9) + 2;
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
record.key = (INSERT_SPLIT_ROOT_NREC_REC * 9) + 3;
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 0;
idx.val = 0;
if (H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index is correct */
if (idx.key != ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 4))
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find non-existent record in level-2 B-tree */
/* (Should not be found, but not fail) */
@@ -4584,59 +4584,59 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != (hsize_t)-1)
- TEST_ERROR
+ TEST_ERROR;
if (found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in root of level-2 B-tree */
find.key = 1347;
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.val != (1347 * 2))
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Check with B-tree */
record.key = 1347;
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in internal node of level-2 B-tree */
find.key = 513;
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.val != (513 * 2))
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Check with B-tree */
record.key = 513;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in leaf of level-2 B-tree */
find.key = 555;
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.val != (555 * 2))
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Check with B-tree */
record.key = 555;
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index non-existent record in level-2 B-tree */
H5E_BEGIN_TRY
@@ -4646,41 +4646,41 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index existing record in root of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)1347, index_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.key != 1347)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != (1347 * 2))
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index existing record in internal node of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)513, index_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.key != 513)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != (513 * 2))
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index existing record in leaf of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.key != 555)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != (555 * 2))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
PASSED();
@@ -4692,68 +4692,68 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 2 internal nodes */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC * 9); u++) {
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 1) - u;
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
for (; u < (INSERT_SPLIT_ROOT_NREC_REC * 41); u++) {
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 1) - (u + 2); /* Leave a gap for later insertion */
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC_REC * 41);
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = 1344;
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Add some extra records to right-most leaf */
record.key = (INSERT_SPLIT_ROOT_NREC_REC * 41) + 2;
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
record.key = (INSERT_SPLIT_ROOT_NREC_REC * 41) + 3;
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Add some extra records to middle leaf */
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) - (INSERT_SPLIT_ROOT_NREC_REC * 9));
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) - (INSERT_SPLIT_ROOT_NREC_REC * 9)) + 1;
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 0;
idx.val = 0;
if (H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index is correct */
if (idx.key != ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 4))
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find non-existent record in level-2 B-tree */
/* (Should not be found, but not fail) */
@@ -4761,59 +4761,59 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != (hsize_t)-1)
- TEST_ERROR
+ TEST_ERROR;
if (found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in root of level-2 B-tree */
find.key = 1344;
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.val != (1344 * 2))
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Check with B-tree */
record.key = 1344;
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in internal node of level-2 B-tree */
find.key = 512;
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.val != (512 * 2))
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Check with B-tree */
record.key = 512;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in leaf of level-2 B-tree */
find.key = 555;
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.val != (555 * 2))
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Check with B-tree */
record.key = 555;
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index non-existent record in level-2 B-tree */
H5E_BEGIN_TRY
@@ -4823,41 +4823,41 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index existing record in root of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)1344, index_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.key != 1344)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != (1344 * 2))
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index existing record in internal node of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)512, index_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.key != 512)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != (512 * 2))
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index existing record in leaf of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.key != 555)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != (555 * 2))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
PASSED();
@@ -4869,78 +4869,78 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert enough records to force root to split into 2 internal nodes */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC * 9); u++) {
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 3) - u;
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
for (; u < (INSERT_SPLIT_ROOT_NREC_REC * 41); u++) {
record.key = u - ((INSERT_SPLIT_ROOT_NREC_REC * 9) - 2); /* Leave a gap for later insertion */
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 2;
bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC_REC * 41);
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = 1345;
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Add some extra records to right-most leaf */
record.key = (INSERT_SPLIT_ROOT_NREC_REC * 41) + 4;
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
record.key = (INSERT_SPLIT_ROOT_NREC_REC * 41) + 5;
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Add some extra records to middle leaf */
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) - (INSERT_SPLIT_ROOT_NREC_REC * 9)) + 2;
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) - (INSERT_SPLIT_ROOT_NREC_REC * 9)) + 3;
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Add some extra records to left-most leaf */
record.key = 0;
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
record.key = 1;
record.val = record.key * 2;
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 0;
idx.val = 0;
if (H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index is correct */
if (idx.key != ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 6))
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find non-existent record in level-2 B-tree */
/* (Should not be found, but not fail) */
@@ -4948,59 +4948,59 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != (hsize_t)-1)
- TEST_ERROR
+ TEST_ERROR;
if (found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in root of level-2 B-tree */
find.key = 1345;
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.val != (1345 * 2))
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Check with B-tree */
record.key = 1345;
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in internal node of level-2 B-tree */
find.key = 513;
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.val != (513 * 2))
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Check with B-tree */
record.key = 513;
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find existent record in leaf of level-2 B-tree */
find.key = 555;
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.val != (555 * 2))
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
/* Check with B-tree */
record.key = 555;
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index non-existent record in level-2 B-tree */
H5E_BEGIN_TRY
@@ -5010,46 +5010,46 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index existing record in level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)1345, index_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.key != 1345)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != (1345 * 2))
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index existing record in internal node of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)513, index_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.key != 513)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != (513 * 2))
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to index existing record in leaf of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
if (H5B2_index(bt2, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.key != 555)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != (555 * 2))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
PASSED();
@@ -5114,7 +5114,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Allocate space for the records */
if (NULL == (records = (H5B2_test_rec_t *)HDmalloc(sizeof(H5B2_test_rec_t) * INSERT_MANY_REC)))
- TEST_ERROR
+ TEST_ERROR;
/* Initialize record #'s */
for (u = 0; u < INSERT_MANY_REC; u++) {
@@ -5135,58 +5135,58 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert random records */
for (u = 0; u < INSERT_MANY_REC; u++) {
record = records[u];
if (H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
bt2_stat.depth = 4;
bt2_stat.nrecords = INSERT_MANY_REC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- STACK_ERROR
+ STACK_ERROR;
file = -1;
/* Re-open the file for the test */
if (reopen_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Re-open v2 B-tree */
if (NULL == (bt2 = H5B2_open(f, bt2_addr, f)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check up on B-tree after re-open */
bt2_stat.depth = 4;
bt2_stat.nrecords = INSERT_MANY_REC;
if (check_stats(bt2, &bt2_stat) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Iterate over B-tree to check records have been inserted correctly */
iter.key = 0;
iter.val = 0;
if (H5B2_iterate(bt2, iter_rec_cb, &iter) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the index is correct */
if (iter.key != INSERT_MANY_REC)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find non-existent record in level-4 B-tree */
/* (Should not be found, but not fail) */
@@ -5194,11 +5194,11 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
find.val = (hsize_t)-1;
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != (hsize_t)-1)
- TEST_ERROR
+ TEST_ERROR;
if (found)
- TEST_ERROR
+ TEST_ERROR;
/* Find random records */
for (u = 0; u < FIND_MANY_REC; u++) {
@@ -5209,11 +5209,11 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Attempt to find existent record in level-4 B-tree */
found = FALSE;
if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.val != (find.key * 2))
- TEST_ERROR
+ TEST_ERROR;
if (!found)
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
/* Attempt to index non-existent record in level-4 B-tree, in increasing & decreasing order */
@@ -5224,7 +5224,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
H5E_BEGIN_TRY
{
ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL);
@@ -5232,7 +5232,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
/* Find random records */
for (u = 0; u < FIND_MANY_REC; u++) {
@@ -5248,11 +5248,11 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Attempt to find existent record in level-4 B-tree */
/* (in increasing order) */
if (H5B2_index(bt2, H5_ITER_INC, idx, index_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.key != idx)
- TEST_ERROR
+ TEST_ERROR;
if (find.val != (find.key * 2))
- TEST_ERROR
+ TEST_ERROR;
/* Reset find record */
find.key = (hsize_t)-1;
@@ -5261,11 +5261,11 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Attempt to find existent record in level-4 B-tree */
/* (in decreasing order) */
if (H5B2_index(bt2, H5_ITER_DEC, idx, index_rec_cb, &find) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (find.key != (INSERT_MANY_REC - (idx + 1)))
- TEST_ERROR
+ TEST_ERROR;
if (find.val != (find.key * 2))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
PASSED();
@@ -5274,30 +5274,30 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
record.key = INSERT_MANY_REC / 2;
modify.key = INSERT_MANY_REC / 2;
modify.val = record.key * 3;
if (H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != INSERT_MANY_REC)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -5350,19 +5350,19 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove a record from a B-tree with no records */
record = 0;
@@ -5373,7 +5373,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -5381,28 +5381,28 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert one record into B-tree */
record = 42;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != 1)
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove a non-existent record from a B-tree with 1 record */
record = 0;
@@ -5413,7 +5413,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -5422,32 +5422,32 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 42;
rrecord = 0;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 42)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the root node has been freed */
if (H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -5456,29 +5456,29 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert several records into B-tree again */
record = 42;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
record = 34;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
record = 56;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
record = 38;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != 4)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -5487,7 +5487,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 0;
H5E_BEGIN_TRY
@@ -5497,7 +5497,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -5506,116 +5506,116 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 42;
rrecord = 0;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 42)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != 3)
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the root node has not been freed */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
record = 34;
rrecord = 0;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 34)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != 2)
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the root node has not been freed */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
record = 56;
rrecord = 0;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 56)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != 1)
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the root node has not been freed */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
record = 38;
rrecord = 0;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 38)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the root node has been freed */
if (H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
PASSED();
@@ -5664,34 +5664,34 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, const bt
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create level-1 B-tree with 3 leaves */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 2))
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove a non-existent record from a B-tree with 1 record */
record = (INSERT_SPLIT_ROOT_NREC * 2) + 1;
@@ -5702,15 +5702,15 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, const bt
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 2))
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -5719,42 +5719,42 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, const bt
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check up on B-tree */
record = 62; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 94; /* Right record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = (INSERT_SPLIT_ROOT_NREC * 2) - 2;
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
rrecord = 0;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != ((INSERT_SPLIT_ROOT_NREC * 2) - 2))
- TEST_ERROR
+ TEST_ERROR;
/* Make certain that the leaf nodes didn't redistribute */
record = 62; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 94; /* Right record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((INSERT_SPLIT_ROOT_NREC * 2) - 1))
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -5763,36 +5763,36 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, const bt
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check up on B-tree */
record = 0;
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
rrecord = 1;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 0)
- TEST_ERROR
+ TEST_ERROR;
/* Make certain that the leaf nodes didn't redistribute */
record = 62; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 94; /* Right record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((INSERT_SPLIT_ROOT_NREC * 2) - 2))
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -5801,45 +5801,45 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, const bt
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check up on B-tree */
record = INSERT_SPLIT_ROOT_NREC;
if (check_node_depth(bt2, &record, (unsigned)0) < 0)
- TEST_ERROR
+ TEST_ERROR;
rrecord = 0;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != INSERT_SPLIT_ROOT_NREC)
- TEST_ERROR
+ TEST_ERROR;
/* Make certain that the leaf nodes didn't redistribute */
record = 62; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 94; /* Right record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((INSERT_SPLIT_ROOT_NREC * 2) - 3))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
PASSED();
@@ -5887,74 +5887,74 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create level-1 B-tree with 3 leaves */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 94; /* Right record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 2))
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove enough records from right leaf of a level-1 B-tree to force redistribution */
for (u = 0; u < 8; u++) {
record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1);
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != ((INSERT_SPLIT_ROOT_NREC * 2) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((INSERT_SPLIT_ROOT_NREC * 2) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 90; /* Right record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -5963,34 +5963,34 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
for (u = 0; u < 39; u++) {
record = u;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != u)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (((INSERT_SPLIT_ROOT_NREC * 2) - 8) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 64; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 90; /* Right record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -5999,43 +5999,43 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
for (u = 0; u < 2; u++) {
record = INSERT_SPLIT_ROOT_NREC + 2 + u;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != (INSERT_SPLIT_ROOT_NREC + 2 + u))
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((((INSERT_SPLIT_ROOT_NREC * 2) - 47)) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 64; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 91; /* Right record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -6083,67 +6083,67 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, const bt
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create level-1 B-tree with 3 leaves */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 2))
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove enough records from right leaf of a level-1 B-tree to force redistribution */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC / 4); u++) {
record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1);
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != ((INSERT_SPLIT_ROOT_NREC * 2) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((INSERT_SPLIT_ROOT_NREC * 2) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
/* Check record values in root of B-tree */
@@ -6151,7 +6151,7 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, const bt
ninfo.nrec = 1;
record = 62; /* Left record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -6160,43 +6160,43 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, const bt
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Fill B-tree back up */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC / 4); u++) {
record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1);
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Remove records */
for (u = 0; u < ((3 * INSERT_SPLIT_ROOT_NREC) / 4) - 1; u++) {
record = u;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != u)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((INSERT_SPLIT_ROOT_NREC * 2) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
/* Check record values in root of B-tree */
@@ -6204,16 +6204,16 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, const bt
ninfo.nrec = 1;
record = 94; /* Left record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -6261,67 +6261,67 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, const bt
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create level-1 B-tree with 3 leaves */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 2))
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove enough records from middle leaf of a level-1 B-tree to force merge */
for (u = 0; u < ((5 * INSERT_SPLIT_ROOT_NREC) / 6) - 1; u++) {
record = ((3 * INSERT_SPLIT_ROOT_NREC) / 2) - (u + 1);
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != (((3 * INSERT_SPLIT_ROOT_NREC) / 2) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((INSERT_SPLIT_ROOT_NREC * 2) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
/* Check record values in root of B-tree */
@@ -6329,16 +6329,16 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, const bt
ninfo.nrec = 1;
record = 37; /* Only record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -6386,88 +6386,88 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, const bt2_te
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create level-1 B-tree with 5 leaves */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC * 4); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 125; /* Center-Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 188; /* Center-Right record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 1;
ninfo.nrec = 4;
record = 220; /* Right-most record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 4))
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove record from root node of a level-1 B-tree to force promotion from right leaf */
record = 220;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 220)
- TEST_ERROR
+ TEST_ERROR;
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 125; /* Center-Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 188; /* Center-Right record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 1;
ninfo.nrec = 4;
record = 221; /* Right-most record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 4) - 1)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -6480,40 +6480,40 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, const bt2_te
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 62;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 62)
- TEST_ERROR
+ TEST_ERROR;
/* Check record values in root of B-tree */
record = 63; /* Left-most record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 125; /* Center-Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 188; /* Center-Right record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 1;
ninfo.nrec = 4;
record = 221; /* Right-most record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 4) - 2)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -6522,49 +6522,49 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, const bt2_te
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 125;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 125)
- TEST_ERROR
+ TEST_ERROR;
/* Check record values in root of B-tree */
record = 63; /* Left-most record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 126; /* Center-Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 188; /* Center-Right record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 1;
ninfo.nrec = 4;
record = 221; /* Right-most record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 4) - 3)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -6613,48 +6613,48 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create level-1 B-tree with 3 leaves */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 2))
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove record from root node of a level-1 B-tree to force promotion from right leaf */
@@ -6663,56 +6663,56 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1);
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != ((INSERT_SPLIT_ROOT_NREC * 2) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((INSERT_SPLIT_ROOT_NREC * 2) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
record = 94;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 94)
- TEST_ERROR
+ TEST_ERROR;
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 1;
ninfo.nrec = 2;
record = 90; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 2) - 8)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -6761,48 +6761,48 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create level-1 B-tree with 3 leaves */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 2))
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove record from root node of a level-1 B-tree to force promotion from middle leaf */
@@ -6811,56 +6811,56 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
record = 63 + u;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != (63 + u))
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((INSERT_SPLIT_ROOT_NREC * 2) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
record = 62;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 62)
- TEST_ERROR
+ TEST_ERROR;
/* Check record values in root of B-tree */
record = 39; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 1;
ninfo.nrec = 2;
record = 86; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 2) - 8)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -6909,48 +6909,48 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create level-1 B-tree with 3 leaves */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 2))
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove record from root node of a level-1 B-tree to force promotion from right leaf */
@@ -6959,53 +6959,53 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1);
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != ((INSERT_SPLIT_ROOT_NREC * 2) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((INSERT_SPLIT_ROOT_NREC * 2) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
record = 87;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 87)
- TEST_ERROR
+ TEST_ERROR;
/* Check record values in root of B-tree */
ninfo.depth = 1;
ninfo.nrec = 1;
record = 62; /* Middle record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 2) - 15)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -7054,48 +7054,48 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create level-2 B-tree with 3 leaves */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
if (check_node_depth(bt2, &record, (unsigned)1) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 2))
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove record from root node of a level-1 B-tree to force promotion from middle leaf */
@@ -7104,53 +7104,53 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
record = ((3 * INSERT_SPLIT_ROOT_NREC) / 2) - (u + 1);
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != (((3 * INSERT_SPLIT_ROOT_NREC) / 2) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((INSERT_SPLIT_ROOT_NREC * 2) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
record = 25;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 25)
- TEST_ERROR
+ TEST_ERROR;
/* Check record values in root of B-tree */
ninfo.depth = 1;
ninfo.nrec = 1;
record = 37; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 2) - 51)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -7198,17 +7198,17 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, const bt2_t
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create level-1 B-tree with 2 leaves */
for (u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check record values in root of B-tree */
@@ -7216,46 +7216,46 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, const bt2_t
ninfo.nrec = 1;
record = 31; /* Middle record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != INSERT_SPLIT_ROOT_NREC)
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove records from B-tree to force a single leaf for the B-tree */
for (u = 0; u < 14; u++) {
record = INSERT_SPLIT_ROOT_NREC - (u + 1);
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != (INSERT_SPLIT_ROOT_NREC - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
/* Check record values in root of B-tree */
@@ -7263,32 +7263,32 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, const bt2_t
ninfo.nrec = (uint16_t)(INSERT_SPLIT_ROOT_NREC - u);
record = 31; /* Middle record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC - u))
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -7336,80 +7336,80 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, const bt2_te
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create level-2 B-tree with 3 internal nodes */
for (u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((INSERT_SPLIT_ROOT_NREC * 59) + 1))
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check information about record in right internal node */
ninfo.depth = 1;
ninfo.nrec = 14;
record = 2960; /* Record in right internal node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove record from right internal node of a level-2 B-tree to force promotion */
record = 2960;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 2960)
- TEST_ERROR
+ TEST_ERROR;
/* Check information about record promoted into right internal node */
ninfo.depth = 1;
ninfo.nrec = 14;
record = 2961; /* Record in right internal node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 59))
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -7418,38 +7418,38 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, const bt2_te
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check information about record in left internal node */
ninfo.depth = 1;
ninfo.nrec = 29;
record = 1133; /* Record in left internal node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1133;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 1133)
- TEST_ERROR
+ TEST_ERROR;
/* Check information about record in left internal node */
ninfo.depth = 1;
ninfo.nrec = 29;
record = 1134; /* Record in left internal node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 59) - 1)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -7458,38 +7458,38 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, const bt2_te
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check information about record in middle internal node */
ninfo.depth = 1;
ninfo.nrec = 14;
record = 2267; /* Record in middle internal node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 2267;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 2267)
- TEST_ERROR
+ TEST_ERROR;
/* Check information about record in middle internal node */
ninfo.depth = 1;
ninfo.nrec = 14;
record = 2268; /* Record in middle internal node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 59) - 2)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -7498,82 +7498,82 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, const bt2_te
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check information about record in root node */
ninfo.depth = 2;
ninfo.nrec = 2;
record = 1889; /* Left record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 1889;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 1889)
- TEST_ERROR
+ TEST_ERROR;
/* Check information about record in root node */
ninfo.depth = 2;
ninfo.nrec = 2;
record = 1890; /* Left record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 59) - 3)
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check information about record in root node */
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
record = 2834;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 2834)
- TEST_ERROR
+ TEST_ERROR;
/* Check information about record in root node */
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2835; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 59) - 4)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -7622,55 +7622,55 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t *
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create level-2 B-tree with 3 internal nodes */
for (u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((INSERT_SPLIT_ROOT_NREC * 59) + 1))
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check status of B-tree */
ninfo.depth = 1;
ninfo.nrec = 14;
record = 3685; /* Right-most record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove record from right internal node of a level-2 B-tree to force promotion
* w/redistribution */
@@ -7678,53 +7678,53 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t *
record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1);
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != (((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
record = 3685;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 3685)
- TEST_ERROR
+ TEST_ERROR;
/* Check status of B-tree */
ninfo.depth = 1;
ninfo.nrec = 14;
record = 3681; /* Right-most record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 59) - 8)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -7773,55 +7773,55 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t *
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create level-2 B-tree with 3 internal nodes */
for (u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((INSERT_SPLIT_ROOT_NREC * 59) + 1))
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check status of B-tree */
ninfo.depth = 1;
ninfo.nrec = 29;
record = 62; /* Left-most record in left node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove record from left internal node of a level-2 B-tree to force promotion
* w/redistribution */
@@ -7829,53 +7829,53 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t *
record = 63 + u;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != (63 + u))
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
record = 62;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 62)
- TEST_ERROR
+ TEST_ERROR;
/* Check status of B-tree */
ninfo.depth = 1;
ninfo.nrec = 29;
record = 49; /* Left-most record in left node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 59) - 38)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -7924,55 +7924,55 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create level-2 B-tree with 3 internal nodes */
for (u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((INSERT_SPLIT_ROOT_NREC * 59) + 1))
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check information about record in right internal node */
ninfo.depth = 1;
ninfo.nrec = 14;
record = 3685; /* Right-most record in right internal node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove record from right internal node of a level-2 B-tree to force promotion
* w/redistribution */
@@ -7980,54 +7980,54 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar
record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1);
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != (((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
/* Force merge by promoting current right-most record */
record = 3678;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 3678)
- TEST_ERROR
+ TEST_ERROR;
/* Check information about record in right internal node */
ninfo.depth = 1;
ninfo.nrec = 13;
record = 3653; /* Right-most record in right internal node (now) */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 59) - 15)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -8076,55 +8076,55 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create level-2 B-tree with 3 internal nodes */
for (u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((INSERT_SPLIT_ROOT_NREC * 59) + 1))
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check information about record in left internal node */
ninfo.depth = 1;
ninfo.nrec = 29;
record = 62; /* Left-most record in left internal node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove record from left internal node of a level-2 B-tree to force promotion
* w/redistribution */
@@ -8132,54 +8132,54 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar
record = 48 + u;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != (48 + u))
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
/* Force merge of left-most internal nodes by promotion */
record = 25;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != 25)
- TEST_ERROR
+ TEST_ERROR;
/* Check information about record in left internal node */
ninfo.depth = 1;
ninfo.nrec = 28;
record = 37; /* Left-most record in left internal node (now) */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_SPLIT_ROOT_NREC * 59) - 112)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -8228,67 +8228,67 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam,
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create level-2 B-tree with 3 internal nodes */
for (u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((INSERT_SPLIT_ROOT_NREC * 59) + 1))
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove records from a level-2 B-tree to force 2 internal nodes to merge */
for (u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 21) + 15); u++) {
record = u;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != u)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
/* Check status of B-tree */
@@ -8296,16 +8296,16 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam,
ninfo.nrec = 1;
record = 2834; /* Middle record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -8354,67 +8354,67 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create level-2 B-tree with 3 internal nodes */
for (u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((INSERT_SPLIT_ROOT_NREC * 59) + 1))
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove records from a level-2 B-tree to force 2 internal nodes to merge */
for (u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 5) + 17); u++) {
record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1);
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != (((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
/* Check status of B-tree */
@@ -8422,16 +8422,16 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam
ninfo.nrec = 1;
record = 1889; /* Middle record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -8479,48 +8479,48 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, cons
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create level-2 B-tree with 3 internal nodes */
for (u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((INSERT_SPLIT_ROOT_NREC * 59) + 1))
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove record from middle internal node of a level-2 B-tree to force promotion
* w/redistribution */
@@ -8528,19 +8528,19 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, cons
record = (INSERT_SPLIT_ROOT_NREC * 20) + u;
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != ((INSERT_SPLIT_ROOT_NREC * 20) + u))
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
/* Check status of B-tree */
@@ -8548,16 +8548,16 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, cons
ninfo.nrec = 1;
record = 1196; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -8606,83 +8606,83 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam, const
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create level-2 B-tree with 3 internal nodes */
for (u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
if (check_node_depth(bt2, &record, (unsigned)2) < 0)
- TEST_ERROR
+ TEST_ERROR;
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != ((INSERT_SPLIT_ROOT_NREC * 59) + 1))
- TEST_ERROR
+ TEST_ERROR;
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (!H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to remove records from a level-2 B-tree to force back to level-1 */
for (u = 0; u < (INSERT_SPLIT_ROOT_NREC * 34) + 17; u++) {
record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1);
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (record != (((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
/* Check up on B-tree */
if (H5B2_stat_info(bt2, &bt2_stat) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (bt2_stat.depth != 1)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -8725,41 +8725,41 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam, had
/* Create the file to work on */
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Get a pointer to the internal file object */
if (NULL == (f = (H5F_t *)H5VL_object(file)))
- STACK_ERROR
+ STACK_ERROR;
/* Ignore metadata tags in the file's cache */
if (H5AC_ignore_tags(f) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert random records */
for (u = 0; u < INSERT_MANY; u++) {
record = records[u];
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
if (H5B2_stat_info(bt2, &bt2_stat) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (bt2_stat.depth != 4)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- STACK_ERROR
+ STACK_ERROR;
return 0;
@@ -8825,7 +8825,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Allocate space for the records */
if (NULL == (records = (hsize_t *)HDmalloc(sizeof(hsize_t) * INSERT_MANY)))
- TEST_ERROR
+ TEST_ERROR;
/* Initialize record #'s */
for (u = 0; u < INSERT_MANY; u++)
@@ -8846,7 +8846,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Generate the v2 B-tree to test */
if (gen_l4_btree2(filename, fapl, cparam, &bt2_addr, records))
- TEST_ERROR
+ TEST_ERROR;
/* Check for VFD which stores data in multiple files */
single_file_vfd = !h5_driver_uses_multiple_files(env_h5_drvr, H5_EXCLUDE_NON_MULTIPART_DRIVERS);
@@ -8855,23 +8855,23 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Open the file just created */
if ((fd = HDopen(filename, O_RDONLY)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Retrieve the file's size */
if (HDfstat(fd, &sb) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Allocate space for the file data */
if (NULL == (file_data = HDmalloc((size_t)sb.st_size)))
- TEST_ERROR
+ TEST_ERROR;
/* Read file's data into memory */
if (HDread(fd, file_data, (size_t)sb.st_size) < (ssize_t)sb.st_size)
- TEST_ERROR
+ TEST_ERROR;
/* Close the file */
if (HDclose(fd) < 0)
- TEST_ERROR
+ TEST_ERROR;
fd = -1;
} /* end if */
@@ -8880,15 +8880,15 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Re-open the file */
if ((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
if (NULL == (f = (H5F_t *)H5VL_object(file)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Ignore metadata tags in the file's cache */
if (H5AC_ignore_tags(f) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Re-shuffle record #'s */
for (u = 0; u < INSERT_MANY; u++) {
@@ -8903,44 +8903,44 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Re-open v2 B-tree */
if (NULL == (bt2 = H5B2_open(f, bt2_addr, f)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Remove all records */
for (u = 0; u < INSERT_MANY; u++) {
record = records[u];
rrecord = HSIZET_MAX;
if (H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != records[u])
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_MANY - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- STACK_ERROR
+ STACK_ERROR;
PASSED();
@@ -8950,21 +8950,21 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Open the file just created */
if ((fd = HDopen(filename, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Write file's data from memory */
if (HDwrite(fd, file_data, (size_t)sb.st_size) < (ssize_t)sb.st_size)
- TEST_ERROR
+ TEST_ERROR;
/* Close the file */
if (HDclose(fd) < 0)
- TEST_ERROR
+ TEST_ERROR;
fd = -1;
} /* end if */
else {
/* Re-generate the v2 B-tree to test */
if (gen_l4_btree2(filename, fapl, cparam, &bt2_addr, records))
- TEST_ERROR
+ TEST_ERROR;
} /* end else */
/* Print banner for this test */
@@ -8972,19 +8972,19 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Re-open the file */
if ((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
if (NULL == (f = (H5F_t *)H5VL_object(file)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Ignore metadata tags in the file's cache */
if (H5AC_ignore_tags(f) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Re-open v2 B-tree */
if (NULL == (bt2 = H5B2_open(f, bt2_addr, f)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Remove all records */
for (u = 0; u < INSERT_MANY; u++) {
@@ -8994,37 +8994,37 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Remove random record */
if (H5B2_remove_by_idx(bt2, H5_ITER_INC, (hsize_t)rem_idx, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord >= INSERT_MANY)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_MANY - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- STACK_ERROR
+ STACK_ERROR;
PASSED();
@@ -9034,21 +9034,21 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Open the file just created */
if ((fd = HDopen(filename, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Write file's data from memory */
if (HDwrite(fd, file_data, (size_t)sb.st_size) < (ssize_t)sb.st_size)
- TEST_ERROR
+ TEST_ERROR;
/* Close the file */
if (HDclose(fd) < 0)
- TEST_ERROR
+ TEST_ERROR;
fd = -1;
} /* end if */
else {
/* Re-generate the v2 B-tree to test */
if (gen_l4_btree2(filename, fapl, cparam, &bt2_addr, records))
- TEST_ERROR
+ TEST_ERROR;
} /* end else */
/* Print banner for this test */
@@ -9057,56 +9057,56 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Re-open the file */
if ((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
if (NULL == (f = (H5F_t *)H5VL_object(file)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Ignore metadata tags in the file's cache */
if (H5AC_ignore_tags(f) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Re-open v2 B-tree */
if (NULL == (bt2 = H5B2_open(f, bt2_addr, f)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Remove all records */
for (u = 0; u < INSERT_MANY; u++) {
/* Remove first record */
rrecord = HSIZET_MAX;
if (H5B2_remove_by_idx(bt2, H5_ITER_INC, (hsize_t)0, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != u)
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_MANY - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- STACK_ERROR
+ STACK_ERROR;
PASSED();
@@ -9116,21 +9116,21 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Open the file just created */
if ((fd = HDopen(filename, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Write file's data from memory */
if (HDwrite(fd, file_data, (size_t)sb.st_size) < (ssize_t)sb.st_size)
- TEST_ERROR
+ TEST_ERROR;
/* Close the file */
if (HDclose(fd) < 0)
- TEST_ERROR
+ TEST_ERROR;
fd = -1;
} /* end if */
else {
/* Re-generate the v2 B-tree to test */
if (gen_l4_btree2(filename, fapl, cparam, &bt2_addr, records))
- TEST_ERROR
+ TEST_ERROR;
} /* end else */
/* Print banner for this test */
@@ -9139,56 +9139,56 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Re-open the file */
if ((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
if (NULL == (f = (H5F_t *)H5VL_object(file)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Ignore metadata tags in the file's cache */
if (H5AC_ignore_tags(f) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Re-open v2 B-tree */
if (NULL == (bt2 = H5B2_open(f, bt2_addr, f)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Remove all records */
for (u = 0; u < INSERT_MANY; u++) {
/* Remove last record */
rrecord = HSIZET_MAX;
if (H5B2_remove_by_idx(bt2, H5_ITER_DEC, (hsize_t)0, remove_cb, &rrecord) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the record value is correct */
if (rrecord != (INSERT_MANY - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
/* Query the number of records in the B-tree */
if (H5B2_get_nrec(bt2, &nrec) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the # of records is correct */
if (nrec != (INSERT_MANY - (u + 1)))
- TEST_ERROR
+ TEST_ERROR;
} /* end for */
/* Query the address of the root node in the B-tree */
if (H5B2__get_root_addr_test(bt2, &root_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Make certain that the address of the root node is defined */
if (H5F_addr_defined(root_addr))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- STACK_ERROR
+ STACK_ERROR;
PASSED();
@@ -9248,7 +9248,7 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param
/* Allocate space for the records */
if (NULL == (records = (hsize_t *)HDmalloc(sizeof(hsize_t) * FIND_NEIGHBOR)))
- TEST_ERROR
+ TEST_ERROR;
/* Initialize record #'s */
for (u = 0; u < FIND_NEIGHBOR; u++)
@@ -9261,17 +9261,17 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert records */
for (u = 0; u < FIND_NEIGHBOR; u++) {
record = records[u];
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Attempt to find record B-tree less than a value */
@@ -9283,65 +9283,65 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
search = 1;
if (H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (record != 0)
- TEST_ERROR
+ TEST_ERROR;
search = 2;
if (H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (record != 0)
- TEST_ERROR
+ TEST_ERROR;
search = 3;
if (H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (record != 2)
- TEST_ERROR
+ TEST_ERROR;
search = 4;
if (H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (record != 2)
- TEST_ERROR
+ TEST_ERROR;
/* Check status of B-tree */
ninfo.depth = 1;
ninfo.nrec = 14;
record = 250; /* Record in left internal node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Neighbor is in internal node */
search = 251;
if (H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (record != 250)
- TEST_ERROR
+ TEST_ERROR;
/* Check status of B-tree */
ninfo.depth = 2;
ninfo.nrec = 1;
record = 1888; /* Record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Neighbor is in root node */
search = 1889;
if (H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (record != 1888)
- TEST_ERROR
+ TEST_ERROR;
search = (FIND_NEIGHBOR * 2) + 1;
if (H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (record != ((FIND_NEIGHBOR - 1) * 2))
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -9352,7 +9352,7 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find record B-tree less than a value */
search = (FIND_NEIGHBOR * 2) + 1;
@@ -9363,67 +9363,67 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
search = 0;
if (H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (record != 2)
- TEST_ERROR
+ TEST_ERROR;
search = 1;
if (H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (record != 2)
- TEST_ERROR
+ TEST_ERROR;
search = 2;
if (H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (record != 4)
- TEST_ERROR
+ TEST_ERROR;
search = 3;
if (H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (record != 4)
- TEST_ERROR
+ TEST_ERROR;
/* Check status of B-tree */
ninfo.depth = 1;
ninfo.nrec = 16;
record = 2896; /* Record in right internal node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Neighbor is in internal node */
search = 2895;
if (H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (record != 2896)
- TEST_ERROR
+ TEST_ERROR;
/* Neighbor is in root node */
search = 1887;
if (H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (record != 1888)
- TEST_ERROR
+ TEST_ERROR;
search = ((FIND_NEIGHBOR - 1) * 2) - 1;
if (H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (record != ((FIND_NEIGHBOR - 1) * 2))
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- STACK_ERROR
+ STACK_ERROR;
PASSED();
@@ -9480,54 +9480,54 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
/* Create the file to work on */
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Close file */
if (H5Fclose(file) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Get the size of an empty file */
if ((empty_size = h5_get_file_size(filename, fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the file to work on */
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Get a pointer to the internal file object */
if (NULL == (f = (H5F_t *)H5VL_object(file)))
- STACK_ERROR
+ STACK_ERROR;
/* Ignore metadata tags in the file's cache */
if (H5AC_ignore_tags(f) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/*
* Delete v2 B-tree
*/
if (H5B2_delete(f, bt2_addr, f, NULL, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Close the file */
if (H5Fclose(file) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Get the size of the file */
if ((file_size = h5_get_file_size(filename, fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Verify the file is correct size */
if (file_size != empty_size)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -9536,55 +9536,55 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
/* Create the file to work on */
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Get a pointer to the internal file object */
if (NULL == (f = (H5F_t *)H5VL_object(file)))
- STACK_ERROR
+ STACK_ERROR;
/* Ignore metadata tags in the file's cache */
if (H5AC_ignore_tags(f) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert records */
for (u = 0; u < DELETE_SMALL; u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
if (H5B2_stat_info(bt2, &bt2_stat) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (bt2_stat.depth != 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/*
* Delete v2 B-tree
*/
if (H5B2_delete(f, bt2_addr, f, NULL, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Close file */
if (H5Fclose(file) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Get the size of the file */
if ((file_size = h5_get_file_size(filename, fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Verify the file is correct size */
if (file_size != empty_size)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -9593,55 +9593,55 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
/* Create the file to work on */
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Get a pointer to the internal file object */
if (NULL == (f = (H5F_t *)H5VL_object(file)))
- STACK_ERROR
+ STACK_ERROR;
/* Ignore metadata tags in the file's cache */
if (H5AC_ignore_tags(f) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert records */
for (u = 0; u < DELETE_MEDIUM; u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
if (H5B2_stat_info(bt2, &bt2_stat) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (bt2_stat.depth != 1)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/*
* Delete v2 B-tree
*/
if (H5B2_delete(f, bt2_addr, f, NULL, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Close file */
if (H5Fclose(file) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Get the size of the file */
if ((file_size = h5_get_file_size(filename, fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Verify the file is correct size */
if (file_size != empty_size)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -9650,55 +9650,55 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
/* Create the file to work on */
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Get a pointer to the internal file object */
if (NULL == (f = (H5F_t *)H5VL_object(file)))
- STACK_ERROR
+ STACK_ERROR;
/* Ignore metadata tags in the file's cache */
if (H5AC_ignore_tags(f) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Insert records */
for (u = 0; u < DELETE_LARGE; u++) {
record = u;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
if (H5B2_stat_info(bt2, &bt2_stat) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (bt2_stat.depth != 2)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/*
* Delete v2 B-tree
*/
if (H5B2_delete(f, bt2_addr, f, NULL, NULL) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Close file */
if (H5Fclose(file) < 0)
- STACK_ERROR
+ STACK_ERROR;
/* Get the size of the file */
if ((file_size = h5_get_file_size(filename, fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Verify the file is correct size */
if (file_size != empty_size)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -9752,24 +9752,24 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
/* Create the file for the test */
if (create_file(&file, &f, fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create level-2 B-tree with 3 internal nodes */
for (u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u * 5;
if (H5B2_insert(bt2, &record) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end for */
/* Check up on B-tree */
if (H5B2_stat_info(bt2, &bt2_stat) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (bt2_stat.depth != 2)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to modify a non-existent record */
record = 3;
@@ -9781,7 +9781,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -9789,38 +9789,38 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check status of B-tree */
ninfo.depth = 0;
ninfo.nrec = 62;
record = 4330; /* Record in leaf node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to modify a record in a leaf node */
record = 4330;
modify = 4331;
if (H5B2_modify(bt2, &record, modify_cb, &modify) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check status of B-tree */
ninfo.depth = 0;
ninfo.nrec = 62;
record = 4331; /* Record in leaf node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find modified record */
record = 4331;
found = 4331;
rec_found = FALSE;
if (H5B2_find(bt2, &record, &rec_found, find_cb, &found) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (found != 4331)
- TEST_ERROR
+ TEST_ERROR;
if (!rec_found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find original record */
record = 4330;
@@ -9832,7 +9832,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -9840,38 +9840,38 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check status of B-tree */
ninfo.depth = 1;
ninfo.nrec = 29;
record = 5350; /* Record in internal node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to modify a record in an internal node */
record = 5350;
modify = 5352;
if (H5B2_modify(bt2, &record, modify_cb, &modify) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check status of B-tree */
ninfo.depth = 1;
ninfo.nrec = 29;
record = 5352; /* Record in internal node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find modified record */
record = 5352;
found = 5352;
rec_found = FALSE;
if (H5B2_find(bt2, &record, &rec_found, find_cb, &found) < 0)
- STACK_ERROR
+ STACK_ERROR;
if (found != 5352)
- TEST_ERROR
+ TEST_ERROR;
if (!rec_found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find original record */
record = 5350;
@@ -9883,7 +9883,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -9891,38 +9891,38 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
/* Check for closing & re-opening the B-tree */
if (reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check status of B-tree */
ninfo.depth = 2;
ninfo.nrec = 2;
record = 9445; /* Record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to modify a record in a root node */
record = 9445;
modify = 9448;
if (H5B2_modify(bt2, &record, modify_cb, &modify) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check status of B-tree */
ninfo.depth = 2;
ninfo.nrec = 2;
record = 9448; /* Record in root node */
if (check_node_info(bt2, record, &ninfo) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find modified record */
record = 9448;
found = 9448;
rec_found = FALSE;
if (H5B2_find(bt2, &record, &rec_found, find_cb, &found) < 0)
- STACK_ERROR
+ STACK_ERROR;
if (found != 9448)
- TEST_ERROR
+ TEST_ERROR;
if (!rec_found)
- TEST_ERROR
+ TEST_ERROR;
/* Attempt to find original record */
record = 9445;
@@ -9934,16 +9934,16 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
- TEST_ERROR
+ TEST_ERROR;
/* Close the v2 B-tree */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close file */
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
@@ -9999,27 +9999,27 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam)
/* Create the file to work on */
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
if (NULL == (f = (H5F_t *)H5VL_object(file)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Ignore metadata tags in the file's cache */
if (H5AC_ignore_tags(f) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Create the v2 B-tree & get its address */
if (create_btree(f, cparam, &bt2, &bt2_addr) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Re-open v2 B-tree */
if (NULL == (bt2_2 = H5B2_open(f, bt2_addr, f)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Close the second v2 B-tree wrapper */
if (H5B2_close(bt2_2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2_2 = NULL;
/* Re-open the file */
@@ -10027,11 +10027,11 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam)
* array is closed)
*/
if ((file0 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Close the first v2 B-tree wrapper */
if (H5B2_close(bt2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2 = NULL;
/* Close the file */
@@ -10039,7 +10039,7 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam)
* shared file information)
*/
if (H5Fclose(file) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
file = -1;
/* Open a different file */
@@ -10049,34 +10049,34 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam)
*/
h5_fixname(FILENAME[1], fapl, filename_tmp, sizeof(filename_tmp));
if ((file00 = H5Fcreate(filename_tmp, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Re-open the file with the v2 B-tree array */
if ((file2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
if (NULL == (f2 = (H5F_t *)H5VL_object(file2)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Open the B-tree through the second file handle */
if (NULL == (bt2_2 = H5B2_open(f2, bt2_addr, f2)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Close the extra file handles */
if (H5Fclose(file0) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Fclose(file00) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Close the second v2 B-tree */
if (H5B2_close(bt2_2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
bt2_2 = NULL;
/* Close file */
if (H5Fclose(file2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* All tests passed */
PASSED();
@@ -10147,7 +10147,7 @@ main(void)
/* Push API context */
if (H5CX_push() < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
api_ctx_pushed = TRUE;
/* Loop over re-opening B-tree during tests */
@@ -10240,7 +10240,7 @@ main(void)
/* Pop API context */
if (api_ctx_pushed && H5CX_pop(FALSE) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
api_ctx_pushed = FALSE;
if (nerrors)