summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJacob Smith <jake.smith@hdfgroup.org>2018-12-20 17:12:53 (GMT)
committerJacob Smith <jake.smith@hdfgroup.org>2018-12-20 17:12:53 (GMT)
commit210ab507256c8b70aac4fee1f4bef1ca25570814 (patch)
tree51fc4529712528210fd8aebcaf5cafb5a11de5c3 /test
parent38de07aea3c824e1fc332e7c03c20e1d0711ecb1 (diff)
downloadhdf5-210ab507256c8b70aac4fee1f4bef1ca25570814.zip
hdf5-210ab507256c8b70aac4fee1f4bef1ca25570814.tar.gz
hdf5-210ab507256c8b70aac4fee1f4bef1ca25570814.tar.bz2
Fix mistake with H5E_BEGIN_TRY {...} H5E_END_TRY block containing ERROR-raising macros.
Formatting tweaks.
Diffstat (limited to 'test')
-rw-r--r--test/dsets.c41
-rw-r--r--test/links.c2
2 files changed, 27 insertions, 16 deletions
diff --git a/test/dsets.c b/test/dsets.c
index b2cc84e..e63878c 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -13063,6 +13063,7 @@ test_object_header_minimization_dcpl(void)
hid_t file_id = -1;
char filename[FILENAME_BUF_SIZE] = "";
hbool_t minimize = FALSE;
+ herr_t ret;
TESTING("dcpl flags to minimize dataset object header");
@@ -13087,25 +13088,25 @@ test_object_header_minimization_dcpl(void)
/* default value (not set explicitly)
*/
- if (FAIL == H5Pget_dset_no_attrs_hint(dcpl_id, &minimize))
+ if (H5Pget_dset_no_attrs_hint(dcpl_id, &minimize) == FAIL)
FAIL_PUTS_ERROR("unable to get minimize value\n");
if (FALSE != minimize)
FAIL_PUTS_ERROR("Expected FALSE default but was not!\n");
/* FALSE-set value
*/
- if (FAIL == H5Pset_dset_no_attrs_hint(dcpl_id, FALSE))
+ if (H5Pset_dset_no_attrs_hint(dcpl_id, FALSE) == FAIL)
FAIL_PUTS_ERROR("unable to set minimize value to FALSE\n");
- if (FAIL == H5Pget_dset_no_attrs_hint(dcpl_id, &minimize))
+ if (H5Pget_dset_no_attrs_hint(dcpl_id, &minimize) == FAIL)
FAIL_PUTS_ERROR("unable to get minimize value\n");
if (FALSE != minimize)
FAIL_PUTS_ERROR("Expected FALSE default but was not!\n");
/* TRUE-set value
*/
- if (FAIL == H5Pset_dset_no_attrs_hint(dcpl_id, TRUE))
+ if (H5Pset_dset_no_attrs_hint(dcpl_id, TRUE) == FAIL)
FAIL_PUTS_ERROR("unable to set minimize value to TRUE\n");
- if (FAIL == H5Pget_dset_no_attrs_hint(dcpl_id, &minimize))
+ if (H5Pget_dset_no_attrs_hint(dcpl_id, &minimize) == FAIL)
FAIL_PUTS_ERROR("unable to get minimize value\n");
if (TRUE != minimize)
FAIL_PUTS_ERROR("Expected TRUE default but was not!\n");
@@ -13113,27 +13114,37 @@ test_object_header_minimization_dcpl(void)
/* error cases
*/
H5E_BEGIN_TRY {
- if (SUCCEED == H5Pget_dset_no_attrs_hint(-1, &minimize))
- FAIL_PUTS_ERROR("Invalid DCPL ID should fail\n");
+ ret = H5Pget_dset_no_attrs_hint(-1, &minimize);
+ } H5E_END_TRY;
+ if (ret == SUCCEED)
+ FAIL_PUTS_ERROR("Invalid DCPL ID should fail\n");
- if (SUCCEED == H5Pset_dset_no_attrs_hint(-1, FALSE))
- FAIL_PUTS_ERROR("Invalid DCPL ID should fail\n");
+ H5E_BEGIN_TRY {
+ ret = H5Pset_dset_no_attrs_hint(-1, FALSE);
+ } H5E_END_TRY;
+ if (ret == SUCCEED)
+ FAIL_PUTS_ERROR("Invalid DCPL ID should fail\n");
- if (SUCCEED == H5Pset_dset_no_attrs_hint(-1, TRUE))
- FAIL_PUTS_ERROR("Invalid DCPL ID should fail\n");
+ H5E_BEGIN_TRY {
+ ret = H5Pset_dset_no_attrs_hint(-1, TRUE);
+ } H5E_END_TRY;
+ if (ret == SUCCEED)
+ FAIL_PUTS_ERROR("Invalid DCPL ID should fail\n");
- if (SUCCEED == H5Pget_dset_no_attrs_hint(dcpl_id, NULL))
- FAIL_PUTS_ERROR("NULL out pointer should fail\n");
+ H5E_BEGIN_TRY {
+ ret = H5Pget_dset_no_attrs_hint(dcpl_id, NULL);
} H5E_END_TRY;
+ if (ret == SUCCEED)
+ FAIL_PUTS_ERROR("NULL out pointer should fail\n");
/************/
/* TEARDOWN */
/************/
- if (FAIL == H5Fclose(file_id))
+ if (H5Fclose(file_id) == FAIL)
FAIL_PUTS_ERROR("can't close FILE");
- if (FAIL == H5Pclose(dcpl_id))
+ if (H5Pclose(dcpl_id) == FAIL)
FAIL_PUTS_ERROR("unable to close DCPL\n");
PASSED();
diff --git a/test/links.c b/test/links.c
index 5038349..4951038 100644
--- a/test/links.c
+++ b/test/links.c
@@ -15086,7 +15086,7 @@ main(void)
nerrors += group_info_old(fapl) < 0 ? 1 : 0;
if (minimize_dset_oh) {
- if (0 > H5Pclose(dcpl_g))
+ if (H5Pclose(dcpl_g) < 0)
TEST_ERROR;
dcpl_g = -1;
}