diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-09-05 20:11:52 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-05 20:11:52 (GMT) |
commit | 920869796031ed4ee9c1fbea8aaccda3592a88b3 (patch) | |
tree | 30f007ff79b87a79c882d9149cdbfcb797be92e1 /test/flush2.c | |
parent | ae1379094b71c51342772397af5caca088862a61 (diff) | |
download | hdf5-920869796031ed4ee9c1fbea8aaccda3592a88b3.zip hdf5-920869796031ed4ee9c1fbea8aaccda3592a88b3.tar.gz hdf5-920869796031ed4ee9c1fbea8aaccda3592a88b3.tar.bz2 |
Convert hbool_t --> bool in test (#3494)
Diffstat (limited to 'test/flush2.c')
-rw-r--r-- | test/flush2.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/test/flush2.c b/test/flush2.c index 05beed7..e0f4224 100644 --- a/test/flush2.c +++ b/test/flush2.c @@ -39,19 +39,19 @@ static const char *FILENAME[] = {"flush", "flush-swmr", "noflu /* Number of sub-groups created in the containing group */ #define NGROUPS 100 -static hbool_t dset_ok(hid_t fid, const char *dset_name); -static hbool_t file_ok(const char *filename, hid_t fapl_id, hbool_t check_second_dset); +static bool dset_ok(hid_t fid, const char *dset_name); +static bool file_ok(const char *filename, hid_t fapl_id, bool check_second_dset); /*------------------------------------------------------------------------- * Function: dset_ok * * Purpose: Checks if the data in a dataset is what it is supposed to be. * - * Return: TRUE/FALSE + * Return: true/false * *------------------------------------------------------------------------- */ -static hbool_t +static bool dset_ok(hid_t fid, const char *dset_name) { hid_t sid = -1; /* dataspace ID */ @@ -86,7 +86,7 @@ dset_ok(hid_t fid, const char *dset_name) free(data); - return TRUE; + return true; error: H5E_BEGIN_TRY @@ -98,7 +98,7 @@ error: free(data); - return FALSE; + return false; } /* end dset_ok() */ /*------------------------------------------------------------------------- @@ -106,12 +106,12 @@ error: * * Purpose: Checks that the contents of a file are what they should be. * - * Return: TRUE/FALSE + * Return: true/false * *------------------------------------------------------------------------- */ -static hbool_t -file_ok(const char *filename, hid_t fapl_id, hbool_t check_second_dset) +static bool +file_ok(const char *filename, hid_t fapl_id, bool check_second_dset) { hid_t fid = -1; /* file ID */ hid_t top_gid = -1; /* containing group ID */ @@ -146,7 +146,7 @@ file_ok(const char *filename, hid_t fapl_id, hbool_t check_second_dset) if (H5Fclose(fid) < 0) goto error; - return TRUE; + return true; error: H5E_BEGIN_TRY @@ -157,7 +157,7 @@ error: } H5E_END_TRY - return FALSE; + return false; } /* end file_ok() */ /*------------------------------------------------------------------------- @@ -173,9 +173,9 @@ error: static herr_t clear_status_flags(const char *filename, hid_t fapl_id) { - hid_t new_fapl_id = -1; /* copy of the file access plist ID */ - hid_t fid = -1; /* file ID */ - hbool_t clear = TRUE; + hid_t new_fapl_id = -1; /* copy of the file access plist ID */ + hid_t fid = -1; /* file ID */ + bool clear = true; /* Get a copy of fapl */ if ((new_fapl_id = H5Pcopy(fapl_id)) < 0) @@ -224,12 +224,12 @@ int main(void) { char *driver = NULL; /* name of current VFD (from env var) */ - hbool_t vfd_supports_swmr; /* whether the current VFD supports SWMR */ + bool vfd_supports_swmr; /* whether the current VFD supports SWMR */ hid_t fapl_id = -1; /* file access proplist ID */ char filename[1024]; /* filename */ - hbool_t check_second_dset; /* whether or not to check the second dset */ + bool check_second_dset; /* whether or not to check the second dset */ H5E_auto2_t func; /* for shutting off error reporting */ - hbool_t driver_is_default_vfd_compatible; + bool driver_is_default_vfd_compatible; h5_reset(); if ((fapl_id = h5_fileaccess()) < 0) @@ -253,7 +253,7 @@ main(void) /* Check the case where the file was flushed */ TESTING("H5Fflush (part2 with flush)"); h5_fixname(FILENAME[0], fapl_id, filename, sizeof(filename)); - check_second_dset = FALSE; + check_second_dset = false; if (file_ok(filename, fapl_id, check_second_dset)) PASSED(); else @@ -264,7 +264,7 @@ main(void) TESTING("H5Fflush (part2 with flush + SWMR)"); if (vfd_supports_swmr) { h5_fixname(FILENAME[1], fapl_id, filename, sizeof(filename)); - check_second_dset = FALSE; + check_second_dset = false; if (clear_status_flags(filename, fapl_id) < 0) TEST_ERROR; if (file_ok(filename, fapl_id, check_second_dset)) @@ -284,7 +284,7 @@ main(void) if (H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0) FAIL_STACK_ERROR; h5_fixname(FILENAME[2], fapl_id, filename, sizeof(filename)); - check_second_dset = FALSE; + check_second_dset = false; if (file_ok(filename, fapl_id, check_second_dset)) { #if defined H5_HAVE_WIN32_API && !defined(hdf5_EXPORTS) SKIPPED(); @@ -309,7 +309,7 @@ main(void) if (H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0) FAIL_STACK_ERROR; h5_fixname(FILENAME[3], fapl_id, filename, sizeof(filename)); - check_second_dset = FALSE; + check_second_dset = false; if (clear_status_flags(filename, fapl_id) < 0) TEST_ERROR; if (file_ok(filename, fapl_id, check_second_dset)) { @@ -334,7 +334,7 @@ main(void) * added afterward and then flushed */ TESTING("H5Fflush (part2 with flush and later addition and another flush)"); - check_second_dset = TRUE; + check_second_dset = true; h5_fixname(FILENAME[4], fapl_id, filename, sizeof(filename)); if (file_ok(filename, fapl_id, check_second_dset)) PASSED(); @@ -347,7 +347,7 @@ main(void) */ TESTING("H5Fflush (part2 with flush and later addition and another flush + SWMR)"); if (vfd_supports_swmr) { - check_second_dset = TRUE; + check_second_dset = true; h5_fixname(FILENAME[5], fapl_id, filename, sizeof(filename)); if (clear_status_flags(filename, fapl_id) < 0) TEST_ERROR; @@ -370,7 +370,7 @@ main(void) if (H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0) FAIL_STACK_ERROR; h5_fixname(FILENAME[6], fapl_id, filename, sizeof(filename)); - check_second_dset = TRUE; + check_second_dset = true; if (file_ok(filename, fapl_id, check_second_dset)) { #if defined H5_HAVE_WIN32_API && !defined(hdf5_EXPORTS) SKIPPED(); @@ -397,7 +397,7 @@ main(void) if (H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0) FAIL_STACK_ERROR; h5_fixname(FILENAME[7], fapl_id, filename, sizeof(filename)); - check_second_dset = TRUE; + check_second_dset = true; if (clear_status_flags(filename, fapl_id) < 0) TEST_ERROR; if (file_ok(filename, fapl_id, check_second_dset)) { |