summaryrefslogtreecommitdiffstats
path: root/test/vds.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/vds.c')
-rw-r--r--test/vds.c41
1 files changed, 37 insertions, 4 deletions
diff --git a/test/vds.c b/test/vds.c
index 5173083..08df7ef 100644
--- a/test/vds.c
+++ b/test/vds.c
@@ -5515,10 +5515,6 @@ test_printf(unsigned config, hid_t fapl)
if(mdims[1] != 20)
TEST_ERROR
- /* Close filespace */
- if(H5Sclose(filespace) < 0)
- TEST_ERROR
-
/* Read data through virtual dataset */
/* Reset rbuf */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -5543,6 +5539,43 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
} /* end for */
+ /* Now try with different selections */
+ count[0] = 10;
+ for(start[1] = (hsize_t)0; start[1] < (hsize_t)5; start[1]++)
+ for(count[1] = (hsize_t)1; count[1] < (hsize_t)11; count[1]++) {
+ /* Reset rbuf */
+ HDmemset(rbuf[0], 0, sizeof(rbuf));
+
+ /* Select hyperslab in memory space */
+ if(H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
+ TEST_ERROR
+
+ /* Select hyperslab in file space */
+ if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
+ TEST_ERROR
+
+ /* Read data */
+ if(H5Dread(vdset, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < (int)mdims[0]; i++)
+ for(j = 0; j < (int)mdims[1]; j++) {
+ if((j < (int)start[1]) || (j >= (int)(start[1] + count[1]))) {
+ if(rbuf[i][j] != 0)
+ TEST_ERROR
+ } /* end if */
+ else
+ if(rbuf[i][j] != erbuf[i][j])
+ TEST_ERROR
+ } /* end for */
+ } /* end for */
+ start[1] = 0;
+
+ /* Close filespace */
+ if(H5Sclose(filespace) < 0)
+ TEST_ERROR
+
/* Close */
if(!(config & TEST_IO_CLOSE_SRC)) {
if(H5Dclose(srcdset[0]) < 0)