summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2015-08-20 16:38:05 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2015-08-20 16:38:05 (GMT)
commite3bea916863c05b93c1a9277edd7fb91c95805c2 (patch)
treeca288c2a4955ecbaa18a2a5a6ee6dde0e34207c1
parentb1dcfc7a84e5e804c84426fc6fa10d323c7f3b24 (diff)
downloadhdf5-e3bea916863c05b93c1a9277edd7fb91c95805c2.zip
hdf5-e3bea916863c05b93c1a9277edd7fb91c95805c2.tar.gz
hdf5-e3bea916863c05b93c1a9277edd7fb91c95805c2.tar.bz2
[svn-r27538] Add tests to cover remaining code coverage assertions in src directory except
for those in H5Doh.c and H5Shyper.c. Tested: ummon
-rw-r--r--src/H5Dint.c1
-rw-r--r--src/H5Dvirtual.c9
-rw-r--r--src/H5Pdapl.c8
-rw-r--r--src/H5Pdcpl.c1
-rw-r--r--src/H5Sselect.c1
-rw-r--r--test/vds.c431
6 files changed, 418 insertions, 33 deletions
diff --git a/src/H5Dint.c b/src/H5Dint.c
index 490a3c5..97f4fc5 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -2056,7 +2056,6 @@ H5D__get_offset(const H5D_t *dset)
switch(dset->shared->layout.type) {
case H5D_VIRTUAL:
- HDassert(0 && "checking code coverage...");//VDSINC
case H5D_CHUNKED:
case H5D_COMPACT:
break;
diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c
index 46255dd..10e53c9 100644
--- a/src/H5Dvirtual.c
+++ b/src/H5Dvirtual.c
@@ -1428,7 +1428,6 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id)
else {
H5O_storage_virtual_srcdset_t *tmp_sub_dset;
- HDassert(0 && "Checking code coverage..."); //VDSINC
/* Extend sub_dset */
if(NULL == (tmp_sub_dset = (H5O_storage_virtual_srcdset_t *)H5MM_realloc(storage->list[i].sub_dset, 2 * storage->list[i].sub_dset_nalloc * sizeof(H5O_storage_virtual_srcdset_t))))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "unable to extend sub dataset array")
@@ -2648,10 +2647,8 @@ H5D__virtual_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
/* Fail if there are unmapped parts of the selection as they would not be
* written */
- if(tot_nelmts != nelmts) {
- HDassert(0 && "Checking code coverage..."); //VDSINC
+ if(tot_nelmts != nelmts)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "write requested to unmapped portion of virtual dataset")
- } //VDSINC
/* Iterate over mappings */
for(i = 0; i < storage->list_nused; i++) {
@@ -2662,11 +2659,9 @@ H5D__virtual_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
if(storage->list[i].psfn_nsubs || storage->list[i].psdn_nsubs) {
/* Iterate over sub-source dsets */
for(j = storage->list[i].sub_dset_io_start;
- j < storage->list[i].sub_dset_io_end; j++) {
- HDassert(0 && "Checking code coverage..."); //VDSINC
+ j < storage->list[i].sub_dset_io_end; j++)
if(H5D__virtual_write_one(io_info, type_info, file_space, &storage->list[i].sub_dset[j]) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write to source dataset")
- } //VDSINC
} /* end if */
else
/* Write to source dataset */
diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c
index b439009..5574fa9 100644
--- a/src/H5Pdapl.c
+++ b/src/H5Pdapl.c
@@ -379,11 +379,9 @@ H5Pget_virtual_view(hid_t plist_id, H5D_vds_view_t *view)
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, H5D_VDS_ERROR, "can't find object for ID")
/* Get value from property list */
- if(view) {
- HDassert(0 && "Checking code coverage..."); //VDSINC
+ if(view)
if(H5P_get(plist, H5D_ACS_VDS_VIEW_NAME, view) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, H5D_VDS_ERROR, "unable to get value")
- } //VDSINC
done:
FUNC_LEAVE_API(ret_value)
@@ -525,11 +523,9 @@ H5Pget_virtual_printf_gap(hid_t plist_id, hsize_t *gap_size)
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, H5D_VDS_ERROR, "can't find object for ID")
/* Get value from property list */
- if(gap_size) {
- HDassert(0 && "Checking code coverage..."); //VDSINC
+ if(gap_size)
if(H5P_get(plist, H5D_ACS_VDS_PRINTF_GAP_NAME, gap_size) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, H5D_VDS_ERROR, "unable to get value")
- } //VDSINC
done:
FUNC_LEAVE_API(ret_value)
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index b70004b..ebc3919 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -1868,7 +1868,6 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name,
} /* end if */
else if(layout.storage.u.virt.list_nused
== layout.storage.u.virt.list_nalloc) {
- HDassert((layout.storage.u.virt.list_nused > 0) && "checking code coverage...");//VDSINC
/* Double size of entry list. Make sure to zero out new memory. */
if(NULL == (layout.storage.u.virt.list = (H5O_storage_virtual_ent_t *)H5MM_realloc(layout.storage.u.virt.list, (size_t)2 * layout.storage.u.virt.list_nalloc * sizeof(H5O_storage_virtual_ent_t))))
HGOTO_ERROR(H5E_PLIST, H5E_RESOURCE, FAIL, "can't reallocate virtual dataset mapping list")
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index 86a8c43..e965dba 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -2350,7 +2350,6 @@ H5S_select_subtract(H5S_t *space, H5S_t *subtract_space)
&& (subtract_space->select.type->type != H5S_SEL_NONE)) {
/* If subtract_space is using the all selection, set space to none */
if(subtract_space->select.type->type == H5S_SEL_ALL) {
- HDassert(0 && "Checking code coverage...");//VDSINC
/* Change to "none" selection */
if(H5S_select_none(space) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection")
diff --git a/test/vds.c b/test/vds.c
index fab2c4f..9d71a46 100644
--- a/test/vds.c
+++ b/test/vds.c
@@ -375,6 +375,10 @@ 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
+ /* Test H5Dget_offset() (just returns HADDR_UNDEF) */
+ if(HADDR_UNDEF != H5Dget_offset(dset))
+ TEST_ERROR
+
/* Close dataset */
if(H5Dclose(dset) < 0)
TEST_ERROR
@@ -1153,6 +1157,7 @@ test_basic_io(unsigned config, hid_t fapl)
int evbuf[10][26]; /* Expected VDS "buffer" */
int erbuf[10][26]; /* Expected read buffer */
int fill = -1; /* Fill value */
+ herr_t ret; /* Generic return value */
int i, j;
TESTING("basic virtual dataset I/O")
@@ -2965,7 +2970,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
/* Now read entire VDS */
- /* Set memory space extent to 9x9, select all in order to reach part of the
+ /* Set memory space extent to 9x9, select all in order to reach part of the
* code in H5S_select_subtract() */
dims[0] = 9;
dims[1] = 9;
@@ -3201,6 +3206,17 @@ test_basic_io(unsigned config, hid_t fapl)
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
+ /* Now try writing to whole VDS (should fail due to unmapped elements) */
+ count[0] = 9;
+ count[1] = 9;
+ if(H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
+ TEST_ERROR
+ H5E_BEGIN_TRY {
+ ret = H5Dwrite(vdset, H5T_NATIVE_INT, memspace, H5S_ALL, H5P_DEFAULT, buf[0]);
+ } H5E_END_TRY
+ if(ret >= 0)
+ TEST_ERROR
+
/* Close */
if(H5Dclose(srcdset[0]) < 0)
TEST_ERROR
@@ -3318,6 +3334,7 @@ test_unlim(unsigned config, hid_t fapl)
int erbuf[10][20]; /* Expected read buffer */
int ndims; /* Number of dimensions */
int fill = -1; /* Fill value */
+ H5D_vds_view_t virtual_view; /* Virtual view property */
int i, j;
TESTING("virtual dataset I/O with unlimited selections")
@@ -3534,6 +3551,12 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
} /* end for */
+ /* Test H5Pget_virtual_view() */
+ if(H5Pget_virtual_view(dapl, &virtual_view) < 0)
+ TEST_ERROR
+ if(virtual_view != H5D_VDS_LAST_AVAILABLE)
+ TEST_ERROR
+
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
if(H5Dclose(vdset) < 0)
@@ -3550,6 +3573,12 @@ test_unlim(unsigned config, hid_t fapl)
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
+ /* Test H5Pget_virtual_view() */
+ if(H5Pget_virtual_view(dapl, &virtual_view) < 0)
+ TEST_ERROR
+ if(virtual_view != H5D_VDS_FIRST_MISSING)
+ TEST_ERROR
+
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
TEST_ERROR
@@ -5898,6 +5927,7 @@ test_printf(unsigned config, hid_t fapl)
int erbuf[10][20]; /* Expected read buffer */
int ndims; /* Number of dimensions */
int fill = -1; /* Fill value */
+ hsize_t gap_size; /* Gap size property */
int i, j;
TESTING("virtual dataset I/O with printf source")
@@ -6277,30 +6307,88 @@ test_printf(unsigned config, hid_t fapl)
} /* end for */
start[1] = 0;
+ /* Now try writing through VDS */
+ /* Select hyperslab in memory space */
+ if(H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, NULL, dims, NULL) < 0)
+ TEST_ERROR
+
+ /* Select hyperslab in file space */
+ if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, NULL, dims, NULL) < 0)
+ TEST_ERROR
+
+ /* Adjust write buffer */
+ for(i = 0; i < (int)mdims[0]; i++)
+ for(j = 0; j < (int)mdims[1]; j++)
+ buf[i][j] += (int)mdims[0] * (int)mdims[1];
+
+ /* Write data through VDS */
+ if(H5Dwrite(vdset, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
/* Close filespace */
if(H5Sclose(filespace) < 0)
TEST_ERROR
- /* Close */
- if(!(config & TEST_IO_CLOSE_SRC)) {
- if(H5Dclose(srcdset[0]) < 0)
- TEST_ERROR
- srcdset[0] = -1;
- if(H5Dclose(srcdset[1]) < 0)
+ /* 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_RDWR, fapl)) < 0)
+ TEST_ERROR
+ if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset0", H5P_DEFAULT)) < 0)
TEST_ERROR
- srcdset[1] = -1;
- if(H5Dclose(srcdset[2]) < 0)
+ if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0)
TEST_ERROR
- srcdset[2] = -1;
- if(H5Fclose(srcfile[0]) < 0)
+ if((srcdset[2] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- srcfile[0] = -1;
- } /* end if */
- else if(!(config & TEST_IO_DIFFERENT_FILE)) {
- if(H5Fclose(srcfile[0]) < 0)
- TEST_ERROR
- srcfile[0] = -1;
} /* end if */
+
+ /* Read srcdset[0] */
+ count[0] = 10;
+ count[1] = 5;
+ if(H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
+ TEST_ERROR
+ if(H5Dread(srcdset[0], H5T_NATIVE_INT, memspace, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < 10; i++)
+ for(j = 0; j < 5; j++)
+ if(rbuf[i][j] != buf[i][j])
+ TEST_ERROR
+
+ /* Read srcdset[1] */
+ if(H5Dread(srcdset[1], H5T_NATIVE_INT, memspace, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < 10; i++)
+ for(j = 0; j < 5; j++)
+ if(rbuf[i][j] != buf[i][j + 5])
+ TEST_ERROR
+
+ /* Read srcdset[2] */
+ if(H5Dread(srcdset[2], H5T_NATIVE_INT, memspace, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < 10; i++)
+ for(j = 0; j < 5; j++)
+ if(rbuf[i][j] != buf[i][j + 10])
+ TEST_ERROR
+
+ /* Close */
+ if(H5Dclose(srcdset[0]) < 0)
+ TEST_ERROR
+ srcdset[0] = -1;
+ if(H5Dclose(srcdset[1]) < 0)
+ TEST_ERROR
+ srcdset[1] = -1;
+ if(H5Dclose(srcdset[2]) < 0)
+ TEST_ERROR
+ srcdset[2] = -1;
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -6594,6 +6682,12 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
} /* end for */
+ /* Test H5Pget_virtual_printf_gap() */
+ if(H5Pget_virtual_printf_gap(dapl, &gap_size) < 0)
+ TEST_ERROR
+ if(gap_size != (hsize_t)0)
+ TEST_ERROR
+
/* Close VDS and reopen with printf gap set to 1, reopen file as well if
* config option specified */
if(H5Dclose(vdset) < 0)
@@ -6610,6 +6704,12 @@ test_printf(unsigned config, hid_t fapl)
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
+ /* Test H5Pget_virtual_printf_gap() */
+ if(H5Pget_virtual_printf_gap(dapl, &gap_size) < 0)
+ TEST_ERROR
+ if(gap_size != (hsize_t)1)
+ TEST_ERROR
+
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
TEST_ERROR
@@ -9122,6 +9222,303 @@ test_printf(unsigned config, hid_t fapl)
vspace[1] = -1;
+ /*
+ * Test 7: 1 Source dataset mapping, 10x1 blocks, test reallocating sub_dset
+ * array
+ */
+ /* Clear virtual layout in DCPL */
+ if(H5Pset_layout(dcpl, H5D_VIRTUAL) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataspaces */
+ if((vspace[0] = H5Screate_simple(2, dims, mdims)) < 0)
+ TEST_ERROR
+
+ /* Create source dataspace */
+ dims[1] = 1;
+ if((srcspace = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Select hyperslabs in virtual space */
+ stride[0] = 1;
+ stride[1] = 1;
+ count[0] = 1;
+ count[1] = H5S_UNLIMITED;
+ block[0] = 10;
+ block[1] = 1;
+ if(H5Sselect_hyperslab(vspace[0], H5S_SELECT_SET, start, stride, count, block) < 0)
+ TEST_ERROR
+
+ /* Add virtual layout mapping */
+ if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilenamepct_map : ".", "src_dset%b", srcspace) < 0)
+ TEST_ERROR
+
+ /* Create virtual file */
+ if((vfile = H5Fcreate(vfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+
+ /* Create source file if requested */
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+ } /* end if */
+ else {
+ srcfile[0] = vfile;
+ if(H5Iinc_ref(srcfile[0]) < 0)
+ TEST_ERROR
+ } /* end if */
+
+ /* Create virtual dataset */
+ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0)
+ TEST_ERROR
+
+ /* Close srcfile if config option specified */
+ if(config & TEST_IO_CLOSE_SRC)
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ } /* end if */
+
+ /* Reopen virtual dataset and file if config option specified */
+ if(config & TEST_IO_REOPEN_VIRT) {
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR
+ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
+ TEST_ERROR
+ } /* end if */
+
+ /* Get VDS space */
+ if((filespace = H5Dget_space(vdset)) < 0)
+ TEST_ERROR
+
+ /* Get VDS space dimensions */
+ if((ndims = H5Sget_simple_extent_ndims(filespace)) < 0)
+ TEST_ERROR
+ if(ndims != 2)
+ TEST_ERROR
+ if(H5Sget_simple_extent_dims(filespace, dims, mdims) < 0)
+ TEST_ERROR
+ if(dims[0] != 10)
+ TEST_ERROR
+ if(dims[1] != 0)
+ TEST_ERROR
+ if(mdims[0] != 10)
+ TEST_ERROR
+ if(mdims[1] != 20)
+ TEST_ERROR
+
+ /* Close filespace */
+ if(H5Sclose(filespace) < 0)
+ TEST_ERROR
+
+ /* Reopen srcfile if config option specified */
+ if(config & TEST_IO_CLOSE_SRC)
+ if(config & TEST_IO_DIFFERENT_FILE)
+ if((srcfile[0] = H5Fopen(srcfilenamepct, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR
+
+ /* Create 1 source dataset */
+ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset0", H5T_NATIVE_INT, srcspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Populate write buffer */
+ for(i = 0; i < (int)mdims[0]; i++)
+ for(j = 0; j < (int)mdims[1]; j++)
+ buf[i][j] = (i * (int)mdims[1]) + j;
+
+ /* Initialize erbuf */
+ for(i = 0; i < (int)mdims[0]; i++)
+ for(j = 0; j < (int)mdims[1]; j++)
+ erbuf[i][j] = fill;
+
+ /* Write to srcdset[0] */
+ if(H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, NULL, block, NULL) < 0)
+ TEST_ERROR
+ if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, memspace, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* Update erbuf */
+ for(i = 0; i < 10; i++)
+ erbuf[i][0] = buf[i][0];
+
+ /* Close srcdset[0] 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 */
+
+ /* Reopen virtual dataset and file if config option specified */
+ if(config & TEST_IO_REOPEN_VIRT) {
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR
+ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
+ TEST_ERROR
+ } /* end if */
+
+ /* Get VDS space */
+ if((filespace = H5Dget_space(vdset)) < 0)
+ TEST_ERROR
+
+ /* Get VDS space dimensions */
+ if((ndims = H5Sget_simple_extent_ndims(filespace)) < 0)
+ TEST_ERROR
+ if(ndims != 2)
+ TEST_ERROR
+ if(H5Sget_simple_extent_dims(filespace, dims, mdims) < 0)
+ TEST_ERROR
+ if(dims[0] != 10)
+ TEST_ERROR
+ if(dims[1] != 1)
+ TEST_ERROR
+ if(mdims[0] != 10)
+ TEST_ERROR
+ 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));
+
+ /* Select hyperslab in memory space */
+ if(H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, NULL, dims, NULL) < 0)
+ TEST_ERROR
+
+ /* Read data */
+ if(H5Dread(vdset, H5T_NATIVE_INT, memspace, H5S_ALL, 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)dims[1]) {
+ if(rbuf[i][j] != 0)
+ TEST_ERROR
+ } /* end if */
+ else
+ if(rbuf[i][j] != erbuf[i][j])
+ TEST_ERROR
+ } /* end for */
+
+ /* Close VDS and reopen with printf gap set to 127, reopen file as well if
+ * config option specified */
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ if(H5Pset_virtual_printf_gap(dapl, (hsize_t)127) < 0)
+ TEST_ERROR
+ if(config & TEST_IO_REOPEN_VIRT) {
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR
+ } /* end if */
+ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
+ TEST_ERROR
+
+ /* Get VDS space */
+ if((filespace = H5Dget_space(vdset)) < 0)
+ TEST_ERROR
+
+ /* Get VDS space dimensions */
+ if((ndims = H5Sget_simple_extent_ndims(filespace)) < 0)
+ TEST_ERROR
+ if(ndims != 2)
+ TEST_ERROR
+ if(H5Sget_simple_extent_dims(filespace, dims, mdims) < 0)
+ TEST_ERROR
+ if(dims[0] != 10)
+ TEST_ERROR
+ if(dims[1] != 1)
+ TEST_ERROR
+ if(mdims[0] != 10)
+ TEST_ERROR
+ 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));
+
+ /* Select hyperslab in memory space */
+ if(H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, NULL, dims, NULL) < 0)
+ TEST_ERROR
+
+ /* Read data */
+ if(H5Dread(vdset, H5T_NATIVE_INT, memspace, H5S_ALL, 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)dims[1]) {
+ if(rbuf[i][j] != 0)
+ TEST_ERROR
+ } /* end if */
+ else
+ if(rbuf[i][j] != erbuf[i][j])
+ TEST_ERROR
+ } /* end for */
+
+ /* Reset dapl */
+ if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0)
+ TEST_ERROR
+
+ /* Close */
+ if(!(config & TEST_IO_CLOSE_SRC)) {
+ if(H5Dclose(srcdset[0]) < 0)
+ TEST_ERROR
+ srcdset[0] = -1;
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ } /* end if */
+ else if(!(config & TEST_IO_DIFFERENT_FILE)) {
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ } /* end if */
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if(H5Sclose(srcspace) < 0)
+ TEST_ERROR
+ srcspace = -1;
+ if(H5Sclose(vspace[0]) < 0)
+ TEST_ERROR
+ vspace[0] = -1;
+
+
/* Close */
if(H5Pclose(dcpl) < 0)
TEST_ERROR