summaryrefslogtreecommitdiffstats
path: root/test/objcopy_ref.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-09-05 20:11:52 (GMT)
committerGitHub <noreply@github.com>2023-09-05 20:11:52 (GMT)
commit920869796031ed4ee9c1fbea8aaccda3592a88b3 (patch)
tree30f007ff79b87a79c882d9149cdbfcb797be92e1 /test/objcopy_ref.c
parentae1379094b71c51342772397af5caca088862a61 (diff)
downloadhdf5-920869796031ed4ee9c1fbea8aaccda3592a88b3.zip
hdf5-920869796031ed4ee9c1fbea8aaccda3592a88b3.tar.gz
hdf5-920869796031ed4ee9c1fbea8aaccda3592a88b3.tar.bz2
Convert hbool_t --> bool in test (#3494)
Diffstat (limited to 'test/objcopy_ref.c')
-rw-r--r--test/objcopy_ref.c94
1 files changed, 47 insertions, 47 deletions
diff --git a/test/objcopy_ref.c b/test/objcopy_ref.c
index 7a81aea..05e006b 100644
--- a/test/objcopy_ref.c
+++ b/test/objcopy_ref.c
@@ -112,28 +112,28 @@ token_insert(H5O_info2_t *oinfo)
*
* Purpose: Check if a token has already been encountered
*
- * Return: Success: TRUE/FALSE
+ * Return: Success: true/false
* Failure: (can't fail)
*
*-------------------------------------------------------------------------
*/
-static H5_ATTR_PURE hbool_t
+static H5_ATTR_PURE bool
token_lookup(hid_t loc_id, H5O_info2_t *oinfo)
{
size_t n;
int token_cmp;
if (oinfo->rc < 2)
- return FALSE; /*only one link possible*/
+ return false; /*only one link possible*/
for (n = 0; n < idtab_g.nobjs; n++) {
if (H5Otoken_cmp(loc_id, &(idtab_g.obj[n]), &oinfo->token, &token_cmp) < 0)
- return FALSE;
+ return false;
if (0 == token_cmp)
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
} /* end token_lookup() */
/*-------------------------------------------------------------------------
@@ -531,7 +531,7 @@ done:
*
* Purpose: Compare two attributes to check that they are equal
*
- * Return: TRUE if attributes are equal/FALSE if they are different
+ * Return: true if attributes are equal/false if they are different
*
*-------------------------------------------------------------------------
*/
@@ -583,7 +583,7 @@ compare_attribute(hid_t aid, hid_t aid2, hid_t pid, const void *wbuf, hid_t obj_
TEST_ERROR;
/* Compare the datatypes */
- if (H5Tequal(tid, tid2) != TRUE)
+ if (H5Tequal(tid, tid2) != true)
TEST_ERROR;
/* Determine the size of datatype (for later) */
@@ -601,7 +601,7 @@ compare_attribute(hid_t aid, hid_t aid2, hid_t pid, const void *wbuf, hid_t obj_
TEST_ERROR;
/* Compare the dataspaces */
- if (H5Sextent_equal(sid, sid2) != TRUE)
+ if (H5Sextent_equal(sid, sid2) != true)
TEST_ERROR;
/* Determine the number of elements in dataspace (for later) */
@@ -636,10 +636,10 @@ compare_attribute(hid_t aid, hid_t aid2, hid_t pid, const void *wbuf, hid_t obj_
TEST_ERROR;
/* Reclaim vlen data, if necessary */
- if (H5Tdetect_class(tid, H5T_VLEN) == TRUE || H5Tdetect_class(tid, H5T_REFERENCE) == TRUE)
+ if (H5Tdetect_class(tid, H5T_VLEN) == true || H5Tdetect_class(tid, H5T_REFERENCE) == true)
if (H5Treclaim(tid, sid, H5P_DEFAULT, rbuf) < 0)
TEST_ERROR;
- if (H5Tdetect_class(tid2, H5T_VLEN) == TRUE || H5Tdetect_class(tid2, H5T_REFERENCE) == TRUE)
+ if (H5Tdetect_class(tid2, H5T_VLEN) == true || H5Tdetect_class(tid2, H5T_REFERENCE) == true)
if (H5Treclaim(tid2, sid2, H5P_DEFAULT, rbuf2) < 0)
TEST_ERROR;
@@ -665,7 +665,7 @@ compare_attribute(hid_t aid, hid_t aid2, hid_t pid, const void *wbuf, hid_t obj_
if (H5Tclose(tid2) < 0)
TEST_ERROR;
- return TRUE;
+ return true;
error:
if (rbuf)
@@ -680,7 +680,7 @@ error:
H5Tclose(tid);
}
H5E_END_TRY
- return FALSE;
+ return false;
} /* end compare_attribute() */
/*-------------------------------------------------------------------------
@@ -688,7 +688,7 @@ error:
*
* Purpose: Compare "standard" attributes on two objects to check that they are equal
*
- * Return: TRUE if objects have same attributes/FALSE if they are different
+ * Return: true if objects have same attributes/false if they are different
*
* Note: This isn't very general, the attributes are assumed to be
* those written in test_copy_attach_attributes().
@@ -755,7 +755,7 @@ compare_std_attributes(hid_t oid, hid_t oid2, hid_t pid)
} /* end if */
/* Objects should be the same. :-) */
- return TRUE;
+ return true;
error:
H5E_BEGIN_TRY
@@ -764,7 +764,7 @@ error:
H5Aclose(aid);
}
H5E_END_TRY
- return FALSE;
+ return false;
} /* end compare_std_attributes() */
/*-------------------------------------------------------------------------
@@ -772,7 +772,7 @@ error:
*
* Purpose: Compare two buffers of data to check that they are equal
*
- * Return: TRUE if buffer are equal/FALSE if they are different
+ * Return: true if buffer are equal/false if they are different
*
*-------------------------------------------------------------------------
*/
@@ -789,7 +789,7 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
/* If the type is a compound containing a vlen, loop over all elements for
* each compound member. Compounds containing reference are not supported
* yet. */
- if ((H5Tget_class(tid) == H5T_COMPOUND) && (H5Tdetect_class(tid, H5T_VLEN) == TRUE)) {
+ if ((H5Tget_class(tid) == H5T_COMPOUND) && (H5Tdetect_class(tid, H5T_VLEN) == true)) {
hid_t memb_id; /* Member id */
const uint8_t *memb1; /* Pointer to current member */
const uint8_t *memb2; /* Pointer to current member */
@@ -852,7 +852,7 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
else {
/* vlens cannot currently be nested below the top layer of a
* compound */
- assert(H5Tdetect_class(memb_id, H5T_VLEN) == FALSE);
+ assert(H5Tdetect_class(memb_id, H5T_VLEN) == false);
/* Iterate over all elements, calling memcmp() for each */
for (elmt = 0; elmt < nelmts; elmt++) {
@@ -866,7 +866,7 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
} /* end else */
} /* end for */
}
- else if (H5Tdetect_class(tid, H5T_VLEN) == TRUE) {
+ else if (H5Tdetect_class(tid, H5T_VLEN) == true) {
const hvl_t *vl_buf1, *vl_buf2; /* Aliases for buffers to compare */
hid_t base_tid; /* Base type of vlen datatype */
size_t u; /* Local index variable */
@@ -896,7 +896,7 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
if (H5Tclose(base_tid) < 0)
TEST_ERROR;
} /* end if */
- else if (H5Tdetect_class(tid, H5T_REFERENCE) == TRUE) {
+ else if (H5Tdetect_class(tid, H5T_REFERENCE) == true) {
size_t u; /* Local index variable */
/* Check for "simple" reference datatype */
@@ -946,24 +946,24 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
TEST_ERROR;
if (H5Oclose(obj2_id) < 0)
TEST_ERROR;
- return TRUE;
+ return true;
}
}
/* Check for types of objects handled */
switch (obj1_type) {
case H5O_TYPE_DATASET:
- if (compare_datasets(obj1_id, obj2_id, pid, NULL) != TRUE)
+ if (compare_datasets(obj1_id, obj2_id, pid, NULL) != true)
TEST_ERROR;
break;
case H5O_TYPE_GROUP:
- if (compare_groups(obj1_id, obj2_id, pid, -1, 0) != TRUE)
+ if (compare_groups(obj1_id, obj2_id, pid, -1, 0) != true)
TEST_ERROR;
break;
case H5O_TYPE_NAMED_DATATYPE:
- if (H5Tequal(obj1_id, obj2_id) != TRUE)
+ if (H5Tequal(obj1_id, obj2_id) != true)
TEST_ERROR;
break;
@@ -1010,10 +1010,10 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
TEST_ERROR;
/* Data should be the same. :-) */
- return TRUE;
+ return true;
error:
- return FALSE;
+ return false;
} /* end compare_data() */
/*-------------------------------------------------------------------------
@@ -1021,7 +1021,7 @@ error:
*
* Purpose: Compare two datasets to check that they are equal
*
- * Return: TRUE if datasets are equal/FALSE if they are different
+ * Return: true if datasets are equal/false if they are different
*
*-------------------------------------------------------------------------
*/
@@ -1060,7 +1060,7 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf)
TEST_ERROR;
/* Compare the datatypes */
- if (H5Tequal(tid, tid2) != TRUE)
+ if (H5Tequal(tid, tid2) != true)
TEST_ERROR;
/* Determine the size of datatype (for later) */
@@ -1078,7 +1078,7 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf)
TEST_ERROR;
/* Compare the dataspaces */
- if (H5Sextent_equal(sid, sid2) != TRUE)
+ if (H5Sextent_equal(sid, sid2) != true)
TEST_ERROR;
/* Determine the number of elements in dataspace (for later) */
@@ -1096,7 +1096,7 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf)
TEST_ERROR;
/* Compare the rest of the dataset creation property lists */
- if (H5Pequal(dcpl, dcpl2) != TRUE)
+ if (H5Pequal(dcpl, dcpl2) != true)
TEST_ERROR;
/* Get the number of filters on dataset (for later) */
@@ -1162,10 +1162,10 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf)
TEST_ERROR;
/* Reclaim vlen data, if necessary */
- if (H5Tdetect_class(tid, H5T_VLEN) == TRUE || H5Tdetect_class(tid, H5T_REFERENCE) == TRUE)
+ if (H5Tdetect_class(tid, H5T_VLEN) == true || H5Tdetect_class(tid, H5T_REFERENCE) == true)
if (H5Treclaim(tid, sid, H5P_DEFAULT, rbuf) < 0)
TEST_ERROR;
- if (H5Tdetect_class(tid2, H5T_VLEN) == TRUE || H5Tdetect_class(tid2, H5T_REFERENCE) == TRUE)
+ if (H5Tdetect_class(tid2, H5T_VLEN) == true || H5Tdetect_class(tid2, H5T_REFERENCE) == true)
if (H5Treclaim(tid2, sid2, H5P_DEFAULT, rbuf2) < 0)
TEST_ERROR;
@@ -1192,11 +1192,11 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf)
TEST_ERROR;
/* Check if the attributes are equal */
- if (compare_std_attributes(did, did2, pid) != TRUE)
+ if (compare_std_attributes(did, did2, pid) != true)
TEST_ERROR;
/* Datasets should be the same. :-) */
- return TRUE;
+ return true;
error:
H5E_BEGIN_TRY
@@ -1213,7 +1213,7 @@ error:
H5Tclose(tid);
}
H5E_END_TRY
- return FALSE;
+ return false;
} /* end compare_datasets() */
/*-------------------------------------------------------------------------
@@ -1221,7 +1221,7 @@ error:
*
* Purpose: Compare two groups to check that they are "equal"
*
- * Return: TRUE if group are equal/FALSE if they are different
+ * Return: true if group are equal/false if they are different
*
*-------------------------------------------------------------------------
*/
@@ -1334,19 +1334,19 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags)
switch (oinfo.type) {
case H5O_TYPE_GROUP:
/* Compare groups */
- if (compare_groups(oid, oid2, pid, depth - 1, copy_flags) != TRUE)
+ if (compare_groups(oid, oid2, pid, depth - 1, copy_flags) != true)
TEST_ERROR;
break;
case H5O_TYPE_DATASET:
/* Compare datasets */
- if (compare_datasets(oid, oid2, pid, NULL) != TRUE)
+ if (compare_datasets(oid, oid2, pid, NULL) != true)
TEST_ERROR;
break;
case H5O_TYPE_NAMED_DATATYPE:
/* Compare datatypes */
- if (H5Tequal(oid, oid2) != TRUE)
+ if (H5Tequal(oid, oid2) != true)
TEST_ERROR;
break;
@@ -1402,18 +1402,18 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags)
} /* end if */
/* Check if the attributes are equal */
- if (compare_std_attributes(gid, gid2, pid) != TRUE)
+ if (compare_std_attributes(gid, gid2, pid) != true)
TEST_ERROR;
/* Groups should be the same. :-) */
- return TRUE;
+ return true;
error:
H5E_BEGIN_TRY
{
}
H5E_END_TRY
- return FALSE;
+ return false;
} /* end compare_groups() */
/*-------------------------------------------------------------------------
@@ -1428,7 +1428,7 @@ error:
*/
static int
test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, unsigned flag,
- hbool_t crt_intermediate_grp, const char *test_desciption)
+ bool crt_intermediate_grp, const char *test_desciption)
{
hid_t fid_src = -1, fid_dst = -1, fid_ext = -1; /* File IDs */
hid_t sid = -1; /* Dataspace ID */
@@ -1675,7 +1675,7 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl,
/* Create link creation plist to pass in intermediate group creation */
if ((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0)
TEST_ERROR;
- if (H5Pset_create_intermediate_group(lcpl_id, TRUE) < 0)
+ if (H5Pset_create_intermediate_group(lcpl_id, true) < 0)
TEST_ERROR;
if (H5Ocopy(fid_src, NAME_GROUP_TOP, fid_dst, "/new_g0/new_g00", pid, lcpl_id) < 0)
@@ -1755,7 +1755,7 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl,
} /* end else */
/* Check if the groups are equal */
- if (compare_groups(gid, gid2, pid, depth, flag) != TRUE)
+ if (compare_groups(gid, gid2, pid, depth, flag) != true)
TEST_ERROR;
if (H5Gclose(gid2) < 0)
TEST_ERROR;
@@ -1918,7 +1918,7 @@ main(void)
/* The tests... */
nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, H5O_COPY_EXPAND_REFERENCE_FLAG,
- FALSE, "H5Ocopy(): expand object reference");
+ false, "H5Ocopy(): expand object reference");
} /* end for */
/* Reset file token checking info */