summaryrefslogtreecommitdiffstats
path: root/test/unregister.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/unregister.c')
-rw-r--r--test/unregister.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/test/unregister.c b/test/unregister.c
index 878270f..dbf6293 100644
--- a/test/unregister.c
+++ b/test/unregister.c
@@ -4,12 +4,10 @@
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic document set and is *
- * linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access *
- * to either file, you may request a copy from help@hdfgroup.org. *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* Programmer: Raymond Lu
@@ -18,6 +16,7 @@
* Purpose: Tests H5Zunregister function
*/
#include "h5test.h"
+#include "H5CXprivate.h" /* API Contexts */
const char *FILENAME[] = {
"unregister_filter_1",
@@ -232,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;
@@ -251,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;
}