Changing file names to avoid possible conflicts during parallel test.

This commit is contained in:
Songyu Lu
2019-04-22 10:23:38 -05:00
parent 500f6cccbd
commit 2c47094d40
4 changed files with 26 additions and 22 deletions

View File

@@ -635,7 +635,7 @@ test_read_file_set(hid_t fapl)
TEST_ERROR
/* Reset the raw data files */
if(reset_raw_data_files() < 0)
if(reset_raw_data_files(0) < 0)
TEST_ERROR
/* Create the file and an initial group. This causes messages about
@@ -775,7 +775,7 @@ test_write_file_set(hid_t fapl)
} /* end for */
/* Reset the raw data files */
if(reset_raw_data_files() < 0)
if(reset_raw_data_files(0) < 0)
TEST_ERROR
/* Create the dataset */
@@ -876,7 +876,7 @@ test_path_absolute(hid_t fapl)
FAIL_STACK_ERROR
/* Reset the raw data files */
if(reset_raw_data_files() < 0)
if(reset_raw_data_files(0) < 0)
TEST_ERROR
/* Create the dcpl */
@@ -972,7 +972,7 @@ test_path_relative(hid_t fapl)
FAIL_STACK_ERROR;
/* Reset the raw data files */
if(reset_raw_data_files() < 0)
if(reset_raw_data_files(0) < 0)
TEST_ERROR
/* Create the dataset */
@@ -1067,7 +1067,7 @@ test_path_relative_cwd(hid_t fapl)
FAIL_STACK_ERROR;
/* Reset the raw data files */
if(reset_raw_data_files() < 0)
if(reset_raw_data_files(0) < 0)
TEST_ERROR
/* Create the dataset */
@@ -1209,7 +1209,7 @@ test_h5d_get_access_plist(hid_t fapl_id)
TEST_ERROR
/* Reset the raw data files */
if(reset_raw_data_files() < 0)
if(reset_raw_data_files(0) < 0)
TEST_ERROR
/* Create the file */

View File

@@ -35,7 +35,7 @@
*-------------------------------------------------------------------------
*/
herr_t
reset_raw_data_files(void)
reset_raw_data_files(int is_env)
{
int fd = 0; /* external file descriptor */
size_t i, j; /* iterators */
@@ -59,7 +59,10 @@ reset_raw_data_files(void)
for(i = 0; i < N_EXT_FILES; i++) {
/* Open file */
HDsprintf(filename, "extern_%lur.raw", (unsigned long)i + 1);
if(is_env)
HDsprintf(filename, "extern_env_%lur.raw", (unsigned long)i + 1);
else
HDsprintf(filename, "extern_%lur.raw", (unsigned long)i + 1);
if((fd = HDopen(filename, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0)
goto error;
@@ -93,7 +96,10 @@ reset_raw_data_files(void)
for(i = 0; i < N_EXT_FILES; i++) {
/* Open file */
HDsprintf(filename, "extern_%luw.raw", (unsigned long)i + 1);
if(is_env)
HDsprintf(filename, "extern_env_%luw.raw", (unsigned long)i + 1);
else
HDsprintf(filename, "extern_%luw.raw", (unsigned long)i + 1);
if((fd = HDopen(filename, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0)
goto error;

View File

@@ -41,5 +41,5 @@ static const char *EXT_FNAME[] = {
#define TOTAL_SIZE 100
#define GARBAGE_PER_FILE 10
H5TEST_DLL herr_t reset_raw_data_files(void);
H5TEST_DLL herr_t reset_raw_data_files(int);
#endif /* _EXTERNAL_COMMON_H */

View File

@@ -64,7 +64,7 @@ test_path_env(hid_t fapl)
FAIL_STACK_ERROR
/* Reset the raw data files */
if(reset_raw_data_files() < 0)
if(reset_raw_data_files(1) < 0)
TEST_ERROR
/* Create the dataset */
@@ -73,7 +73,7 @@ test_path_env(hid_t fapl)
if(NULL == HDgetcwd(cwdpath, sizeof(cwdpath)))
TEST_ERROR
for(i = 0; i < N_EXT_FILES; i++) {
HDsnprintf(filename, sizeof(filename), "..%sextern_%dr.raw", H5_DIR_SEPS, (int) i + 1);
HDsnprintf(filename, sizeof(filename), "..%sextern_env_%dr.raw", H5_DIR_SEPS, (int) i + 1);
if(H5Pset_external(dcpl, filename, (off_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -144,7 +144,6 @@ main(void)
hid_t fapl_id_new = -1; /* file access properties (new format) */
hid_t fid = -1; /* file for test_1* functions */
hid_t gid = -1; /* group to emit diagnostics */
char filename[1024]; /* file name for test_1* funcs */
unsigned latest_format; /* default or latest file format */
int nerrors = 0; /* number of errors */
@@ -152,7 +151,6 @@ main(void)
/* Get a fapl for the old (default) file format */
fapl_id_old = h5_fileaccess();
h5_fixname(EXT_FNAME[0], fapl_id_old, filename, sizeof(filename));
/* Copy and set up a fapl for the latest file format */
if((fapl_id_new = H5Pcopy(fapl_id_old)) < 0)
@@ -186,15 +184,15 @@ main(void)
/* Clean up files used by file set tests */
if(h5_cleanup(EXT_FNAME, fapl_id_old)) {
HDremove("extern_1r.raw");
HDremove("extern_2r.raw");
HDremove("extern_3r.raw");
HDremove("extern_4r.raw");
HDremove("extern_env_1r.raw");
HDremove("extern_env_2r.raw");
HDremove("extern_env_3r.raw");
HDremove("extern_env_4r.raw");
HDremove("extern_1w.raw");
HDremove("extern_2w.raw");
HDremove("extern_3w.raw");
HDremove("extern_4w.raw");
HDremove("extern_env_1w.raw");
HDremove("extern_env_2w.raw");
HDremove("extern_env_3w.raw");
HDremove("extern_env_4w.raw");
HDrmdir("extern_dir");
} /* end if */