diff options
Diffstat (limited to 'test/onion.c')
-rw-r--r-- | test/onion.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/test/onion.c b/test/onion.c index eb44a4f..576d8ad 100644 --- a/test/onion.c +++ b/test/onion.c @@ -68,7 +68,7 @@ struct write_info { const unsigned char *buf; }; struct revise_revision { - hbool_t truncate; /* onion-create, truncating any existing data */ + bool truncate; /* onion-create, truncating any existing data */ uint64_t revision_num; size_t n_writes; struct write_info writes[ONION_TEST_REV_REV_WRITES_MAX]; @@ -1308,7 +1308,7 @@ test_revision_record_encode_decode(void) uint64_t size_ret; H5FD_onion_revision_record_t r_out; uint32_t checksum = 0; - hbool_t badness = FALSE; + bool badness = false; char comment[25] = "Example comment message."; H5FD_onion_revision_record_t record = { H5FD_ONION_REVISION_RECORD_VERSION_CURR, @@ -1386,7 +1386,7 @@ test_revision_record_encode_decode(void) for (i = 0; i < exp_size; i++) { if (exp[i] != buf[i]) { - badness = TRUE; + badness = true; printf("Bad encoded record - Index %zu: expected 0x%02X but got 0x%02X\n", i, (unsigned int)exp[i], (unsigned int)buf[i]); } @@ -1897,9 +1897,9 @@ error: * Purpose: Test the ability of the Onion VFD to create a valid * 'onionized' file. * - * When `truncate_canonical` is FALSE, the canonical file is + * When `truncate_canonical` is false, the canonical file is * nonexistent on the backing store on onion-creation. - * When `truncate_canonical` is TRUE, a canonical file is created + * When `truncate_canonical` is true, a canonical file is created * on the backing store with known contents, which are to be * truncated on onion-creation. * @@ -1908,7 +1908,7 @@ error: *----------------------------------------------------------------------------- */ static int -test_create_oniontarget(hbool_t truncate_canonical, hbool_t with_initial_data) +test_create_oniontarget(bool truncate_canonical, bool with_initial_data) { const char *basename = "somesuch"; hid_t fapl_id = H5I_INVALID_HID; @@ -1929,11 +1929,11 @@ test_create_oniontarget(hbool_t truncate_canonical, hbool_t with_initial_data) struct expected_history filter; char *buf = NULL; - if (TRUE == truncate_canonical && TRUE == with_initial_data) + if (true == truncate_canonical && true == with_initial_data) TESTING("onion creation; truncate extant canonical; w/ initial data"); - else if (TRUE == truncate_canonical) + else if (true == truncate_canonical) TESTING("onion creation; truncate extant canonical; no initial data"); - else if (TRUE == with_initial_data) + else if (true == with_initial_data) TESTING("onion creation; no extant canonical; w/ initial data"); else TESTING("onion creation; no extant canonical; no initial data"); @@ -1955,7 +1955,7 @@ test_create_oniontarget(hbool_t truncate_canonical, hbool_t with_initial_data) HDremove(paths->recovery); /* Create canonical file to be truncated */ - if (TRUE == truncate_canonical) { + if (true == truncate_canonical) { /* Create canonical file. */ vfile_raw = H5FDopen(paths->canon, flags_create_s, onion_info.backing_fapl_id, HADDR_UNDEF); if (NULL == vfile_raw) @@ -2017,7 +2017,7 @@ test_create_oniontarget(hbool_t truncate_canonical, hbool_t with_initial_data) * WRITING */ - if (TRUE == with_initial_data) { + if (true == with_initial_data) { haddr_t half_size = 0; haddr_t buf_size = 0; @@ -2111,7 +2111,7 @@ test_create_oniontarget(hbool_t truncate_canonical, hbool_t with_initial_data) filter.revisions[0].n_index_entries = (uint64_t)(-1); /* don't care */ filter.revisions[0].revision_num = 0; filter.revisions[0].parent_revision_num = 0; - filter.revisions[0].logical_eof = (TRUE == with_initial_data) ? a_list_size_s : 0; + filter.revisions[0].logical_eof = (true == with_initial_data) ? a_list_size_s : 0; if (verify_history_as_expected_onion(vfile_raw, &filter) < 0) TEST_ERROR; @@ -2126,7 +2126,7 @@ test_create_oniontarget(hbool_t truncate_canonical, hbool_t with_initial_data) if (NULL == vfile_ro) TEST_ERROR; - if (TRUE == with_initial_data) { + if (true == with_initial_data) { /* Initial revision contains data */ if (H5FDget_eof(vfile_ro, H5FD_MEM_DRAW) != a_list_size_s) TEST_ERROR; @@ -2204,9 +2204,9 @@ error: * Purpose: Test the ability of the Onion VFD to create a valid * 'onionized' file. * - * When `truncate_canonical` is FALSE, the canonical file is + * When `truncate_canonical` is false, the canonical file is * nonexistent on the backing store on onion-creation. - * When `truncate_canonical` is TRUE, a canonical file is created + * When `truncate_canonical` is true, a canonical file is created * on the backing store with known contents, which are to be * truncated on onion-creation. * @@ -2263,12 +2263,12 @@ test_several_revisions_with_logical_gaps(void) HDremove(paths->recovery); /* Empty first revision */ - about[0].truncate = TRUE; + about[0].truncate = true; about[0].revision_num = H5FD_ONION_FAPL_INFO_REVISION_ID_LATEST; about[0].comment = "first"; about[0].n_writes = 0; - about[1].truncate = FALSE; + about[1].truncate = false; about[1].revision_num = H5FD_ONION_FAPL_INFO_REVISION_ID_LATEST; about[1].comment = "second"; about[1].n_writes = 1; @@ -2276,7 +2276,7 @@ test_several_revisions_with_logical_gaps(void) about[1].writes[0].size = a_list_size_s; about[1].writes[0].buf = a_list_s; - about[2].truncate = FALSE; + about[2].truncate = false; about[2].revision_num = H5FD_ONION_FAPL_INFO_REVISION_ID_LATEST; about[2].comment = "third"; about[2].n_writes = 1; /* TODO: several writes */ @@ -2284,7 +2284,7 @@ test_several_revisions_with_logical_gaps(void) about[2].writes[0].size = b_list_size_s; about[2].writes[0].buf = b_list_s; - about[3].truncate = FALSE; + about[3].truncate = false; about[3].revision_num = H5FD_ONION_FAPL_INFO_REVISION_ID_LATEST; about[3].comment = "fourth"; about[3].n_writes = 1; @@ -2577,10 +2577,10 @@ do_onion_open_and_writes(const char *filename, H5FD_onion_fapl_info_t *onion_inf size_t j = 0; unsigned int flags = H5F_ACC_RDWR; - if (i != 0 && about[i].truncate == TRUE) + if (i != 0 && about[i].truncate == true) goto error; - if (TRUE == about[i].truncate) + if (true == about[i].truncate) flags |= H5F_ACC_CREAT | H5F_ACC_TRUNC; onion_info_p->revision_num = about[i].revision_num; @@ -2712,7 +2712,7 @@ test_page_aligned_history_create(void) HDremove(paths->onion); HDremove(paths->recovery); - about[0].truncate = TRUE; + about[0].truncate = true; about[0].revision_num = H5FD_ONION_FAPL_INFO_REVISION_ID_LATEST; about[0].comment = "initial_commit"; about[0].n_writes = 1; @@ -2720,7 +2720,7 @@ test_page_aligned_history_create(void) about[0].writes[0].size = b_list_size_s; about[0].writes[0].buf = b_list_s; - about[1].truncate = FALSE; + about[1].truncate = false; about[1].revision_num = H5FD_ONION_FAPL_INFO_REVISION_ID_LATEST; about[1].comment = "second"; about[1].n_writes = 1; @@ -4941,10 +4941,10 @@ main(void) nerrors -= test_history_encode_decode_empty(); nerrors -= test_history_encode_decode(); nerrors -= test_revision_record_encode_decode(); - nerrors -= test_create_oniontarget(FALSE, FALSE); - nerrors -= test_create_oniontarget(TRUE, FALSE); - nerrors -= test_create_oniontarget(FALSE, TRUE); - nerrors -= test_create_oniontarget(TRUE, TRUE); + nerrors -= test_create_oniontarget(false, false); + nerrors -= test_create_oniontarget(true, false); + nerrors -= test_create_oniontarget(false, true); + nerrors -= test_create_oniontarget(true, true); nerrors -= test_several_revisions_with_logical_gaps(); nerrors -= test_page_aligned_history_create(); nerrors -= test_integration_create(); |