diff options
author | Vailin Choi <vchoi@jam.ad.hdfgroup.org> | 2018-10-30 21:53:09 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@jam.ad.hdfgroup.org> | 2018-10-30 21:53:09 (GMT) |
commit | d1d2cf776d4f7b809e3cc1bda1a001ea147dfa89 (patch) | |
tree | 4d3cb63d4f3245f0d63fae01252f6e352fb67d3c /test/use_common.c | |
parent | 3145690c9590778b857def090489c6d890e42a5b (diff) | |
download | hdf5-d1d2cf776d4f7b809e3cc1bda1a001ea147dfa89.zip hdf5-d1d2cf776d4f7b809e3cc1bda1a001ea147dfa89.tar.gz hdf5-d1d2cf776d4f7b809e3cc1bda1a001ea147dfa89.tar.bz2 |
Fix for HDFFV-10554 use_append_chunks in swmr use case test failure
Fix the timing issue of the test by moving the open/close of the test file for the writer to
use_append_chunk.c and use_append_mchunks.c.
Diffstat (limited to 'test/use_common.c')
-rw-r--r-- | test/use_common.c | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/test/use_common.c b/test/use_common.c index 5aa6692..164480f 100644 --- a/test/use_common.c +++ b/test/use_common.c @@ -252,13 +252,10 @@ int create_uc_file(void) * * Return: 0 succeed; -1 fail. */ -int write_uc_file(hbool_t tosend) +int write_uc_file(hbool_t tosend, hid_t fid) { - hid_t fid; /* File ID for new HDF5 file */ hid_t dsid; /* dataset ID */ - hid_t fapl; /* File access property list */ hid_t dcpl; /* Dataset creation property list */ - char *name; UC_CTYPE *buffer, *bufptr; /* data buffer */ hsize_t cz=UC_opts.chunksize; /* Chunk size */ hid_t f_sid; /* dataset file space id */ @@ -270,19 +267,6 @@ int write_uc_file(hbool_t tosend) hsize_t start[3] = {0,0,0}, count[3]; /* Hyperslab selection values */ hsize_t i, j, k; - name = UC_opts.filename; - - /* Open the file */ - if((fapl = h5_fileaccess()) < 0) - return -1; - if(UC_opts.use_swmr) - if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - return -1; - if((fid = H5Fopen(name, H5F_ACC_RDWR | (UC_opts.use_swmr ? H5F_ACC_SWMR_WRITE : 0), fapl)) < 0){ - fprintf(stderr, "H5Fopen failed\n"); - return -1; - } - if(tosend) /* Send a message that H5Fopen is complete--releasing the file lock */ h5_send_message(WRITER_MESSAGE, NULL, NULL); @@ -427,14 +411,6 @@ int write_uc_file(hbool_t tosend) fprintf(stderr, "Failed to close file space\n"); return -1; } - if (H5Pclose(fapl) < 0){ - fprintf(stderr, "Failed to property list\n"); - return -1; - } - if (H5Fclose(fid) < 0){ - fprintf(stderr, "Failed to close file id\n"); - return -1; - } return 0; } @@ -645,6 +621,12 @@ int read_uc_file(hbool_t towait) } } + /* Close the file */ + if(H5Fclose(fid) < 0) { + fprintf(stderr, "H5Fclose failed\n"); + return -1; + } + if (nreadererr) return -1; else |