summaryrefslogtreecommitdiffstats
path: root/test/mf.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/mf.c
parentc31460c1b76c8d11534b57f025c57bdff9321f44 (diff)
downloadhdf5-d812c6fe60fec2451d8d78b8fb51547628307a6c.zip
hdf5-d812c6fe60fec2451d8d78b8fb51547628307a6c.tar.gz
hdf5-d812c6fe60fec2451d8d78b8fb51547628307a6c.tar.bz2
Cleanup API context function usage.
Diffstat (limited to 'test/mf.c')
-rw-r--r--test/mf.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/test/mf.c b/test/mf.c
index 846cf90..a537679 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -8868,7 +8868,7 @@ main(void)
unsigned nerrors = 0; /* Cumulative error count */
test_type_t curr_test; /* Current test being worked on */
const char *env_h5_drvr; /* File Driver value from environment */
-hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
/* Get the VFD to use */
env_h5_drvr = HDgetenv("HDF5_DRIVER");
@@ -8878,8 +8878,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
h5_reset();
fapl = h5_fileaccess();
-if(H5CX_push() < 0) FAIL_STACK_ERROR
-api_ctx_pushed = TRUE;
+
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
/* Make a copy of the FAPL before adjusting the alignment */
if((new_fapl = H5Pcopy(fapl)) < 0) TEST_ERROR
@@ -8993,8 +8995,10 @@ api_ctx_pushed = TRUE;
if(H5Pclose(new_fapl) < 0)
FAIL_STACK_ERROR
h5_cleanup(FILENAME, fapl);
-if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
-api_ctx_pushed = FALSE;
+
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
if(nerrors)
goto error;
@@ -9007,8 +9011,10 @@ error:
H5E_BEGIN_TRY {
H5Pclose(fapl);
H5Pclose(new_fapl);
-if(api_ctx_pushed) H5CX_pop();
} H5E_END_TRY;
+
+ if(api_ctx_pushed) H5CX_pop();
+
return(1);
} /* main() */