summaryrefslogtreecommitdiffstats
path: root/test/dsets.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/dsets.c')
-rw-r--r--test/dsets.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/dsets.c b/test/dsets.c
index 0e0b9d9..ca1e3d5 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -28,6 +28,7 @@
#include "H5srcdir.h"
#include "H5Bprivate.h"
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Iprivate.h"
#include "H5Pprivate.h"
@@ -2533,6 +2534,7 @@ test_missing_filter(hid_t file)
size_t i,j; /* Local index variables */
herr_t ret; /* Generic return value */
const char *testfile = H5_get_srcdir_filename(FILE_DEFLATE_NAME); /* Corrected test file name */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
TESTING("dataset access with missing filter");
@@ -2545,6 +2547,10 @@ test_missing_filter(hid_t file)
goto error;
} /* end if */
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
+
/* Unregister deflate filter */
/* (Use private routine, to avoid range checking on filter ID) */
if(H5Z__unregister(H5Z_FILTER_DEFLATE) < 0) {
@@ -2740,10 +2746,16 @@ test_missing_filter(hid_t file)
} /* end if */
#endif /* H5_HAVE_FILTER_DEFLATE */
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
+
PASSED();
return 0;
error:
+ if(api_ctx_pushed) H5CX_pop();
+
return -1;
}