summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-06-16 21:53:15 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-06-16 21:53:15 (GMT)
commitcb18697b3b4338ef9112c4269ace038161c58712 (patch)
tree027e915d595a958e70c4cb74328273bf8e97d366 /test
parent625ef85fe56d8265989e8c1ed32331064012a068 (diff)
downloadhdf5-cb18697b3b4338ef9112c4269ace038161c58712.zip
hdf5-cb18697b3b4338ef9112c4269ace038161c58712.tar.gz
hdf5-cb18697b3b4338ef9112c4269ace038161c58712.tar.bz2
Close all of the datasets we opened.
Diffstat (limited to 'test')
-rw-r--r--test/vfd_swmr_bigset_writer.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/vfd_swmr_bigset_writer.c b/test/vfd_swmr_bigset_writer.c
index 685757a..c29767c 100644
--- a/test/vfd_swmr_bigset_writer.c
+++ b/test/vfd_swmr_bigset_writer.c
@@ -313,6 +313,24 @@ create_extensible_dset(state_t *s, unsigned int which)
}
static void
+close_extensible_dset(state_t *s, unsigned int which)
+{
+ char dname[sizeof("/dataset-9999999999")];
+ hid_t ds;
+
+ assert(which < s->ndatasets);
+
+ esnprintf(dname, sizeof(dname), "/dataset-%d", which);
+
+ ds = s->dataset[which];
+
+ if (H5Dclose(ds) < 0)
+ errx(EXIT_FAILURE, "H5Dclose failed for \"%s\"", dname);
+
+ s->dataset[which] = badhid;
+}
+
+static void
open_extensible_dset(state_t *s, unsigned int which)
{
hsize_t dims[RANK], maxdims[RANK];
@@ -739,6 +757,9 @@ main(int argc, char **argv)
}
}
+ for (which = 0; which < s.ndatasets; which++)
+ close_extensible_dset(&s, which);
+
if (s.use_vfd_swmr && s.wait_for_signal)
await_signal(s.file);