summaryrefslogtreecommitdiffstats
path: root/test/vds.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-12-20 21:11:17 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-12-20 21:11:17 (GMT)
commitb1223dd653e65e076af92b2dfe236f3704da81c8 (patch)
tree2be2721723cc0d8d87e9d32f729a0a35b0a5cfde /test/vds.c
parentb25f123f5f5e25c1447a6a02861cb7c7265c12f2 (diff)
parente94ed99c5bf7c4ae5df56f75606ef1b486e16bb2 (diff)
downloadhdf5-b1223dd653e65e076af92b2dfe236f3704da81c8.zip
hdf5-b1223dd653e65e076af92b2dfe236f3704da81c8.tar.gz
hdf5-b1223dd653e65e076af92b2dfe236f3704da81c8.tar.bz2
Merge pull request #826 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit 'e94ed99c5bf7c4ae5df56f75606ef1b486e16bb2': Add HD prefix HDFFV-9724 Remove VDS file cache functionality Removed incorrect MPI text Par example needs to link with mpi libs Because of MPI requirements in library ALWAYS add include path Cleanup comments and if() in TRY blocks Skip test if 1.6 API HDFFV-9724 Add ENV VAR to vds test HDFFV-9724 Copy efc_open search from Lextern_traverse Add prefix dir to the clear command HDFFV-9724 Add H5LS prefix test with ${ORIGIN} Add h5dump VDS prefix tests HDFFV-9724 combine efc and vds into one function Correct var name Fix VDS file cache var names Remove return from void functions Added java wrappers and tests HDFFV-9724 Initial changes and test Changed reference from dl to CMake variable H5detect and H5make_libsettings need include folder
Diffstat (limited to 'test/vds.c')
-rw-r--r--test/vds.c1493
1 files changed, 923 insertions, 570 deletions
diff --git a/test/vds.c b/test/vds.c
index c9b7a1b..eca26bc 100644
--- a/test/vds.c
+++ b/test/vds.c
@@ -36,6 +36,12 @@ const char *FILENAME[] = {
"vds_src_1",
"vds%%_src",
"vds_dapl",
+ "vds_virt_2",
+ "vds_virt_3",
+ "vds_src_2",
+ "vds_src_3",
+ "vds%%_src2",
+ "vds_dapl2",
NULL
};
@@ -49,6 +55,8 @@ const char *FILENAME[] = {
#define FILENAME_BUF_SIZE 1024
+#define TMPDIR "tmp/"
+
/*-------------------------------------------------------------------------
* Function: vds_select_equal
@@ -57,14 +65,7 @@ const char *FILENAME[] = {
* provided dataspaces are the same.
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: Neil Fortner
- * Monday, March 2, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static htri_t
@@ -130,7 +131,7 @@ vds_select_equal(hid_t space1, hid_t space2)
if(buf1[i] != buf2[i]) {
ret_value = FALSE;
break;
- } /* end if */
+ }
/* Free buffers */
HDfree(buf1);
@@ -180,7 +181,7 @@ vds_select_equal(hid_t space1, hid_t space2)
if(buf1[i] != buf2[i]) {
ret_value = FALSE;
break;
- } /* end if */
+ }
/* Free buffers */
HDfree(buf1);
@@ -217,14 +218,7 @@ error:
* parameters.
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: Neil Fortner
- * Monday, March 2, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -298,8 +292,7 @@ vds_check_mapping(hid_t dcpl, size_t i, hid_t vspace, hid_t srcspace,
error:
H5E_BEGIN_TRY {
- if(space_out >= 0)
- (void)H5Sclose(space_out);
+ H5Sclose(space_out);
} H5E_END_TRY
return -1;
@@ -312,14 +305,7 @@ error:
* Purpose: Tests API functions related to virtual datasets.
*
* Return: Success: 0
- *
* Failure: number of errors
- *
- * Programmer: Neil Fortner
- * Monday, February 16, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
/* Helper function to get DCPL for examination depending on config */
@@ -370,12 +356,12 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl,
file = -1;
if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Open dataset */
if((dset = H5Dopen2(file, "vdset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get DCPL from dataset */
if((*ex_dcpl = H5Dget_create_plist(dset)) < 0)
@@ -394,8 +380,8 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl,
if(oinfo.meta_size.obj.heap_size != exp_meta_size) {
printf("VDS metadata size: %llu Expected: %llu\n", (long long unsigned)oinfo.meta_size.obj.heap_size, (long long unsigned)exp_meta_size);
TEST_ERROR
- } /* end if */
- } /* end if */
+ }
+ }
else
if((oinfo.meta_size.obj.heap_size != exp_meta_size)
&& (oinfo.meta_size.obj.heap_size != (hsize_t)0))
@@ -424,12 +410,12 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl,
if(H5Fclose(file) < 0)
TEST_ERROR
file = -1;
- } /* end if */
+ }
else if(config == TEST_API_COPY_PLIST) {
/* Copy property list */
if((*ex_dcpl = H5Pcopy(dcpl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else if(config == TEST_API_ENCDEC_PLIST) {
size_t plist_buf_size;
@@ -448,14 +434,14 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl,
/* Free plist_buf */
HDfree(plist_buf);
plist_buf = NULL;
- } /* end if */
+ }
else {
/* Simply copy the id to ex_dcpl and increment the ref count so ex_dcpl
* can be closed */
if(H5Iinc_ref(dcpl) < 0)
TEST_ERROR
*ex_dcpl = dcpl;
- } /* end else */
+ }
/* Verify examination DCPL is equal to original DCPL. Do not compare the
* plist to itself, and do not do the comparison if we reopened the file,
@@ -466,16 +452,14 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl,
TEST_ERROR
if(!tri_ret)
TEST_ERROR
- } /* end if */
+ }
return 0;
error:
H5E_BEGIN_TRY {
- if(file >= 0)
- (void)H5Fclose(file);
- if(dset >= 0)
- (void)H5Dclose(dset);
+ H5Fclose(file);
+ H5Dclose(dset);
} H5E_END_TRY;
if(plist_buf)
HDfree(plist_buf);
@@ -532,7 +516,7 @@ test_api(test_api_config_t config, hid_t fapl)
case TEST_API_NTESTS:
default:
TEST_ERROR
- } /* end switch */
+ }
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
@@ -818,7 +802,7 @@ test_api(test_api_config_t config, hid_t fapl)
/* Create virtual dataspace */
if((vspace[i] = H5Screate_simple(2, dims, NULL)) < 0)
TEST_ERROR
- } /* end for */
+ }
/* Select all (should not be necessary, but just to be sure) */
if(H5Sselect_all(srcspace[0]) < 0)
@@ -932,7 +916,7 @@ test_api(test_api_config_t config, hid_t fapl)
if(H5Sclose(vspace[i]) < 0)
TEST_ERROR
vspace[i] = -1;
- } /* end for */
+ }
if(H5Pclose(ex_dcpl) < 0)
TEST_ERROR
ex_dcpl = -1;
@@ -1038,7 +1022,7 @@ test_api(test_api_config_t config, hid_t fapl)
/* Add virtual layout mapping */
if(H5Pset_virtual(dcpl, vspace[i], tmp_filename, tmp_dsetname, srcspace[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get examination DCPL */
if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, (hsize_t)697) < 0)
@@ -1063,7 +1047,7 @@ test_api(test_api_config_t config, hid_t fapl)
/* Check that the mapping in the DCPL is correct */
if(vds_check_mapping(ex_dcpl, (size_t)i, vspace[i], srcspace[0], tmp_filename, tmp_dsetname) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Close */
if(H5Sclose(srcspace[0]) < 0)
@@ -1073,7 +1057,7 @@ test_api(test_api_config_t config, hid_t fapl)
if(H5Sclose(vspace[i]) < 0)
TEST_ERROR
vspace[i] = -1;
- } /* end for */
+ }
if(H5Pclose(ex_dcpl) < 0)
TEST_ERROR
ex_dcpl = -1;
@@ -1123,23 +1107,459 @@ test_api(test_api_config_t config, hid_t fapl)
error:
H5E_BEGIN_TRY {
- for(i = 0; i < (sizeof(srcspace) / sizeof(srcspace[0])); i++) {
- if(srcspace[i] >= 0)
- (void)H5Sclose(srcspace[i]);
- } /* end for */
- for(i = 0; i < (sizeof(vspace) / sizeof(vspace[0])); i++) {
- if(vspace[i] >= 0)
- (void)H5Sclose(vspace[i]);
- } /* end for */
- if(dcpl >= 0)
- (void)H5Pclose(dcpl);
- if(ex_dcpl >= 0)
- (void)H5Pclose(ex_dcpl);
+ for(i = 0; i < (sizeof(srcspace) / sizeof(srcspace[0])); i++)
+ H5Sclose(srcspace[i]);
+ for(i = 0; i < (sizeof(vspace) / sizeof(vspace[0])); i++)
+ H5Sclose(vspace[i]);
+ H5Pclose(dcpl);
+ H5Pclose(ex_dcpl);
} H5E_END_TRY;
return 1;
} /* end test_api() */
+/*-------------------------------------------------------------------------
+ * Function: vds_link_prefix
+ *
+ * Purpose: Set up vds link prefix via H5Pset_virtual_prefix() to be "tmp"
+ * Should be able to access the target source files in tmp directory via the prefix set
+ * by H5Pset_virtual_prefix()
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+test_vds_prefix(unsigned config, hid_t fapl)
+{
+ char srcfilename[FILENAME_BUF_SIZE];
+ char srcfilename_map[FILENAME_BUF_SIZE];
+ char vfilename[FILENAME_BUF_SIZE];
+ char vfilename2[FILENAME_BUF_SIZE];
+ char srcfilenamepct[FILENAME_BUF_SIZE];
+ char srcfilenamepct_map[FILENAME_BUF_SIZE];
+ const char *srcfilenamepct_map_orig = "vds%%%%_src";
+ hid_t srcfile[4] = {-1, -1, -1, -1}; /* Files with source dsets */
+ hid_t vfile = -1; /* File with virtual dset */
+ hid_t vfile2 = -1; /* File with copied virtual dset */
+ hid_t dcpl = -1; /* Dataset creation property list */
+ hid_t dapl = -1; /* Dataset access property list */
+ hid_t srcspace[4] = {-1, -1, -1, -1}; /* Source dataspaces */
+ hid_t vspace[4] = {-1, -1, -1, -1}; /* Virtual dset dataspaces */
+ hid_t memspace = -1; /* Memory dataspace */
+ hid_t srcdset[4] = {-1, -1, -1, -1}; /* Source datsets */
+ hid_t vdset = -1; /* Virtual dataset */
+ hsize_t dims[4] = {10, 26, 0, 0}; /* Data space current size */
+ hsize_t start[4]; /* Hyperslab start */
+ hsize_t stride[4]; /* Hyperslab stride */
+ hsize_t count[4]; /* Hyperslab count */
+ hsize_t block[4]; /* Hyperslab block */
+ hssize_t offset[2] = {0, 0}; /* Selection offset */
+ int buf[10][26]; /* Write and expected read buffer */
+ int rbuf[10][26]; /* Read buffer */
+ int rbuf99[9][9]; /* 9x9 Read buffer */
+ 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;
+ char buffer[1024]; /* buffer to read vds_prefix */
+
+ TESTING("basic virtual dataset I/O via H5Pset_vds_prefix()")
+
+ h5_fixname(FILENAME[0], fapl, vfilename, sizeof vfilename);
+ h5_fixname(FILENAME[7], fapl, vfilename2, sizeof vfilename2);
+ h5_fixname(FILENAME[8], fapl, srcfilename, sizeof srcfilename);
+ h5_fixname_printf(FILENAME[8], fapl, srcfilename_map, sizeof srcfilename_map);
+ h5_fixname(FILENAME[10], fapl, srcfilenamepct, sizeof srcfilenamepct);
+ h5_fixname_printf(srcfilenamepct_map_orig, fapl, srcfilenamepct_map, sizeof srcfilenamepct_map);
+
+ /* create tmp directory and get current working directory path */
+ if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST)
+ TEST_ERROR
+
+ /* Create DCPL */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ TEST_ERROR
+
+ /* Set fill value */
+ if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0)
+ TEST_ERROR
+
+ /* Initialize VDS prefix items */
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ TEST_ERROR
+
+ if(H5Pset_virtual_prefix(dapl, TMPDIR) < 0)
+ TEST_ERROR
+ if(H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0)
+ TEST_ERROR
+
+ if(HDstrcmp(buffer, TMPDIR) != 0)
+ FAIL_PUTS_ERROR("vds prefix not set correctly");
+
+ /*
+ * Test 1: All - all selection
+ */
+ /* 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 all (should not be necessary, but just to be sure) */
+ if(H5Sselect_all(srcspace[0]) < 0)
+ TEST_ERROR
+ if(H5Sselect_all(vspace[0]) < 0)
+ TEST_ERROR
+
+ /* Add virtual layout mapping */
+ if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset", srcspace[0]) < 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) {
+ HDgetcwd(buffer, 1024);
+ HDchdir(TMPDIR);
+ if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+ HDchdir(buffer);
+ }
+ else {
+ srcfile[0] = vfile;
+ if(H5Iinc_ref(srcfile[0]) < 0)
+ TEST_ERROR
+ }
+
+ /* Create source dataset */
+ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataset */
+ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0)
+ TEST_ERROR
+
+ /* Populate write buffer */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j;
+
+ /* Write data directly to source dataset */
+ if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* 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;
+ }
+ }
+
+ /* 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
+ }
+
+ /* Read data through virtual dataset */
+ HDmemset(rbuf[0], 0, sizeof(rbuf));
+ if(H5Dread(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) {
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ if(rbuf[i][j] != buf[i][j]) {
+ TEST_ERROR
+ }
+ }
+
+ /* Adjust write buffer */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ buf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0]));
+
+ /* Write data through virtual dataset */
+ if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* Reopen srcdset and srcfile if config option specified */
+ if(config & TEST_IO_CLOSE_SRC) {
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ HDgetcwd(buffer, 1024);
+ HDchdir(TMPDIR);
+ if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0)
+ TEST_ERROR
+ HDchdir(buffer);
+ }
+ if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ }
+
+ /* Read data directly from source dataset */
+ HDmemset(rbuf[0], 0, sizeof(rbuf));
+ if(H5Dread(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ if(rbuf[i][j] != buf[i][j])
+ TEST_ERROR
+
+ /* Close */
+ if(H5Dclose(srcdset[0]) < 0)
+ TEST_ERROR
+ srcdset[0] = -1;
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if(H5Sclose(srcspace[0]) < 0)
+ TEST_ERROR
+ srcspace[0] = -1;
+ if(H5Sclose(vspace[0]) < 0)
+ TEST_ERROR
+ vspace[0] = -1;
+ if(H5Pclose(dapl) < 0)
+ TEST_ERROR
+ dapl = -1;
+ if(H5Pclose(dcpl) < 0)
+ TEST_ERROR
+ dcpl = -1;
+
+ /*
+ * Test 2: All - all selection with ENV prefix
+ */
+ if(HDsetenv("HDF5_VDS_PREFIX", "${ORIGIN}/tmp", 1))
+ TEST_ERROR
+
+ /* Create DCPL */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ TEST_ERROR
+
+ /* Set fill value */
+ if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0)
+ TEST_ERROR
+
+ /* Set prefix to a nonexistent directory, will be overwritten by environment variable */
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ TEST_ERROR
+
+ if(H5Pset_virtual_prefix(dapl, "someprefix") < 0)
+ TEST_ERROR
+ if(H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0)
+ TEST_ERROR
+
+ if(HDstrcmp(buffer, "someprefix") != 0)
+ FAIL_PUTS_ERROR("vds prefix not set correctly");
+
+ /* 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 all (should not be necessary, but just to be sure) */
+ if(H5Sselect_all(srcspace[0]) < 0)
+ TEST_ERROR
+ if(H5Sselect_all(vspace[0]) < 0)
+ TEST_ERROR
+
+ /* Add virtual layout mapping */
+ if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset", srcspace[0]) < 0)
+ TEST_ERROR
+
+ /* Create virtual file */
+ if((vfile = H5Fcreate(vfilename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+
+ /* Create source file if requested */
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ HDgetcwd(buffer, 1024);
+ HDchdir(TMPDIR);
+ if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+ HDchdir(buffer);
+ }
+ else {
+ srcfile[0] = vfile;
+ if(H5Iinc_ref(srcfile[0]) < 0)
+ TEST_ERROR
+ }
+
+ /* Create source dataset */
+ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataset */
+ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0)
+ TEST_ERROR
+
+ /* Populate write buffer */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j;
+
+ /* Write data directly to source dataset */
+ if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* 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;
+ }
+ }
+
+ /* 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(vfilename2, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR
+ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
+ TEST_ERROR
+ }
+
+ /* Read data through virtual dataset */
+ HDmemset(rbuf[0], 0, sizeof(rbuf));
+ if(H5Dread(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) {
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ if(rbuf[i][j] != buf[i][j]) {
+ TEST_ERROR
+ }
+ }
+
+ /* Adjust write buffer */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ buf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0]));
+
+ /* Write data through virtual dataset */
+ if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* Reopen srcdset and srcfile if config option specified */
+ if(config & TEST_IO_CLOSE_SRC) {
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ HDgetcwd(buffer, 1024);
+ HDchdir(TMPDIR);
+ if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0)
+ TEST_ERROR
+ HDchdir(buffer);
+ }
+ if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ }
+
+ /* Read data directly from source dataset */
+ HDmemset(rbuf[0], 0, sizeof(rbuf));
+ if(H5Dread(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ if(rbuf[i][j] != buf[i][j])
+ TEST_ERROR
+
+ /* Close */
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Dclose(srcdset[0]) < 0)
+ TEST_ERROR
+ srcdset[0] = -1;
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if(H5Sclose(srcspace[0]) < 0)
+ TEST_ERROR
+ srcspace[0] = -1;
+ if(H5Sclose(vspace[0]) < 0)
+ TEST_ERROR
+ vspace[0] = -1;
+ if(H5Pclose(dapl) < 0)
+ TEST_ERROR
+ dapl = -1;
+ if(H5Pclose(dcpl) < 0)
+ TEST_ERROR
+ dcpl = -1;
+
+ if(HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0)
+ TEST_ERROR
+
+ PASSED();
+ return 0;
+
+ error:
+ H5E_BEGIN_TRY {
+ for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++)
+ H5Dclose(srcdset[i]);
+ H5Dclose(vdset);
+ for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++)
+ H5Fclose(srcfile[i]);
+ H5Fclose(vfile);
+ H5Fclose(vfile2);
+ for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++)
+ H5Sclose(srcspace[i]);
+ for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++)
+ H5Sclose(vspace[i]);
+ H5Sclose(memspace);
+ H5Pclose(dcpl);
+ } H5E_END_TRY;
+
+ if(HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0)
+ TEST_ERROR
+
+ return 1;
+} /* end vds_link_prefix() */
+
/*-------------------------------------------------------------------------
* Function: test_basic_io
@@ -1148,14 +1568,7 @@ error:
* pattern-matching file/dataset strings
*
* Return: Success: 0
- *
* Failure: number of errors
- *
- * Programmer: Neil Fortner
- * Tuesday, March 3, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -1238,12 +1651,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, 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 source dataset */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -1272,8 +1685,8 @@ test_basic_io(unsigned config, hid_t fapl)
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) {
@@ -1287,7 +1700,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data through virtual dataset */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -1316,7 +1729,7 @@ test_basic_io(unsigned config, hid_t fapl)
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));
@@ -1400,12 +1813,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, 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 source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "%src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -1441,8 +1854,8 @@ test_basic_io(unsigned config, hid_t fapl)
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) {
@@ -1456,7 +1869,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data through virtual dataset */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -1487,7 +1900,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data directly from source datasets */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -1536,8 +1949,8 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -1546,7 +1959,7 @@ test_basic_io(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Open v_dset2 */
if((vdset = H5Dopen2(vfile, "v_dset2", H5P_DEFAULT)) < 0)
@@ -1572,7 +1985,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Only copy to a different file if the source datasets are in a different
* file */
@@ -1614,8 +2027,8 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen copied virtual file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -1624,7 +2037,7 @@ test_basic_io(unsigned config, hid_t fapl)
vfile2 = -1;
if((vfile2 = H5Fopen(vfilename2, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Open v_dset3 */
if((vdset = H5Dopen2(vfile2, "v_dset3", H5P_DEFAULT)) < 0)
@@ -1650,13 +2063,13 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Close copied virtual file */
if(H5Fclose(vfile2) < 0)
TEST_ERROR
vfile2 = -1;
- } /* end if */
+ }
/* Close */
if(H5Dclose(srcdset[0]) < 0)
@@ -1735,12 +2148,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, 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 source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "%src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -1782,8 +2195,8 @@ test_basic_io(unsigned config, hid_t fapl)
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) {
@@ -1797,7 +2210,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data through virtual dataset */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -1828,7 +2241,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data directly from source datasets */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -1923,12 +2336,12 @@ test_basic_io(unsigned config, hid_t fapl)
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 source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -1964,8 +2377,8 @@ test_basic_io(unsigned config, hid_t fapl)
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) {
@@ -1979,7 +2392,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read first source dataset through virtual dataset */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -2032,7 +2445,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data directly from source datasets */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -2131,12 +2544,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, 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 source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -2164,7 +2577,7 @@ test_basic_io(unsigned config, hid_t fapl)
evbuf[i][j] = buf[2 * i][j];
for(/* j = 13 */; j < 26; j++)
evbuf[i][j] = buf[2 * i + 1][j - 13];
- } /* end for */
+ }
/* Adjust write buffer */
for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
@@ -2181,7 +2594,7 @@ test_basic_io(unsigned config, hid_t fapl)
evbuf[i + 5][j] = buf[2 * i][j + 13];
for(/* j = 13 */; j < 26; j++)
evbuf[i + 5][j] = buf[2 * i + 1][j];
- } /* end for */
+ }
/* Close srcdsets and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -2196,8 +2609,8 @@ test_basic_io(unsigned config, hid_t fapl)
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) {
@@ -2211,7 +2624,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data through virtual dataset by hyperslab */
/* Reset rbuf */
@@ -2227,7 +2640,7 @@ test_basic_io(unsigned config, hid_t fapl)
erbuf[i][j] = evbuf[2 * i][j];
for(/* j = 13 */; j < 26; j++)
erbuf[i][j] = evbuf[2 * i + 1][j - 13];
- } /* end for */
+ }
/* Read second slice */
if(H5Dread(vdset, H5T_NATIVE_INT, vspace[1], srcspace[1], H5P_DEFAULT, rbuf[0]) < 0)
@@ -2239,7 +2652,7 @@ test_basic_io(unsigned config, hid_t fapl)
erbuf[i + 5][j] = evbuf[2 * i][j + 13];
for(/* j = 13 */; j < 26; j++)
erbuf[i + 5][j] = evbuf[2 * i + 1][j];
- } /* end for */
+ }
/* Verify read data */
for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
@@ -2263,7 +2676,7 @@ test_basic_io(unsigned config, hid_t fapl)
evbuf[2 * i][j] = buf[i][j];
for(/* j = 13 */; j < 26; j++)
evbuf[2 * i + 1][j - 13] = buf[i][j];
- } /* end for */
+ }
/* Adjust write buffer */
for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
@@ -2280,7 +2693,7 @@ test_basic_io(unsigned config, hid_t fapl)
evbuf[2 * i][j + 13] = buf[i + 5][j];
for(/* j = 13 */; j < 26; j++)
evbuf[2 * i + 1][j] = buf[i + 5][j];
- } /* end for */
+ }
/* Reopen srcdsets and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -2291,7 +2704,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data directly from source datasets */
/* Reset rbuf */
@@ -2307,7 +2720,7 @@ test_basic_io(unsigned config, hid_t fapl)
erbuf[2 * i][j] = evbuf[i][j];
for(/* j = 13 */; j < 26; j++)
erbuf[2 * i + 1][j - 13] = evbuf[i][j];
- } /* end for */
+ }
/* Read second dataset */
if(H5Dread(srcdset[1], H5T_NATIVE_INT, srcspace[1], srcspace[1], H5P_DEFAULT, rbuf[0]) < 0)
@@ -2319,7 +2732,7 @@ test_basic_io(unsigned config, hid_t fapl)
erbuf[2 * i][j + 13] = evbuf[i + 5][j];
for(/* j = 13 */; j < 26; j++)
erbuf[2 * i + 1][j] = evbuf[i + 5][j];
- } /* end for */
+ }
/* Verify read data */
for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
@@ -2439,12 +2852,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, 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 source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -2498,8 +2911,8 @@ test_basic_io(unsigned config, hid_t fapl)
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) {
@@ -2513,7 +2926,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data through virtual dataset by hyperslab */
/* Reset rbuf */
@@ -2538,7 +2951,7 @@ test_basic_io(unsigned config, hid_t fapl)
for(j = 0; j < 26; j++) {
erbuf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0]));
erbuf[i + 1][j] -= (int)(sizeof(buf) / sizeof(buf[0][0]));
- } /* end for */
+ }
/* Verify read data */
for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
@@ -2584,7 +2997,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data directly from source datasets */
/* Reset rbuf */
@@ -2605,7 +3018,7 @@ test_basic_io(unsigned config, hid_t fapl)
for(j = 0; j < 26; j++) {
erbuf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0]));
erbuf[i + 1][j] -= (int)(sizeof(buf) / sizeof(buf[0][0]));
- } /* end for */
+ }
/* Read second dataset */
if(H5Dread(srcdset[1], H5T_NATIVE_INT, memspace, srcspace[0], H5P_DEFAULT, rbuf[0]) < 0)
@@ -2780,12 +3193,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, 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 source dataset */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -2822,8 +3235,8 @@ test_basic_io(unsigned config, hid_t fapl)
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) {
@@ -2837,7 +3250,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data through virtual dataset */
/* Reset rbuf */
@@ -2943,7 +3356,7 @@ test_basic_io(unsigned config, hid_t fapl)
if((j >= 3) && (j < 6)) {
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != 0)
TEST_ERROR
@@ -2996,7 +3409,7 @@ test_basic_io(unsigned config, hid_t fapl)
if((j >= 6) && (j < 9)) {
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != 0)
TEST_ERROR
@@ -3214,7 +3627,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data directly from source dataset */
/* Select hyperslab in memory space */
@@ -3289,32 +3702,19 @@ test_basic_io(unsigned config, hid_t fapl)
error:
H5E_BEGIN_TRY {
- for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) {
- if(srcdset[i] >= 0)
- (void)H5Dclose(srcdset[i]);
- } /* end for */
- if(vdset >= 0)
- (void)H5Dclose(vdset);
- for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) {
- if(srcfile[i] >= 0)
- (void)H5Fclose(srcfile[i]);
- } /* end for */
- if(vfile >= 0)
- (void)H5Fclose(vfile);
- if(vfile2 >= 0)
- (void)H5Fclose(vfile2);
- for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) {
- if(srcspace[i] >= 0)
- (void)H5Sclose(srcspace[i]);
- } /* end for */
- for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) {
- if(vspace[i] >= 0)
- (void)H5Sclose(vspace[i]);
- } /* end for */
- if(memspace >= 0)
- (void)H5Sclose(memspace);
- if(dcpl >= 0)
- (void)H5Pclose(dcpl);
+ for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++)
+ H5Dclose(srcdset[i]);
+ H5Dclose(vdset);
+ for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++)
+ H5Fclose(srcfile[i]);
+ H5Fclose(vfile);
+ H5Fclose(vfile2);
+ for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++)
+ H5Sclose(srcspace[i]);
+ for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++)
+ H5Sclose(vspace[i]);
+ H5Sclose(memspace);
+ H5Pclose(dcpl);
} H5E_END_TRY;
return 1;
@@ -3327,14 +3727,7 @@ error:
* Purpose: Tests VDS with unlimited selections
*
* Return: Success: 0
- *
* Failure: number of errors
- *
- * Programmer: Neil Fortner
- * Thursday, April 30, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -3447,12 +3840,12 @@ test_unlim(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, 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 source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0)
@@ -3517,8 +3910,8 @@ test_unlim(unsigned config, hid_t fapl)
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) {
@@ -3532,7 +3925,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -3577,11 +3970,11 @@ test_unlim(unsigned config, hid_t fapl)
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 */
+ }
/* Test H5Pget_virtual_view() */
if(H5Pget_virtual_view(dapl, &virtual_view) < 0)
@@ -3601,7 +3994,7 @@ test_unlim(unsigned config, hid_t fapl)
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
@@ -3649,11 +4042,11 @@ test_unlim(unsigned config, hid_t fapl)
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 */
+ }
/* Reopen srcdset[0] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -3662,7 +4055,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[0] */
dims[0] = 5;
@@ -3699,8 +4092,8 @@ test_unlim(unsigned config, hid_t fapl)
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) {
@@ -3714,7 +4107,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -3761,11 +4154,11 @@ test_unlim(unsigned config, hid_t fapl)
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 view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -3779,7 +4172,7 @@ test_unlim(unsigned config, hid_t fapl)
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
@@ -3832,11 +4225,11 @@ test_unlim(unsigned config, hid_t fapl)
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 */
+ }
/* Reopen srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -3845,7 +4238,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[1] */
dims[0] = 5;
@@ -3887,8 +4280,8 @@ test_unlim(unsigned config, hid_t fapl)
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) {
@@ -3902,7 +4295,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -3964,7 +4357,7 @@ test_unlim(unsigned config, hid_t fapl)
if((i == 4) || (i == 5)) {
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != 0)
TEST_ERROR
@@ -4029,11 +4422,11 @@ test_unlim(unsigned config, hid_t fapl)
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 */
+ }
/* Shrink to 15 */
dims[1] = 15;
@@ -4060,12 +4453,12 @@ test_unlim(unsigned config, hid_t fapl)
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 */
- } /* end if */
+ }
+ }
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -4079,7 +4472,7 @@ test_unlim(unsigned config, hid_t fapl)
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
@@ -4127,11 +4520,11 @@ test_unlim(unsigned config, hid_t fapl)
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 */
+ }
/* Now test reopening virtual dataset without calling H5Dget_space, if
* REOPEN_VIRT flag set */
@@ -4166,11 +4559,11 @@ test_unlim(unsigned config, hid_t fapl)
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 */
+ }
/* Now try setting extent manually */
/* Grow to 18 */
@@ -4198,11 +4591,11 @@ test_unlim(unsigned config, hid_t fapl)
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 */
+ }
/* Grow to 20 */
dims[1] = 20;
@@ -4228,7 +4621,7 @@ test_unlim(unsigned config, hid_t fapl)
for(j = 0; j < (int)mdims[1]; j++)
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end if */
+ }
/* Close */
if(!(config & TEST_IO_CLOSE_SRC)) {
@@ -4241,12 +4634,12 @@ test_unlim(unsigned config, hid_t fapl)
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;
@@ -4322,12 +4715,12 @@ test_unlim(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, 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 source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0)
@@ -4392,8 +4785,8 @@ test_unlim(unsigned config, hid_t fapl)
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) {
@@ -4407,7 +4800,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -4451,11 +4844,11 @@ test_unlim(unsigned config, hid_t fapl)
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 view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -4469,7 +4862,7 @@ test_unlim(unsigned config, hid_t fapl)
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
@@ -4511,11 +4904,11 @@ test_unlim(unsigned config, hid_t fapl)
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 */
+ }
/* Reopen srcdset[0] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -4524,7 +4917,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[0] */
dims[1] = 7;
@@ -4566,8 +4959,8 @@ test_unlim(unsigned config, hid_t fapl)
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) {
@@ -4581,7 +4974,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -4627,11 +5020,11 @@ test_unlim(unsigned config, hid_t fapl)
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 view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -4645,7 +5038,7 @@ test_unlim(unsigned config, hid_t fapl)
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
@@ -4696,11 +5089,11 @@ test_unlim(unsigned config, hid_t fapl)
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 */
+ }
/* Reopen srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -4709,7 +5102,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[1] */
dims[1] = 10;
@@ -4751,8 +5144,8 @@ test_unlim(unsigned config, hid_t fapl)
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) {
@@ -4766,7 +5159,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -4828,7 +5221,7 @@ test_unlim(unsigned config, hid_t fapl)
if((i == 4) || (i == 5)) {
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != 0)
TEST_ERROR
@@ -4845,7 +5238,7 @@ test_unlim(unsigned config, hid_t fapl)
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
@@ -4897,11 +5290,11 @@ test_unlim(unsigned config, hid_t fapl)
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 */
if(!(config & TEST_IO_CLOSE_SRC)) {
@@ -4914,12 +5307,12 @@ test_unlim(unsigned config, hid_t fapl)
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;
@@ -5014,12 +5407,12 @@ test_unlim(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, 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 source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0)
@@ -5059,7 +5452,7 @@ test_unlim(unsigned config, hid_t fapl)
for(j = 0; j < 2; j++) {
erbuf[i][6 * j] = buf[i][2 * j];
erbuf[i][(6 * j) + 1] = buf[i][(2 * j) + 1];
- } /* end for */
+ }
/* Adjust write buffer */
for(i = 0; i < (int)mdims[0]; i++)
@@ -5075,7 +5468,7 @@ test_unlim(unsigned config, hid_t fapl)
for(j = 0; j < 2; j++) {
erbuf[i][(6 * j) + 2] = buf[i][2 * j];
erbuf[i][(6 * j) + 3] = buf[i][(2 * j) + 1];
- } /* end for */
+ }
/* Adjust write buffer */
for(i = 0; i < (int)mdims[0]; i++)
@@ -5096,7 +5489,7 @@ test_unlim(unsigned config, hid_t fapl)
for(i = 0; i < 10; i++) {
erbuf[i][4] = buf[i][0];
erbuf[i][5] = buf[i][1];
- } /* end for */
+ }
/* Close srcdsets and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -5114,8 +5507,8 @@ test_unlim(unsigned config, hid_t fapl)
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) {
@@ -5129,7 +5522,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -5173,11 +5566,11 @@ test_unlim(unsigned config, hid_t fapl)
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 view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -5191,7 +5584,7 @@ test_unlim(unsigned config, hid_t fapl)
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
@@ -5233,11 +5626,11 @@ test_unlim(unsigned config, hid_t fapl)
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 */
+ }
/* Reopen srcdset[0] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -5246,7 +5639,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[0] */
dims[1] = 7;
@@ -5283,8 +5676,8 @@ test_unlim(unsigned config, hid_t fapl)
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) {
@@ -5298,7 +5691,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -5343,11 +5736,11 @@ test_unlim(unsigned config, hid_t fapl)
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 view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -5361,7 +5754,7 @@ test_unlim(unsigned config, hid_t fapl)
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
@@ -5371,7 +5764,7 @@ test_unlim(unsigned config, hid_t fapl)
erbuf[i][12] = buf[i][0];
erbuf[i][13] = buf[i][1];
erbuf[i][18] = buf[i][2];
- } /* end for */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -5415,11 +5808,11 @@ test_unlim(unsigned config, hid_t fapl)
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 */
+ }
/* Reopen srcdset[2] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -5428,7 +5821,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[2] = H5Dopen2(srcfile[0], "src_dset3", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[2] */
dims[1] = 5;
@@ -5460,7 +5853,7 @@ test_unlim(unsigned config, hid_t fapl)
erbuf[i][10] = buf[i][0];
erbuf[i][11] = buf[i][1];
erbuf[i][16] = buf[i][2];
- } /* end for */
+ }
/* Close srcdset[2] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -5472,8 +5865,8 @@ test_unlim(unsigned config, hid_t fapl)
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) {
@@ -5487,7 +5880,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -5532,11 +5925,11 @@ test_unlim(unsigned config, hid_t fapl)
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 view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -5550,7 +5943,7 @@ test_unlim(unsigned config, hid_t fapl)
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
@@ -5596,11 +5989,11 @@ test_unlim(unsigned config, hid_t fapl)
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 */
+ }
/* Reopen srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -5609,7 +6002,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[1] */
dims[1] = 6;
@@ -5640,7 +6033,7 @@ test_unlim(unsigned config, hid_t fapl)
for(i = 0; i < 10; i++) {
erbuf[i][14] = buf[i][0];
erbuf[i][15] = buf[i][1];
- } /* end for */
+ }
/* Close srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -5652,8 +6045,8 @@ test_unlim(unsigned config, hid_t fapl)
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) {
@@ -5667,7 +6060,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -5711,11 +6104,11 @@ test_unlim(unsigned config, hid_t fapl)
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 view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -5729,7 +6122,7 @@ test_unlim(unsigned config, hid_t fapl)
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
@@ -5771,11 +6164,11 @@ test_unlim(unsigned config, hid_t fapl)
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 */
+ }
/* Now just read middle 2 rows */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -5801,11 +6194,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else if((i == 4) || (i == 5)) {
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != 0)
TEST_ERROR
@@ -5824,12 +6217,12 @@ test_unlim(unsigned config, hid_t fapl)
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;
@@ -5910,12 +6303,12 @@ test_unlim(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, 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 source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0)
@@ -5968,8 +6361,8 @@ test_unlim(unsigned config, hid_t fapl)
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) {
@@ -5983,7 +6376,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -6029,11 +6422,11 @@ test_unlim(unsigned config, hid_t fapl)
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 view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -6047,7 +6440,7 @@ test_unlim(unsigned config, hid_t fapl)
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
@@ -6089,11 +6482,11 @@ test_unlim(unsigned config, hid_t fapl)
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 */
+ }
/* Reopen srcdset[0] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -6102,7 +6495,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[0] */
dims[0] = 5;
@@ -6140,8 +6533,8 @@ test_unlim(unsigned config, hid_t fapl)
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) {
@@ -6155,7 +6548,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -6201,11 +6594,11 @@ test_unlim(unsigned config, hid_t fapl)
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 view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -6219,7 +6612,7 @@ test_unlim(unsigned config, hid_t fapl)
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
@@ -6267,11 +6660,11 @@ test_unlim(unsigned config, hid_t fapl)
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 */
if(!(config & TEST_IO_CLOSE_SRC)) {
@@ -6284,12 +6677,12 @@ test_unlim(unsigned config, hid_t fapl)
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;
@@ -6332,23 +6725,23 @@ error:
for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) {
if(srcdset[i] >= 0)
(void)H5Dclose(srcdset[i]);
- } /* end for */
+ }
if(vdset >= 0)
(void)H5Dclose(vdset);
for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) {
if(srcfile[i] >= 0)
(void)H5Fclose(srcfile[i]);
- } /* end for */
+ }
if(vfile >= 0)
(void)H5Fclose(vfile);
for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) {
if(srcspace[i] >= 0)
(void)H5Sclose(srcspace[i]);
- } /* end for */
+ }
for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) {
if(vspace[i] >= 0)
(void)H5Sclose(vspace[i]);
- } /* end for */
+ }
if(filespace >= 0)
(void)H5Sclose(filespace);
if(memspace >= 0)
@@ -6485,12 +6878,12 @@ test_printf(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, 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)
@@ -6502,7 +6895,7 @@ test_printf(unsigned config, hid_t fapl)
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) {
@@ -6516,7 +6909,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -6602,8 +6995,8 @@ test_printf(unsigned config, hid_t fapl)
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) {
@@ -6617,7 +7010,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -6661,11 +7054,11 @@ test_printf(unsigned config, hid_t fapl)
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 */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -6702,8 +7095,8 @@ test_printf(unsigned config, hid_t fapl)
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) {
@@ -6717,7 +7110,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -6757,11 +7150,11 @@ test_printf(unsigned config, hid_t fapl)
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 */
+ }
/* Now try with different selections */
count[0] = 10;
@@ -6788,12 +7181,12 @@ test_printf(unsigned config, hid_t fapl)
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;
/* Now try writing through VDS */
@@ -6829,7 +7222,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[2] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read srcdset[0] */
count[0] = 10;
@@ -6931,12 +7324,12 @@ test_printf(unsigned config, hid_t fapl)
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)
@@ -6948,7 +7341,7 @@ test_printf(unsigned config, hid_t fapl)
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) {
@@ -6962,7 +7355,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -7100,14 +7493,14 @@ test_printf(unsigned config, hid_t fapl)
if(H5Dclose(srcdset[i]) < 0)
TEST_ERROR
srcdset[i] = -1;
- } /* end for */
+ }
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) {
@@ -7121,7 +7514,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -7165,11 +7558,11 @@ test_printf(unsigned config, hid_t fapl)
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 */
+ }
/* Test H5Pget_virtual_printf_gap() */
if(H5Pget_virtual_printf_gap(dapl, &gap_size) < 0)
@@ -7189,7 +7582,7 @@ test_printf(unsigned config, hid_t fapl)
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
@@ -7241,11 +7634,11 @@ test_printf(unsigned config, hid_t fapl)
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 2, reopen file as well if
* config option specified */
@@ -7259,7 +7652,7 @@ test_printf(unsigned config, hid_t fapl)
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
@@ -7311,11 +7704,11 @@ test_printf(unsigned config, hid_t fapl)
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 3, reopen file as well if
* config option specified */
@@ -7329,7 +7722,7 @@ test_printf(unsigned config, hid_t fapl)
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
@@ -7381,11 +7774,11 @@ test_printf(unsigned config, hid_t fapl)
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 4, reopen file as well if
* config option specified */
@@ -7399,7 +7792,7 @@ test_printf(unsigned config, hid_t fapl)
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
@@ -7451,11 +7844,11 @@ test_printf(unsigned config, hid_t fapl)
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 view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -7469,7 +7862,7 @@ test_printf(unsigned config, hid_t fapl)
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
@@ -7515,11 +7908,11 @@ test_printf(unsigned config, hid_t fapl)
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)
@@ -7533,16 +7926,16 @@ test_printf(unsigned config, hid_t fapl)
if(H5Dclose(srcdset[i]) < 0)
TEST_ERROR
srcdset[i] = -1;
- } /* end for */
+ }
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;
@@ -7615,7 +8008,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -7681,7 +8074,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[1]) < 0)
TEST_ERROR
srcfile[1] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -7695,7 +8088,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -7739,11 +8132,11 @@ test_printf(unsigned config, hid_t fapl)
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 */
+ }
/* Reopen srcfile[1] if config option specified */
if(config & TEST_IO_CLOSE_SRC)
@@ -7778,7 +8171,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[1]) < 0)
TEST_ERROR
srcfile[1] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -7792,7 +8185,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -7836,11 +8229,11 @@ test_printf(unsigned config, hid_t fapl)
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 */
if(!(config & TEST_IO_CLOSE_SRC)) {
@@ -7856,7 +8249,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[1]) < 0)
TEST_ERROR
srcfile[1] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -7926,7 +8319,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -7992,7 +8385,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[1]) < 0)
TEST_ERROR
srcfile[1] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -8006,7 +8399,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -8050,11 +8443,11 @@ test_printf(unsigned config, hid_t fapl)
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 */
+ }
/* Reopen srcfile[1] if config option specified */
if(config & TEST_IO_CLOSE_SRC)
@@ -8089,7 +8482,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[1]) < 0)
TEST_ERROR
srcfile[1] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -8103,7 +8496,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -8147,11 +8540,11 @@ test_printf(unsigned config, hid_t fapl)
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 */
if(!(config & TEST_IO_CLOSE_SRC)) {
@@ -8167,7 +8560,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[1]) < 0)
TEST_ERROR
srcfile[1] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -8180,7 +8573,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Sclose(vspace[0]) < 0)
TEST_ERROR
vspace[0] = -1;
- } /* end if */
+ }
/*
@@ -8238,12 +8631,12 @@ test_printf(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, 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)
@@ -8255,7 +8648,7 @@ test_printf(unsigned config, hid_t fapl)
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) {
@@ -8269,7 +8662,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -8355,8 +8748,8 @@ test_printf(unsigned config, hid_t fapl)
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) {
@@ -8370,7 +8763,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -8414,11 +8807,11 @@ test_printf(unsigned config, hid_t fapl)
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 */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -8454,8 +8847,8 @@ test_printf(unsigned config, hid_t fapl)
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) {
@@ -8469,7 +8862,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -8513,11 +8906,11 @@ test_printf(unsigned config, hid_t fapl)
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 view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -8531,7 +8924,7 @@ test_printf(unsigned config, hid_t fapl)
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
@@ -8578,11 +8971,11 @@ test_printf(unsigned config, hid_t fapl)
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 */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -8618,8 +9011,8 @@ test_printf(unsigned config, hid_t fapl)
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) {
@@ -8633,7 +9026,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -8677,11 +9070,11 @@ test_printf(unsigned config, hid_t fapl)
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 view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -8695,7 +9088,7 @@ test_printf(unsigned config, hid_t fapl)
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
@@ -8742,11 +9135,11 @@ test_printf(unsigned config, hid_t fapl)
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 1, reopen file as well if
* config option specified */
@@ -8760,7 +9153,7 @@ test_printf(unsigned config, hid_t fapl)
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
@@ -8807,11 +9200,11 @@ test_printf(unsigned config, hid_t fapl)
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)
@@ -8825,16 +9218,16 @@ test_printf(unsigned config, hid_t fapl)
if(H5Dclose(srcdset[i]) < 0)
TEST_ERROR
srcdset[i] = -1;
- } /* end for */
+ }
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;
@@ -8910,12 +9303,12 @@ test_printf(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, 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)
@@ -8927,7 +9320,7 @@ test_printf(unsigned config, hid_t fapl)
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) {
@@ -8941,7 +9334,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -9037,8 +9430,8 @@ test_printf(unsigned config, hid_t fapl)
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) {
@@ -9052,7 +9445,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -9096,11 +9489,11 @@ test_printf(unsigned config, hid_t fapl)
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 view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -9114,7 +9507,7 @@ test_printf(unsigned config, hid_t fapl)
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
@@ -9161,11 +9554,11 @@ test_printf(unsigned config, hid_t fapl)
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 */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -9205,8 +9598,8 @@ test_printf(unsigned config, hid_t fapl)
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) {
@@ -9220,7 +9613,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -9264,11 +9657,11 @@ test_printf(unsigned config, hid_t fapl)
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 view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -9282,7 +9675,7 @@ test_printf(unsigned config, hid_t fapl)
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
@@ -9328,11 +9721,11 @@ test_printf(unsigned config, hid_t fapl)
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 */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -9369,8 +9762,8 @@ test_printf(unsigned config, hid_t fapl)
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) {
@@ -9384,7 +9777,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -9428,11 +9821,11 @@ test_printf(unsigned config, hid_t fapl)
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 */
+ }
/* Now test reopening virtual dataset without calling H5Dget_space, if
* REOPEN_VIRT flag set */
@@ -9466,11 +9859,11 @@ test_printf(unsigned config, hid_t fapl)
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 */
+ }
/* Now try setting extent manually */
/* Shrink to 12 */
@@ -9496,11 +9889,11 @@ test_printf(unsigned config, hid_t fapl)
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 */
+ }
/* Shrink to 10 */
dims[1] = 12;
@@ -9525,12 +9918,12 @@ test_printf(unsigned config, hid_t fapl)
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 */
- } /* end if */
+ }
+ }
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -9544,7 +9937,7 @@ test_printf(unsigned config, hid_t fapl)
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
@@ -9590,11 +9983,11 @@ test_printf(unsigned config, hid_t fapl)
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 */
+ }
/* Now test reopening virtual dataset without calling H5Dget_space, if
* REOPEN_VIRT flag set */
@@ -9628,11 +10021,11 @@ test_printf(unsigned config, hid_t fapl)
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 */
+ }
/* Now try setting extent manually */
/* Grow to 12 */
@@ -9658,11 +10051,11 @@ test_printf(unsigned config, hid_t fapl)
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 */
+ }
/* Grow to 15 */
dims[1] = 15;
@@ -9687,12 +10080,12 @@ test_printf(unsigned config, hid_t fapl)
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 */
- } /* end if */
+ }
+ }
/* Reset dapl */
if(H5Pset_virtual_view(dapl, H5D_VDS_LAST_AVAILABLE) < 0)
@@ -9704,16 +10097,16 @@ test_printf(unsigned config, hid_t fapl)
if(H5Dclose(srcdset[i]) < 0)
TEST_ERROR
srcdset[i] = -1;
- } /* end for */
+ }
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;
@@ -9770,12 +10163,12 @@ test_printf(unsigned config, hid_t fapl)
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)
@@ -9787,7 +10180,7 @@ test_printf(unsigned config, hid_t fapl)
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) {
@@ -9801,7 +10194,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -9867,8 +10260,8 @@ test_printf(unsigned config, hid_t fapl)
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) {
@@ -9882,7 +10275,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -9926,11 +10319,11 @@ test_printf(unsigned config, hid_t fapl)
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 */
@@ -9944,7 +10337,7 @@ test_printf(unsigned config, hid_t fapl)
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
@@ -9990,11 +10383,11 @@ test_printf(unsigned config, hid_t fapl)
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)
@@ -10008,12 +10401,12 @@ test_printf(unsigned config, hid_t fapl)
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;
@@ -10044,32 +10437,19 @@ test_printf(unsigned config, hid_t fapl)
error:
H5E_BEGIN_TRY {
- for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) {
- if(srcdset[i] >= 0)
- (void)H5Dclose(srcdset[i]);
- } /* end for */
- if(vdset >= 0)
- (void)H5Dclose(vdset);
- for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) {
- if(srcfile[i] >= 0)
- (void)H5Fclose(srcfile[i]);
- } /* end for */
- if(vfile >= 0)
- (void)H5Fclose(vfile);
- if(srcspace >= 0)
- (void)H5Sclose(srcspace);
- for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) {
- if(vspace[i] >= 0)
- (void)H5Sclose(vspace[i]);
- } /* end for */
- if(filespace >= 0)
- (void)H5Sclose(filespace);
- if(memspace >= 0)
- (void)H5Sclose(memspace);
- if(dcpl >= 0)
- (void)H5Pclose(dcpl);
- if(dapl >= 0)
- (void)H5Pclose(dapl);
+ for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++)
+ H5Dclose(srcdset[i]);
+ H5Dclose(vdset);
+ for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++)
+ H5Fclose(srcfile[i]);
+ H5Fclose(vfile);
+ H5Sclose(srcspace);
+ for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++)
+ H5Sclose(vspace[i]);
+ H5Sclose(filespace);
+ H5Sclose(memspace);
+ H5Pclose(dcpl);
+ H5Pclose(dapl);
} H5E_END_TRY;
return 1;
@@ -10083,14 +10463,7 @@ error:
* VDS
*
* Return: Success: 0
- *
* Failure: number of errors
- *
- * Programmer: Neil Fortner
- * Friday, August 14, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -10212,12 +10585,12 @@ test_all(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile = vfile;
if(H5Iinc_ref(srcfile) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create virtual dataset */
if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
@@ -10229,7 +10602,7 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10243,7 +10616,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10314,14 +10687,14 @@ test_all(unsigned config, hid_t fapl)
if(H5Dclose(srcdset[i]) < 0)
TEST_ERROR
srcdset[i] = -1;
- } /* end for */
+ }
if(config & TEST_IO_DIFFERENT_FILE) {
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10335,7 +10708,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10381,11 +10754,11 @@ test_all(unsigned config, hid_t fapl)
if((i >= (int)dims[0]) || (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 */
+ }
/* Reopen srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -10394,7 +10767,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[1] */
dims[0] = 2;
@@ -10429,8 +10802,8 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10444,7 +10817,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10490,11 +10863,11 @@ test_all(unsigned config, hid_t fapl)
if((i >= (int)dims[0]) || (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 */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -10534,8 +10907,8 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10549,7 +10922,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10595,11 +10968,11 @@ test_all(unsigned config, hid_t fapl)
if((i >= (int)dims[0]) || (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 */
+ }
/* Reopen srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -10608,7 +10981,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[1] */
dims[0] = 3;
@@ -10652,8 +11025,8 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10667,7 +11040,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10713,11 +11086,11 @@ test_all(unsigned config, hid_t fapl)
if((i >= (int)dims[0]) || (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 */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -10757,8 +11130,8 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10772,7 +11145,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10818,11 +11191,11 @@ test_all(unsigned config, hid_t fapl)
if((i >= (int)dims[0]) || (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 */
+ }
/* Reopen srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -10831,7 +11204,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[1] */
dims[0] = 7;
@@ -10876,8 +11249,8 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10891,7 +11264,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10937,11 +11310,11 @@ test_all(unsigned config, hid_t fapl)
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 */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -10981,8 +11354,8 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10996,7 +11369,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -11048,16 +11421,16 @@ test_all(unsigned config, hid_t fapl)
if(H5Dclose(srcdset[i]) < 0)
TEST_ERROR
srcdset[i] = -1;
- } /* end for */
+ }
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
+ }
else if(!(config & TEST_IO_DIFFERENT_FILE)) {
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -11068,12 +11441,12 @@ test_all(unsigned config, hid_t fapl)
if(H5Sclose(srcspace[i]) < 0)
TEST_ERROR
srcspace[i] = -1;
- } /* end for */
+ }
for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) {
if(H5Sclose(vspace[i]) < 0)
TEST_ERROR
vspace[i] = -1;
- } /* end for */
+ }
if(H5Pclose(dcpl) < 0)
TEST_ERROR
dcpl = -1;
@@ -11089,32 +11462,19 @@ test_all(unsigned config, hid_t fapl)
error:
H5E_BEGIN_TRY {
- for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) {
- if(srcdset[i] >= 0)
- (void)H5Dclose(srcdset[i]);
- } /* end for */
- if(vdset >= 0)
- (void)H5Dclose(vdset);
- if(srcfile >= 0)
- (void)H5Fclose(srcfile);
- if(vfile >= 0)
- (void)H5Fclose(vfile);
- for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) {
- if(srcspace[i] >= 0)
- (void)H5Sclose(srcspace[i]);
- } /* end for */
- for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) {
- if(vspace[i] >= 0)
- (void)H5Sclose(vspace[i]);
- } /* end for */
- if(filespace >= 0)
- (void)H5Sclose(filespace);
- if(memspace >= 0)
- (void)H5Sclose(memspace);
- if(dcpl >= 0)
- (void)H5Pclose(dcpl);
- if(srcdcpl >= 0)
- (void)H5Pclose(srcdcpl);
+ for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++)
+ H5Dclose(srcdset[i]);
+ H5Dclose(vdset);
+ H5Fclose(srcfile);
+ H5Fclose(vfile);
+ for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++)
+ H5Sclose(srcspace[i]);
+ for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++)
+ H5Sclose(vspace[i]);
+ H5Sclose(filespace);
+ H5Sclose(memspace);
+ H5Pclose(dcpl);
+ H5Pclose(srcdcpl);
} H5E_END_TRY;
return 1;
@@ -11128,10 +11488,6 @@ error:
*
* Return: Success: 0
* Failure: 1
- *
- * Programmer: Dana Robinson
- * March 2016
- *
*-------------------------------------------------------------------------
*/
static int
@@ -11273,10 +11629,6 @@ test_dapl_values(hid_t fapl_id)
* Purpose: Tests datasets with virtual layout
*
* Return: EXIT_SUCCESS/EXIT_FAILURE
- *
- * Programmer: Neil Fortner
- * Tuesday, February 17, 2015
- *
*-------------------------------------------------------------------------
*/
int
@@ -11299,10 +11651,11 @@ main(void)
for(bit_config = 0; bit_config < TEST_IO_NTESTS; bit_config++) {
printf("Config: %s%s%s\n", bit_config & TEST_IO_CLOSE_SRC ? "closed source dataset, " : "", bit_config & TEST_IO_DIFFERENT_FILE ? "different source file" : "same source file", bit_config & TEST_IO_REOPEN_VIRT ? ", reopen virtual file" : "");
nerrors += test_basic_io(bit_config, fapl);
+ nerrors += test_vds_prefix(bit_config, fapl);
nerrors += test_unlim(bit_config, fapl);
nerrors += test_printf(bit_config, fapl);
nerrors += test_all(bit_config, fapl);
- } /* end for */
+ }
nerrors += test_dapl_values(fapl);