summaryrefslogtreecommitdiffstats
path: root/test/vds.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2015-03-19 20:04:36 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2015-03-19 20:04:36 (GMT)
commit43dec53436614341f3597271603b90d41dac5ac2 (patch)
treeb057617d8483473d4e2ca4a71f7188cf5f47169c /test/vds.c
parent4cfe53284bb6c3f7f57ff70af6ceb7396683aaa4 (diff)
downloadhdf5-43dec53436614341f3597271603b90d41dac5ac2.zip
hdf5-43dec53436614341f3597271603b90d41dac5ac2.tar.gz
hdf5-43dec53436614341f3597271603b90d41dac5ac2.tar.bz2
[svn-r26482] Opening source files now reuses the flags from the virtual file.
Added tests for I/O on virtual dataset with source datasets in unopened files. Note there are still some code coverage assertions in the selection matching algorithm - if you hit these try taking them out. Note make check still fails in h5dump test (unrelated to this checkin). Tested: ummon
Diffstat (limited to 'test/vds.c')
-rw-r--r--test/vds.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/test/vds.c b/test/vds.c
index d261cd5..cc0a9de 100644
--- a/test/vds.c
+++ b/test/vds.c
@@ -1071,11 +1071,17 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
TEST_ERROR
- /* Close srcdset if config option specified */
+ /* Close srcdset and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
if(H5Dclose(srcdset[0]) < 0)
TEST_ERROR
srcdset[0] = -1;
+
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ } /* end if */
} /* end if */
/* Read data through virtual dataset */
@@ -1098,10 +1104,14 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
TEST_ERROR
- /* Reopen srcdset if config option specified */
- if(config & TEST_IO_CLOSE_SRC)
+ /* Reopen srcdset and srcfile if config option specified */
+ if(config & TEST_IO_CLOSE_SRC) {
+ if(config & TEST_IO_DIFFERENT_FILE)
+ if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
+ TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
+ } /* end if */
/* Read data directly from source dataset */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -1211,7 +1221,7 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Dwrite(srcdset[1], H5T_NATIVE_INT, vspace[1], H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
TEST_ERROR
- /* Close srcdsets if config option specified */
+ /* Close srcdsets and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
if(H5Dclose(srcdset[0]) < 0)
TEST_ERROR
@@ -1219,6 +1229,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Dclose(srcdset[1]) < 0)
TEST_ERROR
srcdset[1] = -1;
+
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ } /* end if */
} /* end if */
/* Read data through virtual dataset */
@@ -1241,8 +1257,11 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
TEST_ERROR
- /* Reopen srcdsets if config option specified */
+ /* Reopen srcdsets and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
+ if(config & TEST_IO_DIFFERENT_FILE)
+ if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
+ TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)