summaryrefslogtreecommitdiffstats
path: root/test/efc.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/efc.c')
-rw-r--r--test/efc.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/test/efc.c b/test/efc.c
index e62f6cc..e508b47 100644
--- a/test/efc.c
+++ b/test/efc.c
@@ -33,7 +33,8 @@ const char *FILENAME[] = {
};
/* Global patched filename buffer */
-static char filename[6][128];
+#define N_FILENAMES 6
+static char *filename[N_FILENAMES];
/* Global property lists - just copies of the defaults (necessary to use
* internal functions */
@@ -2896,10 +2897,11 @@ error:
int
main(void)
{
- unsigned nerrors = 0; /* track errors */
- H5P_genplist_t *plist; /* Property list pointer for FAPL */
- H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
- hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
+ unsigned nerrors = 0; /* track errors */
+ H5P_genplist_t *plist; /* Property list pointer for FAPL */
+ H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
+ int i; /* iterator */
/* Test Setup */
HDputs("Testing the external file cache");
@@ -2908,6 +2910,11 @@ main(void)
fcpl_id = H5Pcreate(H5P_FILE_CREATE);
fapl_id = h5_fileaccess();
+ /* Allocate memory for filenames */
+ for(i = 0; i < N_FILENAMES; i++) {
+ filename[i] = (char *)HDcalloc(PATH_MAX, sizeof(char));
+ }
+
/* Patch filenames */
h5_fixname(FILENAME[0], fapl_id, filename[0], sizeof(filename[0]));
h5_fixname(FILENAME[1], fapl_id, filename[1], sizeof(filename[1]));
@@ -2942,7 +2949,8 @@ main(void)
nerrors += (h5_verify_cached_stabs(FILENAME, fapl_id) < 0 ? 1 : 0);
/* Pop API context */
- if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ if(api_ctx_pushed && H5CX_pop() < 0)
+ FAIL_STACK_ERROR
api_ctx_pushed = FALSE;
if(nerrors)
@@ -2952,6 +2960,10 @@ main(void)
h5_clean_files(FILENAME, fapl_id);
+ for(i = 0; i < N_FILENAMES; i++) {
+ HDfree(filename[i]);
+ }
+
return EXIT_SUCCESS;
error:
@@ -2961,7 +2973,12 @@ error:
H5Pclose(fapl_id);
} H5E_END_TRY
- if(api_ctx_pushed) H5CX_pop();
+ if(api_ctx_pushed)
+ H5CX_pop();
+
+ for(i = 0; i < N_FILENAMES; i++) {
+ HDfree(filename[i]);
+ }
return EXIT_FAILURE;
} /* end main() */