summaryrefslogtreecommitdiffstats
path: root/test/vds.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2018-03-18 23:36:49 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2018-03-18 23:36:49 (GMT)
commitf38864920d4e0bc8adaf9a23fd3f775ad90cb3f7 (patch)
treeb5f709e5415db2f1a9287b43565fea826b3018f5 /test/vds.c
parent4a17aff4085ad6ee265b95730aca3f493056dec8 (diff)
parent7aa4eb1b04014f1ad7e1c857ca6509aeeb6c0ae7 (diff)
downloadhdf5-f38864920d4e0bc8adaf9a23fd3f775ad90cb3f7.zip
hdf5-f38864920d4e0bc8adaf9a23fd3f775ad90cb3f7.tar.gz
hdf5-f38864920d4e0bc8adaf9a23fd3f775ad90cb3f7.tar.bz2
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/hdffv/hdf5 into merge_func_enter_vol
Plus initial steps toward merging API context push into FUNC_ENTER_API* macros
Diffstat (limited to 'test/vds.c')
-rw-r--r--test/vds.c1529
1 files changed, 926 insertions, 603 deletions
diff --git a/test/vds.c b/test/vds.c
index c9b7a1b..7a659cb 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,451 @@ 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 */
+ int buf[10][26]; /* Write and expected read buffer */
+ int rbuf[10][26]; /* Read buffer */
+ int fill = -1; /* Fill 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(dapl);
+ 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 +1560,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 +1643,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 +1677,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 +1692,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 +1721,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 +1805,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 +1846,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 +1861,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 +1892,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 +1941,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 +1951,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 +1977,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 +2019,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 +2029,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 +2055,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 +2140,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 +2187,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 +2202,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 +2233,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 +2328,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 +2369,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 +2384,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 +2437,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 +2536,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 +2569,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 +2586,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 +2601,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 +2616,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 +2632,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 +2644,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 +2668,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 +2685,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 +2696,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 +2712,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 +2724,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 +2844,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 +2903,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 +2918,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 +2943,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 +2989,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 +3010,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 +3185,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 +3227,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 +3242,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 +3348,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 +3401,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 +3619,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 +3694,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 +3719,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 +3832,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 +3902,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 +3917,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 +3962,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 +3986,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 +4034,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 +4047,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 +4084,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 +4099,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 +4146,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 +4164,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 +4217,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 +4230,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 +4272,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 +4287,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 +4349,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 +4414,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 +4445,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 +4464,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 +4512,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 +4551,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 +4583,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 +4613,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 +4626,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 +4707,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 +4777,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 +4792,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 +4836,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 +4854,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 +4896,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 +4909,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 +4951,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 +4966,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 +5012,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 +5030,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 +5081,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 +5094,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 +5136,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 +5151,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 +5213,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 +5230,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 +5282,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 +5299,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 +5399,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 +5444,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 +5460,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 +5481,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 +5499,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 +5514,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 +5558,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 +5576,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 +5618,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 +5631,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 +5668,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 +5683,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 +5728,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 +5746,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 +5756,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 +5800,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 +5813,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 +5845,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 +5857,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 +5872,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 +5917,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 +5935,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 +5981,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 +5994,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 +6025,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 +6037,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 +6052,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 +6096,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 +6114,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 +6156,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 +6186,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 +6209,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 +6295,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 +6353,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 +6368,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 +6414,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 +6432,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 +6474,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 +6487,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 +6525,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 +6540,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 +6586,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 +6604,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 +6652,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 +6669,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;
@@ -6329,36 +6714,21 @@ test_unlim(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);
- 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);
- 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);
+ 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);
+ H5Pclose(dapl);
} H5E_END_TRY;
return 1;
@@ -6372,14 +6742,7 @@ error:
* source dataset resolution
*
* Return: Success: 0
- *
* Failure: number of errors
- *
- * Programmer: Neil Fortner
- * Tuesday, May 26, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -6485,12 +6848,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 +6865,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 +6879,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 +6965,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 +6980,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 +7024,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 +7065,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 +7080,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 +7120,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 +7151,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 +7192,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 +7294,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 +7311,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 +7325,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 +7463,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 +7484,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 +7528,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 +7552,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 +7604,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 +7622,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 +7674,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 +7692,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 +7744,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 +7762,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 +7814,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 +7832,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 +7878,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 +7896,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 +7978,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 +8044,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 +8058,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 +8102,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 +8141,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 +8155,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 +8199,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 +8219,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 +8289,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 +8355,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 +8369,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 +8413,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 +8452,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 +8466,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 +8510,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 +8530,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 +8543,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Sclose(vspace[0]) < 0)
TEST_ERROR
vspace[0] = -1;
- } /* end if */
+ }
/*
@@ -8238,12 +8601,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 +8618,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 +8632,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 +8718,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 +8733,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 +8777,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 +8817,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 +8832,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 +8876,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 +8894,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 +8941,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 +8981,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 +8996,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 +9040,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 +9058,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 +9105,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 +9123,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 +9170,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 +9188,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 +9273,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 +9290,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 +9304,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 +9400,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 +9415,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 +9459,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 +9477,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 +9524,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 +9568,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 +9583,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 +9627,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 +9645,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 +9691,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 +9732,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 +9747,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 +9791,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 +9829,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 +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 */
+ }
/* Shrink to 10 */
dims[1] = 12;
@@ -9525,12 +9888,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 +9907,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 +9953,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 +9991,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 +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 */
+ }
/* Grow to 15 */
dims[1] = 15;
@@ -9687,12 +10050,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 +10067,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 +10133,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 +10150,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 +10164,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 +10230,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 +10245,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 +10289,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 +10307,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 +10353,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 +10371,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 +10407,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 +10433,7 @@ error:
* VDS
*
* Return: Success: 0
- *
* Failure: number of errors
- *
- * Programmer: Neil Fortner
- * Friday, August 14, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -10212,12 +10555,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 +10572,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 +10586,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 +10657,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 +10678,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 +10724,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 +10737,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 +10772,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 +10787,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 +10833,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 +10877,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 +10892,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 +10938,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 +10951,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 +10995,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 +11010,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 +11056,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 +11100,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 +11115,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 +11161,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 +11174,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 +11219,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 +11234,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 +11280,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 +11324,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 +11339,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 +11391,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 +11411,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 +11432,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 +11458,6 @@ error:
*
* Return: Success: 0
* Failure: 1
- *
- * Programmer: Dana Robinson
- * March 2016
- *
*-------------------------------------------------------------------------
*/
static int
@@ -11273,10 +11599,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 +11621,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);