summaryrefslogtreecommitdiffstats
path: root/test/btree2.c
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2021-04-01 20:14:21 (GMT)
committerGitHub <noreply@github.com>2021-04-01 20:14:21 (GMT)
commit87d18137ceed7eae1ca7009dda6f4cf2841ff195 (patch)
tree291983f4bc5f9230bf53564e8555272319d382aa /test/btree2.c
parentdf75d35cc5295b03dc305ca7e5495fece5737d30 (diff)
downloadhdf5-87d18137ceed7eae1ca7009dda6f4cf2841ff195.zip
hdf5-87d18137ceed7eae1ca7009dda6f4cf2841ff195.tar.gz
hdf5-87d18137ceed7eae1ca7009dda6f4cf2841ff195.tar.bz2
Hdf5 merge issue 487 v110 (#533)
* Cleans up a couple of MSVC warnings in testhdf5 (#475) * Fixes a few testhdf5 warnings raised in Visual Studio Visual Studio is grumpier about treating pointers like integers than gcc. * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Fix typos and grammar errors. (#476) * Suppresses the tcheck_version test's abort dialog on Windows (#477) * Suppresses the tcheck_version test's abort dialog on Windows Windows raises a modal abort/retry/ignore dialog box when CRT calls abort(). This change installs a report hook that suppresses the dialog so that the CMake tests don't time out waiting for a nonexistent user to click a dialog box. * Committing clang-format changes * Removes __cdecl from callback Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Committing clang-format changes Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: H. Joe Lee <hyoklee@hdfgroup.org>
Diffstat (limited to 'test/btree2.c')
-rw-r--r--test/btree2.c115
1 files changed, 92 insertions, 23 deletions
diff --git a/test/btree2.c b/test/btree2.c
index 4a9a062..58c45e2 100644
--- a/test/btree2.c
+++ b/test/btree2.c
@@ -672,7 +672,10 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Attempt to index record in B-tree with no records */
idx = 0;
- H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -715,7 +718,10 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Attempt to index non-existant record in B-tree with 1 record */
idx = 0;
- H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, find_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, find_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -771,7 +777,10 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Attempt to index non-existant record in B-tree with several records */
idx = 0;
- H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, find_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, find_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -3068,12 +3077,18 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
} /* end for */
/* Attempt to index non-existant record in level-4 B-tree, in increasing & decreasing order */
- H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY * 3), find_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY * 3), find_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
TEST_ERROR
- H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY * 3), find_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY * 3), find_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -3104,7 +3119,10 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
TEST_ERROR
record = INSERT_MANY / 2;
- H5E_BEGIN_TRY { ret = H5B2_insert(bt2, &record); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_insert(bt2, &record);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -3223,7 +3241,10 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
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); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -3285,7 +3306,10 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
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); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -3353,7 +3377,10 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
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); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -3438,7 +3465,10 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
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); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -5044,12 +5074,18 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
} /* end for */
/* Attempt to index non-existant record in level-4 B-tree, in increasing & decreasing order */
- H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
TEST_ERROR
- H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -5187,7 +5223,10 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Attempt to remove a record from a B-tree with no records */
record = 0;
- H5E_BEGIN_TRY { ret = H5B2_remove(bt2, &record, NULL, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_remove(bt2, &record, NULL, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -5224,7 +5263,10 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Attempt to remove a non-existant record from a B-tree with 1 record */
record = 0;
- H5E_BEGIN_TRY { ret = H5B2_remove(bt2, &record, NULL, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_remove(bt2, &record, NULL, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -5305,7 +5347,10 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
TEST_ERROR
record = 0;
- H5E_BEGIN_TRY { ret = H5B2_remove(bt2, &record, NULL, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_remove(bt2, &record, NULL, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -5507,7 +5552,10 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, const bt
/* Attempt to remove a non-existant record from a B-tree with 1 record */
record = (INSERT_SPLIT_ROOT_NREC * 2) + 1;
- H5E_BEGIN_TRY { ret = H5B2_remove(bt2, &record, NULL, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_remove(bt2, &record, NULL, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -9086,7 +9134,10 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param
/* Attempt to find record B-tree less than a value */
search = 0;
- H5E_BEGIN_TRY { ret = H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -9163,7 +9214,10 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param
/* Attempt to find record B-tree less than a value */
search = (FIND_NEIGHBOR * 2) + 1;
- H5E_BEGIN_TRY { ret = H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -9577,7 +9631,10 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
/* Attempt to modify a non-existant record */
record = 3;
modify = 4;
- H5E_BEGIN_TRY { ret = H5B2_modify(bt2, &record, modify_cb, &modify); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_modify(bt2, &record, modify_cb, &modify);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -9622,7 +9679,10 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
/* Attempt to find original record */
record = 4330;
found = HSIZET_MAX;
- H5E_BEGIN_TRY { ret = H5B2_modify(bt2, &record, modify_cb, &modify); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_modify(bt2, &record, modify_cb, &modify);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -9667,7 +9727,10 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
/* Attempt to find original record */
record = 5350;
found = 5350;
- H5E_BEGIN_TRY { ret = H5B2_modify(bt2, &record, modify_cb, &modify); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_modify(bt2, &record, modify_cb, &modify);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -9712,7 +9775,10 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
/* Attempt to find original record */
record = 9445;
found = 9445;
- H5E_BEGIN_TRY { ret = H5B2_modify(bt2, &record, modify_cb, &modify); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_modify(bt2, &record, modify_cb, &modify);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -10032,7 +10098,10 @@ main(void)
error:
puts("*** TESTS FAILED ***");
- H5E_BEGIN_TRY { H5Pclose(fapl); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(fapl);
+ }
H5E_END_TRY;
if (api_ctx_pushed)