summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorH. Joe Lee <hyoklee@hdfgroup.org>2021-11-15 23:09:45 (GMT)
committerGitHub <noreply@github.com>2021-11-15 23:09:45 (GMT)
commitcb5e8be7d6cb80657dd951ba789b124ec8e496e7 (patch)
treec0e43bc0f5e19fc865bbf0dd466627bac38dc804 /test
parent8ad1f3914ac1e1b52e378ce4b94c2965cb322133 (diff)
downloadhdf5-cb5e8be7d6cb80657dd951ba789b124ec8e496e7.zip
hdf5-cb5e8be7d6cb80657dd951ba789b124ec8e496e7.tar.gz
hdf5-cb5e8be7d6cb80657dd951ba789b124ec8e496e7.tar.bz2
1.10 TRILAB-266: Remove clang warnings. (#1200)
* OESS-99:Sync from develop. * TRILAB-266: Remove clang warnings. * Committing clang-format changes * TRILAB-266: Remove clang warnings. * TRILAB-266: Address @byrnHDF review. Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'test')
-rw-r--r--test/cork.c137
-rw-r--r--test/swmr.c20
-rw-r--r--test/tvlstr.c6
3 files changed, 82 insertions, 81 deletions
diff --git a/test/cork.c b/test/cork.c
index 1b24ab3..c427dbd 100644
--- a/test/cork.c
+++ b/test/cork.c
@@ -89,10 +89,11 @@ static unsigned
verify_old_dset_cork(void)
{
/* Variable Declarations */
- hid_t fid = -1; /* File ID */
- hid_t did = -1, did2 = -1, did3 = -1; /* Dataset IDs */
- hid_t dcpl = -1, dcpl2 = -1, dcpl3 = -1; /* Dataset creation property lists */
- hid_t sid = -1, sid2 = -1, sid3 = -1; /* Dataspace IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID, did3 = H5I_INVALID_HID; /* Dataset IDs */
+ hid_t dcpl = H5I_INVALID_HID, dcpl2 = H5I_INVALID_HID,
+ dcpl3 = H5I_INVALID_HID; /* Dataset creation property lists */
+ hid_t sid = H5I_INVALID_HID, sid2 = H5I_INVALID_HID, sid3 = H5I_INVALID_HID; /* Dataspace IDs */
hsize_t dims[2] = {100, 20}; /* Dataset dimension sizes */
hsize_t max_dims[2] = {100, H5S_UNLIMITED}; /* Dataset maximum dimension sizes */
hsize_t chunk_dims[2] = {2, 5}; /* Dataset chunked dimension sizes */
@@ -295,19 +296,19 @@ static unsigned
verify_obj_dset_cork(hbool_t swmr)
{
/* Variable Declarations */
- hid_t fid = -1; /* File ID */
- hid_t fapl = -1; /* File access property list */
- hid_t aid = -1; /* Attribute ID */
- hid_t sid = -1, sid2 = -1; /* Dataspace IDs */
- hid_t did = -1, did2 = -1; /* Dataset IDs */
- hid_t oid = -1; /* Object ID */
- hid_t dcpl2; /* Dataset creation property list */
- int i = 0; /* Local index variable */
- hsize_t dim[1] = {100}; /* Dataset dimension size */
- hsize_t chunk_dim[1] = {7}; /* Dataset chunk dimension size */
- H5O_info_t oinfo, oinfo2; /* Object metadata information */
- char attrname[500]; /* Name of attribute */
- unsigned flags; /* File access flags */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fapl = H5I_INVALID_HID; /* File access property list */
+ hid_t aid = H5I_INVALID_HID; /* Attribute ID */
+ hid_t sid = H5I_INVALID_HID, sid2 = H5I_INVALID_HID; /* Dataspace IDs */
+ hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */
+ hid_t oid = H5I_INVALID_HID; /* Object ID */
+ hid_t dcpl2 = H5I_INVALID_HID; /* Dataset creation property list */
+ int i = 0; /* Local index variable */
+ hsize_t dim[1] = {100}; /* Dataset dimension size */
+ hsize_t chunk_dim[1] = {7}; /* Dataset chunk dimension size */
+ H5O_info_t oinfo, oinfo2; /* Object metadata information */
+ char attrname[500]; /* Name of attribute */
+ unsigned flags; /* File access flags */
if (swmr) {
TESTING("cork status for dataset objects with attributes (SWMR)");
@@ -500,11 +501,11 @@ static unsigned
verify_dset_cork(hbool_t swmr, hbool_t new_format)
{
/* Variable Declarations */
- hid_t fid = -1; /* File ID */
- hid_t fapl = -1; /* File access property list */
- hid_t did = -1, did2 = -1, did3 = -1; /* Dataset IDs */
- hid_t dcpl = -1; /* Dataset creation property list */
- hid_t sid = -1, sid2 = -1, sid3 = -1; /* Dataspace IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fapl = H5I_INVALID_HID; /* File access property list */
+ hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID, did3 = H5I_INVALID_HID; /* Dataset IDs */
+ hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */
+ hid_t sid = H5I_INVALID_HID, sid2 = H5I_INVALID_HID, sid3 = H5I_INVALID_HID; /* Dataspace IDs */
hsize_t dims[2] = {100, 20}; /* Dataset dimension sizes */
hsize_t max_dims[2] = {100, H5S_UNLIMITED}; /* Dataset maximum dimension sizes */
hsize_t chunk_dims[2] = {2, 5}; /* Dataset chunked dimension sizes */
@@ -758,15 +759,15 @@ static unsigned
verify_group_cork(hbool_t swmr)
{
/* Variable Declarations */
- hid_t fid = -1; /* File ID */
- hid_t fapl = -1; /* File access property list */
- hid_t gid = -1, gid2 = -1, gid3 = -1; /* Group IDs */
- H5O_info_t oinfo, oinfo2, oinfo3; /* Object metadata information */
- hid_t aid; /* Attribute ID */
- hid_t sid; /* Dataspace ID */
- char attrname[500]; /* Name of attribute */
- unsigned flags; /* File access flags */
- int i = 0; /* Local index variable */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fapl = H5I_INVALID_HID; /* File access property list */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID, gid3 = H5I_INVALID_HID; /* Group IDs */
+ H5O_info_t oinfo, oinfo2, oinfo3; /* Object metadata information */
+ hid_t aid = H5I_INVALID_HID; /* Attribute ID */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ char attrname[500]; /* Name of attribute */
+ unsigned flags; /* File access flags */
+ int i = 0; /* Local index variable */
/* Testing Macro */
if (swmr) {
@@ -927,17 +928,17 @@ static unsigned
verify_named_cork(hbool_t swmr)
{
/* Variable Declarations */
- hid_t fid = -1; /* File ID */
- hid_t fapl = -1; /* File access property list */
- hid_t tid = -1, tid2 = -1, tid3 = -1; /* Datatype IDs */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
- H5O_info_t oinfo, oinfo2, oinfo3, oinfo4; /* Object metadata information */
- hid_t aid = -1; /* Attribute ID */
- hid_t sid; /* Dataspace ID */
- hid_t did; /* Dataset ID */
- char attrname[500]; /* Name of attribute */
- unsigned flags; /* File access flags */
- int i = 0; /* Local index variable */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fapl = H5I_INVALID_HID; /* File access property list */
+ hid_t tid = H5I_INVALID_HID, tid2 = H5I_INVALID_HID, tid3 = H5I_INVALID_HID; /* Datatype IDs */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
+ H5O_info_t oinfo, oinfo2, oinfo3, oinfo4; /* Object metadata information */
+ hid_t aid = H5I_INVALID_HID; /* Attribute ID */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t did = H5I_INVALID_HID; /* Dataset ID */
+ char attrname[500]; /* Name of attribute */
+ unsigned flags; /* File access flags */
+ int i = 0; /* Local index variable */
/* Testing Macro */
if (swmr) {
@@ -1204,20 +1205,20 @@ static unsigned
verify_multiple_cork(hbool_t swmr)
{
/* Variable Declarations */
- hid_t fid1 = -1, fid2 = -1; /* File ID */
- hid_t fapl = -1; /* File access property list */
- hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */
- hid_t gid1 = -1, gid2 = -1; /* Group IDs */
- hid_t did1 = -1, did2 = -1; /* Dataset ID */
- hid_t aidg1 = -1, aidg2 = -1; /* Attribute ID */
- hid_t aidd1 = -1, aidd2 = -1; /* Attribute ID */
- hid_t aidt1 = -1, aidt2 = -1; /* Attribute ID */
- hid_t sid = -1; /* Dataspace ID */
- H5O_info_t oinfo1, oinfo2, oinfo3; /* Object metadata information */
- hsize_t dim[1] = {5}; /* Dimension sizes */
- unsigned flags; /* File access flags */
- hbool_t corked; /* Cork status */
- herr_t ret; /* Return value */
+ hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File ID */
+ hid_t fapl = H5I_INVALID_HID; /* File access property list */
+ hid_t tid1 = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype IDs */
+ hid_t gid1 = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
+ hid_t did1 = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset ID */
+ hid_t aidg1 = H5I_INVALID_HID, aidg2 = H5I_INVALID_HID; /* Attribute ID */
+ hid_t aidd1 = H5I_INVALID_HID, aidd2 = H5I_INVALID_HID; /* Attribute ID */
+ hid_t aidt1 = H5I_INVALID_HID, aidt2 = H5I_INVALID_HID; /* Attribute ID */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ H5O_info_t oinfo1, oinfo2, oinfo3; /* Object metadata information */
+ hsize_t dim[1] = {5}; /* Dimension sizes */
+ unsigned flags; /* File access flags */
+ hbool_t corked; /* Cork status */
+ herr_t ret; /* Return value */
/* Testing Macro */
if (swmr) {
@@ -1880,18 +1881,18 @@ error:
static unsigned
test_dset_cork(hbool_t swmr, hbool_t new_format)
{
- hid_t fid; /* File ID */
- hid_t fapl; /* File access property list */
- hid_t gid; /* Groupd ID */
- hid_t did1, did2; /* Dataset IDs */
- hid_t tid1, tid2; /* Datatype IDs */
- hid_t sid; /* Dataspace ID */
- hid_t dcpl; /* Dataset creation property list */
- hsize_t dims[RANK]; /* Dataset dimensions */
- hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dataset dimensions */
- hsize_t cdims[RANK] = {2, 2}; /* Chunk dimensions */
- int fillval = 0; /* Fill value */
- int i, j, k = 0; /* Local index variables */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fapl = H5I_INVALID_HID; /* File access property list */
+ hid_t gid = H5I_INVALID_HID; /* Groupd ID */
+ hid_t did1 = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */
+ hid_t tid1 = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype IDs */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */
+ hsize_t dims[RANK]; /* Dataset dimensions */
+ hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dataset dimensions */
+ hsize_t cdims[RANK] = {2, 2}; /* Chunk dimensions */
+ int fillval = 0; /* Fill value */
+ int i, j, k = 0; /* Local index variables */
int ** wbuf = NULL; /* Data buffer for writes (pointers to fake 2D array) */
int * wbuf_data = NULL; /* Data buffer for writes (real data) */
int * rbuf_data = NULL; /* Data buffer for reads (real data) */
diff --git a/test/swmr.c b/test/swmr.c
index 9a6fee4..5227765 100644
--- a/test/swmr.c
+++ b/test/swmr.c
@@ -5221,8 +5221,8 @@ test_file_lock_swmr_concur(hid_t H5_ATTR_UNUSED in_fapl)
static int
test_file_lock_swmr_concur(hid_t in_fapl)
{
- hid_t fid; /* File ID */
- hid_t fapl; /* File access property list */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fapl = H5I_INVALID_HID; /* File access property list */
char filename[NAME_BUF_SIZE]; /* file name */
pid_t childpid = 0; /* Child process ID */
int child_status; /* Status passed to waitpid */
@@ -6722,14 +6722,14 @@ test_refresh_concur(hid_t H5_ATTR_UNUSED in_fapl, hbool_t new_format)
static int
test_refresh_concur(hid_t in_fapl, hbool_t new_format)
{
- hid_t fid; /* File ID */
- hid_t fapl; /* File access property list */
- pid_t childpid = 0; /* Child process ID */
- pid_t tmppid; /* Child process ID returned by waitpid */
- int child_status; /* Status passed to waitpid */
- int child_wait_option = 0; /* Options passed to waitpid */
- int child_exit_val; /* Exit status of the child */
- char filename[NAME_BUF_SIZE]; /* File name */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fapl = H5I_INVALID_HID; /* File access property list */
+ pid_t childpid = 0; /* Child process ID */
+ pid_t tmppid; /* Child process ID returned by waitpid */
+ int child_status; /* Status passed to waitpid */
+ int child_wait_option = 0; /* Options passed to waitpid */
+ int child_exit_val; /* Exit status of the child */
+ char filename[NAME_BUF_SIZE]; /* File name */
hid_t did = -1;
hid_t sid = -1;
diff --git a/test/tvlstr.c b/test/tvlstr.c
index 0363798..5fb7a10 100644
--- a/test/tvlstr.c
+++ b/test/tvlstr.c
@@ -293,7 +293,7 @@ test_vlstrings_special(void)
/* Check data read in */
for (i = 0; i < SPACE1_DIM1; i++)
if (rdata[i] != NULL)
- TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n", (int)i, rdata[i]);
+ TestErrPrintf("VL doesn't match!, rdata[%d]=%s\n", (int)i, rdata[i]);
/* Write dataset to disk */
ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
@@ -352,7 +352,7 @@ test_vlstrings_special(void)
/* Check data read in */
for (i = 0; i < SPACE1_DIM1; i++)
if (rdata[i] != NULL)
- TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n", (int)i, rdata[i]);
+ TestErrPrintf("VL doesn't match!, rdata[%d]=%s\n", (int)i, rdata[i]);
/* Try to write nil strings to disk. */
ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata2);
@@ -365,7 +365,7 @@ test_vlstrings_special(void)
/* Check data read in */
for (i = 0; i < SPACE1_DIM1; i++)
if (rdata[i] != NULL)
- TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n", (int)i, rdata[i]);
+ TestErrPrintf("VL doesn't match!, rdata[%d]=%s\n", (int)i, rdata[i]);
/* Close Dataset */
ret = H5Dclose(dataset);