diff options
author | David Young <dyoung@hdfgroup.org> | 2020-08-21 14:53:50 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-08-21 14:53:50 (GMT) |
commit | 0bbf92da01ec9d19bd498a9eb7f92c46b4b469ac (patch) | |
tree | ae14b252e4f366e55ddff88d675bc34653e50a24 /test | |
parent | 2ef65c82a6a8b7d1fac4b5b825b4b6de81494de7 (diff) | |
parent | c68700769fa56b04e4e13f2e5019cc2b93599fd5 (diff) | |
download | hdf5-0bbf92da01ec9d19bd498a9eb7f92c46b4b469ac.zip hdf5-0bbf92da01ec9d19bd498a9eb7f92c46b4b469ac.tar.gz hdf5-0bbf92da01ec9d19bd498a9eb7f92c46b4b469ac.tar.bz2 |
Merge branch 'feature/vfd_swmr' into multi
Diffstat (limited to 'test')
-rw-r--r-- | test/page_buffer.c | 18 | ||||
-rw-r--r-- | test/vfd_swmr_addrem_writer.c | 5 | ||||
-rw-r--r-- | test/vfd_swmr_bigset_writer.c | 2 | ||||
-rw-r--r-- | test/vfd_swmr_generator.c | 4 | ||||
-rw-r--r-- | test/vfd_swmr_group_writer.c | 2 | ||||
-rw-r--r-- | test/vfd_swmr_reader.c | 2 | ||||
-rw-r--r-- | test/vfd_swmr_remove_reader.c | 4 | ||||
-rw-r--r-- | test/vfd_swmr_remove_writer.c | 2 | ||||
-rw-r--r-- | test/vfd_swmr_sparse_reader.c | 2 | ||||
-rw-r--r-- | test/vfd_swmr_sparse_writer.c | 2 | ||||
-rw-r--r-- | test/vfd_swmr_vlstr_reader.c | 2 | ||||
-rw-r--r-- | test/vfd_swmr_vlstr_writer.c | 2 | ||||
-rw-r--r-- | test/vfd_swmr_writer.c | 2 | ||||
-rw-r--r-- | test/vfd_swmr_zoo_writer.c | 2 |
14 files changed, 29 insertions, 22 deletions
diff --git a/test/page_buffer.c b/test/page_buffer.c index d89a701..88b3317 100644 --- a/test/page_buffer.c +++ b/test/page_buffer.c @@ -140,17 +140,23 @@ swmr_fapl_augment(hid_t fapl, const char *filename, uint32_t max_lag) , .writer = true , .md_pages_reserved = 128 }; - const char *dname; - char *tname; + const char *bname, *dname; + char *tname[2]; - if ((tname = strdup(filename)) == NULL) { + if ((tname[0] = strdup(filename)) == NULL) { HDfprintf(stderr, "temporary string allocation failed\n"); return -1; } - dname = dirname(tname); + if ((tname[1] = strdup(filename)) == NULL) { + HDfprintf(stderr, "temporary string allocation failed\n"); + return -1; + } + dname = dirname(tname[0]); + bname = basename(tname[1]); snprintf(config.md_file_path, sizeof(config.md_file_path), - "%s/my_md_file", dname); - free(tname); + "%s/%s.shadow", dname, bname); + free(tname[0]); + free(tname[1]); /* Enable VFD SWMR configuration */ if(H5Pset_vfd_swmr_config(fapl, &config) < 0) { diff --git a/test/vfd_swmr_addrem_writer.c b/test/vfd_swmr_addrem_writer.c index a8aefa9..2b93926 100644 --- a/test/vfd_swmr_addrem_writer.c +++ b/test/vfd_swmr_addrem_writer.c @@ -107,7 +107,7 @@ open_skeleton(const char *filename, unsigned verbose) goto error; /* Allocate memory for the configuration structure */ - if((config = (H5F_vfd_swmr_config_t *)calloc(1, sizeof(H5F_vfd_swmr_config_t))) == NULL) + if((config = calloc(1, sizeof(*config))) == NULL) goto error; config->version = H5F__CURR_VFD_SWMR_CONFIG_VERSION; @@ -115,7 +115,8 @@ open_skeleton(const char *filename, unsigned verbose) config->max_lag = 5; config->writer = TRUE; config->md_pages_reserved = 128; - HDstrcpy(config->md_file_path, "./my_md_file"); + esnprintf(config->md_file_path, sizeof(config->md_file_path), + "./rw-shadow"); /* Enable VFD SWMR configuration */ if(H5Pset_vfd_swmr_config(fapl, config) < 0) diff --git a/test/vfd_swmr_bigset_writer.c b/test/vfd_swmr_bigset_writer.c index 2da7566..39e8d78 100644 --- a/test/vfd_swmr_bigset_writer.c +++ b/test/vfd_swmr_bigset_writer.c @@ -1085,7 +1085,7 @@ main(int argc, char **argv) } fapl = vfd_swmr_create_fapl(s.writer, true, s.use_vfd_swmr, - "./metadata-%zu", i); + "./bigset-shadow-%zu", i); if (fapl < 0) errx(EXIT_FAILURE, "vfd_swmr_create_fapl"); diff --git a/test/vfd_swmr_generator.c b/test/vfd_swmr_generator.c index 13fc941..f0d043c 100644 --- a/test/vfd_swmr_generator.c +++ b/test/vfd_swmr_generator.c @@ -144,7 +144,7 @@ gen_skeleton(const char *filename, hbool_t verbose, hbool_t vfd_swmr_write, return -1; /* Allocate memory for the VFD SWMR configuration structure */ - if((config = (H5F_vfd_swmr_config_t *)HDcalloc(1, sizeof(H5F_vfd_swmr_config_t))) == NULL) + if((config = HDcalloc(1, sizeof(*config))) == NULL) return -1; config->version = H5F__CURR_VFD_SWMR_CONFIG_VERSION; @@ -152,7 +152,7 @@ gen_skeleton(const char *filename, hbool_t verbose, hbool_t vfd_swmr_write, config->max_lag = 10; config->writer = TRUE; config->md_pages_reserved = 128; - HDstrcpy(config->md_file_path, "my_md_file"); + HDstrcpy(config->md_file_path, "generator-shadow"); /* Enable VFD SWMR configuration in fapl */ if(H5Pset_vfd_swmr_config(fapl, config) < 0) diff --git a/test/vfd_swmr_group_writer.c b/test/vfd_swmr_group_writer.c index a1bea61..66ff114 100644 --- a/test/vfd_swmr_group_writer.c +++ b/test/vfd_swmr_group_writer.c @@ -288,7 +288,7 @@ main(int argc, char **argv) "unknown personality, expected vfd_swmr_group_{reader,writer}"); } - fapl = vfd_swmr_create_fapl(writer, true, s.use_vfd_swmr, "./shadow"); + fapl = vfd_swmr_create_fapl(writer, true, s.use_vfd_swmr, "./group-shadow"); if (fapl < 0) errx(EXIT_FAILURE, "vfd_swmr_create_fapl"); diff --git a/test/vfd_swmr_reader.c b/test/vfd_swmr_reader.c index 706c894..ff31bdd 100644 --- a/test/vfd_swmr_reader.c +++ b/test/vfd_swmr_reader.c @@ -353,7 +353,7 @@ read_records(const char *filename, hbool_t verbose, FILE *verbose_file, config->max_lag = 5; config->writer = FALSE; config->md_pages_reserved = 128; - HDstrcpy(config->md_file_path, "./my_md_file"); + HDstrcpy(config->md_file_path, "./rw-shadow"); /* Enable VFD SWMR configuration */ if(H5Pset_vfd_swmr_config(fapl, config) < 0) { diff --git a/test/vfd_swmr_remove_reader.c b/test/vfd_swmr_remove_reader.c index 3515987..f56fce3 100644 --- a/test/vfd_swmr_remove_reader.c +++ b/test/vfd_swmr_remove_reader.c @@ -309,7 +309,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nseconds, goto error; /* Allocate memory for the configuration structure */ - if((config = (H5F_vfd_swmr_config_t *)HDcalloc(1, sizeof(H5F_vfd_swmr_config_t))) == NULL) + if((config = HDcalloc(1, sizeof(*config))) == NULL) goto error; config->version = H5F__CURR_VFD_SWMR_CONFIG_VERSION; @@ -317,7 +317,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nseconds, config->max_lag = 5; config->writer = FALSE; config->md_pages_reserved = 128; - HDstrcpy(config->md_file_path, "./my_md_file"); + HDstrcpy(config->md_file_path, "./rw-shadow"); /* Enable VFD SWMR configuration */ if(H5Pset_vfd_swmr_config(fapl, config) < 0) diff --git a/test/vfd_swmr_remove_writer.c b/test/vfd_swmr_remove_writer.c index 2ebe96f..ae64ff0 100644 --- a/test/vfd_swmr_remove_writer.c +++ b/test/vfd_swmr_remove_writer.c @@ -108,7 +108,7 @@ open_skeleton(const char *filename, unsigned verbose, config->max_lag = 5; config->writer = TRUE; config->md_pages_reserved = 128; - HDstrcpy(config->md_file_path, "./my_md_file"); + HDstrcpy(config->md_file_path, "./rw-shadow"); /* Enable VFD SWMR configuration */ if(H5Pset_vfd_swmr_config(fapl, config) < 0) diff --git a/test/vfd_swmr_sparse_reader.c b/test/vfd_swmr_sparse_reader.c index 83fb886..4f87ac5 100644 --- a/test/vfd_swmr_sparse_reader.c +++ b/test/vfd_swmr_sparse_reader.c @@ -223,7 +223,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nrecords, config->max_lag = 5; config->writer = FALSE; config->md_pages_reserved = 128; - HDstrcpy(config->md_file_path, "./my_md_file"); + HDstrcpy(config->md_file_path, "./rw-shadow"); /* Enable VFD SWMR configuration */ if(H5Pset_vfd_swmr_config(fapl, config) < 0) diff --git a/test/vfd_swmr_sparse_writer.c b/test/vfd_swmr_sparse_writer.c index 5722558..509a62c 100644 --- a/test/vfd_swmr_sparse_writer.c +++ b/test/vfd_swmr_sparse_writer.c @@ -108,7 +108,7 @@ open_skeleton(const char *filename, unsigned verbose) config->max_lag = 5; config->writer = TRUE; config->md_pages_reserved = 128; - HDstrcpy(config->md_file_path, "./my_md_file"); + HDstrcpy(config->md_file_path, "./rw-shadow"); /* Enable VFD SWMR configuration */ if(H5Pset_vfd_swmr_config(fapl, config) < 0) diff --git a/test/vfd_swmr_vlstr_reader.c b/test/vfd_swmr_vlstr_reader.c index 48a1f41..e78f36b 100644 --- a/test/vfd_swmr_vlstr_reader.c +++ b/test/vfd_swmr_vlstr_reader.c @@ -136,7 +136,7 @@ main(int argc, char **argv) errx(EXIT_FAILURE, "unexpected command-line arguments"); fapl = vfd_swmr_create_fapl(false, sel == TEST_OOB, use_vfd_swmr, - "./shadow"); + "./vlstr-shadow"); if (fapl < 0) errx(EXIT_FAILURE, "vfd_swmr_create_fapl"); diff --git a/test/vfd_swmr_vlstr_writer.c b/test/vfd_swmr_vlstr_writer.c index d4a83ae..cb52fcb 100644 --- a/test/vfd_swmr_vlstr_writer.c +++ b/test/vfd_swmr_vlstr_writer.c @@ -199,7 +199,7 @@ main(int argc, char **argv) errx(EXIT_FAILURE, "unexpected command-line arguments"); fapl = vfd_swmr_create_fapl(true, sel == TEST_OOB, use_vfd_swmr, - "./shadow"); + "./vlstr-shadow"); if (fapl < 0) errx(EXIT_FAILURE, "vfd_swmr_create_fapl"); diff --git a/test/vfd_swmr_writer.c b/test/vfd_swmr_writer.c index 1d73dd6..1538ef3 100644 --- a/test/vfd_swmr_writer.c +++ b/test/vfd_swmr_writer.c @@ -117,7 +117,7 @@ open_skeleton(const char *filename, hbool_t verbose, FILE *verbose_file, config->max_lag = 5; config->writer = TRUE; config->md_pages_reserved = 128; - HDstrcpy(config->md_file_path, "./my_md_file"); + HDstrcpy(config->md_file_path, "./rw-shadow"); /* Enable VFD SWMR configuration */ if(H5Pset_vfd_swmr_config(fapl, config) < 0) diff --git a/test/vfd_swmr_zoo_writer.c b/test/vfd_swmr_zoo_writer.c index e2892ec..12db3cd 100644 --- a/test/vfd_swmr_zoo_writer.c +++ b/test/vfd_swmr_zoo_writer.c @@ -284,7 +284,7 @@ main(int argc, char **argv) if (argc > 0) errx(EXIT_FAILURE, "unexpected command-line arguments"); - fapl = vfd_swmr_create_fapl(writer, true, use_vfd_swmr, "./shadow"); + fapl = vfd_swmr_create_fapl(writer, true, use_vfd_swmr, "./zoo-shadow"); if (use_vfd_swmr && H5Pget_vfd_swmr_config(fapl, &swmr_config) < 0) errx(EXIT_FAILURE, "H5Pget_vfd_swmr_config"); |