summaryrefslogtreecommitdiffstats
path: root/test/vds.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2015-08-19 16:21:27 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2015-08-19 16:21:27 (GMT)
commit6909d2033f0d7d87c9fc03dfc778ea3e9437032a (patch)
treeeb5fdf5bb781fa955f2acfbc69d724c2647206dd /test/vds.c
parent69e2f53edbfba4bee9865cec3df78c0cbab42182 (diff)
downloadhdf5-6909d2033f0d7d87c9fc03dfc778ea3e9437032a.zip
hdf5-6909d2033f0d7d87c9fc03dfc778ea3e9437032a.tar.gz
hdf5-6909d2033f0d7d87c9fc03dfc778ea3e9437032a.tar.bz2
[svn-r27527] Add tests to hit code coverage assertions in H5Olayout.c.
Fix issue in VDS delete routine. Tested: ummon
Diffstat (limited to 'test/vds.c')
-rw-r--r--test/vds.c46
1 files changed, 44 insertions, 2 deletions
diff --git a/test/vds.c b/test/vds.c
index 2804227..fab2c4f 100644
--- a/test/vds.c
+++ b/test/vds.c
@@ -362,7 +362,7 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl,
if(H5Fclose(file) < 0)
TEST_ERROR
file = -1;
- if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0)
+ if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
} /* end if */
@@ -375,10 +375,16 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl,
if((*ex_dcpl = H5Dget_create_plist(dset)) < 0)
TEST_ERROR
- /* Close dataset and file */
+ /* Close dataset */
if(H5Dclose(dset) < 0)
TEST_ERROR
dset = -1;
+
+ /* Delete dataset */
+ if(H5Ldelete(file, "vdset", H5P_DEFAULT) < 0)
+ TEST_ERROR
+
+ /* Close file */
if(H5Fclose(file) < 0)
TEST_ERROR
file = -1;
@@ -894,7 +900,9 @@ test_api(test_api_config_t config, hid_t fapl)
if(H5Pclose(ex_dcpl) < 0)
TEST_ERROR
ex_dcpl = -1;
+
#else /* VDS_POINT_SELECTIONS */
+
/*
* Test 3: Verify point selections fail
*/
@@ -1035,6 +1043,40 @@ test_api(test_api_config_t config, hid_t fapl)
ex_dcpl = -1;
+ /*
+ * Test 7: Empty VDS
+ */
+ /* Clear virtual layout in DCPL */
+ if(H5Pset_layout(dcpl, H5D_VIRTUAL) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataspace */
+ if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Select all (should not be necessary, but just to be sure) */
+ if(H5Sselect_all(vspace[0]) < 0)
+ TEST_ERROR
+
+ /* Get examination DCPL */
+ if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename) < 0)
+ TEST_ERROR
+
+ /* Test H5Pget_virtual_count */
+ if(H5Pget_virtual_count(ex_dcpl, &size_out) < 0)
+ TEST_ERROR
+ if(size_out != (size_t)0)
+ TEST_ERROR
+
+ /* Close */
+ if(H5Sclose(vspace[0]) < 0)
+ TEST_ERROR
+ vspace[0] = -1;
+ if(H5Pclose(ex_dcpl) < 0)
+ TEST_ERROR
+ ex_dcpl = -1;
+
+
/* Close */
if(H5Pclose(dcpl) < 0)
TEST_ERROR