summaryrefslogtreecommitdiffstats
path: root/test/error_test.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/error_test.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/error_test.c')
-rw-r--r--test/error_test.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/test/error_test.c b/test/error_test.c
index 9ac76dd..c546948 100644
--- a/test/error_test.c
+++ b/test/error_test.c
@@ -186,9 +186,9 @@ init_error(void)
H5E_type_t msg_type;
if (NULL == (cls_name = (char *)HDmalloc(HDstrlen(ERR_CLS_NAME) + 1)))
- TEST_ERROR
+ TEST_ERROR;
if (NULL == (msg = (char *)HDmalloc(HDstrlen(ERR_MIN_SUBROUTINE_MSG) + 1)))
- TEST_ERROR
+ TEST_ERROR;
if ((ERR_CLS = H5Eregister_class(ERR_CLS_NAME, PROG_NAME, PROG_VERS)) < 0)
TEST_ERROR;
@@ -467,12 +467,12 @@ test_create(void)
/* Create an empty error stack */
if ((estack_id = H5Ecreate_stack()) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check the number of errors on stack */
err_num = H5Eget_num(estack_id);
if (err_num != 0)
- TEST_ERROR
+ TEST_ERROR;
/* Push an error with a long description */
if (H5Epush(estack_id, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s",
@@ -482,20 +482,20 @@ test_create(void)
/* Check the number of errors on stack */
err_num = H5Eget_num(estack_id);
if (err_num != 1)
- TEST_ERROR
+ TEST_ERROR;
/* Clear the error stack */
if (H5Eclear2(estack_id) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check the number of errors on stack */
err_num = H5Eget_num(estack_id);
if (err_num != 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close error stack */
if (H5Eclose_stack(estack_id) < 0)
- TEST_ERROR
+ TEST_ERROR;
return 0;
@@ -530,30 +530,30 @@ test_copy(void)
/* Check the number of errors on stack */
err_num = H5Eget_num(H5E_DEFAULT);
if (err_num != 1)
- TEST_ERROR
+ TEST_ERROR;
/* Copy error stack, which clears the original */
if ((estack_id = H5Eget_current_stack()) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check the number of errors on stack copy */
err_num = H5Eget_num(estack_id);
if (err_num != 1)
- TEST_ERROR
+ TEST_ERROR;
/* Check the number of errors on original stack */
err_num = H5Eget_num(H5E_DEFAULT);
if (err_num != 0)
- TEST_ERROR
+ TEST_ERROR;
/* Put the stack copy as the default. It closes the stack copy, too. */
if (H5Eset_current_stack(estack_id) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check the number of errors on default stack */
err_num = H5Eget_num(H5E_DEFAULT);
if (err_num != 1)
- TEST_ERROR
+ TEST_ERROR;
/* Try to close error stack copy. Should fail because
* the current H5Eset_current_stack closes the stack to be set.
@@ -564,7 +564,7 @@ test_copy(void)
}
H5E_END_TRY
if (ret >= 0)
- TEST_ERROR
+ TEST_ERROR;
return 0;
@@ -600,21 +600,21 @@ test_append(void)
/* Copy error stack, which clears the original */
if ((estack_id1 = H5Eget_current_stack()) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check the number of errors on stack #1 */
err_num = H5Eget_num(estack_id1);
if (err_num != 1)
- TEST_ERROR
+ TEST_ERROR;
/* Create another stack, from scratch */
if ((estack_id2 = H5Ecreate_stack()) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check the number of errors on stack #2 */
err_num = H5Eget_num(estack_id2);
if (err_num != 0)
- TEST_ERROR
+ TEST_ERROR;
/* Push an error on stack #2 */
if (H5Epush(estack_id2, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_CREATE, "%s",
@@ -624,7 +624,7 @@ test_append(void)
/* Check the number of errors on stack #2 */
err_num = H5Eget_num(estack_id2);
if (err_num != 1)
- TEST_ERROR
+ TEST_ERROR;
/* Try to append bad error stack IDs */
H5E_BEGIN_TRY
@@ -633,39 +633,39 @@ test_append(void)
}
H5E_END_TRY
if (ret >= 0)
- TEST_ERROR
+ TEST_ERROR;
H5E_BEGIN_TRY
{
ret = H5Eappend_stack(estack_id1, H5E_DEFAULT, FALSE);
}
H5E_END_TRY
if (ret >= 0)
- TEST_ERROR
+ TEST_ERROR;
H5E_BEGIN_TRY
{
ret = H5Eappend_stack(H5E_DEFAULT, estack_id2, FALSE);
}
H5E_END_TRY
if (ret >= 0)
- TEST_ERROR
+ TEST_ERROR;
/* Append error stack #2 to error stack #1, without closing stack #2 */
if (H5Eappend_stack(estack_id1, estack_id2, FALSE) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check the number of errors on stack #1 */
err_num = H5Eget_num(estack_id1);
if (err_num != 2)
- TEST_ERROR
+ TEST_ERROR;
/* Check the number of errors on stack #2 */
err_num = H5Eget_num(estack_id2);
if (err_num != 1)
- TEST_ERROR
+ TEST_ERROR;
/* Append error stack #2 to error stack #1, and close stack #2 */
if (H5Eappend_stack(estack_id1, estack_id2, TRUE) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Try to close error stack #2. Should fail because H5Eappend_stack
* should have already closed it.
@@ -676,12 +676,12 @@ test_append(void)
}
H5E_END_TRY
if (ret >= 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check the number of errors on stack #1 */
err_num = H5Eget_num(estack_id1);
if (err_num != 3)
- TEST_ERROR
+ TEST_ERROR;
return 0;
@@ -760,10 +760,10 @@ test_filter_error(const char *fname, hid_t fapl)
/* Close/release resources */
if (H5Dclose(dataset) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5Fclose(file) < 0)
- TEST_ERROR
+ TEST_ERROR;
return 0;