summaryrefslogtreecommitdiffstats
path: root/test/cmpd_dset.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2022-06-24 03:16:21 (GMT)
committerGitHub <noreply@github.com>2022-06-24 03:16:21 (GMT)
commitac7bddf2af317d4bc34854f5565396da51ff12aa (patch)
treef06f4267731f53e29da848d7d043950ec023f0b3 /test/cmpd_dset.c
parent50b3fb09a79cf94064d09087df6c44e680adc3a8 (diff)
downloadhdf5-ac7bddf2af317d4bc34854f5565396da51ff12aa.zip
hdf5-ac7bddf2af317d4bc34854f5565396da51ff12aa.tar.gz
hdf5-ac7bddf2af317d4bc34854f5565396da51ff12aa.tar.bz2
VFD SWMR: sync with develop (#1825)
* bin directory sync * doxygen changes * C++ sync with develop * Fortran sync with develop * Sync various docs with develop * Java sync with develop * More doxygen sync with develop * tools sync with develop * h5test.h testing macros get enclosed in do..while loops (#1721) * Minor examples normalization with develop * hl sync with develop * sprintf to snprintf (#1815) * Misc sync w/ develop * Brings some selection I/O bits over from develop * Brings over some const fixes from develop * Brings over more const bits from develop * Minor bits missed in early syncs * Brings over rest of selection I/O * Sync of mirror VFD changes w/ develop * Committing clang-format changes * Adds missing testpar file Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'test/cmpd_dset.c')
-rw-r--r--test/cmpd_dset.c204
1 files changed, 102 insertions, 102 deletions
diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c
index 024b6c0..83fa050 100644
--- a/test/cmpd_dset.c
+++ b/test/cmpd_dset.c
@@ -1378,32 +1378,32 @@ test_hdf5_src_subset(char *filename, hid_t fapl)
/* Create xfer properties to preserve initialized data */
if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Pset_preserve(dxpl, TRUE) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Rewrite contiguous data set */
if ((dataset = H5Dopen2(file, DSET_NAME[0], H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Write the data to the dataset */
if (H5Dwrite(dataset, rew_tid, H5S_ALL, H5S_ALL, dxpl, rew_buf) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Dclose(dataset) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Rewrite chunked data set */
if ((dataset = H5Dopen2(file, DSET_NAME[1], H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Write the data to the dataset */
if (H5Dwrite(dataset, rew_tid, H5S_ALL, H5S_ALL, dxpl, rew_buf) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Dclose(dataset) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
PASSED();
@@ -1415,48 +1415,48 @@ test_hdf5_src_subset(char *filename, hid_t fapl)
/* Check contiguous data set */
if ((dataset = H5Dopen2(file, DSET_NAME[0], H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Dread(dataset, dst_tid, H5S_ALL, H5S_ALL, dxpl, rbuf) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (compare_data(orig, rbuf, TRUE) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5Dclose(dataset) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Check chunked data set */
if ((dataset = H5Dopen2(file, DSET_NAME[1], H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Dread(dataset, dst_tid, H5S_ALL, H5S_ALL, dxpl, rbuf) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (compare_data(orig, rbuf, TRUE) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5Dclose(dataset) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Finishing test and release resources */
if (H5Sclose(space) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Pclose(dcpl) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Pclose(dxpl) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(src_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(dst_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(rew_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Fclose(file) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
HDfree(orig);
HDfree(rbuf);
@@ -1993,207 +1993,207 @@ test_ooo_order(char *filename, hid_t fapl_id)
hid_t dtype_tmp = -1; /* Temp Datatype ID */
H5T_t *dt = NULL; /* Datatype pointer */
- TESTING("that compound member insertion order is preserved")
+ TESTING("that compound member insertion order is preserved");
/* Create the file */
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create the compound */
if ((dtype = H5Tcreate(H5T_COMPOUND, (size_t)20)) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tinsert(dtype, "A", (size_t)8, H5T_STD_I32LE) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tinsert(dtype, "B", (size_t)12, H5T_STD_I32LE) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tinsert(dtype, "C", (size_t)0, H5T_STD_I32LE) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tinsert(dtype, "D", (size_t)16, H5T_STD_I32LE) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Verify that the compound is not packed */
if (NULL == (dt = (H5T_t *)H5I_object_verify(dtype, H5I_DATATYPE)))
- TEST_ERROR
+ TEST_ERROR;
if (dt->shared->u.compnd.packed)
- TEST_ERROR
+ TEST_ERROR;
/* Verify that the order is the same as the insertion order */
if (H5Tget_member_offset(dtype, 0) != 8)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 1) != 12)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 2) != 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 3) != 16)
- TEST_ERROR
+ TEST_ERROR;
/* Commit the datatype */
if (H5Tcommit2(file, "dtype", dtype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close and reopen the file */
if (H5Tclose(dtype))
- TEST_ERROR
+ TEST_ERROR;
if (H5Fclose(file))
- TEST_ERROR
+ TEST_ERROR;
if ((file = H5Fopen(filename, H5F_ACC_RDWR, fapl_id)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Open the type */
if ((dtype_tmp = H5Topen2(file, "dtype", H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Verify that the compound is not packed */
if (NULL == (dt = (H5T_t *)H5I_object_verify(dtype_tmp, H5I_DATATYPE)))
- TEST_ERROR
+ TEST_ERROR;
if (dt->shared->u.compnd.packed)
- TEST_ERROR
+ TEST_ERROR;
/* Verify that the order is the same as the insertion order */
if (H5Tget_member_offset(dtype_tmp, 0) != 8)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype_tmp, 1) != 12)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype_tmp, 2) != 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype_tmp, 3) != 16)
- TEST_ERROR
+ TEST_ERROR;
/* Copy the datatype */
if ((dtype = H5Tcopy(dtype_tmp)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Verify that the compound is not packed */
if (NULL == (dt = (H5T_t *)H5I_object_verify(dtype, H5I_DATATYPE)))
- TEST_ERROR
+ TEST_ERROR;
if (dt->shared->u.compnd.packed)
- TEST_ERROR
+ TEST_ERROR;
/* Verify that the order is the same as the insertion order */
if (H5Tget_member_offset(dtype, 0) != 8)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 1) != 12)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 2) != 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 3) != 16)
- TEST_ERROR
+ TEST_ERROR;
/* Insert the last member */
if (H5Tinsert(dtype, "E", (size_t)4, H5T_STD_I32LE) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Verify that the compound is packed */
if (NULL == (dt = (H5T_t *)H5I_object_verify(dtype, H5I_DATATYPE)))
- TEST_ERROR
+ TEST_ERROR;
if (!dt->shared->u.compnd.packed)
- TEST_ERROR
+ TEST_ERROR;
/* Verify that the order is the same as the insertion order */
if (H5Tget_member_offset(dtype, 0) != 8)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 1) != 12)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 2) != 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 3) != 16)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 4) != 4)
- TEST_ERROR
+ TEST_ERROR;
/* Commit the modified datatype */
if (H5Tcommit2(file, "dtype2", dtype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Close and reopen the file */
if (H5Tclose(dtype_tmp))
- TEST_ERROR
+ TEST_ERROR;
if (H5Tclose(dtype))
- TEST_ERROR
+ TEST_ERROR;
if (H5Fclose(file))
- TEST_ERROR
+ TEST_ERROR;
if ((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl_id)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Open the type, and verify status */
if ((dtype_tmp = H5Topen2(file, "dtype2", H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (NULL == (dt = (H5T_t *)H5I_object_verify(dtype_tmp, H5I_DATATYPE)))
- TEST_ERROR
+ TEST_ERROR;
if (!dt->shared->u.compnd.packed)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype_tmp, 0) != 8)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype_tmp, 1) != 12)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype_tmp, 2) != 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype_tmp, 3) != 16)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype_tmp, 4) != 4)
- TEST_ERROR
+ TEST_ERROR;
/* Copy the datatype, and verify status */
if ((dtype = H5Tcopy(dtype_tmp)) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (NULL == (dt = (H5T_t *)H5I_object_verify(dtype, H5I_DATATYPE)))
- TEST_ERROR
+ TEST_ERROR;
if (!dt->shared->u.compnd.packed)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 0) != 8)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 1) != 12)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 2) != 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 3) != 16)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 4) != 4)
- TEST_ERROR
+ TEST_ERROR;
/* Expand the type, and verify that it became unpacked */
if (H5Tset_size(dtype, (size_t)21) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (NULL == (dt = (H5T_t *)H5I_object_verify(dtype, H5I_DATATYPE)))
- TEST_ERROR
+ TEST_ERROR;
if (dt->shared->u.compnd.packed)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 0) != 8)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 1) != 12)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 2) != 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 3) != 16)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 4) != 4)
- TEST_ERROR
+ TEST_ERROR;
/* Shrink the type, and verify that it became packed */
if (H5Tset_size(dtype, (size_t)20) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (NULL == (dt = (H5T_t *)H5I_object_verify(dtype, H5I_DATATYPE)))
- TEST_ERROR
+ TEST_ERROR;
if (!dt->shared->u.compnd.packed)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 0) != 8)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 1) != 12)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 2) != 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 3) != 16)
- TEST_ERROR
+ TEST_ERROR;
if (H5Tget_member_offset(dtype, 4) != 4)
- TEST_ERROR
+ TEST_ERROR;
/* Close */
if (H5Tclose(dtype_tmp))
- TEST_ERROR
+ TEST_ERROR;
if (H5Tclose(dtype))
- TEST_ERROR
+ TEST_ERROR;
if (H5Fclose(file))
- TEST_ERROR
+ TEST_ERROR;
PASSED();
return 0;