diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2018-03-19 03:51:19 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2018-03-19 03:51:19 (GMT) |
commit | d812c6fe60fec2451d8d78b8fb51547628307a6c (patch) | |
tree | fb1f02516e6dfe5abce1cdb0155046b5d68a73d5 /test/unregister.c | |
parent | c31460c1b76c8d11534b57f025c57bdff9321f44 (diff) | |
download | hdf5-d812c6fe60fec2451d8d78b8fb51547628307a6c.zip hdf5-d812c6fe60fec2451d8d78b8fb51547628307a6c.tar.gz hdf5-d812c6fe60fec2451d8d78b8fb51547628307a6c.tar.bz2 |
Cleanup API context function usage.
Diffstat (limited to 'test/unregister.c')
-rw-r--r-- | test/unregister.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/test/unregister.c b/test/unregister.c index 4d7c902..dbf6293 100644 --- a/test/unregister.c +++ b/test/unregister.c @@ -231,13 +231,15 @@ main(void) { hid_t fapl; int nerrors = 0; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Testing setup */ 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; /* Test unregistering filter in its own file */ nerrors += (test_unregister_filters(fapl) < 0 ? 1 : 0); @@ -245,9 +247,12 @@ api_ctx_pushed = TRUE; 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); -if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR -api_ctx_pushed = FALSE; return 0; @@ -255,7 +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(); + + if(api_ctx_pushed) H5CX_pop(); + return 1; } |