diff options
Diffstat (limited to 'test/cork.c')
-rw-r--r-- | test/cork.c | 146 |
1 files changed, 73 insertions, 73 deletions
diff --git a/test/cork.c b/test/cork.c index d67d18b..cec18f3 100644 --- a/test/cork.c +++ b/test/cork.c @@ -65,14 +65,14 @@ /* ===================== */ /* Tests */ -static unsigned test_objs_cork(hbool_t swmr, hbool_t new_format); -static unsigned test_dset_cork(hbool_t swmr, hbool_t new_format); +static unsigned test_objs_cork(bool swmr, bool new_format); +static unsigned test_dset_cork(bool swmr, bool new_format); static unsigned verify_old_dset_cork(void); -static unsigned verify_obj_dset_cork(hbool_t swmr); -static unsigned verify_dset_cork(hbool_t swmr, hbool_t new_format); -static unsigned verify_group_cork(hbool_t swmr); -static unsigned verify_named_cork(hbool_t swmr); -static unsigned verify_multiple_cork(hbool_t swmr); +static unsigned verify_obj_dset_cork(bool swmr); +static unsigned verify_dset_cork(bool swmr, bool new_format); +static unsigned verify_group_cork(bool swmr); +static unsigned verify_named_cork(bool swmr); +static unsigned verify_multiple_cork(bool swmr); /*------------------------------------------------------------------------- * Function: verify_old_dset_cork @@ -133,7 +133,7 @@ verify_old_dset_cork(void) TEST_ERROR; /* Verify cork status */ - if (H5C__verify_cork_tag_test(fid, oinfo.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo.token, true) < 0) TEST_ERROR; /* Set up data array */ @@ -154,7 +154,7 @@ verify_old_dset_cork(void) TEST_ERROR; /* Verify the cork status for DSET_BT1 */ - if (H5C__verify_cork_tag_test(fid, oinfo.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo.token, true) < 0) TEST_ERROR; /* Create compact dataset: DSET_COMPACT */ @@ -178,7 +178,7 @@ verify_old_dset_cork(void) TEST_ERROR; /* Verify cork status */ - if (H5C__verify_cork_tag_test(fid, oinfo2.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo2.token, true) < 0) TEST_ERROR; /* Closing */ @@ -226,11 +226,11 @@ verify_old_dset_cork(void) TEST_ERROR; /* Verify the cork status for DSET_CONTIG */ - if (H5C__verify_cork_tag_test(fid, oinfo3.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo3.token, true) < 0) TEST_ERROR; /* Verify the cork status for DSET_BT1 */ - if (H5C__verify_cork_tag_test(fid, oinfo.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo.token, false) < 0) TEST_ERROR; /* Un-cork the dataset: DSET_CONTIG */ @@ -238,7 +238,7 @@ verify_old_dset_cork(void) TEST_ERROR; /* Verify the cork status for DSET_CONTIG */ - if (H5C__verify_cork_tag_test(fid, oinfo3.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo3.token, false) < 0) TEST_ERROR; /* Closing */ @@ -291,7 +291,7 @@ error: *------------------------------------------------------------------------- */ static unsigned -verify_obj_dset_cork(hbool_t swmr) +verify_obj_dset_cork(bool swmr) { /* Variable Declarations */ hid_t fid = H5I_INVALID_HID; /* File ID */ @@ -342,7 +342,7 @@ verify_obj_dset_cork(hbool_t swmr) TEST_ERROR; /* Verify cork status of the dataset: DSET */ - if (H5C__verify_cork_tag_test(fid, oinfo.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo.token, false) < 0) TEST_ERROR; /* Cork the dataset: DSET */ @@ -354,7 +354,7 @@ verify_obj_dset_cork(hbool_t swmr) TEST_ERROR; /* Verify cork status of the dataset: DSET */ - if (H5C__verify_cork_tag_test(fid, oinfo.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo.token, true) < 0) TEST_ERROR; /* Close the attribute */ @@ -362,7 +362,7 @@ verify_obj_dset_cork(hbool_t swmr) TEST_ERROR; /* Verify cork status of the dataset: DSET */ - if (H5C__verify_cork_tag_test(fid, oinfo.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo.token, true) < 0) TEST_ERROR; /* Create dcpl */ @@ -400,7 +400,7 @@ verify_obj_dset_cork(hbool_t swmr) } /* end for */ /* Verify cork status of the dataset: DSET_NONE */ - if (H5C__verify_cork_tag_test(fid, oinfo2.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo2.token, true) < 0) TEST_ERROR; /* Closing */ @@ -429,7 +429,7 @@ verify_obj_dset_cork(hbool_t swmr) TEST_ERROR; /* Verify cork status of the dataset: DSET */ - if (H5C__verify_cork_tag_test(fid, oinfo2.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo2.token, false) < 0) TEST_ERROR; /* Open the attribute attached to the dataset object: DSET_NONE */ @@ -442,7 +442,7 @@ verify_obj_dset_cork(hbool_t swmr) TEST_ERROR; /* Verify cork status of the dataset: DSET_NONE */ - if (H5C__verify_cork_tag_test(fid, oinfo2.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo2.token, true) < 0) TEST_ERROR; /* Close the attribute */ @@ -450,7 +450,7 @@ verify_obj_dset_cork(hbool_t swmr) TEST_ERROR; /* Verify cork status of the dataset: DSET */ - if (H5C__verify_cork_tag_test(fid, oinfo.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo.token, true) < 0) TEST_ERROR; /* Closing */ @@ -494,7 +494,7 @@ error: *------------------------------------------------------------------------- */ static unsigned -verify_dset_cork(hbool_t swmr, hbool_t new_format) +verify_dset_cork(bool swmr, bool new_format) { /* Variable Declarations */ hid_t fid = H5I_INVALID_HID; /* File ID */ @@ -568,7 +568,7 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format) TEST_ERROR; /* Verify cork status */ - if (H5C__verify_cork_tag_test(fid, oinfo.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo.token, true) < 0) TEST_ERROR; /* Create chunked dataset with fixed array indexing: DSET_FA */ @@ -590,11 +590,11 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format) TEST_ERROR; /* Verify the cork status for DSET_FA */ - if (H5C__verify_cork_tag_test(fid, oinfo2.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo2.token, true) < 0) TEST_ERROR; /* Verify the cork status for DSET_EA */ - if (H5C__verify_cork_tag_test(fid, oinfo.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo.token, false) < 0) TEST_ERROR; /* Create chunked dataset with v2-Btree indexing */ @@ -613,7 +613,7 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format) TEST_ERROR; /* Verify the cork status for DSET_BT2 */ - if (H5C__verify_cork_tag_test(fid, oinfo3.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo3.token, true) < 0) TEST_ERROR; /* Closing */ @@ -664,7 +664,7 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format) TEST_ERROR; /* Verify the cork status for DSET_EA */ - if (H5C__verify_cork_tag_test(fid, oinfo.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo.token, false) < 0) TEST_ERROR; /* Open and write to the dataset: DSET_FA */ @@ -678,7 +678,7 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format) TEST_ERROR; /* Verify the cork status for DSET_FA */ - if (H5C__verify_cork_tag_test(fid, oinfo2.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo2.token, true) < 0) TEST_ERROR; /* Open and write to the dataset: DSET_BT2 */ @@ -688,7 +688,7 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format) TEST_ERROR; /* Verify the cork status for DSET_BT2 */ - if (H5C__verify_cork_tag_test(fid, oinfo3.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo3.token, false) < 0) TEST_ERROR; /* Cork the dataset: DSET_BT2 */ @@ -696,7 +696,7 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format) TEST_ERROR; /* Verify the cork status for DSET_BT2 */ - if (H5C__verify_cork_tag_test(fid, oinfo3.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo3.token, true) < 0) TEST_ERROR; /* Closing */ @@ -750,7 +750,7 @@ error: *------------------------------------------------------------------------- */ static unsigned -verify_group_cork(hbool_t swmr) +verify_group_cork(bool swmr) { /* Variable Declarations */ hid_t fid = H5I_INVALID_HID; /* File ID */ @@ -806,11 +806,11 @@ verify_group_cork(hbool_t swmr) TEST_ERROR; /* Verify cork status of the groups */ - if (H5C__verify_cork_tag_test(fid, oinfo.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo.token, false) < 0) TEST_ERROR; - if (H5C__verify_cork_tag_test(fid, oinfo2.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo2.token, true) < 0) TEST_ERROR; - if (H5C__verify_cork_tag_test(fid, oinfo3.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo3.token, false) < 0) TEST_ERROR; /* Close the second group: GRP2 */ @@ -822,7 +822,7 @@ verify_group_cork(hbool_t swmr) FAIL_STACK_ERROR; /* Verify cork status of the second group: GRP2 */ - if (H5C__verify_cork_tag_test(fid, oinfo2.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo2.token, false) < 0) TEST_ERROR; /* Closing */ @@ -863,7 +863,7 @@ verify_group_cork(hbool_t swmr) if (i == 3) { if (H5Odisable_mdc_flushes(gid3) < 0) TEST_ERROR; - if (H5C__verify_cork_tag_test(fid, oinfo3.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo3.token, true) < 0) TEST_ERROR; } if (H5Aclose(aid) < 0) @@ -871,7 +871,7 @@ verify_group_cork(hbool_t swmr) } /* end for */ /* Verify cork status of the third group: GRP3 */ - if (H5C__verify_cork_tag_test(fid, oinfo3.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo3.token, true) < 0) TEST_ERROR; /* Closing */ @@ -917,7 +917,7 @@ error: *------------------------------------------------------------------------- */ static unsigned -verify_named_cork(hbool_t swmr) +verify_named_cork(bool swmr) { /* Variable Declarations */ hid_t fid = H5I_INVALID_HID; /* File ID */ @@ -995,11 +995,11 @@ verify_named_cork(hbool_t swmr) TEST_ERROR; /* Verify cork status of the named datatypes */ - if (H5C__verify_cork_tag_test(fid, oinfo.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo.token, true) < 0) TEST_ERROR; - if (H5C__verify_cork_tag_test(fid, oinfo2.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo2.token, false) < 0) TEST_ERROR; - if (H5C__verify_cork_tag_test(fid, oinfo3.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo3.token, true) < 0) TEST_ERROR; /* Close the datatypes */ @@ -1019,11 +1019,11 @@ verify_named_cork(hbool_t swmr) FAIL_STACK_ERROR; /* Verify cork status of the named datatypes */ - if (H5C__verify_cork_tag_test(fid, oinfo.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo.token, false) < 0) TEST_ERROR; - if (H5C__verify_cork_tag_test(fid, oinfo2.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo2.token, false) < 0) TEST_ERROR; - if (H5C__verify_cork_tag_test(fid, oinfo3.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo3.token, false) < 0) TEST_ERROR; /* Closing */ @@ -1078,7 +1078,7 @@ verify_named_cork(hbool_t swmr) if (i == 3) { if (H5Odisable_mdc_flushes(tid3) < 0) TEST_ERROR; - if (H5C__verify_cork_tag_test(fid, oinfo3.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo3.token, true) < 0) TEST_ERROR; } if (H5Aclose(aid) < 0) @@ -1098,20 +1098,20 @@ verify_named_cork(hbool_t swmr) TEST_ERROR; /* Verify cork status of the datatype: DT */ - if (H5C__verify_cork_tag_test(fid, oinfo.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo.token, false) < 0) TEST_ERROR; /* Verify cork status of the datatype: DT2 */ - if (H5C__verify_cork_tag_test(fid, oinfo2.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo2.token, true) < 0) TEST_ERROR; /* Verify cork status of the datatype: DT3 */ - if (H5C__verify_cork_tag_test(fid, oinfo3.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo3.token, true) < 0) TEST_ERROR; /* Un-cork the datatype: DT3 */ if (H5Oenable_mdc_flushes(tid3) < 0) TEST_ERROR; /* Verify cork status of the datatype: DT3 */ - if (H5C__verify_cork_tag_test(fid, oinfo3.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo3.token, false) < 0) TEST_ERROR; /* Cork the datatype: DT */ @@ -1119,14 +1119,14 @@ verify_named_cork(hbool_t swmr) TEST_ERROR; /* Verify cork status of the datatype: DT */ - if (H5C__verify_cork_tag_test(fid, oinfo.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo.token, true) < 0) TEST_ERROR; /* Verify cork status of the datatype: DT2 */ - if (H5C__verify_cork_tag_test(fid, oinfo2.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo2.token, true) < 0) TEST_ERROR; /* Verify cork status of the dataset: DSET */ - if (H5C__verify_cork_tag_test(fid, oinfo4.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo4.token, true) < 0) TEST_ERROR; /* Close the dataset */ @@ -1134,11 +1134,11 @@ verify_named_cork(hbool_t swmr) TEST_ERROR; /* Verify cork status of the datatype: DT */ - if (H5C__verify_cork_tag_test(fid, oinfo.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo.token, true) < 0) TEST_ERROR; /* Verify cork status of the dataset: DSET */ - if (H5C__verify_cork_tag_test(fid, oinfo4.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid, oinfo4.token, false) < 0) TEST_ERROR; /* Closing */ @@ -1192,7 +1192,7 @@ error: *------------------------------------------------------------------------- */ static unsigned -verify_multiple_cork(hbool_t swmr) +verify_multiple_cork(bool swmr) { /* Variable Declarations */ hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File ID */ @@ -1207,7 +1207,7 @@ verify_multiple_cork(hbool_t swmr) H5O_info2_t oinfo1, oinfo2, oinfo3; /* Object metadata information */ hsize_t dim[1] = {5}; /* Dimension sizes */ unsigned flags; /* File access flags */ - hbool_t corked; /* Cork status */ + bool corked; /* Cork status */ herr_t ret; /* Return value */ /* Testing Macro */ @@ -1306,7 +1306,7 @@ verify_multiple_cork(hbool_t swmr) /* Verify cork status of the group: gid2 */ if (H5Oget_info3(gid2, &oinfo1, H5O_INFO_BASIC) < 0) TEST_ERROR; - if (H5C__verify_cork_tag_test(fid2, oinfo1.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid2, oinfo1.token, true) < 0) TEST_ERROR; /* Check cork status of the group: gid1 */ @@ -1334,7 +1334,7 @@ verify_multiple_cork(hbool_t swmr) /* Verify cork status of the dataset: did1 */ if (H5Oget_info3(did1, &oinfo2, H5O_INFO_BASIC) < 0) TEST_ERROR; - if (H5C__verify_cork_tag_test(fid1, oinfo2.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid1, oinfo2.token, true) < 0) TEST_ERROR; /* Check cork status of the dataset: did2 */ @@ -1362,7 +1362,7 @@ verify_multiple_cork(hbool_t swmr) /* Verify cork status of the datatype: tid2 */ if (H5Oget_info3(tid2, &oinfo3, H5O_INFO_BASIC) < 0) TEST_ERROR; - if (H5C__verify_cork_tag_test(fid2, oinfo3.token, TRUE) < 0) + if (H5C__verify_cork_tag_test(fid2, oinfo3.token, true) < 0) TEST_ERROR; /* Check cork status of the datatype: tid1 */ @@ -1378,7 +1378,7 @@ verify_multiple_cork(hbool_t swmr) /* Verify cork status of the group: gid1 */ if (H5Oget_info3(gid1, &oinfo1, H5O_INFO_BASIC) < 0) TEST_ERROR; - if (H5C__verify_cork_tag_test(fid1, oinfo1.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid1, oinfo1.token, false) < 0) TEST_ERROR; /* Check cork status of the group: gid2 */ @@ -1398,7 +1398,7 @@ verify_multiple_cork(hbool_t swmr) TEST_ERROR; /* Verify cork status of the group: gid1 */ - if (H5C__verify_cork_tag_test(fid1, oinfo1.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid1, oinfo1.token, false) < 0) TEST_ERROR; /* Close the group: gid1 */ @@ -1412,7 +1412,7 @@ verify_multiple_cork(hbool_t swmr) /* Verify cork status of the dataset: did2 */ if (H5Oget_info3(did2, &oinfo2, H5O_INFO_BASIC) < 0) TEST_ERROR; - if (H5C__verify_cork_tag_test(fid2, oinfo2.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid2, oinfo2.token, false) < 0) TEST_ERROR; /* Check cork status of the dataset: did1 */ @@ -1432,7 +1432,7 @@ verify_multiple_cork(hbool_t swmr) TEST_ERROR; /* Verify cork status of the dataset: did1 */ - if (H5C__verify_cork_tag_test(fid1, oinfo2.token, FALSE) < 0) + if (H5C__verify_cork_tag_test(fid1, oinfo2.token, false) < 0) TEST_ERROR; /* Close the dataset: did1 */ @@ -1565,7 +1565,7 @@ error: *------------------------------------------------------------------------- */ static unsigned -test_objs_cork(hbool_t swmr, hbool_t new_format) +test_objs_cork(bool swmr, bool new_format) { hid_t fid = H5I_INVALID_HID; /* HDF5 File ID */ hid_t fapl = H5I_INVALID_HID; /* File access property list */ @@ -1575,7 +1575,7 @@ test_objs_cork(hbool_t swmr, hbool_t new_format) hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ hid_t aid = H5I_INVALID_HID; /* Attribute ID */ hsize_t dims[RANK]; /* Dataset dimension sizes */ - hbool_t corked; /* Cork status of an object */ + bool corked; /* Cork status of an object */ unsigned flags; /* File access flags */ herr_t ret; /* Return value */ @@ -1865,7 +1865,7 @@ error: *------------------------------------------------------------------------- */ static unsigned -test_dset_cork(hbool_t swmr, hbool_t new_format) +test_dset_cork(bool swmr, bool new_format) { hid_t fid = H5I_INVALID_HID; /* File ID */ hid_t fapl; /* File access property list */ @@ -1882,7 +1882,7 @@ test_dset_cork(hbool_t swmr, hbool_t new_format) 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) */ - hbool_t corked; /* Cork status of an object */ + bool corked; /* Cork status of an object */ unsigned flags; /* File access flags */ /* Testing Macro */ @@ -2243,16 +2243,16 @@ main(void) /* Tests with new/old library format */ /* This is the test moved from th5o.c: test_h5o_cork() */ - nerrs += test_objs_cork(swmr, TRUE); - nerrs += test_objs_cork(swmr, FALSE); + nerrs += test_objs_cork(swmr, true); + nerrs += test_objs_cork(swmr, false); /* This is the test moved from th5o.c: test_h5o_cork_dataset() */ - nerrs += test_dset_cork(swmr, TRUE); - nerrs += test_dset_cork(swmr, FALSE); + nerrs += test_dset_cork(swmr, true); + nerrs += test_dset_cork(swmr, false); /* Tests with/without SWMR access */ nerrs += verify_obj_dset_cork(swmr); - nerrs += verify_dset_cork(swmr, TRUE); - nerrs += verify_dset_cork(swmr, FALSE); + nerrs += verify_dset_cork(swmr, true); + nerrs += verify_dset_cork(swmr, false); nerrs += verify_group_cork(swmr); nerrs += verify_named_cork(swmr); nerrs += verify_multiple_cork(swmr); |