summaryrefslogtreecommitdiffstats
path: root/test/btree2.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/btree2.c')
-rw-r--r--test/btree2.c287
1 files changed, 220 insertions, 67 deletions
diff --git a/test/btree2.c b/test/btree2.c
index 613d8d5..21b821b 100644
--- a/test/btree2.c
+++ b/test/btree2.c
@@ -631,6 +631,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
hsize_t idx; /* Index within B-tree, for iterator */
+ hbool_t found; /* Whether record was found */
herr_t ret; /* Generic error return value */
/*
@@ -666,8 +667,11 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
TEST_ERROR
/* Attempt to find record in B-tree with no records */
- idx = 0;
- if (H5B2_find(bt2, &idx, find_cb, NULL) != FALSE)
+ idx = 0;
+ found = FALSE;
+ if (H5B2_find(bt2, &idx, &found, find_cb, NULL) < 0)
+ TEST_ERROR
+ if (found)
TEST_ERROR
/* Attempt to index record in B-tree with no records */
@@ -695,22 +699,34 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Attempt to find non-existant record in B-tree with 1 record */
/* (Should not be found, but not fail) */
- idx = 41;
- if (H5B2_find(bt2, &idx, find_cb, &idx) != FALSE)
+ idx = 41;
+ found = FALSE;
+ if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
+ TEST_ERROR
+ if (found)
TEST_ERROR
/* Try again with NULL 'op' */
/* (Should not be found, but not fail) */
- if (H5B2_find(bt2, &idx, NULL, NULL) != FALSE)
+ found = FALSE;
+ if (H5B2_find(bt2, &idx, &found, NULL, NULL) < 0)
+ TEST_ERROR
+ if (found)
TEST_ERROR
/* Attempt to find existant record in B-tree with 1 record */
- idx = 42;
- if (H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
+ idx = 42;
+ found = FALSE;
+ if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
+ TEST_ERROR
+ if (!found)
TEST_ERROR
/* Try again with NULL 'op' */
- if (H5B2_find(bt2, &idx, NULL, NULL) != TRUE)
+ found = FALSE;
+ if (H5B2_find(bt2, &idx, &found, NULL, NULL) < 0)
+ TEST_ERROR
+ if (!found)
TEST_ERROR
/* Attempt to index non-existant record in B-tree with 1 record */
@@ -760,13 +776,19 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Attempt to find non-existant record in level-0 B-tree with several records */
/* (Should not be found, but not fail) */
- idx = 41;
- if (H5B2_find(bt2, &idx, find_cb, &idx) != FALSE)
+ idx = 41;
+ found = FALSE;
+ if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
+ TEST_ERROR
+ if (found)
TEST_ERROR
/* Attempt to find existant record in level-0 B-tree with several record */
- idx = 56;
- if (H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
+ idx = 56;
+ found = FALSE;
+ if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
+ TEST_ERROR
+ if (!found)
TEST_ERROR
/* Attempt to index non-existant record in B-tree with several records */
@@ -843,6 +865,7 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p
hsize_t idx; /* Index within B-tree, for iterator */
H5B2_stat_t bt2_stat; /* Statistics about B-tree created */
unsigned u; /* Local index variable */
+ hbool_t found; /* Whether record was found */
herr_t ret; /* Generic error return value */
/*
@@ -928,19 +951,28 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p
/* Attempt to find non-existant record in level-1 B-tree */
/* (Should not be found, but not fail) */
- idx = INSERT_SPLIT_ROOT_NREC + 10;
- if (H5B2_find(bt2, &idx, find_cb, &idx) != FALSE)
+ idx = INSERT_SPLIT_ROOT_NREC + 10;
+ found = FALSE;
+ if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
+ TEST_ERROR
+ if (found)
TEST_ERROR
/* Attempt to find existant record in root of level-1 B-tree */
- idx = 33;
- if (H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
+ idx = 33;
+ found = FALSE;
+ if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
FAIL_STACK_ERROR
+ if (!found)
+ TEST_ERROR
/* Attempt to find existant record in leaf of level-1 B-tree */
- idx = 56;
- if (H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
+ idx = 56;
+ found = FALSE;
+ if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
FAIL_STACK_ERROR
+ if (!found)
+ TEST_ERROR
/* Attempt to index non-existant record in level-1 B-tree */
idx = 0;
@@ -1593,6 +1625,7 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
H5B2_stat_t bt2_stat; /* Statistics about B-tree created */
hsize_t idx; /* Index within B-tree, for iterator */
unsigned u; /* Local index variable */
+ hbool_t found; /* Whether record was found */
herr_t ret; /* Generic error return value */
/*
@@ -1664,14 +1697,20 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
/* Attempt to find non-existant record in level-2 B-tree */
/* (Should not be found, but not fail) */
- idx = INSERT_SPLIT_ROOT_NREC * 30;
- if (H5B2_find(bt2, &idx, find_cb, &idx) != FALSE)
+ idx = INSERT_SPLIT_ROOT_NREC * 30;
+ found = FALSE;
+ if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
+ TEST_ERROR
+ if (found)
TEST_ERROR
/* Attempt to find existant record in root of level-2 B-tree */
- idx = 948;
- if (H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
+ idx = 948;
+ found = FALSE;
+ if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
FAIL_STACK_ERROR
+ if (!found)
+ TEST_ERROR
/* Check with B-tree */
record = 948;
@@ -1679,9 +1718,12 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
TEST_ERROR
/* Attempt to find existant record in internal node of level-2 B-tree */
- idx = 505;
- if (H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
+ idx = 505;
+ found = FALSE;
+ if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
FAIL_STACK_ERROR
+ if (!found)
+ TEST_ERROR
/* Check with B-tree */
record = 505;
@@ -1689,9 +1731,12 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
TEST_ERROR
/* Attempt to find existant record in leaf of level-2 B-tree */
- idx = 555;
- if (H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
+ idx = 555;
+ found = FALSE;
+ if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
FAIL_STACK_ERROR
+ if (!found)
+ TEST_ERROR
/* Check with B-tree */
record = 555;
@@ -2948,6 +2993,7 @@ test_insert_lots(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t
hsize_t temp_rec; /* Temporary record */
H5B2_stat_t bt2_stat; /* Statistics about B-tree created */
hsize_t nrec; /* Number of records in B-tree */
+ hbool_t found; /* Whether record was found */
herr_t ret; /* Generic error return value */
/* Initialize random number seed */
@@ -3053,8 +3099,11 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
/* Attempt to find non-existant record in level-4 B-tree */
/* (Should not be found, but not fail) */
- idx = INSERT_MANY * 2;
- if (H5B2_find(bt2, &idx, find_cb, &idx) != FALSE)
+ idx = INSERT_MANY * 2;
+ found = FALSE;
+ if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
+ TEST_ERROR
+ if (found)
TEST_ERROR
/* Find random records */
@@ -3063,8 +3112,11 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
idx = (hsize_t)(HDrandom() % INSERT_MANY);
/* Attempt to find existant record in root of level-4 B-tree */
- if (H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
+ found = FALSE;
+ if (H5B2_find(bt2, &idx, &found, find_cb, &idx) < 0)
FAIL_STACK_ERROR
+ if (!found)
+ TEST_ERROR
} /* end for */
/* Attempt to index non-existant record in level-4 B-tree, in increasing & decreasing order */
@@ -3168,6 +3220,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
H5B2_test_rec_t record; /* Record to insert into tree */
H5B2_test_rec_t modify; /* Modified value */
H5B2_test_rec_t find; /* Record to find */
+ hbool_t found; /* Whether record was found */
herr_t ret; /* Generic error return value */
/* Create the file for the test */
@@ -3196,31 +3249,43 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* (Should not be found, but not fail) */
find.key = 10;
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if (find.val != (hsize_t)-1)
TEST_ERROR
+ if (found)
+ TEST_ERROR
/* Try again with NULL 'op' */
/* (Should not be found, but not fail) */
- if (H5B2_find(bt2, &find, NULL, NULL) != FALSE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, NULL, NULL) < 0)
FAIL_STACK_ERROR
if (find.val != (hsize_t)-1)
TEST_ERROR
+ if (found)
+ TEST_ERROR
/* Attempt to find existant record in B-tree with 1 record */
find.key = 42;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if (find.val != 72)
TEST_ERROR
+ if (!found)
+ TEST_ERROR
/* Try again with NULL 'op' */
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, NULL, NULL) != TRUE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, NULL, NULL) < 0)
FAIL_STACK_ERROR
if (find.val != (hsize_t)-1)
TEST_ERROR
+ if (!found)
+ TEST_ERROR
/* Attempt to index non-existant record in B-tree with 1 record */
H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL); }
@@ -3258,31 +3323,43 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* (Should not be found, but not fail) */
find.key = 10;
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if (find.val != (hsize_t)-1)
TEST_ERROR
+ if (found)
+ TEST_ERROR
/* Try again with NULL 'op' */
/* (Should not be found, but not fail) */
- if (H5B2_find(bt2, &find, NULL, NULL) != FALSE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, NULL, NULL) < 0)
FAIL_STACK_ERROR
if (find.val != (hsize_t)-1)
TEST_ERROR
+ if (found)
+ TEST_ERROR
/* Attempt to find modified record in B-tree with 1 record */
find.key = 42;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if (find.val != 43)
TEST_ERROR
+ if (!found)
+ TEST_ERROR
/* Try again with NULL 'op' */
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, NULL, NULL) != TRUE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, NULL, NULL) < 0)
FAIL_STACK_ERROR
if (find.val != (hsize_t)-1)
TEST_ERROR
+ if (!found)
+ TEST_ERROR
/* Attempt to index non-existant record in B-tree with 1 record */
H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL); }
@@ -3340,17 +3417,23 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* (Should not be found, but not fail) */
find.key = 10;
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
TEST_ERROR
if (find.val != (hsize_t)-1)
TEST_ERROR
+ if (found)
+ TEST_ERROR
/* Attempt to find existant record in level-0 B-tree with several records */
find.key = 56;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
TEST_ERROR
if (find.val != 12)
TEST_ERROR
+ if (!found)
+ TEST_ERROR
/* Attempt to index non-existant record in B-tree with several records */
H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL); }
@@ -3425,17 +3508,23 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* (Should not be found, but not fail) */
find.key = 41;
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
TEST_ERROR
if (find.val != (hsize_t)-1)
TEST_ERROR
+ if (found)
+ TEST_ERROR
/* Attempt to find existant record in level-0 B-tree with several record */
find.key = 56;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
TEST_ERROR
if (find.val != 22)
TEST_ERROR
+ if (!found)
+ TEST_ERROR
/* Attempt to index non-existant record in B-tree with several records */
H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL); }
@@ -3532,6 +3621,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p
H5B2_test_rec_t idx; /* Index within B-tree, for iterator */
H5B2_stat_t bt2_stat; /* Statistics about B-tree created */
unsigned u; /* Local index variable */
+ hbool_t found; /* Whether record was found */
herr_t ret; /* Generic error return value */
/*
@@ -3666,30 +3756,39 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p
/* (Should not be found, but not fail) */
find.key = 800;
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
TEST_ERROR
if (find.val != (hsize_t)-1)
TEST_ERROR
+ if (found)
+ TEST_ERROR
/* Attempt to find existant record in root of level-1 B-tree */
find.key = 33;
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if (find.key != 33)
TEST_ERROR
if (find.val != 67)
TEST_ERROR
+ if (!found)
+ TEST_ERROR
/* Attempt to find existant record in leaf of level-1 B-tree */
find.key = 56;
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if (find.key != 56)
TEST_ERROR
if (find.val != 113)
TEST_ERROR
+ if (!found)
+ TEST_ERROR
/* Attempt to index non-existant record in level-1 B-tree */
H5E_BEGIN_TRY
@@ -4372,6 +4471,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
H5B2_test_rec_t idx; /* Index within B-tree, for iterator */
H5B2_stat_t bt2_stat; /* Statistics about B-tree created */
unsigned u; /* Local index variable */
+ hbool_t found; /* Whether record was found */
herr_t ret; /* Generic error return value */
/*
@@ -4452,18 +4552,24 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
/* (Should not be found, but not fail) */
find.key = INSERT_SPLIT_ROOT_NREC_REC * 42;
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
TEST_ERROR
if (find.val != (hsize_t)-1)
TEST_ERROR
+ if (found)
+ TEST_ERROR
/* Attempt to find existant record in root of level-2 B-tree */
find.key = 1347;
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if (find.val != (1347 * 2))
TEST_ERROR
+ if (!found)
+ TEST_ERROR
/* Check with B-tree */
record.key = 1347;
@@ -4473,10 +4579,13 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
/* Attempt to find existant record in internal node of level-2 B-tree */
find.key = 513;
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if (find.val != (513 * 2))
TEST_ERROR
+ if (!found)
+ TEST_ERROR
/* Check with B-tree */
record.key = 513;
@@ -4486,10 +4595,13 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
/* Attempt to find existant record in leaf of level-2 B-tree */
find.key = 555;
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if (find.val != (555 * 2))
TEST_ERROR
+ if (!found)
+ TEST_ERROR
/* Check with B-tree */
record.key = 555;
@@ -4617,18 +4729,24 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
/* (Should not be found, but not fail) */
find.key = INSERT_SPLIT_ROOT_NREC_REC * 42;
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
TEST_ERROR
if (find.val != (hsize_t)-1)
TEST_ERROR
+ if (found)
+ TEST_ERROR
/* Attempt to find existant record in root of level-2 B-tree */
find.key = 1344;
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if (find.val != (1344 * 2))
TEST_ERROR
+ if (!found)
+ TEST_ERROR
/* Check with B-tree */
record.key = 1344;
@@ -4638,10 +4756,13 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
/* Attempt to find existant record in internal node of level-2 B-tree */
find.key = 512;
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if (find.val != (512 * 2))
TEST_ERROR
+ if (!found)
+ TEST_ERROR
/* Check with B-tree */
record.key = 512;
@@ -4651,10 +4772,13 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
/* Attempt to find existant record in leaf of level-2 B-tree */
find.key = 555;
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if (find.val != (555 * 2))
TEST_ERROR
+ if (!found)
+ TEST_ERROR
/* Check with B-tree */
record.key = 555;
@@ -4792,18 +4916,24 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
/* (Should not be found, but not fail) */
find.key = INSERT_SPLIT_ROOT_NREC_REC * 42;
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
TEST_ERROR
if (find.val != (hsize_t)-1)
TEST_ERROR
+ if (found)
+ TEST_ERROR
/* Attempt to find existant record in root of level-2 B-tree */
find.key = 1345;
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if (find.val != (1345 * 2))
TEST_ERROR
+ if (!found)
+ TEST_ERROR
/* Check with B-tree */
record.key = 1345;
@@ -4813,10 +4943,13 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
/* Attempt to find existant record in internal node of level-2 B-tree */
find.key = 513;
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if (find.val != (513 * 2))
TEST_ERROR
+ if (!found)
+ TEST_ERROR
/* Check with B-tree */
record.key = 513;
@@ -4826,10 +4959,13 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_
/* Attempt to find existant record in leaf of level-2 B-tree */
find.key = 555;
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if (find.val != (555 * 2))
TEST_ERROR
+ if (!found)
+ TEST_ERROR
/* Check with B-tree */
record.key = 555;
@@ -4930,6 +5066,7 @@ test_update_lots(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t
H5B2_stat_t bt2_stat; /* Statistics about B-tree created */
hsize_t nrec; /* Number of records in B-tree */
unsigned u; /* Local index variable */
+ hbool_t found; /* Whether record was found */
herr_t ret; /* Generic error return value */
/* Initialize random number seed */
@@ -5025,10 +5162,13 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* (Should not be found, but not fail) */
find.key = INSERT_MANY_REC * 2;
find.val = (hsize_t)-1;
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
TEST_ERROR
if (find.val != (hsize_t)-1)
TEST_ERROR
+ if (found)
+ TEST_ERROR
/* Find random records */
for (u = 0; u < FIND_MANY_REC; u++) {
@@ -5037,10 +5177,13 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
find.val = (hsize_t)-1;
/* Attempt to find existant record in level-4 B-tree */
- if (H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
+ found = FALSE;
+ if (H5B2_find(bt2, &find, &found, find_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if (find.val != (find.key * 2))
TEST_ERROR
+ if (!found)
+ TEST_ERROR
} /* end for */
/* Attempt to index non-existant record in level-4 B-tree, in increasing & decreasing order */
@@ -9546,6 +9689,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
H5B2_stat_t bt2_stat; /* Statistics about B-tree created */
H5B2_node_info_test_t ninfo; /* B-tree node info */
unsigned u; /* Local index variable */
+ hbool_t rec_found; /* Whether record was found */
herr_t ret; /* Generic error return value */
/*
@@ -9612,12 +9756,15 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
TEST_ERROR
/* Attempt to find modified record */
- record = 4331;
- found = 4331;
- if (H5B2_find(bt2, &record, find_cb, &found) != TRUE)
+ record = 4331;
+ found = 4331;
+ rec_found = FALSE;
+ if (H5B2_find(bt2, &record, &rec_found, find_cb, &found) < 0)
FAIL_STACK_ERROR
if (found != 4331)
TEST_ERROR
+ if (!rec_found)
+ TEST_ERROR
/* Attempt to find original record */
record = 4330;
@@ -9657,12 +9804,15 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
TEST_ERROR
/* Attempt to find modified record */
- record = 5352;
- found = 5352;
- if (H5B2_find(bt2, &record, find_cb, &found) != TRUE)
+ record = 5352;
+ found = 5352;
+ rec_found = FALSE;
+ if (H5B2_find(bt2, &record, &rec_found, find_cb, &found) < 0)
STACK_ERROR
if (found != 5352)
TEST_ERROR
+ if (!rec_found)
+ TEST_ERROR
/* Attempt to find original record */
record = 5350;
@@ -9702,12 +9852,15 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
TEST_ERROR
/* Attempt to find modified record */
- record = 9448;
- found = 9448;
- if (H5B2_find(bt2, &record, find_cb, &found) != TRUE)
+ record = 9448;
+ found = 9448;
+ rec_found = FALSE;
+ if (H5B2_find(bt2, &record, &rec_found, find_cb, &found) < 0)
STACK_ERROR
if (found != 9448)
TEST_ERROR
+ if (!rec_found)
+ TEST_ERROR
/* Attempt to find original record */
record = 9445;