summaryrefslogtreecommitdiffstats
path: root/test/efc.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/efc.c')
-rw-r--r--test/efc.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/test/efc.c b/test/efc.c
index 30ecdb5..d40d4a2 100644
--- a/test/efc.c
+++ b/test/efc.c
@@ -2891,7 +2891,7 @@ int
main(void)
{
unsigned nerrors = 0; /* track errors */
-hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
/* Test Setup */
puts("Testing the external file cache");
@@ -2907,8 +2907,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
h5_fixname(FILENAME[3], fapl_id, filename[3], sizeof(filename[3]));
h5_fixname(FILENAME[4], fapl_id, filename[4], sizeof(filename[4]));
h5_fixname(FILENAME[5], fapl_id, filename[5], sizeof(filename[5]));
-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 Functions */
nerrors += test_single();
@@ -2921,8 +2923,10 @@ api_ctx_pushed = TRUE;
/* Verify symbol table messages are cached */
nerrors += (h5_verify_cached_stabs(FILENAME, fapl_id) < 0 ? 1 : 0);
-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;
@@ -2940,6 +2944,8 @@ error:
H5Pclose(fapl_id);
} H5E_END_TRY
+ if(api_ctx_pushed) H5CX_pop();
+
return 1;
} /* end main() */