summaryrefslogtreecommitdiffstats
path: root/test/vds_env.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/vds_env.c')
-rw-r--r--test/vds_env.c108
1 files changed, 54 insertions, 54 deletions
diff --git a/test/vds_env.c b/test/vds_env.c
index 97aa245..c80384b 100644
--- a/test/vds_env.c
+++ b/test/vds_env.c
@@ -67,20 +67,20 @@ test_vds_prefix_second(unsigned config, hid_t fapl)
int i, j;
char buffer[1024]; /* buffer to read vds_prefix */
- TESTING("basic virtual dataset I/O via H5Pset_vds_prefix(): all selection with ENV prefix")
+ TESTING("basic virtual dataset I/O via H5Pset_vds_prefix(): all selection with ENV prefix");
if (NULL == (srcfilename = HDmalloc(FILENAME_BUF_SIZE)))
- TEST_ERROR
+ TEST_ERROR;
if (NULL == (srcfilename_map = HDmalloc(FILENAME_BUF_SIZE)))
- TEST_ERROR
+ TEST_ERROR;
if (NULL == (vfilename = HDmalloc(FILENAME_BUF_SIZE)))
- TEST_ERROR
+ TEST_ERROR;
if (NULL == (vfilename2 = HDmalloc(FILENAME_BUF_SIZE)))
- TEST_ERROR
+ TEST_ERROR;
if (NULL == (srcfilenamepct = HDmalloc(FILENAME_BUF_SIZE)))
- TEST_ERROR
+ TEST_ERROR;
if (NULL == (srcfilenamepct_map = HDmalloc(FILENAME_BUF_SIZE)))
- TEST_ERROR
+ TEST_ERROR;
h5_fixname(FILENAME[0], fapl, vfilename, FILENAME_BUF_SIZE);
h5_fixname(FILENAME[1], fapl, vfilename2, FILENAME_BUF_SIZE);
@@ -91,76 +91,76 @@ test_vds_prefix_second(unsigned config, hid_t fapl)
/* create tmp directory and get current working directory path */
if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST)
- TEST_ERROR
+ TEST_ERROR;
/* Create DCPL */
if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Set fill value */
if (H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Set prefix to a nonexistent directory, will be overwritten by environment variable */
if ((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5Pset_virtual_prefix(dapl, "someprefix") < 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0)
- TEST_ERROR
+ 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
+ TEST_ERROR;
/* Create virtual dataspace */
if ((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Select all (should not be necessary, but just to be sure) */
if (H5Sselect_all(srcspace[0]) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5Sselect_all(vspace[0]) < 0)
- TEST_ERROR
+ 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
+ TEST_ERROR;
/* Create virtual file */
if ((vfile = H5Fcreate(vfilename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create source file if requested */
if (config & TEST_IO_DIFFERENT_FILE) {
if (NULL == HDgetcwd(buffer, 1024))
- TEST_ERROR
+ TEST_ERROR;
if (HDchdir(TMPDIR) < 0)
- TEST_ERROR
+ TEST_ERROR;
if ((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (HDchdir(buffer) < 0)
- TEST_ERROR
+ TEST_ERROR;
}
else {
srcfile[0] = vfile;
if (H5Iinc_ref(srcfile[0]) < 0)
- TEST_ERROR
+ 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
+ TEST_ERROR;
/* Create virtual dataset */
if ((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Populate write buffer */
for (i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
@@ -169,17 +169,17 @@ test_vds_prefix_second(unsigned config, hid_t fapl)
/* Write data directly to source dataset */
if (H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close srcdset and srcfile if config option specified */
if (config & TEST_IO_CLOSE_SRC) {
if (H5Dclose(srcdset[0]) < 0)
- TEST_ERROR
+ TEST_ERROR;
srcdset[0] = -1;
if (config & TEST_IO_DIFFERENT_FILE) {
if (H5Fclose(srcfile[0]) < 0)
- TEST_ERROR
+ TEST_ERROR;
srcfile[0] = -1;
}
}
@@ -187,27 +187,27 @@ test_vds_prefix_second(unsigned config, hid_t fapl)
/* Reopen virtual dataset and file if config option specified */
if (config & TEST_IO_REOPEN_VIRT) {
if (H5Dclose(vdset) < 0)
- TEST_ERROR
+ TEST_ERROR;
vdset = -1;
if (H5Fclose(vfile) < 0)
- TEST_ERROR
+ TEST_ERROR;
vfile = -1;
if ((vfile = H5Fopen(vfilename2, H5F_ACC_RDWR, fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR;
if ((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
- TEST_ERROR
+ 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
+ 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
+ TEST_ERROR;
}
}
@@ -218,59 +218,59 @@ test_vds_prefix_second(unsigned config, hid_t fapl)
/* Write data through virtual dataset */
if (H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Reopen srcdset and srcfile if config option specified */
if (config & TEST_IO_CLOSE_SRC) {
if (config & TEST_IO_DIFFERENT_FILE) {
if (NULL == HDgetcwd(buffer, 1024))
- TEST_ERROR
+ TEST_ERROR;
if (HDchdir(TMPDIR) < 0)
- TEST_ERROR
+ TEST_ERROR;
if ((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (HDchdir(buffer) < 0)
- TEST_ERROR
+ TEST_ERROR;
}
if ((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0)
- TEST_ERROR
+ 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
+ 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
+ TEST_ERROR;
/* Close */
if (H5Dclose(vdset) < 0)
- TEST_ERROR
+ TEST_ERROR;
vdset = -1;
if (H5Dclose(srcdset[0]) < 0)
- TEST_ERROR
+ TEST_ERROR;
srcdset[0] = -1;
if (H5Fclose(srcfile[0]) < 0)
- TEST_ERROR
+ TEST_ERROR;
srcfile[0] = -1;
if (H5Fclose(vfile) < 0)
- TEST_ERROR
+ TEST_ERROR;
vfile = -1;
if (H5Sclose(srcspace[0]) < 0)
- TEST_ERROR
+ TEST_ERROR;
srcspace[0] = -1;
if (H5Sclose(vspace[0]) < 0)
- TEST_ERROR
+ TEST_ERROR;
vspace[0] = -1;
if (H5Pclose(dapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
dapl = -1;
if (H5Pclose(dcpl) < 0)
- TEST_ERROR
+ TEST_ERROR;
dcpl = -1;
HDfree(srcfilenamepct_map);
@@ -349,7 +349,7 @@ main(void)
/* Set to use the latest file format */
if ((my_fapl = H5Pcopy(fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Loop through all the combinations of low/high version bounds */
for (low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
@@ -368,7 +368,7 @@ main(void)
/* Set the low/high version bounds */
if (H5Pset_libver_bounds(my_fapl, low, high) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Display testing info */
low_string = h5_get_version_string(low);
@@ -392,7 +392,7 @@ main(void)
} /* end for low */
if (H5Pclose(my_fapl) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (nerrors)
goto error;