diff options
Diffstat (limited to 'test/btree2.c')
-rw-r--r-- | test/btree2.c | 97 |
1 files changed, 50 insertions, 47 deletions
diff --git a/test/btree2.c b/test/btree2.c index e7dbfee..88f4f07 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -42,6 +42,9 @@ const char *FILENAME[] = { #define DELETE_MEDIUM 200 #define DELETE_LARGE 2000 +/* B-tree creation parameters */ +static const H5B2_create_t cparam_g = {H5B2_TEST, 512, 8, 100, 40}; + /*------------------------------------------------------------------------- * Function: iter_cb @@ -245,7 +248,7 @@ test_insert_basic(hid_t fapl) * Test v2 B-tree creation */ TESTING("B-tree creation"); - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR if(!H5F_addr_defined(bt2_addr)) FAIL_STACK_ERROR @@ -436,7 +439,7 @@ test_insert_split_root(hid_t fapl) /* * Test v2 B-tree creation */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Insert records to fill root leaf node */ @@ -610,7 +613,7 @@ test_insert_level1_2leaf_redistrib(hid_t fapl) /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Insert enough records to force root to split into 2 leaves */ @@ -663,7 +666,7 @@ test_insert_level1_2leaf_redistrib(hid_t fapl) /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Insert enough records to force root to split into 2 leaves */ @@ -770,7 +773,7 @@ test_insert_level1_side_split(hid_t fapl) /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Insert enough records to force root to split into 2 leaves */ @@ -828,7 +831,7 @@ test_insert_level1_side_split(hid_t fapl) /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Insert enough records to force root to split into 2 leaves */ @@ -942,7 +945,7 @@ test_insert_level1_3leaf_redistrib(hid_t fapl) /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Insert enough records to force root to split into 2 leaves */ @@ -1090,7 +1093,7 @@ test_insert_level1_middle_split(hid_t fapl) /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Insert enough records to force root to split into 2 leaves */ @@ -1215,7 +1218,7 @@ test_insert_make_level2(hid_t fapl) /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Insert enough records to force root to split into 2 internal nodes */ @@ -1398,7 +1401,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl) /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Insert enough records to force root to split into 2 internal nodes */ @@ -1663,7 +1666,7 @@ test_insert_level2_leaf_split(hid_t fapl) /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Insert enough records to force root to split into 2 internal nodes */ @@ -1939,7 +1942,7 @@ test_insert_level2_2internal_redistrib(hid_t fapl) /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Insert enough records to force root to split into 2 internal nodes */ @@ -2132,7 +2135,7 @@ test_insert_level2_2internal_split(hid_t fapl) /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Insert enough records to force root to split into 2 internal nodes */ @@ -2335,7 +2338,7 @@ test_insert_level2_3internal_redistrib(hid_t fapl) /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Insert enough records to force root to split into 3 internal nodes */ @@ -2537,7 +2540,7 @@ test_insert_level2_3internal_split(hid_t fapl) /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Insert enough records to force root to split into 3 internal nodes */ @@ -2771,7 +2774,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Insert random records */ @@ -2944,9 +2947,9 @@ test_remove_basic(hid_t fapl) TESTING("B-tree remove: record from empty B-tree"); /* - * Test v2 B-tree creation + * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Query the number of records in the B-tree */ @@ -3231,9 +3234,9 @@ test_remove_level1_noredistrib(hid_t fapl) TESTING("B-tree remove: non-existant record from level-1 B-tree"); /* - * Test v2 B-tree creation + * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Create level-1 B-tree with 3 leaves */ @@ -3453,9 +3456,9 @@ test_remove_level1_redistrib(hid_t fapl) TESTING("B-tree remove: redistribute 2 leaves in level-1 B-tree (r->l)"); /* - * Test v2 B-tree creation + * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Create level-1 B-tree with 3 leaves */ @@ -3653,9 +3656,9 @@ test_remove_level1_2leaf_merge(hid_t fapl) TESTING("B-tree remove: merge 2 leaves to 1 in level-1 B-tree (r->l)"); /* - * Test v2 B-tree creation + * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Create level-1 B-tree with 3 leaves */ @@ -3839,7 +3842,7 @@ test_remove_level1_3leaf_merge(hid_t fapl) /* * v2 B-tree creation */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Create level-1 B-tree with 3 leaves */ @@ -3967,7 +3970,7 @@ test_remove_level1_promote(hid_t fapl) /* * v2 B-tree creation */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Create level-1 B-tree with 5 leaves */ @@ -4211,7 +4214,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl) /* * v2 B-tree creation */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Create level-1 B-tree with 3 leaves */ @@ -4364,7 +4367,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl) /* * v2 B-tree creation */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Create level-1 B-tree with 3 leaves */ @@ -4517,7 +4520,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl) /* * v2 B-tree creation */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Create level-1 B-tree with 3 leaves */ @@ -4665,7 +4668,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl) /* * v2 B-tree creation */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Create level-2 B-tree with 3 leaves */ @@ -4812,7 +4815,7 @@ test_remove_level1_collapse(hid_t fapl) /* * v2 B-tree creation */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Create level-1 B-tree with 2 leaves */ @@ -4952,7 +4955,7 @@ test_remove_level2_promote(hid_t fapl) /* * v2 B-tree creation */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Create level-2 B-tree with 3 internal nodes */ @@ -5243,7 +5246,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl) /* * v2 B-tree creation */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Create level-2 B-tree with 3 internal nodes */ @@ -5396,7 +5399,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl) /* * v2 B-tree creation */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Create level-2 B-tree with 3 internal nodes */ @@ -5549,7 +5552,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl) /* * v2 B-tree creation */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Create level-2 B-tree with 3 internal nodes */ @@ -5705,7 +5708,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl) /* * v2 B-tree creation */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Create level-2 B-tree with 3 internal nodes */ @@ -5861,7 +5864,7 @@ test_remove_level2_2internal_merge_left(hid_t fapl) /* * v2 B-tree creation */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Create level-2 B-tree with 3 internal nodes */ @@ -5989,7 +5992,7 @@ test_remove_level2_2internal_merge_right(hid_t fapl) /* * v2 B-tree creation */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Create level-2 B-tree with 3 internal nodes */ @@ -6117,7 +6120,7 @@ test_remove_level2_3internal_merge(hid_t fapl) /* * v2 B-tree creation */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Create level-2 B-tree with 3 internal nodes */ @@ -6246,7 +6249,7 @@ test_remove_level2_collapse_right(hid_t fapl) /* * v2 B-tree creation */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Create level-2 B-tree with 3 internal nodes */ @@ -6362,7 +6365,7 @@ gen_l4_btree2(const char *filename, hid_t fapl, haddr_t *bt2_addr, /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Insert random records */ @@ -6844,7 +6847,7 @@ test_find_neighbor(hid_t fapl) /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Insert records */ @@ -7068,7 +7071,7 @@ test_delete(hid_t fapl) /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* @@ -7105,7 +7108,7 @@ test_delete(hid_t fapl) /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Insert records */ @@ -7155,7 +7158,7 @@ test_delete(hid_t fapl) /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Insert records */ @@ -7205,7 +7208,7 @@ test_delete(hid_t fapl) /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Insert records */ @@ -7299,7 +7302,7 @@ test_modify(hid_t fapl) /* * Create v2 B-tree */ - if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, (size_t)512, (size_t)8, 100, 40, &bt2_addr/*out*/) < 0) + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, &cparam_g, &bt2_addr/*out*/) < 0) FAIL_STACK_ERROR /* Create level-2 B-tree with 3 internal nodes */ |