summaryrefslogtreecommitdiffstats
path: root/test/unregister.c
diff options
context:
space:
mode:
authorM. Scot Breitenfeld <brtnfld@hdfgroup.org>2018-05-08 22:17:45 (GMT)
committerM. Scot Breitenfeld <brtnfld@hdfgroup.org>2018-05-08 22:17:45 (GMT)
commitb69bd0771eba5810db3db25217d5f32dc479185e (patch)
treec783a54f7cd8ef2ff504299749f5e18486a0363d /test/unregister.c
parent525b9f40e5c112b777a28d207ccb6fd454f156fc (diff)
parent0cc480d952e2e215f006fc172485fcbabc0f599f (diff)
downloadhdf5-b69bd0771eba5810db3db25217d5f32dc479185e.zip
hdf5-b69bd0771eba5810db3db25217d5f32dc479185e.tar.gz
hdf5-b69bd0771eba5810db3db25217d5f32dc479185e.tar.bz2
Merge branch 'develop' into hdf5_1_10.sync
Diffstat (limited to 'test/unregister.c')
-rw-r--r--test/unregister.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unregister.c b/test/unregister.c
index a4bf24e..dbf6293 100644
--- a/test/unregister.c
+++ b/test/unregister.c
@@ -16,6 +16,7 @@
* Purpose: Tests H5Zunregister function
*/
#include "h5test.h"
+#include "H5CXprivate.h" /* API Contexts */
const char *FILENAME[] = {
"unregister_filter_1",
@@ -230,17 +231,27 @@ main(void)
{
hid_t fapl;
int nerrors = 0;
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
/* Testing setup */
h5_reset();
fapl = h5_fileaccess();
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
+
/* Test unregistering filter in its own file */
nerrors += (test_unregister_filters(fapl) < 0 ? 1 : 0);
if(nerrors)
goto error;
printf("All filter unregistration tests passed.\n");
+
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
+
h5_cleanup(FILENAME, fapl);
return 0;
@@ -249,6 +260,9 @@ error:
nerrors = MAX(1, nerrors);
printf("***** %d FILTER UNREGISTRATION TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S");
+
+ if(api_ctx_pushed) H5CX_pop();
+
return 1;
}