summaryrefslogtreecommitdiffstats
path: root/test/vds.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2015-08-07 16:15:39 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2015-08-07 16:15:39 (GMT)
commit98f947ceaedbae472efbebad505680d2ca62b403 (patch)
tree21146ddcd7fd224d9f68bccc9824aa082eb9c205 /test/vds.c
parentbfd13897f6dcfddce253c6a5463cb9f53b927800 (diff)
downloadhdf5-98f947ceaedbae472efbebad505680d2ca62b403.zip
hdf5-98f947ceaedbae472efbebad505680d2ca62b403.tar.gz
hdf5-98f947ceaedbae472efbebad505680d2ca62b403.tar.bz2
[svn-r27479] Add checking for invalid inputs to H5Dset_virtual: point selections, incorrect
numbers of elements selected, incorrect "slice" through limited dimensions, incorrect number of printf substitutions. Patch source selection space extent with bounds of selection if extent is unknown before returning via H5Pget_virtual_srcspace. Write updated VDS dataspace to file when it changes due to unlimited selections. Other minor fixes/cleanup. Tested: ummon
Diffstat (limited to 'test/vds.c')
-rw-r--r--test/vds.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/test/vds.c b/test/vds.c
index 04c0e5f..547f775 100644
--- a/test/vds.c
+++ b/test/vds.c
@@ -461,6 +461,7 @@ test_api(test_api_config_t config, hid_t fapl)
hsize_t block[2]; /* Hyperslab block */
hsize_t coord[10]; /* Point selection array */
size_t size_out;
+ herr_t ret;
unsigned i;
/* Initialize vspace */
@@ -616,6 +617,7 @@ test_api(test_api_config_t config, hid_t fapl)
ex_dcpl = -1;
+#ifdef VDS_POINT_SELECTIONS /* VDS does not currently support point selections */
/*
* Test 3: Point - point selection
*/
@@ -892,6 +894,57 @@ 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
+ */
+ /* Clear virtual layout in DCPL */
+ if(H5Pset_layout(dcpl, H5D_VIRTUAL) < 0)
+ TEST_ERROR
+
+ /* Create source dataspace */
+ if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataspace */
+ if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Select points in source space */
+ coord[0] = 5;
+ coord[1] = 15;
+ coord[2] = 7;
+ coord[3] = 19;
+ coord[4] = 8;
+ coord[5] = 0;
+ coord[6] = 2;
+ coord[7] = 14;
+ coord[8] = 8;
+ coord[9] = 18;
+ if(H5Sselect_elements(srcspace[0], H5S_SELECT_SET, (size_t)5, coord) < 0)
+ TEST_ERROR
+
+ /* Select points in virtual space */
+ coord[0] = 3;
+ coord[1] = 12;
+ coord[2] = 7;
+ coord[3] = 11;
+ coord[4] = 4;
+ coord[5] = 9;
+ coord[6] = 7;
+ coord[7] = 11;
+ coord[8] = 5;
+ coord[9] = 5;
+ if(H5Sselect_elements(vspace[0], H5S_SELECT_SET, (size_t)5, coord) < 0)
+ TEST_ERROR
+
+ /* Attempt to add virtual layout mapping */
+ H5E_BEGIN_TRY {
+ ret = H5Pset_virtual(dcpl, vspace[0], src_file[0], src_dset[0], srcspace[0]);
+ } H5E_END_TRY
+ if(ret >= 0)
+ TEST_ERROR
+#endif /* VDS_POINT_SELECTIONS */
/*