diff options
author | vchoi-hdfgroup <55293060+vchoi-hdfgroup@users.noreply.github.com> | 2021-08-24 02:23:52 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-24 02:23:52 (GMT) |
commit | 88082d7d46b9654d04f713eefbd928429f98117b (patch) | |
tree | b3b68b3499b5579d4124b91bccd06253d349b1fe | |
parent | b5a5be4a56f5a9ac497d75f78017b73d11f90c78 (diff) | |
parent | 6eaa6012ff6edfa6db2cd0975649067b48eb3b00 (diff) | |
download | hdf5-88082d7d46b9654d04f713eefbd928429f98117b.zip hdf5-88082d7d46b9654d04f713eefbd928429f98117b.tar.gz hdf5-88082d7d46b9654d04f713eefbd928429f98117b.tar.bz2 |
Merge pull request #916 from vchoi-hdfgroup/obj_reg_ref_feature_vfd_swmr
Obj reg ref feature vfd swmr
-rw-r--r-- | test/testvfdswmr.sh.in | 28 | ||||
-rw-r--r-- | test/vfd_swmr_attrdset_writer.c | 33 | ||||
-rw-r--r-- | test/vfd_swmr_bigset_writer.c | 13 | ||||
-rw-r--r-- | test/vfd_swmr_vlstr_reader.c | 7 |
4 files changed, 41 insertions, 40 deletions
diff --git a/test/testvfdswmr.sh.in b/test/testvfdswmr.sh.in index 1401da1..bafdc2c 100644 --- a/test/testvfdswmr.sh.in +++ b/test/testvfdswmr.sh.in @@ -1021,21 +1021,21 @@ done # # GROUP_seg_n=1000000 # Number of groups when segmentation fault occurs -if [ ${do_os_groups_seg:-no} = no ]; then - continue -fi -echo launch vfd_swmr_group operations with old-style group: $GROUP_seg_n groups ......may take some time...... -catch_out_err_and_rc vfd_swmr_group_writer \ - ../vfd_swmr_group_writer -q -N -G -n $GROUP_seg_n -a $GROUP_seg_n - -# Collect exit code of the writer -if [ $(cat vfd_swmr_group_writer.rc) -ne 0 ]; then - echo writer had error - nerrors=$((nerrors + 1)) -fi +# +if [ ${do_os_groups_seg:-no} != no ]; then + echo launch vfd_swmr_group operations with old-style group: $GROUP_seg_n groups ......may take some time...... + catch_out_err_and_rc vfd_swmr_group_writer \ + ../vfd_swmr_group_writer -q -N -G -n $GROUP_seg_n -a $GROUP_seg_n + + # Collect exit code of the writer + if [ $(cat vfd_swmr_group_writer.rc) -ne 0 ]; then + echo writer had error + nerrors=$((nerrors + 1)) + fi -# Clean up output files -rm -f vfd_swmr_group_writer.{out,rc} + # Clean up output files + rm -f vfd_swmr_group_writer.{out,rc} +fi ############################################################################### # diff --git a/test/vfd_swmr_attrdset_writer.c b/test/vfd_swmr_attrdset_writer.c index 67eeb2c..f445321 100644 --- a/test/vfd_swmr_attrdset_writer.c +++ b/test/vfd_swmr_attrdset_writer.c @@ -924,7 +924,6 @@ perform_dsets_operations(state_t *s, dsets_state_t *ds, H5F_vfd_swmr_config_t *c unsigned step; bool result; unsigned dd; - bool ret = true; for (step = 0; step < s->asteps; step++) { dbgf(2, "Adding attribute %d\n", step); @@ -1507,11 +1506,11 @@ verify_add_or_modify_attr(unsigned action, hid_t did, char *attr_name, unsigned unsigned int read_which; unsigned int tmp_val; char tmp_vl_val[sizeof("attr-9999999999")]; - char * read_vl_which = NULL; - bool is_vl = false; - hid_t aid = H5I_INVALID_HID; - hid_t atid = H5I_INVALID_HID; - bool ret = FALSE; + char * read_vl_which; + bool is_vl = false; + hid_t aid = H5I_INVALID_HID; + hid_t atid = H5I_INVALID_HID; + bool ret = FALSE; HDassert(did != badhid); HDassert(action == ADD_ATTR || action == MODIFY_ATTR); @@ -1531,11 +1530,6 @@ verify_add_or_modify_attr(unsigned action, hid_t did, char *attr_name, unsigned HDsprintf(tmp_vl_val, "%u", which); else HDsprintf(tmp_vl_val, "%u %c", which, 'M'); - - if ((read_vl_which = HDmalloc(sizeof("9999999999"))) == NULL) { - HDprintf("HDmalloc failed\n"); - TEST_ERROR; - } } else { if (action == MODIFY_ATTR) @@ -1544,7 +1538,7 @@ verify_add_or_modify_attr(unsigned action, hid_t did, char *attr_name, unsigned tmp_val = which; } - if (H5Aread(aid, atid, is_vl ? (void *)&read_vl_which : (void *)&read_which) < 0) { + if (H5Aread(aid, atid, is_vl ? &read_vl_which : (void *)&read_which) < 0) { HDprintf("H5Aread failed\n"); TEST_ERROR; } @@ -1569,8 +1563,8 @@ verify_add_or_modify_attr(unsigned action, hid_t did, char *attr_name, unsigned ret = (read_which == tmp_val); } - if (read_vl_which) - HDfree(read_vl_which); + if (is_vl) + H5free_memory(read_vl_which); return ret; @@ -1582,8 +1576,8 @@ error: } H5E_END_TRY; - if (read_vl_which) - HDfree(read_vl_which); + if (is_vl) + H5free_memory(read_vl_which); return false; @@ -1960,17 +1954,14 @@ error: int main(int argc, char **argv) { - hid_t fapl = H5I_INVALID_HID; - hid_t fcpl = H5I_INVALID_HID; - unsigned step; + hid_t fapl = H5I_INVALID_HID; + hid_t fcpl = H5I_INVALID_HID; bool writer = FALSE; state_t s; const char * personality; H5F_vfd_swmr_config_t config; np_state_t np; dsets_state_t ds; - unsigned dd; - bool result; if (!state_init(&s, argc, argv)) { HDprintf("state_init() failed\n"); diff --git a/test/vfd_swmr_bigset_writer.c b/test/vfd_swmr_bigset_writer.c index d3a9ce8..6280af5 100644 --- a/test/vfd_swmr_bigset_writer.c +++ b/test/vfd_swmr_bigset_writer.c @@ -192,10 +192,10 @@ newmat(unsigned rows, unsigned cols) { mat_t *mat; - mat = malloc(sizeof(*mat) + (rows * cols - 1) * sizeof(mat->elt[0])); + mat = HDmalloc(sizeof(*mat) + (rows * cols - 1) * sizeof(mat->elt[0])); if (mat == NULL) - err(EXIT_FAILURE, "%s: malloc", __func__); + err(EXIT_FAILURE, "%s: HDmalloc", __func__); mat->rows = rows; mat->cols = cols; @@ -463,11 +463,11 @@ state_init(state_t *s, int argc, char **argv) if ((s->one_by_one_sid = H5Screate_simple(1, &dims, &dims)) < 0) errx(EXIT_FAILURE, "H5Screate_simple failed"); - s->dataset = malloc(sizeof(*s->dataset) * s->ndatasets); + s->dataset = HDmalloc(sizeof(*s->dataset) * s->ndatasets); if (s->dataset == NULL) err(EXIT_FAILURE, "could not allocate dataset handles"); - s->sources = malloc(sizeof(*s->sources) * s->ndatasets); + s->sources = HDmalloc(sizeof(*s->sources) * s->ndatasets); if (s->sources == NULL) err(EXIT_FAILURE, "could not allocate quadrant dataset handles"); @@ -1174,6 +1174,11 @@ main(int argc, char **argv) free(mat); + if (s.dataset) + HDfree(s.dataset); + if (s.sources) + HDfree(s.sources); + return EXIT_SUCCESS; } diff --git a/test/vfd_swmr_vlstr_reader.c b/test/vfd_swmr_vlstr_reader.c index c3ee2ed..fa9d7b4 100644 --- a/test/vfd_swmr_vlstr_reader.c +++ b/test/vfd_swmr_vlstr_reader.c @@ -140,7 +140,7 @@ main(int argc, char **argv) if (fid == badhid) errx(EXIT_FAILURE, "H5Fcreate"); - /* content 1 seq 1 short + /* content 0 seq 1 short * content 1 seq 1 long long long long long long long long * content 1 seq 1 medium medium medium */ @@ -178,6 +178,11 @@ main(int argc, char **argv) dbgf(2, ": read which %d seq %d tail %s\n", scanned_content.which, scanned_content.seq, scanned_content.tail); H5Dclose(dset[which]); + + if (content[which] != NULL) { + HDfree(content[which]); + content[which] = NULL; + } } if (caught_out_of_bounds) |