summaryrefslogtreecommitdiffstats
path: root/test/dsets.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2018-03-19 03:51:19 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2018-03-19 03:51:19 (GMT)
commitd812c6fe60fec2451d8d78b8fb51547628307a6c (patch)
treefb1f02516e6dfe5abce1cdb0155046b5d68a73d5 /test/dsets.c
parentc31460c1b76c8d11534b57f025c57bdff9321f44 (diff)
downloadhdf5-d812c6fe60fec2451d8d78b8fb51547628307a6c.zip
hdf5-d812c6fe60fec2451d8d78b8fb51547628307a6c.tar.gz
hdf5-d812c6fe60fec2451d8d78b8fb51547628307a6c.tar.bz2
Cleanup API context function usage.
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;
}