summaryrefslogtreecommitdiffstats
path: root/test/accum.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/accum.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/accum.c')
-rw-r--r--test/accum.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/test/accum.c b/test/accum.c
index 6f4db2d..70b99c6 100644
--- a/test/accum.c
+++ b/test/accum.c
@@ -51,7 +51,7 @@ unsigned test_read_after(H5F_t *f);
unsigned test_free(H5F_t *f);
unsigned test_big(H5F_t *f);
unsigned test_random_write(H5F_t *f);
-unsigned test_swmr_write_big(hbool_t newest_format);
+unsigned test_swmr_write_big(bool newest_format);
/* Helper Function Prototypes */
void accum_printf(const H5F_t *f);
@@ -61,7 +61,7 @@ void accum_printf(const H5F_t *f);
#define accum_read(a, s, b) H5F_block_read(f, H5FD_MEM_DEFAULT, (haddr_t)(a), (size_t)(s), (b))
#define accum_free(f, a, s) H5F__accum_free(f->shared, H5FD_MEM_DEFAULT, (haddr_t)(a), (hsize_t)(s))
#define accum_flush(f) H5F__accum_flush(f->shared)
-#define accum_reset(f) H5F__accum_reset(f->shared, TRUE)
+#define accum_reset(f) H5F__accum_reset(f->shared, true)
/* ================= */
/* Main Test Routine */
@@ -81,7 +81,7 @@ int
main(void)
{
unsigned nerrors = 0; /* track errors */
- hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
+ bool api_ctx_pushed = false; /* Whether API context pushed */
hid_t fid = -1;
hid_t fapl = -1; /* File access property list */
char filename[1024];
@@ -103,7 +103,7 @@ main(void)
/* Push API context */
if (H5CX_push() < 0)
FAIL_STACK_ERROR;
- api_ctx_pushed = TRUE;
+ api_ctx_pushed = true;
/* Get H5F_t * to internal file structure */
if (NULL == (f = (H5F_t *)H5VL_object(fid)))
@@ -133,17 +133,17 @@ main(void)
nerrors += test_random_write(f);
/* Pop API context */
- if (api_ctx_pushed && H5CX_pop(FALSE) < 0)
+ if (api_ctx_pushed && H5CX_pop(false) < 0)
FAIL_STACK_ERROR;
- api_ctx_pushed = FALSE;
+ api_ctx_pushed = false;
/* End of test code, close and delete file */
if (H5Fclose(fid) < 0)
TEST_ERROR;
/* This test uses a different file */
- nerrors += test_swmr_write_big(TRUE);
- nerrors += test_swmr_write_big(FALSE);
+ nerrors += test_swmr_write_big(true);
+ nerrors += test_swmr_write_big(false);
if (nerrors)
goto error;
@@ -154,7 +154,7 @@ main(void)
error:
if (api_ctx_pushed)
- H5CX_pop(FALSE);
+ H5CX_pop(false);
HDputs("*** TESTS FAILED ***");
return 1;
@@ -2047,7 +2047,7 @@ error:
*-------------------------------------------------------------------------
*/
unsigned
-test_swmr_write_big(hbool_t newest_format)
+test_swmr_write_big(bool newest_format)
{
hid_t fid = -1; /* File ID */
@@ -2057,9 +2057,9 @@ test_swmr_write_big(hbool_t newest_format)
uint8_t *wbuf2 = NULL, *rbuf = NULL; /* Buffers for reading & writing */
uint8_t wbuf[1024]; /* Buffer for reading & writing */
unsigned u; /* Local index variable */
- hbool_t process_success = FALSE;
+ bool process_success = false;
char *driver = NULL; /* VFD string (from env variable) */
- hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
+ bool api_ctx_pushed = false; /* Whether API context pushed */
if (newest_format)
TESTING("SWMR write of large metadata: with latest format");
@@ -2113,7 +2113,7 @@ test_swmr_write_big(hbool_t newest_format)
/* Push API context */
if (H5CX_push() < 0)
FAIL_STACK_ERROR;
- api_ctx_pushed = TRUE;
+ api_ctx_pushed = true;
/* Get H5F_t * to internal file structure */
if (NULL == (rf = (H5F_t *)H5VL_object(fid)))
@@ -2193,17 +2193,17 @@ test_swmr_write_big(hbool_t newest_format)
si.cb = sizeof(si);
ZeroMemory(&pi, sizeof(pi));
- if (0 == CreateProcess(NULL, SWMR_READER, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
+ if (0 == CreateProcess(NULL, SWMR_READER, NULL, NULL, false, 0, NULL, NULL, &si, &pi)) {
printf("CreateProcess failed (%d).\n", GetLastError());
FAIL_STACK_ERROR;
}
(void)WaitForSingleObject(pi.hProcess, INFINITE);
- if (FALSE == GetExitCodeProcess(pi.hProcess, &exit_code) || EXIT_FAILURE == exit_code)
- process_success = FALSE;
+ if (false == GetExitCodeProcess(pi.hProcess, &exit_code) || EXIT_FAILURE == exit_code)
+ process_success = false;
else
- process_success = TRUE;
+ process_success = true;
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
@@ -2238,7 +2238,7 @@ test_swmr_write_big(hbool_t newest_format)
/* Check if child process terminates normally and its return value */
if (WIFEXITED(status) && !WEXITSTATUS(status))
- process_success = TRUE;
+ process_success = true;
}
#endif /* defined(H5_HAVE_WIN32_API) */
@@ -2259,9 +2259,9 @@ test_swmr_write_big(hbool_t newest_format)
FAIL_STACK_ERROR;
/* Pop API context */
- if (api_ctx_pushed && H5CX_pop(FALSE) < 0)
+ if (api_ctx_pushed && H5CX_pop(false) < 0)
FAIL_STACK_ERROR;
- api_ctx_pushed = FALSE;
+ api_ctx_pushed = false;
/* Release memory */
if (wbuf2)
@@ -2277,7 +2277,7 @@ error:
H5Fclose(fid);
if (api_ctx_pushed)
- H5CX_pop(FALSE);
+ H5CX_pop(false);
H5Pclose(fapl);
@@ -2319,7 +2319,7 @@ accum_printf(const H5F_t *f)
printf("=====================================================\n");
printf(" accumulator allocated size == %zu\n", accum->alloc_size);
printf(" accumulated data size == %zu\n", accum->size);
- fprintf(stdout, " accumulator dirty? == %s\n", accum->dirty ? "TRUE" : "FALSE");
+ fprintf(stdout, " accumulator dirty? == %s\n", accum->dirty ? "true" : "false");
printf("=====================================================\n");
fprintf(stdout, " start of accumulated data, loc = %" PRIuHADDR "\n", accum->loc);
if (accum->dirty) {