summaryrefslogtreecommitdiffstats
path: root/test/btree2.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/btree2.c')
-rw-r--r--test/btree2.c3086
1 files changed, 1525 insertions, 1561 deletions
diff --git a/test/btree2.c b/test/btree2.c
index 4c820b3..c4c5530 100644
--- a/test/btree2.c
+++ b/test/btree2.c
@@ -20,12 +20,13 @@
* This file needs to access private datatypes from the H5B2 package.
* This file also needs to access the v2 B-tree testing code.
*/
-#define H5B2_FRIEND /*suppress error about including H5B2pkg */
+#define H5B2_FRIEND /*suppress error about including H5B2pkg */
#define H5B2_TESTING
#include "H5B2pkg.h"
/* Other private headers that this test requires */
-#include "H5Iprivate.h"
+#include "H5CXprivate.h" /* API Contexts */
+#include "H5VLprivate.h" /* Virtual Object Layer */
const char *FILENAME[] = {
"btree2",
@@ -49,16 +50,16 @@ typedef struct bt2_test_param_t {
hbool_t reopen_btree; /* Whether to re-open the B-tree during the test */
} bt2_test_param_t;
-
+
/*-------------------------------------------------------------------------
- * Function: init_cparam
+ * Function: init_cparam
*
- * Purpose: Initialize v2 B-tree creation parameter structure
+ * Purpose: Initialize v2 B-tree creation parameter structure
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, October 29, 2009
*
*-------------------------------------------------------------------------
@@ -89,16 +90,16 @@ init_cparam(H5B2_create_t *cparam, H5B2_create_t *cparam2)
return(0);
} /* init_cparam() */
-
+
/*-------------------------------------------------------------------------
- * Function: create_file
+ * Function: create_file
*
- * Purpose: Perform common "creation" operations on file
+ * Purpose: Perform common "creation" operations on file
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, November 5, 2009
*
*-------------------------------------------------------------------------
@@ -106,7 +107,7 @@ init_cparam(H5B2_create_t *cparam, H5B2_create_t *cparam2)
static int
create_file(hid_t *file, H5F_t **f, hid_t fapl)
{
- char filename[1024]; /* Filename to use */
+ char filename[1024]; /* Filename to use */
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -116,7 +117,7 @@ create_file(hid_t *file, H5F_t **f, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
+ if(NULL == (*f = (H5F_t *)H5VL_object(*file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -130,26 +131,26 @@ error:
return(-1);
} /* end create_file() */
-
+
/*-------------------------------------------------------------------------
- * Function: create_btree
+ * Function: create_btree
*
- * Purpose: Perform common "create" operations on B-tree for testing
+ * Purpose: Perform common "create" operations on B-tree for testing
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, November 5, 2009
*
*-------------------------------------------------------------------------
*/
static int
-create_btree(H5F_t *f, hid_t dxpl, const H5B2_create_t *cparam,
+create_btree(H5F_t *f, const H5B2_create_t *cparam,
H5B2_t **bt2, haddr_t *bt2_addr)
{
/* Create the v2 B-tree & get its address */
- if(NULL == (*bt2 = H5B2_create(f, dxpl, cparam, f)))
+ if(NULL == (*bt2 = H5B2_create(f, cparam, f)))
FAIL_STACK_ERROR
if(H5B2_get_addr(*bt2, bt2_addr/*out*/) < 0)
FAIL_STACK_ERROR
@@ -163,16 +164,16 @@ error:
return(-1);
} /* end create_btree() */
-
+
/*-------------------------------------------------------------------------
- * Function: reopen_file
+ * Function: reopen_file
*
- * Purpose: Re-open the file
+ * Purpose: Re-open the file
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, December 28, 2015
*
*-------------------------------------------------------------------------
@@ -180,7 +181,7 @@ error:
static int
reopen_file(hid_t *file, H5F_t **f, hid_t fapl)
{
- char filename[1024]; /* Filename to use */
+ char filename[1024]; /* Filename to use */
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -190,7 +191,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
+ if(NULL == (*f = (H5F_t *)H5VL_object(*file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -204,32 +205,32 @@ error:
return(-1);
} /* end create_file() */
-
+
/*-------------------------------------------------------------------------
- * Function: reopen_btree
+ * Function: reopen_btree
*
- * Purpose: Perform common "re-open" operations on B-tree for testing
+ * Purpose: Perform common "re-open" operations on B-tree for testing
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, November 5, 2009
*
*-------------------------------------------------------------------------
*/
static int
-reopen_btree(H5F_t *f, hid_t dxpl, H5B2_t **bt2, haddr_t bt2_addr,
+reopen_btree(H5F_t *f, H5B2_t **bt2, haddr_t bt2_addr,
const bt2_test_param_t *tparam)
{
/* Check for closing & re-opening the B-tree */
if(tparam->reopen_btree) {
/* Close (empty) v2 B-tree */
- if(H5B2_close(*bt2, dxpl) < 0)
+ if(H5B2_close(*bt2) < 0)
FAIL_STACK_ERROR
/* Re-open v2 B-tree */
- if(NULL == (*bt2 = H5B2_open(f, dxpl, bt2_addr, f)))
+ if(NULL == (*bt2 = H5B2_open(f, bt2_addr, f)))
FAIL_STACK_ERROR
} /* end if */
@@ -240,16 +241,16 @@ error:
return(-1);
} /* end reopen_btree() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_stats
+ * Function: check_stats
*
- * Purpose: Check statistics about v1 B-tree
+ * Purpose: Check statistics about v1 B-tree
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, November 5, 2009
*
*-------------------------------------------------------------------------
@@ -274,26 +275,26 @@ error:
return(-1);
} /* end check_stats() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_node_depth
+ * Function: check_node_depth
*
- * Purpose: Check the depth of the node containing a record
+ * Purpose: Check the depth of the node containing a record
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, November 5, 2009
*
*-------------------------------------------------------------------------
*/
static int
-check_node_depth(H5B2_t *bt2, hid_t dxpl, void *record, unsigned depth)
+check_node_depth(H5B2_t *bt2, void *record, unsigned depth)
{
int rec_depth; /* Depth of record in B-tree */
- if((rec_depth = H5B2_get_node_depth_test(bt2, dxpl, record)) < 0)
+ if((rec_depth = H5B2__get_node_depth_test(bt2, record)) < 0)
FAIL_STACK_ERROR
if((unsigned)rec_depth != depth)
TEST_ERROR
@@ -305,27 +306,27 @@ error:
return(-1);
} /* end check_node_depth() */
-
+
/*-------------------------------------------------------------------------
- * Function: check_node_info
+ * Function: check_node_info
*
- * Purpose: Check the info of the node containing a record
+ * Purpose: Check the info of the node containing a record
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, November 6, 2009
*
*-------------------------------------------------------------------------
*/
static int
-check_node_info(H5B2_t *bt2, hid_t dxpl, hsize_t record,
+check_node_info(H5B2_t *bt2, hsize_t record,
H5B2_node_info_test_t *ninfo)
{
H5B2_node_info_test_t rec_ninfo; /* Node info for record in B-tree */
- if(H5B2_get_node_info_test(bt2, dxpl, &record, &rec_ninfo) < 0)
+ if(H5B2__get_node_info_test(bt2, &record, &rec_ninfo) < 0)
FAIL_STACK_ERROR
if(rec_ninfo.depth != ninfo->depth)
TEST_ERROR
@@ -339,16 +340,16 @@ error:
return(-1);
} /* end check_node_info() */
-
+
/*-------------------------------------------------------------------------
- * Function: iter_cb
+ * Function: iter_cb
*
- * Purpose: v2 B-tree iterator callback
+ * Purpose: v2 B-tree iterator callback
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, February 16, 2005
*
*-------------------------------------------------------------------------
@@ -366,16 +367,16 @@ iter_cb(const void *_record, void *_op_data)
return(H5_ITER_CONT);
} /* end iter_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: iter_rec_cb
+ * Function: iter_rec_cb
*
- * Purpose: v2 B-tree iterator callback for H5B2_test_rec_t records
+ * Purpose: v2 B-tree iterator callback for H5B2_test_rec_t records
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, December 25, 2015
*
*-------------------------------------------------------------------------
@@ -396,16 +397,16 @@ iter_rec_cb(const void *_record, void *_op_data)
return(H5_ITER_CONT);
} /* end iter_rec_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: find_cb
+ * Function: find_cb
*
- * Purpose: v2 B-tree find callback
+ * Purpose: v2 B-tree find callback
*
- * Return: Success: TRUE/FALSE
- * Failure: FAIL
+ * Return: Success: TRUE/FALSE
+ * Failure: FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, February 24, 2005
*
*-------------------------------------------------------------------------
@@ -422,16 +423,16 @@ find_cb(const void *_record, void *_op_data)
return(TRUE);
} /* end find_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: find_rec_cb
+ * Function: find_rec_cb
*
- * Purpose: v2 B-tree find callback for H5B2_test_rec_t records
+ * Purpose: v2 B-tree find callback for H5B2_test_rec_t records
*
- * Return: Success: TRUE/FALSE
- * Failure: FAIL
+ * Return: Success: TRUE/FALSE
+ * Failure: FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, December 25, 2015
*
*-------------------------------------------------------------------------
@@ -449,18 +450,18 @@ find_rec_cb(const void *_record, void *_op_data)
return(TRUE);
} /* end find_rec_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: find_dec_cb
+ * Function: find_dec_cb
*
- * Purpose: v2 B-tree find callback for indexing in decreasing order
+ * Purpose: v2 B-tree find callback for indexing in decreasing order
*
- * Note: Currently hard-wired to "insert_lots" test
+ * Note: Currently hard-wired to "insert_lots" test
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, November 7, 2006
*
*-------------------------------------------------------------------------
@@ -477,16 +478,16 @@ find_dec_cb(const void *_record, void *_op_data)
return(0);
} /* end find_dec_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: index_rec_cb
+ * Function: index_rec_cb
*
- * Purpose: v2 B-tree index callback for H5B2_test_rec_t records
+ * Purpose: v2 B-tree index callback for H5B2_test_rec_t records
*
- * Return: Success: TRUE/FALSE
- * Failure: FAIL
+ * Return: Success: TRUE/FALSE
+ * Failure: FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, December 25, 2015
*
*-------------------------------------------------------------------------
@@ -505,17 +506,17 @@ index_rec_cb(const void *_record, void *_op_data)
return(TRUE);
} /* end index_rec_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: neighbor_cb
+ * Function: neighbor_cb
*
- * Purpose: v2 B-tree neighbor callback
+ * Purpose: v2 B-tree neighbor callback
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 8, 2005
*
*-------------------------------------------------------------------------
@@ -531,17 +532,17 @@ neighbor_cb(const void *_record, void *_op_data)
return(0);
} /* end neighbor_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: modify_cb
+ * Function: modify_cb
*
- * Purpose: v2 B-tree modify callback
+ * Purpose: v2 B-tree modify callback
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 10, 2005
*
*-------------------------------------------------------------------------
@@ -558,16 +559,16 @@ modify_cb(void *_record, void *_op_data, hbool_t *changed)
return(0);
} /* end modify_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: modify_rec_cb
+ * Function: modify_rec_cb
*
- * Purpose: v2 B-tree modify callback for H5B2_test_rec_t records
+ * Purpose: v2 B-tree modify callback for H5B2_test_rec_t records
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, December 25, 2015
*
*-------------------------------------------------------------------------
@@ -585,17 +586,17 @@ modify_rec_cb(void *_record, void *_op_data, hbool_t *changed)
return(0);
} /* end modify_rec_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: no_modify_cb
+ * Function: no_modify_cb
*
- * Purpose: v2 B-tree modify callback for updates which shouldn't change
- * the record (ie. inserting not modifying)
+ * Purpose: v2 B-tree modify callback for updates which shouldn't change
+ * the record (ie. inserting not modifying)
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, December 23, 2015
*
*-------------------------------------------------------------------------
@@ -609,17 +610,17 @@ no_modify_cb(void H5_ATTR_UNUSED *_record, void H5_ATTR_UNUSED *_op_data,
return(1);
} /* end no_modify_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: remove_cb
+ * Function: remove_cb
*
- * Purpose: v2 B-tree remove callback
+ * Purpose: v2 B-tree remove callback
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, August 8, 2006
*
*-------------------------------------------------------------------------
@@ -635,16 +636,16 @@ remove_cb(const void *_record, void *_op_data)
return(0);
} /* end remove_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_basic
+ * Function: test_insert_basic
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, February 3, 2005
*
*-------------------------------------------------------------------------
@@ -653,9 +654,8 @@ static unsigned
test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -672,7 +672,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
PASSED();
@@ -683,12 +683,12 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree iteration: empty B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to iterate over a B-tree with no records */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index hasn't changed */
if(idx != 0)
@@ -696,13 +696,13 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to find record in B-tree with no records */
idx = 0;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, NULL) != FALSE)
+ if(H5B2_find(bt2, &idx, find_cb, NULL) != FALSE)
TEST_ERROR
/* Attempt to index record in B-tree with no records */
idx = 0;
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -716,37 +716,37 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree insert: first record");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
record = 42;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Attempt to find non-existant record in B-tree with 1 record */
/* (Should not be found, but not fail) */
idx = 41;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != FALSE)
TEST_ERROR
/* Try again with NULL 'op' */
/* (Should not be found, but not fail) */
- if(H5B2_find(bt2, dxpl, &idx, NULL, NULL) != FALSE)
+ if(H5B2_find(bt2, &idx, NULL, NULL) != FALSE)
TEST_ERROR
/* Attempt to find existant record in B-tree with 1 record */
idx = 42;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
TEST_ERROR
/* Try again with NULL 'op' */
- if(H5B2_find(bt2, dxpl, &idx, NULL, NULL) != TRUE)
+ if(H5B2_find(bt2, &idx, NULL, NULL) != TRUE)
TEST_ERROR
/* Attempt to index non-existant record in B-tree with 1 record */
idx = 0;
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, find_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, find_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -754,7 +754,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in B-tree with 1 record */
idx = 42;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0)
TEST_ERROR
PASSED();
@@ -765,45 +765,45 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree insert: several records");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/*
* Test inserting second record into v2 B-tree, before all other records
*/
record = 34;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/*
* Test inserting third record into v2 B-tree, after all other records
*/
record = 56;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/*
* Test inserting fourth record into v2 B-tree, in the middle of other records
*/
record = 38;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Attempt to find non-existant record in level-0 B-tree with several records */
/* (Should not be found, but not fail) */
idx = 41;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != FALSE)
TEST_ERROR
/* Attempt to find existant record in level-0 B-tree with several record */
idx = 56;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
TEST_ERROR
/* Attempt to index non-existant record in B-tree with several records */
idx = 0;
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)4, find_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, find_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -811,20 +811,20 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in B-tree with several records */
idx = 34;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0)
TEST_ERROR
idx = 38;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, find_cb, &idx) < 0)
TEST_ERROR
idx = 42;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)2, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)2, find_cb, &idx) < 0)
TEST_ERROR
idx = 56;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)3, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)3, find_cb, &idx) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -840,25 +840,25 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_insert_basic() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_split_root
+ * Function: test_insert_split_root
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to split the root node and force the tree to depth 1.
* It also continues to add a few more records to each of the
* left and right leaf nodes after the split
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, February 3, 2005
*
*-------------------------------------------------------------------------
@@ -867,9 +867,8 @@ static unsigned
test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -888,13 +887,13 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert records to fill root leaf node */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC - 1); u++) {
record = u + 2;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -904,16 +903,16 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (hsize_t)33;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert record to split root leaf node */
record = INSERT_SPLIT_ROOT_NREC + 1;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -922,20 +921,20 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (hsize_t)33;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert a couple more records, on the left side of the B-tree */
record = 0;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
record = 1;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -944,17 +943,17 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (hsize_t)33;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -964,23 +963,23 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to find non-existant record in level-1 B-tree */
/* (Should not be found, but not fail) */
idx = INSERT_SPLIT_ROOT_NREC + 10;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != FALSE)
TEST_ERROR
/* Attempt to find existant record in root of level-1 B-tree */
idx = 33;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
FAIL_STACK_ERROR
/* Attempt to find existant record in leaf of level-1 B-tree */
idx = 56;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
FAIL_STACK_ERROR
/* Attempt to index non-existant record in level-1 B-tree */
idx = 0;
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC+2), find_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC+2), find_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -988,21 +987,21 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in root of level-1 B-tree */
idx = 33;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)33, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)33, find_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Attempt to index existing record in left leaf of level-1 B-tree */
idx = 0;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Attempt to index existing record in right leaf of level-1 B-tree */
idx = 50;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)50, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)50, find_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -1016,26 +1015,26 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_split_root() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_level1_2leaf_redistrib
+ * Function: test_insert_level1_2leaf_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to split the root node and force the tree to depth 1.
* It continues to add a more records to the each of the
* left and right leaf nodes after the split to force a 2 node
* redistribution
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, February 8, 2005
*
*-------------------------------------------------------------------------
@@ -1044,9 +1043,8 @@ static unsigned
test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -1063,13 +1061,13 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u + (INSERT_SPLIT_ROOT_NREC/2) + 1;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1079,18 +1077,18 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (hsize_t)INSERT_SPLIT_ROOT_NREC;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force redistribution from left node into right node */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1100,11 +1098,11 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (hsize_t)((INSERT_SPLIT_ROOT_NREC / 2) + (INSERT_SPLIT_ROOT_NREC / 4) + 1);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -1116,13 +1114,13 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree insert: redistribute 2 leaves in level 1 B-tree (r->l)");
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1132,17 +1130,17 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (hsize_t)(INSERT_SPLIT_ROOT_NREC / 2);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force redistribution from left node into right node */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) {
record = u + INSERT_SPLIT_ROOT_NREC;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1152,11 +1150,11 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (hsize_t)((INSERT_SPLIT_ROOT_NREC / 2) + (INSERT_SPLIT_ROOT_NREC / 4) + 1);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -1171,26 +1169,26 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_level1_2leaf_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_level1_side_split
+ * Function: test_insert_level1_side_split
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to split the root node and force the tree to depth 1.
* It continues to add a more records to the each of the
* left and right leaf nodes after the split to force a 2 node
* split, adding another node to the B-tree
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, February 9, 2005
*
*-------------------------------------------------------------------------
@@ -1199,9 +1197,8 @@ static unsigned
test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -1218,13 +1215,13 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u + INSERT_SPLIT_ROOT_NREC;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1234,17 +1231,17 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force left node to split */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1254,14 +1251,14 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 31;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 63;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -1273,13 +1270,13 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree insert: split side leaf into 2 leaves in level 1 B-tree (r->l)");
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1289,17 +1286,17 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (INSERT_SPLIT_ROOT_NREC / 2);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force right node to split */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u + INSERT_SPLIT_ROOT_NREC;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1309,14 +1306,14 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 62;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 94;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -1331,28 +1328,28 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_level1_side_split() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_level1_3leaf_redistrib
+ * Function: test_insert_level1_3leaf_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to split the root node and force the tree to depth 1.
* It continues to add a more records to the each of the
* left and right leaf nodes after the split to force a 2 node
* split, adding another node to the B-tree, then continues to
* add records until a 3 node redistribution occurs
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, February 10, 2005
*
*-------------------------------------------------------------------------
@@ -1361,9 +1358,8 @@ static unsigned
test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -1381,13 +1377,13 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u + (INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2) + 1);
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1397,17 +1393,17 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (2 * INSERT_SPLIT_ROOT_NREC);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force left node to split */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1417,20 +1413,20 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (INSERT_SPLIT_ROOT_NREC / 2);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = (INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2) + 1);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert records to force middle node to redistribute */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC / 2) + 1); u++) {
record = u + INSERT_SPLIT_ROOT_NREC;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1440,19 +1436,19 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 52;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 105;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -1460,7 +1456,7 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -1475,27 +1471,27 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_level1_3leaf_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_level1_middle_split
+ * Function: test_insert_level1_middle_split
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to split the root node and force the tree to depth 1.
* It continues to add a more records to the each of the
* left and right leaf nodes after the split to force a 2 node
* split, adding another node to the B-tree, then continues to
* add records until a 3 node split occurs
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, February 10, 2005
*
*-------------------------------------------------------------------------
@@ -1504,9 +1500,8 @@ static unsigned
test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -1524,13 +1519,13 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 2);
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1540,17 +1535,17 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (2 * INSERT_SPLIT_ROOT_NREC) + (INSERT_SPLIT_ROOT_NREC / 2);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force split from left node into right node */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1560,22 +1555,22 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 62;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 94;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 126;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -1583,7 +1578,7 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -1598,23 +1593,23 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_level1_middle_split() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_make_level2
+ * Function: test_insert_make_level2
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to make a level 2 B-tree
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, February 11, 2005
*
*-------------------------------------------------------------------------
@@ -1623,9 +1618,8 @@ static unsigned
test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -1644,18 +1638,18 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 internal nodes */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 9); u++) {
record = u + 2;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
for(; u < ((INSERT_SPLIT_ROOT_NREC * 29) + 1); u++) {
record = u + 4;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1665,37 +1659,37 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 948;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Add some extra records to left-most leaf */
record = 0;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
record = 1;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Add some extra records to middle leaf */
record = (INSERT_SPLIT_ROOT_NREC * 9) + 2;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
record = (INSERT_SPLIT_ROOT_NREC * 9) + 3;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -1705,43 +1699,43 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to find non-existant record in level-2 B-tree */
/* (Should not be found, but not fail) */
idx = INSERT_SPLIT_ROOT_NREC * 30;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != FALSE)
TEST_ERROR
/* Attempt to find existant record in root of level-2 B-tree */
idx = 948;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
FAIL_STACK_ERROR
/* Check with B-tree */
record = 948;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
/* Attempt to find existant record in internal node of level-2 B-tree */
idx = 505;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
FAIL_STACK_ERROR
/* Check with B-tree */
record = 505;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Attempt to find existant record in leaf of level-2 B-tree */
idx = 555;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
FAIL_STACK_ERROR
/* Check with B-tree */
record = 555;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Attempt to index non-existant record in level-2 B-tree */
idx = 0;
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC * 30), find_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC * 30), find_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -1749,21 +1743,21 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in root of level-2 B-tree */
idx = 948;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)948, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)948, find_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Attempt to index existing record in internal node of level-2 B-tree */
idx = 505;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)505, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)505, find_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Attempt to index existing record in leaf of level-2 B-tree */
idx = 555;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)555, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)555, find_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -1778,25 +1772,25 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_make_level2() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_level2_leaf_redistrib
+ * Function: test_insert_level2_leaf_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to make a level 2 B-tree and then adds enough more
* records to force the leaves to redistribute
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, February 17, 2005
*
*-------------------------------------------------------------------------
@@ -1805,9 +1799,8 @@ static unsigned
test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -1825,19 +1818,19 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 internal nodes */
/* And fill rightmost leaf */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 8); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC / 2) + 1;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
for(; u < ((INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2)); u++) {
record = u + INSERT_SPLIT_ROOT_NREC + 1;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1847,22 +1840,22 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1008;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 1859;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 1921;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert record to force redistribution of rightmost leaf */
record = u + INSERT_SPLIT_ROOT_NREC + 1;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -1871,13 +1864,13 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1008;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 1875;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 1922;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
PASSED();
@@ -1885,7 +1878,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree insert: redistrib left-most leaf in level 2 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check up on B-tree */
@@ -1894,13 +1887,13 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1008;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 94;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 32;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Add more records to left-most leaf, to force a 2->1 split and then a
@@ -1908,7 +1901,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
*/
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1918,13 +1911,13 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1008;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 47;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 0;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
PASSED();
@@ -1932,7 +1925,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree insert: redistrib middle leaf in level 2 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check up on B-tree */
@@ -1941,22 +1934,22 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1008;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) /* Record in root node */
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0) /* Record in root node */
TEST_ERROR
record = 535;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) /* Record in middle node before insertion point */
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0) /* Record in middle node before insertion point */
TEST_ERROR
record = 630;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) /* Record in middle node after insertion point */
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0) /* Record in middle node after insertion point */
TEST_ERROR
record = 568;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) /* Record in leaf node just after insertion point */
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0) /* Record in leaf node just after insertion point */
TEST_ERROR
/* Add more records to middle leaf, to force a split and a 3 node redistribution on middle leaf */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 8) + (INSERT_SPLIT_ROOT_NREC / 2) + 1;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1966,25 +1959,25 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1008;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) /* Record in root node */
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0) /* Record in root node */
TEST_ERROR
record = 524;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) /* Record in middle node before insertion point */
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0) /* Record in middle node before insertion point */
TEST_ERROR
record = 577;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) /* Record in middle node after insertion point */
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0) /* Record in middle node after insertion point */
TEST_ERROR
record = 568;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) /* Record in leaf node just after insertion point */
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0) /* Record in leaf node just after insertion point */
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -1992,7 +1985,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -2007,25 +2000,25 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_level2_leaf_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_level2_leaf_split
+ * Function: test_insert_level2_leaf_split
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to make a level 2 B-tree and then adds enough more
* records to force leaves to split.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, February 17, 2005
*
*-------------------------------------------------------------------------
@@ -2034,9 +2027,8 @@ static unsigned
test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -2054,18 +2046,18 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 internal nodes */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 8); u++) {
record = u + 1;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
for(; u < ((INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2)); u++) {
record = u + 2;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -2075,23 +2067,23 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 946; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 1797; /* Right-most record in right internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 1859; /* Right-most record in right-most leaf */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert enough records to force right-most leaf to split */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC / 2) + 1); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2) + 2;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -2101,16 +2093,16 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 946; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 1828; /* Next-to-right-most record in right-most internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 1860; /* Right-most record in right-most internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 1891; /* Right-most record in right-most leaf */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
PASSED();
@@ -2118,7 +2110,7 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree insert: split left-most leaf in level 2 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check up on B-tree */
@@ -2127,18 +2119,18 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 946; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 63; /* Left-most record in left-most internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 1; /* Left-most record in left-most leaf */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Add another record to left-most leaf, to force a 1->2 node split on left leaf */
record = 0;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -2147,16 +2139,16 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 946; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 63; /* Left-most record in left-most internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 32; /* Left-most record in left internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 0; /* Left-most record in left-most leaf */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
PASSED();
@@ -2164,7 +2156,7 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree insert: split middle leaf in level 2 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check up on B-tree */
@@ -2173,21 +2165,21 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 946; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 504; /* Record in internal node just before insertion point */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 568; /* Record in internal node just after insertion point */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 506; /* Record in leaf node just after insertion point */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Add another record to middle leaf, to force a node split on middle leaf */
record = (INSERT_SPLIT_ROOT_NREC * 8) + 1;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -2196,28 +2188,28 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 946; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 504; /* Left-most record of split in left internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 537; /* Middle record of split in left internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 568; /* Right-most record of split in left internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 506; /* Record in leaf node just after insertion point */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -2225,7 +2217,7 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -2240,26 +2232,26 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_level2_leaf_split() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_level2_2internal_redistrib
+ * Function: test_insert_level2_2internal_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to make a level 2 B-tree and then adds enough more
* records to force the left-most and right-most internal nodes to
* redistribute.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, February 18, 2005
*
*-------------------------------------------------------------------------
@@ -2268,9 +2260,8 @@ static unsigned
test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -2288,14 +2279,14 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 internal nodes */
/* And fill up right internal node, to just before to redistribute it */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 44); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 6) - 4;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -2305,22 +2296,22 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1318; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 3114; /* Right-most record in right internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 3145; /* Right-most record in right leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert record to redistribute right-most internal node */
record = u + (INSERT_SPLIT_ROOT_NREC * 6) - 4;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -2329,13 +2320,13 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1822; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 3114; /* Right-most record in right internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 3146; /* Right-most record in right leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
PASSED();
@@ -2343,7 +2334,7 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree insert: redist. 2 internal (l->r) in level 2 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check up on B-tree */
@@ -2352,19 +2343,19 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1822; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 436; /* Left-most record in left internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 374; /* Left-most record in left leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Force left-most internal node to redistribute */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 6) - 4); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -2374,22 +2365,22 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1570; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 61; /* Left-most record in left internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 0; /* Left-most record in left leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -2397,7 +2388,7 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -2412,26 +2403,26 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_level2_2internal_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_level2_2internal_split
+ * Function: test_insert_level2_2internal_split
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to make a level 2 B-tree and then adds enough more
* records to force the left-most and right-most internal nodes to
* split.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, February 18, 2005
*
*-------------------------------------------------------------------------
@@ -2440,9 +2431,8 @@ static unsigned
test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -2460,14 +2450,14 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 internal nodes */
/* (And fill up two child internal nodes) */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 59); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 14) - (INSERT_SPLIT_ROOT_NREC / 4) + 3;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -2477,22 +2467,22 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 2759; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 4555; /* Right-most record in right internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 4586; /* Right-most record in right leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert record to split right-most internal node */
record = u + (INSERT_SPLIT_ROOT_NREC * 14) - (INSERT_SPLIT_ROOT_NREC / 4) + 3;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -2501,16 +2491,16 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 2759; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 3704; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 4555; /* Right-most record in right internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 4387; /* Right-most record in right leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
PASSED();
@@ -2518,7 +2508,7 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree insert: split side internal node to 2 in level 2 B-tree (l->2)");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check up on B-tree */
@@ -2527,19 +2517,19 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 2759; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 932; /* Left-most record in left internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 870; /* Left-most record in left leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Force left-most internal node to split */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 14) - (INSERT_SPLIT_ROOT_NREC / 4) + 3); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -2549,25 +2539,25 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 870; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 1814; /* Next-to-left-most record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 61; /* Left-most record in left internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 0; /* Left-most record in left leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -2575,7 +2565,7 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -2590,27 +2580,27 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_level2_2internal_split() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_level2_3internal_redistrib
+ * Function: test_insert_level2_3internal_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to make a level 2 B-tree and then adds enough more
* records to force the left-most and right-most internal nodes to
* split and more records to force a 3 node redistribution of the
* internal nodes.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, February 19, 2005
*
*-------------------------------------------------------------------------
@@ -2619,9 +2609,8 @@ static unsigned
test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -2639,18 +2628,18 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 3 internal nodes */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 36); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
for(; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 3;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -2660,29 +2649,29 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 3703; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 2267; /* Record to left of insertion point in middle internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 3199; /* Record to right of insertion point in middle internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 3137; /* Record just above insertion point in leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert records to fill up middle internal node */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 2); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 36);
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -2692,28 +2681,28 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 3703; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 3104; /* Record to left of insertion point in middle internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 3137; /* Record to right of insertion point in middle internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 3135; /* Record just above insertion point in leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert another record, forcing the middle internal node to redistribute */
record = u + (INSERT_SPLIT_ROOT_NREC * 36);
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -2722,30 +2711,30 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1574; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 3104; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
#ifdef NONE
record = 2862; /* Record to left of insertion point in right internal node (now) */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
#endif /* NONE */
record = 3137; /* Record to right of insertion point in right internal node (now) */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 3135; /* Record just above insertion point in leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -2753,7 +2742,7 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -2768,27 +2757,27 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_level2_3internal_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_level2_3internal_split
+ * Function: test_insert_level2_3internal_split
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to make a level 2 B-tree and then adds enough more
* records to force the left-most and right-most internal nodes to
* split and more records to force a 3->4 node split of the
* internal nodes.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, February 19, 2005
*
*-------------------------------------------------------------------------
@@ -2797,9 +2786,8 @@ static unsigned
test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -2817,24 +2805,24 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 3 internal nodes */
/* (and fill right internal node) */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 31); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
for(; u < (INSERT_SPLIT_ROOT_NREC * 74); u++) {
record = u + ((INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 3);
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check up on B-tree */
@@ -2843,25 +2831,25 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 3703; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 1952; /* Record to left of insertion point in middle internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 2884; /* Record to right of insertion point in middle internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 2822; /* Record just after insertion point in leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Insert records to fill up middle internal node */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 2); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 31);
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -2871,28 +2859,28 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 3703; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 2789; /* Record to left of insertion point in middle internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 2822; /* Record to right of insertion point in middle internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 2823; /* Record just above insertion point in leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert record to split middle internal node */
record = u + (INSERT_SPLIT_ROOT_NREC * 31);
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -2901,33 +2889,33 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 2789; /* Middle record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 3703; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
#ifdef NONE
record = 3049; /* Record to left of insertion point in middle internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
#endif /* NONE */
record = 2822; /* Record to right of insertion point in middle internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 2823; /* Record just above insertion point in leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -2935,7 +2923,7 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -2950,24 +2938,24 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_insert_level2_3internal_split() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_insert_lots
+ * Function: test_insert_lots
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts many
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts many
* records in random order, enough to make at a level 4 B-tree.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, February 19, 2005
*
*-------------------------------------------------------------------------
@@ -2976,10 +2964,9 @@ static unsigned
test_insert_lots(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- char filename[1024]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ char filename[1024]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -3030,7 +3017,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3038,13 +3025,13 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
STACK_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert random records */
for(u = 0; u < INSERT_MANY; u++) {
record = records[u];
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -3055,7 +3042,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -3068,7 +3055,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3076,7 +3063,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
STACK_ERROR
/* Re-open v2 B-tree */
- if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f)))
+ if(NULL == (bt2 = H5B2_open(f, bt2_addr, f)))
FAIL_STACK_ERROR
/* Check up on B-tree after re-open */
@@ -3087,7 +3074,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -3097,7 +3084,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
/* Attempt to find non-existant record in level-4 B-tree */
/* (Should not be found, but not fail) */
idx = INSERT_MANY * 2;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != FALSE)
TEST_ERROR
/* Find random records */
@@ -3106,19 +3093,19 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
idx = (hsize_t)(HDrandom()%INSERT_MANY);
/* Attempt to find existant record in root of level-4 B-tree */
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
FAIL_STACK_ERROR
} /* end for */
/* Attempt to index non-existant record in level-4 B-tree, in increasing & decreasing order */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_MANY*3), find_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY*3), find_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
TEST_ERROR
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, H5_ITER_DEC, (hsize_t)(INSERT_MANY*3), find_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY*3), find_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -3131,12 +3118,12 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
/* Attempt to find existant record in root of level-4 B-tree */
/* (in increasing order) */
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, idx, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, idx, find_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Attempt to find existant record in root of level-4 B-tree */
/* (in decreasing order) */
- if(H5B2_index(bt2, dxpl, H5_ITER_DEC, idx, find_dec_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_DEC, idx, find_dec_cb, &idx) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -3145,12 +3132,12 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
TESTING("B-tree insert: attempt duplicate record in level 4 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
record = INSERT_MANY / 2;
H5E_BEGIN_TRY {
- ret = H5B2_insert(bt2, dxpl, &record);
+ ret = H5B2_insert(bt2, &record);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -3165,7 +3152,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -3182,23 +3169,23 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
HDfree(records);
return 1;
} /* test_insert_lots() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_update_basic
+ * Function: test_update_basic
*
- * Purpose: Basic tests for the v2 B-tree update operation
+ * Purpose: Basic tests for the v2 B-tree update operation
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, December 23, 2015
*
*-------------------------------------------------------------------------
@@ -3207,9 +3194,8 @@ static unsigned
test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
H5B2_test_rec_t record; /* Record to insert into tree */
@@ -3222,7 +3208,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/*
@@ -3231,47 +3217,47 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree update: inserting first record in empty B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
record.key = 42;
record.val = 72;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Attempt to find non-existant record in B-tree with 1 record */
/* (Should not be found, but not fail) */
find.key = 10;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
FAIL_STACK_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
/* Try again with NULL 'op' */
/* (Should not be found, but not fail) */
- if(H5B2_find(bt2, dxpl, &find, NULL, NULL) != FALSE)
+ if(H5B2_find(bt2, &find, NULL, NULL) != FALSE)
FAIL_STACK_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
/* Attempt to find existant record in B-tree with 1 record */
find.key = 42;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != 72)
TEST_ERROR
/* Try again with NULL 'op' */
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, NULL, NULL) != TRUE)
+ if(H5B2_find(bt2, &find, NULL, NULL) != TRUE)
FAIL_STACK_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
/* Attempt to index non-existant record in B-tree with 1 record */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -3279,7 +3265,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in B-tree with 1 record */
find.key = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 42)
TEST_ERROR
@@ -3295,47 +3281,47 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree update: update only record in B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
modify.key = 42;
modify.val = 43;
- if(H5B2_update(bt2, dxpl, &modify, modify_rec_cb, &modify) < 0)
+ if(H5B2_update(bt2, &modify, modify_rec_cb, &modify) < 0)
FAIL_STACK_ERROR
/* Attempt to find non-existant record in B-tree with 1 record */
/* (Should not be found, but not fail) */
find.key = 10;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
FAIL_STACK_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
/* Try again with NULL 'op' */
/* (Should not be found, but not fail) */
- if(H5B2_find(bt2, dxpl, &find, NULL, NULL) != FALSE)
+ if(H5B2_find(bt2, &find, NULL, NULL) != FALSE)
FAIL_STACK_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
/* Attempt to find modified record in B-tree with 1 record */
find.key = 42;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != 43)
TEST_ERROR
/* Try again with NULL 'op' */
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, NULL, NULL) != TRUE)
+ if(H5B2_find(bt2, &find, NULL, NULL) != TRUE)
FAIL_STACK_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
/* Attempt to index non-existant record in B-tree with 1 record */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -3344,7 +3330,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in B-tree with 1 record */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 42)
TEST_ERROR
@@ -3360,7 +3346,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree update: insert several records");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/*
@@ -3368,7 +3354,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
*/
record.key = 34;
record.val = 11;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/*
@@ -3376,7 +3362,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
*/
record.key = 56;
record.val = 12;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/*
@@ -3384,28 +3370,28 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
*/
record.key = 38;
record.val = 13;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Attempt to find non-existant record in level-0 B-tree with several records */
/* (Should not be found, but not fail) */
find.key = 10;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
TEST_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
/* Attempt to find existant record in level-0 B-tree with several records */
find.key = 56;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
TEST_ERROR
if(find.val != 12)
TEST_ERROR
/* Attempt to index non-existant record in B-tree with several records */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -3414,7 +3400,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in B-tree with several records */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
TEST_ERROR
if(find.key != 34)
TEST_ERROR
@@ -3422,7 +3408,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, &find) < 0)
TEST_ERROR
if(find.key != 38)
TEST_ERROR
@@ -3430,7 +3416,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)2, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)2, index_rec_cb, &find) < 0)
TEST_ERROR
if(find.key != 42)
TEST_ERROR
@@ -3438,7 +3424,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)3, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)3, index_rec_cb, &find) < 0)
TEST_ERROR
if(find.key != 56)
TEST_ERROR
@@ -3456,43 +3442,43 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
record.key = 34;
modify.key = 34;
modify.val = 21;
- if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0)
+ if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0)
FAIL_STACK_ERROR
record.key = 38;
modify.key = 38;
modify.val = 23;
- if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0)
+ if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0)
FAIL_STACK_ERROR
record.key = 42;
modify.key = 42;
modify.val = 24;
- if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0)
+ if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0)
FAIL_STACK_ERROR
record.key = 56;
modify.key = 56;
modify.val = 22;
- if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0)
+ if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0)
FAIL_STACK_ERROR
/* Attempt to find non-existant record in level-0 B-tree with several records */
/* (Should not be found, but not fail) */
find.key = 41;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
TEST_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
/* Attempt to find existant record in level-0 B-tree with several record */
find.key = 56;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
TEST_ERROR
if(find.val != 22)
TEST_ERROR
/* Attempt to index non-existant record in B-tree with several records */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -3501,7 +3487,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in B-tree with several records */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
TEST_ERROR
if(find.key != 34)
TEST_ERROR
@@ -3509,7 +3495,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, &find) < 0)
TEST_ERROR
if(find.key != 38)
TEST_ERROR
@@ -3517,7 +3503,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)2, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)2, index_rec_cb, &find) < 0)
TEST_ERROR
if(find.key != 42)
TEST_ERROR
@@ -3525,7 +3511,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)3, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)3, index_rec_cb, &find) < 0)
TEST_ERROR
if(find.key != 56)
TEST_ERROR
@@ -3533,7 +3519,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -3550,25 +3536,25 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_update_basic() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_update_split_root
+ * Function: test_update_split_root
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to split the root node and force the tree to depth 1.
* It also continues to add a few more records to each of the
* left and right leaf nodes after the split
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, December 23, 2015
*
*-------------------------------------------------------------------------
@@ -3577,9 +3563,8 @@ static unsigned
test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
H5B2_test_rec_t record; /* Record to insert into tree */
@@ -3600,14 +3585,14 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert records to fill root leaf node */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC - 1); u++) {
record.key = u + 2;
record.val = u * 2 + 4;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -3617,17 +3602,17 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 33;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert record to split root leaf node */
record.key = INSERT_SPLIT_ROOT_NREC_REC + 1;
record.val = (INSERT_SPLIT_ROOT_NREC_REC - 1) * 2 + 4;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -3636,13 +3621,13 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 33;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 2;
idx.val = 4;
- if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -3650,7 +3635,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Modify all records */
@@ -3658,7 +3643,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
record.key = u + 2;
modify.key = u + 2;
modify.val = u * 2 + 5;
- if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0)
+ if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -3668,13 +3653,13 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 33;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 2;
idx.val = 5;
- if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -3683,17 +3668,17 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert a couple more records, on the left side of the B-tree */
record.key = 0;
record.val = 1;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
record.key = 1;
record.val = 3;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -3702,18 +3687,18 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 33;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 0;
idx.val = 1;
- if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -3724,7 +3709,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* (Should not be found, but not fail) */
find.key = 800;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
TEST_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
@@ -3732,7 +3717,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to find existant record in root of level-1 B-tree */
find.key = 33;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.key != 33)
TEST_ERROR
@@ -3742,7 +3727,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to find existant record in leaf of level-1 B-tree */
find.key = 56;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.key != 56)
TEST_ERROR
@@ -3751,7 +3736,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index non-existant record in level-1 B-tree */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC + 2), index_rec_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC + 2), index_rec_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -3760,7 +3745,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in root of level-1 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)33, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)33, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 33)
TEST_ERROR
@@ -3770,7 +3755,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in left leaf of level-1 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 0)
TEST_ERROR
@@ -3780,7 +3765,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in right leaf of level-1 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)50, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)50, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 50)
TEST_ERROR
@@ -3788,7 +3773,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -3802,26 +3787,26 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_update_split_root() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_update_level1_2leaf_redistrib
+ * Function: test_update_level1_2leaf_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to split the root node and force the tree to depth 1.
* It continues to add a more records to the each of the
* left and right leaf nodes after the split to force a 2 node
* redistribution
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, December 26, 2015
*
*-------------------------------------------------------------------------
@@ -3830,9 +3815,8 @@ static unsigned
test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
H5B2_test_rec_t record; /* Record to insert into tree */
@@ -3849,14 +3833,14 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1;
record.val = u + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 10;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -3866,11 +3850,11 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = INSERT_SPLIT_ROOT_NREC_REC;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
@@ -3878,7 +3862,7 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1; u++) {
record.key = u;
record.val = u + 9;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -3888,11 +3872,11 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) + (INSERT_SPLIT_ROOT_NREC_REC / 4);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -3904,14 +3888,14 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree update: redistribute 2 leaves in level 1 B-tree (r->l)");
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u;
record.val = u + 9;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -3921,18 +3905,18 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force redistribution from left node into right node */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1; u++) {
record.key = u + INSERT_SPLIT_ROOT_NREC_REC;
record.val = u + INSERT_SPLIT_ROOT_NREC_REC + 9;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -3942,11 +3926,11 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) + (INSERT_SPLIT_ROOT_NREC_REC / 4) - 1;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -3961,26 +3945,26 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_update_level1_2leaf_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_update_level1_side_split
+ * Function: test_update_level1_side_split
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to split the root node and force the tree to depth 1.
* It continues to add a more records to the each of the
* left and right leaf nodes after the split to force a 2 node
* split, adding another node to the B-tree
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, December 26, 2015
*
*-------------------------------------------------------------------------
@@ -3989,9 +3973,8 @@ static unsigned
test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
H5B2_test_rec_t record; /* Record to insert into tree */
@@ -4008,14 +3991,14 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u + INSERT_SPLIT_ROOT_NREC_REC;
record.val = u + INSERT_SPLIT_ROOT_NREC_REC + 10;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4025,18 +4008,18 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = INSERT_SPLIT_ROOT_NREC_REC + (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force left node to split */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u;
record.val = u + 10;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4046,14 +4029,14 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 31;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record.key = 64;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -4065,14 +4048,14 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree update: split side leaf into 2 leaves in level 1 B-tree (r->l)");
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u;
record.val = u + 10;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4082,18 +4065,18 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force right node to split */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u + INSERT_SPLIT_ROOT_NREC_REC;
record.val = u + INSERT_SPLIT_ROOT_NREC_REC + 10;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4103,14 +4086,14 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 63;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record.key = 95;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -4125,28 +4108,28 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_update_level1_side_split() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_update_level1_3leaf_redistrib
+ * Function: test_update_level1_3leaf_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to split the root node and force the tree to depth 1.
* It continues to add a more records to the each of the
* left and right leaf nodes after the split to force a 2 node
* split, adding another node to the B-tree, then continues to
* add records until a 3 node redistribution occurs
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, December 26, 2015
*
*-------------------------------------------------------------------------
@@ -4155,9 +4138,8 @@ static unsigned
test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
H5B2_test_rec_t record; /* Record to insert into tree */
@@ -4175,14 +4157,14 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u + (INSERT_SPLIT_ROOT_NREC_REC + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1);
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4192,18 +4174,18 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = (2 * INSERT_SPLIT_ROOT_NREC_REC);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force left node to split */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4213,21 +4195,21 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record.key = INSERT_SPLIT_ROOT_NREC_REC + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert records to force middle node to redistribute */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC_REC / 2) + 1); u++) {
record.key = u + INSERT_SPLIT_ROOT_NREC_REC;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4237,20 +4219,20 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 52;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record.key = 107;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 0;
idx.val = 0;
- if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -4258,7 +4240,7 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -4273,27 +4255,27 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_update_level1_3leaf_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_update_level1_middle_split
+ * Function: test_update_level1_middle_split
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to split the root node and force the tree to depth 1.
* It continues to add a more records to the each of the
* left and right leaf nodes after the split to force a 2 node
* split, adding another node to the B-tree, then continues to
* add records until a 3 node split occurs
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, December 26, 2015
*
*-------------------------------------------------------------------------
@@ -4302,9 +4284,8 @@ static unsigned
test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
H5B2_test_rec_t record; /* Record to insert into tree */
@@ -4322,14 +4303,14 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u + (INSERT_SPLIT_ROOT_NREC_REC * 2);
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4339,18 +4320,18 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = (2 * INSERT_SPLIT_ROOT_NREC_REC) + (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force split from left node into right node */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC * 2); u++) {
record.key = u;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4360,23 +4341,23 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 63;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record.key = 95;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record.key = 128;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 0;
idx.val = 0;
- if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -4384,7 +4365,7 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -4399,23 +4380,23 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_update_level1_middle_split() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_update_make_level2
+ * Function: test_update_make_level2
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts enough
* records to make a level 2 B-tree
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, December 26, 2015
*
*-------------------------------------------------------------------------
@@ -4424,9 +4405,8 @@ static unsigned
test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
H5B2_test_rec_t record; /* Record to insert into tree */
@@ -4446,20 +4426,20 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 internal nodes */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC * 9); u++) {
record.key = u + 2; /* Leave a gap for later insertion */
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
for(; u < (INSERT_SPLIT_ROOT_NREC_REC * 41); u++) {
record.key = u + 4; /* Leave a gap for later insertion */
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4469,42 +4449,42 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 1347;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Add some extra records to left-most leaf */
record.key = 0;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
record.key = 1;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Add some extra records to middle leaf */
record.key = (INSERT_SPLIT_ROOT_NREC_REC * 9) + 2;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
record.key = (INSERT_SPLIT_ROOT_NREC_REC * 9) + 3;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 0;
idx.val = 0;
- if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -4515,7 +4495,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* (Should not be found, but not fail) */
find.key = INSERT_SPLIT_ROOT_NREC_REC * 42;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
TEST_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
@@ -4523,45 +4503,45 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to find existant record in root of level-2 B-tree */
find.key = 1347;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != (1347 * 2))
TEST_ERROR
/* Check with B-tree */
record.key = 1347;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
/* Attempt to find existant record in internal node of level-2 B-tree */
find.key = 513;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != (513 * 2))
TEST_ERROR
/* Check with B-tree */
record.key = 513;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Attempt to find existant record in leaf of level-2 B-tree */
find.key = 555;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != (555 * 2))
TEST_ERROR
/* Check with B-tree */
record.key = 555;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Attempt to index non-existant record in level-2 B-tree */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -4570,7 +4550,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in root of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1347, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1347, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 1347)
TEST_ERROR
@@ -4580,7 +4560,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in internal node of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)513, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)513, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 513)
TEST_ERROR
@@ -4590,7 +4570,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in leaf of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 555)
TEST_ERROR
@@ -4598,7 +4578,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -4611,20 +4591,20 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree update: make level 2 B-tree (r->l)");
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 internal nodes */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC * 9); u++) {
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 1) - u;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
for(; u < (INSERT_SPLIT_ROOT_NREC_REC * 41); u++) {
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 1) - (u +2); /* Leave a gap for later insertion */
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4634,42 +4614,42 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 1344;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Add some extra records to right-most leaf */
record.key = (INSERT_SPLIT_ROOT_NREC_REC * 41) + 2;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
record.key = (INSERT_SPLIT_ROOT_NREC_REC * 41) + 3;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Add some extra records to middle leaf */
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) - (INSERT_SPLIT_ROOT_NREC_REC * 9));
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) - (INSERT_SPLIT_ROOT_NREC_REC * 9)) + 1;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 0;
idx.val = 0;
- if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -4680,7 +4660,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* (Should not be found, but not fail) */
find.key = INSERT_SPLIT_ROOT_NREC_REC * 42;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
TEST_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
@@ -4688,45 +4668,45 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to find existant record in root of level-2 B-tree */
find.key = 1344;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != (1344 * 2))
TEST_ERROR
/* Check with B-tree */
record.key = 1344;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
/* Attempt to find existant record in internal node of level-2 B-tree */
find.key = 512;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != (512 * 2))
TEST_ERROR
/* Check with B-tree */
record.key = 512;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Attempt to find existant record in leaf of level-2 B-tree */
find.key = 555;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != (555 * 2))
TEST_ERROR
/* Check with B-tree */
record.key = 555;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Attempt to index non-existant record in level-2 B-tree */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -4735,7 +4715,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in root of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1344, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1344, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 1344)
TEST_ERROR
@@ -4745,7 +4725,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in internal node of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)512, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)512, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 512)
TEST_ERROR
@@ -4755,7 +4735,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in leaf of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 555)
TEST_ERROR
@@ -4763,7 +4743,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -4776,20 +4756,20 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree update: make level 2 B-tree (l+r->middle)");
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 internal nodes */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC * 9); u++) {
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 3) - u;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
for(; u < (INSERT_SPLIT_ROOT_NREC_REC * 41); u++) {
record.key = u - ((INSERT_SPLIT_ROOT_NREC_REC * 9) - 2); /* Leave a gap for later insertion */
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4799,52 +4779,52 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 1345;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Add some extra records to right-most leaf */
record.key = (INSERT_SPLIT_ROOT_NREC_REC * 41) + 4;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
record.key = (INSERT_SPLIT_ROOT_NREC_REC * 41) + 5;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Add some extra records to middle leaf */
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) - (INSERT_SPLIT_ROOT_NREC_REC * 9)) + 2;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) - (INSERT_SPLIT_ROOT_NREC_REC * 9)) + 3;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Add some extra records to left-most leaf */
record.key = 0;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
record.key = 1;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 0;
idx.val = 0;
- if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -4855,7 +4835,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* (Should not be found, but not fail) */
find.key = INSERT_SPLIT_ROOT_NREC_REC * 42;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
TEST_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
@@ -4863,45 +4843,45 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to find existant record in root of level-2 B-tree */
find.key = 1345;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != (1345 * 2))
TEST_ERROR
/* Check with B-tree */
record.key = 1345;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
/* Attempt to find existant record in internal node of level-2 B-tree */
find.key = 513;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != (513 * 2))
TEST_ERROR
/* Check with B-tree */
record.key = 513;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Attempt to find existant record in leaf of level-2 B-tree */
find.key = 555;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != (555 * 2))
TEST_ERROR
/* Check with B-tree */
record.key = 555;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Attempt to index non-existant record in level-2 B-tree */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -4910,7 +4890,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1345, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1345, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 1345)
TEST_ERROR
@@ -4920,7 +4900,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in internal node of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)513, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)513, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 513)
TEST_ERROR
@@ -4930,7 +4910,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in leaf of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 555)
TEST_ERROR
@@ -4938,7 +4918,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -4953,23 +4933,23 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_update_make_level2() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_update_lots
+ * Function: test_update_lots
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts many
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts many
* records in random order, enough to make at a level 4 B-tree.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Sunday, December 27, 2015
*
*-------------------------------------------------------------------------
@@ -4978,9 +4958,8 @@ static unsigned
test_update_lots(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
time_t curr_time; /* Current time, for seeding random number generator */
@@ -5033,13 +5012,13 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert random records */
for(u = 0; u < INSERT_MANY_REC; u++) {
record = records[u];
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -5050,7 +5029,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -5064,7 +5043,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TEST_ERROR
/* Re-open v2 B-tree */
- if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f)))
+ if(NULL == (bt2 = H5B2_open(f, bt2_addr, f)))
FAIL_STACK_ERROR
/* Check up on B-tree after re-open */
@@ -5076,7 +5055,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Iterate over B-tree to check records have been inserted correctly */
iter.key = 0;
iter.val = 0;
- if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &iter) < 0)
+ if(H5B2_iterate(bt2, iter_rec_cb, &iter) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -5087,7 +5066,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* (Should not be found, but not fail) */
find.key = INSERT_MANY_REC * 2;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
TEST_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
@@ -5099,7 +5078,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
find.val = (hsize_t)-1;
/* Attempt to find existant record in level-4 B-tree */
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != (find.key * 2))
TEST_ERROR
@@ -5107,13 +5086,13 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Attempt to index non-existant record in level-4 B-tree, in increasing & decreasing order */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
TEST_ERROR
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, H5_ITER_DEC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL);
+ ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -5132,7 +5111,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Attempt to find existant record in level-4 B-tree */
/* (in increasing order) */
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, idx, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, idx, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != idx)
TEST_ERROR
@@ -5145,7 +5124,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Attempt to find existant record in level-4 B-tree */
/* (in decreasing order) */
- if(H5B2_index(bt2, dxpl, H5_ITER_DEC, idx, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_DEC, idx, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != (INSERT_MANY_REC - (idx + 1)))
TEST_ERROR
@@ -5158,13 +5137,13 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TESTING("B-tree update: update record in level 4 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
record.key = INSERT_MANY_REC / 2;
modify.key = INSERT_MANY_REC / 2;
modify.val = record.key * 3;
- if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0)
+ if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0)
FAIL_STACK_ERROR
/* Query the number of records in the B-tree */
@@ -5176,7 +5155,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -5194,24 +5173,24 @@ error:
HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
HDfree(records);
return 1;
} /* test_update_lots() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_basic
+ * Function: test_remove_basic
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, February 25, 2005
*
*-------------------------------------------------------------------------
@@ -5220,9 +5199,8 @@ static unsigned
test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -5239,7 +5217,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -5253,7 +5231,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to remove a record from a B-tree with no records */
record = 0;
H5E_BEGIN_TRY {
- ret = H5B2_remove(bt2, dxpl, &record, NULL, NULL);
+ ret = H5B2_remove(bt2, &record, NULL, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -5264,12 +5242,12 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: non-existant record from 1 record B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert one record into B-tree */
record = 42;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Query the number of records in the B-tree */
@@ -5281,7 +5259,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -5291,7 +5269,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to remove a non-existant record from a B-tree with 1 record */
record = 0;
H5E_BEGIN_TRY {
- ret = H5B2_remove(bt2, dxpl, &record, NULL, NULL);
+ ret = H5B2_remove(bt2, &record, NULL, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -5303,12 +5281,12 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: existant record from 1 record B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
record = 42;
rrecord = 0;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5324,7 +5302,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the root node has been freed */
@@ -5337,21 +5315,21 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: adding records to B-tree after removal");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert several records into B-tree again */
record = 42;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
record = 34;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
record = 56;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
record = 38;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Query the number of records in the B-tree */
@@ -5368,12 +5346,12 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: non-existant record from level-0 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
record = 0;
H5E_BEGIN_TRY {
- ret = H5B2_remove(bt2, dxpl, &record, NULL, NULL);
+ ret = H5B2_remove(bt2, &record, NULL, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -5385,12 +5363,12 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: mult. existant records from level-0 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
record = 42;
rrecord = 0;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5406,7 +5384,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the root node has not been freed */
@@ -5415,7 +5393,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
record = 34;
rrecord = 0;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5431,7 +5409,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the root node has not been freed */
@@ -5440,7 +5418,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
record = 56;
rrecord = 0;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5456,7 +5434,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the root node has not been freed */
@@ -5465,7 +5443,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
record = 38;
rrecord = 0;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5481,7 +5459,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the root node has been freed */
@@ -5489,7 +5467,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -5504,22 +5482,22 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_basic() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level1_noredistrib
+ * Function: test_remove_level1_noredistrib
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, February 25, 2005
*
*-------------------------------------------------------------------------
@@ -5528,9 +5506,8 @@ static unsigned
test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -5548,13 +5525,13 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-1 B-tree with 3 leaves */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -5567,7 +5544,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -5577,7 +5554,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to remove a non-existant record from a B-tree with 1 record */
record = (INSERT_SPLIT_ROOT_NREC * 2) + 1;
H5E_BEGIN_TRY {
- ret = H5B2_remove(bt2, dxpl, &record, NULL, NULL);
+ ret = H5B2_remove(bt2, &record, NULL, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -5597,22 +5574,22 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: record from right leaf of level-1 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check up on B-tree */
record = 62; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 94; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = (INSERT_SPLIT_ROOT_NREC * 2) - 2;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
rrecord = 0;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5621,10 +5598,10 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
/* Make certain that the leaf nodes didn't redistribute */
record = 62; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 94; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -5641,16 +5618,16 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: record from left leaf of level-1 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check up on B-tree */
record = 0;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
rrecord = 1;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5659,10 +5636,10 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
/* Make certain that the leaf nodes didn't redistribute */
record = 62; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 94; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -5679,16 +5656,16 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: record from middle leaf of level-1 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check up on B-tree */
record = INSERT_SPLIT_ROOT_NREC;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
rrecord = 0;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5697,10 +5674,10 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
/* Make certain that the leaf nodes didn't redistribute */
record = 62; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 94; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -5712,7 +5689,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -5727,22 +5704,22 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level1_noredistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level1_redistrib
+ * Function: test_remove_level1_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 4, 2005
*
*-------------------------------------------------------------------------
@@ -5751,9 +5728,8 @@ static unsigned
test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -5770,22 +5746,22 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-1 B-tree with 3 leaves */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 94; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -5797,7 +5773,7 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -5805,14 +5781,14 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove enough records from right leaf of a level-1 B-tree to force redistribution */
for(u = 0; u < 8; u++) {
record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5830,10 +5806,10 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam,
/* Check record values in root of B-tree */
record = 62; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 90; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
PASSED();
@@ -5842,13 +5818,13 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: redistribute 2 leaves in level-1 B-tree (l->r)");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
for(u = 0; u < 39; u++) {
record = u;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5866,10 +5842,10 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam,
/* Check record values in root of B-tree */
record = 64; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 90; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
PASSED();
@@ -5878,13 +5854,13 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: redistribute 3 leaves in level-1 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
for(u = 0; u < 2; u++) {
record = INSERT_SPLIT_ROOT_NREC + 2 + u;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5902,14 +5878,14 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam,
/* Check record values in root of B-tree */
record = 64; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 91; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -5924,22 +5900,22 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level1_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level1_2leaf_merge
+ * Function: test_remove_level1_2leaf_merge
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 4, 2005
*
*-------------------------------------------------------------------------
@@ -5948,9 +5924,8 @@ static unsigned
test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -5967,24 +5942,24 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-1 B-tree with 3 leaves */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -5996,7 +5971,7 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -6004,14 +5979,14 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove enough records from right leaf of a level-1 B-tree to force redistribution */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 4); u++) {
record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6031,7 +6006,7 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 1;
record = 62; /* Left record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
PASSED();
@@ -6040,31 +6015,31 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: merge 2 leaves to 1 in level-1 B-tree (l->r)");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Fill B-tree back up */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 4); u++) {
record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1);
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Remove records */
for(u = 0; u < ((3 * INSERT_SPLIT_ROOT_NREC) / 4) - 1; u++) {
record = u;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6084,11 +6059,11 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 1;
record = 94; /* Left record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -6103,22 +6078,22 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level1_2leaf_merge() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level1_3leaf_merge
+ * Function: test_remove_level1_3leaf_merge
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 4, 2005
*
*-------------------------------------------------------------------------
@@ -6127,9 +6102,8 @@ static unsigned
test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -6146,24 +6120,24 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-1 B-tree with 3 leaves */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6175,7 +6149,7 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -6183,14 +6157,14 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove enough records from middle leaf of a level-1 B-tree to force merge */
for(u = 0; u < ((5 * INSERT_SPLIT_ROOT_NREC) / 6) - 1; u++) {
record = ((3 * INSERT_SPLIT_ROOT_NREC) / 2) - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6210,11 +6184,11 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 1;
record = 37; /* Only record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -6229,22 +6203,22 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level1_3leaf_merge() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level1_promote
+ * Function: test_remove_level1_promote
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 4, 2005
*
*-------------------------------------------------------------------------
@@ -6253,9 +6227,8 @@ static unsigned
test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -6272,30 +6245,30 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-1 B-tree with 5 leaves */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 4); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 125; /* Center-Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 188; /* Center-Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 4;
record = 220; /* Right-most record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6307,7 +6280,7 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -6315,13 +6288,13 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove record from root node of a level-1 B-tree to force promotion from right leaf */
record = 220;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6330,18 +6303,18 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 125; /* Center-Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 188; /* Center-Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 4;
record = 221; /* Right-most record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6362,12 +6335,12 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: promote from left leaf of level-1 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
record = 62;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6376,18 +6349,18 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
/* Check record values in root of B-tree */
record = 63; /* Left-most record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 125; /* Center-Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 188; /* Center-Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 4;
record = 221; /* Right-most record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6404,12 +6377,12 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: promote from middle leaf of level-1 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
record = 125;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6418,18 +6391,18 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
/* Check record values in root of B-tree */
record = 63; /* Left-most record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 126; /* Center-Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 188; /* Center-Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 4;
record = 221; /* Right-most record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6441,7 +6414,7 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -6456,22 +6429,22 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level1_promote() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level1_promote_2leaf_redistrib
+ * Function: test_remove_level1_promote_2leaf_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 4, 2005
*
*-------------------------------------------------------------------------
@@ -6480,9 +6453,8 @@ static unsigned
test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -6499,24 +6471,24 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-1 B-tree with 3 leaves */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6528,7 +6500,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -6536,7 +6508,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove record from root node of a level-1 B-tree to force promotion from right leaf */
@@ -6545,7 +6517,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
for(u = 0; u < 7; u++) {
record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6563,7 +6535,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
record = 94;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6572,12 +6544,12 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 2;
record = 90; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6589,7 +6561,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -6604,22 +6576,22 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level1_promote_2leaf_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level1_promote_3leaf_redistrib
+ * Function: test_remove_level1_promote_3leaf_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 4, 2005
*
*-------------------------------------------------------------------------
@@ -6628,9 +6600,8 @@ static unsigned
test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -6647,24 +6618,24 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-1 B-tree with 3 leaves */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6676,7 +6647,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -6684,7 +6655,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove record from root node of a level-1 B-tree to force promotion from middle leaf */
@@ -6693,7 +6664,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
for(u = 0; u < 7; u++) {
record = 63 + u;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6711,7 +6682,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
record = 62;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6720,12 +6691,12 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
/* Check record values in root of B-tree */
record = 39; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 2;
record = 86; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6737,7 +6708,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -6752,22 +6723,22 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level1_promote_3leaf_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level1_promote_2leaf_merge
+ * Function: test_remove_level1_promote_2leaf_merge
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 4, 2005
*
*-------------------------------------------------------------------------
@@ -6776,9 +6747,8 @@ static unsigned
test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -6795,24 +6765,24 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-1 B-tree with 3 leaves */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6824,7 +6794,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -6832,7 +6802,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove record from root node of a level-1 B-tree to force promotion from right leaf */
@@ -6841,7 +6811,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
for(u = 0; u < 14; u++) {
record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6859,7 +6829,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
record = 87;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6870,7 +6840,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 1;
record = 62; /* Middle record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6882,7 +6852,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -6897,22 +6867,22 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level1_promote_2leaf_merge() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level1_promote_3leaf_merge
+ * Function: test_remove_level1_promote_3leaf_merge
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 4, 2005
*
*-------------------------------------------------------------------------
@@ -6921,9 +6891,8 @@ static unsigned
test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -6940,24 +6909,24 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 leaves */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6969,7 +6938,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -6977,7 +6946,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove record from root node of a level-1 B-tree to force promotion from middle leaf */
@@ -6986,7 +6955,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
for(u = 0; u < 50; u++) {
record = ((3 * INSERT_SPLIT_ROOT_NREC) / 2) - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7004,7 +6973,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
record = 25;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7015,7 +6984,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 1;
record = 37; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7027,7 +6996,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -7042,22 +7011,22 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level1_promote_3leaf_merge() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level1_collapse
+ * Function: test_remove_level1_collapse
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 4, 2005
*
*-------------------------------------------------------------------------
@@ -7066,9 +7035,8 @@ static unsigned
test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -7085,13 +7053,13 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-1 B-tree with 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -7099,7 +7067,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 1;
record = 31; /* Middle record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7111,7 +7079,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -7119,14 +7087,14 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove records from B-tree to force a single leaf for the B-tree */
for(u = 0; u < 14; u++) {
record = INSERT_SPLIT_ROOT_NREC - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7146,7 +7114,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 0;
ninfo.nrec = (uint16_t)(INSERT_SPLIT_ROOT_NREC - u);
record = 31; /* Middle record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7158,7 +7126,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -7166,7 +7134,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -7181,22 +7149,22 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level1_collapse() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level2_promote
+ * Function: test_remove_level2_promote
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 4, 2005
*
*-------------------------------------------------------------------------
@@ -7205,9 +7173,8 @@ static unsigned
test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -7224,24 +7191,24 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 internal nodes */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7253,7 +7220,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -7261,20 +7228,20 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check information about record in right internal node */
ninfo.depth = 1;
ninfo.nrec = 14;
record = 2960; /* Record in right internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to remove record from right internal node of a level-2 B-tree to force promotion */
record = 2960;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7285,7 +7252,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 14;
record = 2961; /* Record in right internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7302,19 +7269,19 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: promote from left internal of level-2 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check information about record in left internal node */
ninfo.depth = 1;
ninfo.nrec = 29;
record = 1133; /* Record in left internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
record = 1133;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7325,7 +7292,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 29;
record = 1134; /* Record in left internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7342,19 +7309,19 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: promote from middle internal of level-2 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check information about record in middle internal node */
ninfo.depth = 1;
ninfo.nrec = 14;
record = 2267; /* Record in middle internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
record = 2267;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7365,7 +7332,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 14;
record = 2268; /* Record in middle internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7382,19 +7349,19 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: promote record from root of level-2 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check information about record in root node */
ninfo.depth = 2;
ninfo.nrec = 2;
record = 1889; /* Left record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
record = 1889;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7405,7 +7372,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 2;
ninfo.nrec = 2;
record = 1890; /* Left record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7417,19 +7384,19 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check information about record in root node */
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
record = 2834;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7440,7 +7407,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2835; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7452,7 +7419,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -7467,22 +7434,22 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level2_promote() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level2_promote_2internal_redistrib
+ * Function: test_remove_level2_promote_2internal_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 7, 2005
*
*-------------------------------------------------------------------------
@@ -7491,9 +7458,8 @@ static unsigned
test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -7510,24 +7476,24 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t *
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 internal nodes */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7539,7 +7505,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t *
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -7547,21 +7513,21 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t *
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check status of B-tree */
ninfo.depth = 1;
ninfo.nrec = 14;
record = 3685; /* Right-most record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to remove record from right internal node of a level-2 B-tree to force promotion w/redistribution */
for(u = 0; u < 8; u++) {
record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7579,7 +7545,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t *
record = 3685;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7590,7 +7556,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t *
ninfo.depth = 1;
ninfo.nrec = 14;
record = 3681; /* Right-most record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7602,7 +7568,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t *
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -7617,22 +7583,22 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t *
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level2_promote_2internal_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level2_3promote_internal_redistrib
+ * Function: test_remove_level2_3promote_internal_redistrib
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 7, 2005
*
*-------------------------------------------------------------------------
@@ -7641,9 +7607,8 @@ static unsigned
test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -7660,24 +7625,24 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t *
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 internal nodes */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7689,7 +7654,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t *
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -7697,21 +7662,21 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t *
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check status of B-tree */
ninfo.depth = 1;
ninfo.nrec = 29;
record = 62; /* Left-most record in left node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to remove record from left internal node of a level-2 B-tree to force promotion w/redistribution */
for(u = 0; u < 38; u++) {
record = 63 + u;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7729,7 +7694,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t *
record = 62;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7740,7 +7705,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t *
ninfo.depth = 1;
ninfo.nrec = 29;
record = 49; /* Left-most record in left node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7752,7 +7717,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t *
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -7767,22 +7732,22 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t *
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level2_promote_3internal_redistrib() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level2_promote_2internal_merge
+ * Function: test_remove_level2_promote_2internal_merge
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 7, 2005
*
*-------------------------------------------------------------------------
@@ -7791,9 +7756,8 @@ static unsigned
test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -7810,24 +7774,24 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 internal nodes */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7839,7 +7803,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -7847,21 +7811,21 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check information about record in right internal node */
ninfo.depth = 1;
ninfo.nrec = 14;
record = 3685; /* Right-most record in right internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to remove record from right internal node of a level-2 B-tree to force promotion w/redistribution */
for(u = 0; u < 15; u++) {
record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7880,7 +7844,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar
/* Force merge by promoting current right-most record */
record = 3678;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7891,7 +7855,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar
ninfo.depth = 1;
ninfo.nrec = 13;
record = 3653; /* Right-most record in right internal node (now) */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7903,7 +7867,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -7918,22 +7882,22 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level2_promote_2internal_merge() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level2_3promote_internal_merge
+ * Function: test_remove_level2_3promote_internal_merge
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 7, 2005
*
*-------------------------------------------------------------------------
@@ -7942,9 +7906,8 @@ static unsigned
test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -7961,24 +7924,24 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 internal nodes */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7990,7 +7953,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -7998,21 +7961,21 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check information about record in left internal node */
ninfo.depth = 1;
ninfo.nrec = 29;
record = 62; /* Left-most record in left internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to remove record from left internal node of a level-2 B-tree to force promotion w/redistribution */
for(u = 0; u < 112; u++) {
record = 48 + u;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -8031,7 +7994,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar
/* Force merge of left-most internal nodes by promotion */
record = 25;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -8042,7 +8005,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar
ninfo.depth = 1;
ninfo.nrec = 28;
record = 37; /* Left-most record in left internal node (now) */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -8054,7 +8017,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -8069,22 +8032,22 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level2_promote_3internal_merge() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level2_2internal_merge_left
+ * Function: test_remove_level2_2internal_merge_left
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 8, 2005
*
*-------------------------------------------------------------------------
@@ -8093,9 +8056,8 @@ static unsigned
test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -8112,24 +8074,24 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 internal nodes */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -8141,7 +8103,7 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -8149,14 +8111,14 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove records from a level-2 B-tree to force 2 internal nodes to merge */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 21) + 15); u++) {
record = u;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -8176,11 +8138,11 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 2;
ninfo.nrec = 1;
record = 2834; /* Middle record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -8195,22 +8157,22 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level2_2internal_merge_left() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level2_2internal_merge_right
+ * Function: test_remove_level2_2internal_merge_right
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 8, 2005
*
*-------------------------------------------------------------------------
@@ -8219,9 +8181,8 @@ static unsigned
test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -8238,24 +8199,24 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 internal nodes */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -8267,7 +8228,7 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -8275,14 +8236,14 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove records from a level-2 B-tree to force 2 internal nodes to merge */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 5) + 17); u++) {
record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -8302,11 +8263,11 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam
ninfo.depth = 2;
ninfo.nrec = 1;
record = 1889; /* Middle record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -8321,22 +8282,22 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level2_2internal_merge_right() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level2_3internal_merge
+ * Function: test_remove_level2_3internal_merge
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 8, 2005
*
*-------------------------------------------------------------------------
@@ -8345,9 +8306,8 @@ static unsigned
test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -8364,24 +8324,24 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 internal nodes */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -8393,7 +8353,7 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -8401,14 +8361,14 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove record from middle internal node of a level-2 B-tree to force promotion w/redistribution */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 23) + 15); u++) {
record = (INSERT_SPLIT_ROOT_NREC * 20) + u;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -8428,11 +8388,11 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 2;
ninfo.nrec = 1;
record = 1196; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -8447,22 +8407,22 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level2_3internal_merge() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_level2_collapse_right
+ * Function: test_remove_level2_collapse_right
*
- * Purpose: Basic tests for the B-tree v2 code
+ * Purpose: Basic tests for the B-tree v2 code
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 8, 2005
*
*-------------------------------------------------------------------------
@@ -8471,9 +8431,8 @@ static unsigned
test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -8491,24 +8450,24 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 internal nodes */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -8520,7 +8479,7 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -8528,14 +8487,14 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove records from a level-2 B-tree to force back to level-1 */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 34) + 17; u++) {
record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -8558,7 +8517,7 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -8573,22 +8532,22 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_remove_level2_collapse_right() */
-
+
/*-------------------------------------------------------------------------
- * Function: gen_l4_btree2
+ * Function: gen_l4_btree2
*
- * Purpose: Generate a level-4 v2 B-tree for testing.
+ * Purpose: Generate a level-4 v2 B-tree for testing.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, October 14, 2008
*
*-------------------------------------------------------------------------
@@ -8597,9 +8556,8 @@ static unsigned
gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam,
haddr_t *bt2_addr, const hsize_t *records)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
hsize_t record; /* Record to insert into tree */
unsigned u; /* Local index variable */
@@ -8610,7 +8568,7 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam,
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -8618,13 +8576,13 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam,
STACK_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, bt2_addr) < 0)
TEST_ERROR
/* Insert random records */
for(u = 0; u < INSERT_MANY; u++) {
record = records[u];
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -8635,7 +8593,7 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -8648,25 +8606,25 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* gen_l4_btree2() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_remove_lots
+ * Function: test_remove_lots
*
- * Purpose: Basic tests for the B-tree v2 code. This test inserts many
+ * Purpose: Basic tests for the B-tree v2 code. This test inserts many
* records in random order, enough to make at a level 4 B-tree
* and then removes them all, by record and by index.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 8, 2005
*
*-------------------------------------------------------------------------
@@ -8674,13 +8632,12 @@ error:
static unsigned
test_remove_lots(const char *env_h5_drvr, hid_t fapl, const H5B2_create_t *cparam)
{
- hid_t file = -1; /* File ID */
- char filename[1024]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ char filename[1024]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
int fd = -1; /* File descriptor */
- h5_stat_t sb; /* Stat buffer for file */
+ h5_stat_t sb; /* Stat buffer for file */
void *file_data = NULL; /* Copy of file data */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -8765,7 +8722,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -8784,14 +8741,14 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
} /* end for */
/* Re-open v2 B-tree */
- if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f)))
+ if(NULL == (bt2 = H5B2_open(f, bt2_addr, f)))
FAIL_STACK_ERROR
/* Remove all records */
for(u = 0; u < INSERT_MANY; u++) {
record = records[u];
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -8808,7 +8765,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
} /* end for */
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -8816,7 +8773,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -8860,7 +8817,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -8868,7 +8825,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
STACK_ERROR
/* Re-open v2 B-tree */
- if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f)))
+ if(NULL == (bt2 = H5B2_open(f, bt2_addr, f)))
FAIL_STACK_ERROR
/* Remove all records */
@@ -8878,7 +8835,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
rrecord = HSIZET_MAX;
/* Remove random record */
- if(H5B2_remove_by_idx(bt2, dxpl, H5_ITER_INC, (hsize_t)rem_idx, remove_cb, &rrecord) < 0)
+ if(H5B2_remove_by_idx(bt2, H5_ITER_INC, (hsize_t)rem_idx, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -8895,7 +8852,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
} /* end for */
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -8903,7 +8860,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -8948,7 +8905,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -8956,14 +8913,14 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
STACK_ERROR
/* Re-open v2 B-tree */
- if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f)))
+ if(NULL == (bt2 = H5B2_open(f, bt2_addr, f)))
FAIL_STACK_ERROR
/* Remove all records */
for(u = 0; u < INSERT_MANY; u++) {
/* Remove first record */
rrecord = HSIZET_MAX;
- if(H5B2_remove_by_idx(bt2, dxpl, H5_ITER_INC, (hsize_t)0, remove_cb, &rrecord) < 0)
+ if(H5B2_remove_by_idx(bt2, H5_ITER_INC, (hsize_t)0, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -8980,7 +8937,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
} /* end for */
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -8988,7 +8945,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -9033,7 +8990,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -9041,14 +8998,14 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
STACK_ERROR
/* Re-open v2 B-tree */
- if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f)))
+ if(NULL == (bt2 = H5B2_open(f, bt2_addr, f)))
FAIL_STACK_ERROR
/* Remove all records */
for(u = 0; u < INSERT_MANY; u++) {
/* Remove last record */
rrecord = HSIZET_MAX;
- if(H5B2_remove_by_idx(bt2, dxpl, H5_ITER_DEC, (hsize_t)0, remove_cb, &rrecord) < 0)
+ if(H5B2_remove_by_idx(bt2, H5_ITER_DEC, (hsize_t)0, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -9065,7 +9022,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
} /* end for */
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -9073,7 +9030,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -9093,8 +9050,8 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
if(fd > 0)
@@ -9107,17 +9064,17 @@ error:
return 1;
} /* test_remove_lots() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_find_neighbor
+ * Function: test_find_neighbor
*
- * Purpose: Basic tests for the B-tree v2 code. This test exercises
+ * Purpose: Basic tests for the B-tree v2 code. This test exercises
* code to find nearest neighbors to a given value in a B-tree.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 8, 2005
*
*-------------------------------------------------------------------------
@@ -9126,9 +9083,8 @@ static unsigned
test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -9156,45 +9112,45 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert records */
for(u = 0; u < FIND_NEIGHBOR; u++) {
record = records[u];
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Attempt to find record B-tree less than a value */
search = 0;
H5E_BEGIN_TRY {
- ret = H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record);
+ ret = H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
TEST_ERROR
search = 1;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 0)
TEST_ERROR
search = 2;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 0)
TEST_ERROR
search = 3;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 2)
TEST_ERROR
search = 4;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 2)
TEST_ERROR
@@ -9203,12 +9159,12 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 14;
record = 250; /* Record in left internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Neighbor is in internal node */
search = 251;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 250)
TEST_ERROR
@@ -9217,18 +9173,18 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 2;
ninfo.nrec = 1;
record = 1888; /* Record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Neighbor is in root node */
search = 1889;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 1888)
TEST_ERROR
search = (FIND_NEIGHBOR * 2) + 1;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != ((FIND_NEIGHBOR - 1) * 2))
TEST_ERROR
@@ -9241,38 +9197,38 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree find: nearest neighbor greater than a value");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to find record B-tree less than a value */
search = (FIND_NEIGHBOR * 2) + 1;
H5E_BEGIN_TRY {
- ret = H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record);
+ ret = H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
TEST_ERROR
search = 0;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 2)
TEST_ERROR
search = 1;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 2)
TEST_ERROR
search = 2;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 4)
TEST_ERROR
search = 3;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 4)
TEST_ERROR
@@ -9281,31 +9237,31 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 16;
record = 2896; /* Record in right internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Neighbor is in internal node */
search = 2895;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 2896)
TEST_ERROR
/* Neighbor is in root node */
search = 1887;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 1888)
TEST_ERROR
search = ((FIND_NEIGHBOR - 1) * 2) - 1;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != ((FIND_NEIGHBOR - 1) * 2))
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -9322,24 +9278,24 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
HDfree(records);
return 1;
} /* test_find_neighbor() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_delete
+ * Function: test_delete
*
- * Purpose: Basic tests for the B-tree v2 code. This test exercises
+ * Purpose: Basic tests for the B-tree v2 code. This test exercises
* code to delete a B-tree from a file
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, March 9, 2005
*
*-------------------------------------------------------------------------
@@ -9347,12 +9303,11 @@ error:
static unsigned
test_delete(hid_t fapl, const H5B2_create_t *cparam)
{
- hid_t file = -1; /* File ID */
- char filename[1024]; /* Filename to use */
- H5F_t *f = NULL; /* Internal file object pointer */
+ hid_t file = -1; /* File ID */
+ char filename[1024]; /* Filename to use */
+ H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t empty_size; /* Size of an empty file */
h5_stat_size_t file_size; /* Size of each file created */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -9383,7 +9338,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -9391,18 +9346,18 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
STACK_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
/*
* Delete v2 B-tree
*/
- if(H5B2_delete(f, dxpl, bt2_addr, f, NULL, NULL) < 0)
+ if(H5B2_delete(f, bt2_addr, f, NULL, NULL) < 0)
FAIL_STACK_ERROR
/* Close the file */
@@ -9427,7 +9382,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -9435,13 +9390,13 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
STACK_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert records */
for(u = 0; u < DELETE_SMALL; u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -9452,14 +9407,14 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
/*
* Delete v2 B-tree
*/
- if(H5B2_delete(f, H5AC_ind_read_dxpl_id, bt2_addr, f, NULL, NULL) < 0)
+ if(H5B2_delete(f, bt2_addr, f, NULL, NULL) < 0)
FAIL_STACK_ERROR
/* Close file */
@@ -9484,7 +9439,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -9492,13 +9447,13 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
STACK_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert records */
for(u = 0; u < DELETE_MEDIUM; u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -9509,14 +9464,14 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
/*
* Delete v2 B-tree
*/
- if(H5B2_delete(f, dxpl, bt2_addr, f, NULL, NULL) < 0)
+ if(H5B2_delete(f, bt2_addr, f, NULL, NULL) < 0)
FAIL_STACK_ERROR
/* Close file */
@@ -9541,7 +9496,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -9549,13 +9504,13 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
STACK_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert records */
for(u = 0; u < DELETE_LARGE; u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -9566,14 +9521,14 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
/*
* Delete v2 B-tree
*/
- if(H5B2_delete(f, dxpl, bt2_addr, f, NULL, NULL) < 0)
+ if(H5B2_delete(f, bt2_addr, f, NULL, NULL) < 0)
FAIL_STACK_ERROR
/* Close file */
@@ -9595,23 +9550,23 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_delete() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_modify
+ * Function: test_modify
*
- * Purpose: Basic tests for the B-tree v2 code. This test exercises
+ * Purpose: Basic tests for the B-tree v2 code. This test exercises
* code to modify an existing record in the B-tree
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 10, 2005
*
*-------------------------------------------------------------------------
@@ -9620,9 +9575,8 @@ static unsigned
test_modify(hid_t fapl, const H5B2_create_t *cparam,
const bt2_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
hsize_t record; /* Record to insert into tree */
@@ -9643,13 +9597,13 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 internal nodes */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u * 5;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -9663,7 +9617,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
record = 3;
modify = 4;
H5E_BEGIN_TRY {
- ret = H5B2_modify(bt2, dxpl, &record, modify_cb, &modify);
+ ret = H5B2_modify(bt2, &record, modify_cb, &modify);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -9674,33 +9628,33 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree modify: modify record in leaf node");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check status of B-tree */
ninfo.depth = 0;
ninfo.nrec = 62;
record = 4330; /* Record in leaf node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to modify a record in a leaf node */
record = 4330;
modify = 4331;
- if(H5B2_modify(bt2, dxpl, &record, modify_cb, &modify) < 0)
+ if(H5B2_modify(bt2, &record, modify_cb, &modify) < 0)
FAIL_STACK_ERROR
/* Check status of B-tree */
ninfo.depth = 0;
ninfo.nrec = 62;
record = 4331; /* Record in leaf node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to find modified record */
record = 4331;
found = 4331;
- if(H5B2_find(bt2, dxpl, &record, find_cb, &found) != TRUE)
+ if(H5B2_find(bt2, &record, find_cb, &found) != TRUE)
FAIL_STACK_ERROR
if(found != 4331)
TEST_ERROR
@@ -9709,7 +9663,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
record = 4330;
found = HSIZET_MAX;
H5E_BEGIN_TRY {
- ret = H5B2_modify(bt2, dxpl, &record, modify_cb, &modify);
+ ret = H5B2_modify(bt2, &record, modify_cb, &modify);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -9720,33 +9674,33 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree modify: modify record in internal node");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check status of B-tree */
ninfo.depth = 1;
ninfo.nrec = 29;
record = 5350; /* Record in internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to modify a record in an internal node */
record = 5350;
modify = 5352;
- if(H5B2_modify(bt2, dxpl, &record, modify_cb, &modify) < 0)
+ if(H5B2_modify(bt2, &record, modify_cb, &modify) < 0)
FAIL_STACK_ERROR
/* Check status of B-tree */
ninfo.depth = 1;
ninfo.nrec = 29;
record = 5352; /* Record in internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to find modified record */
record = 5352;
found = 5352;
- if(H5B2_find(bt2, dxpl, &record, find_cb, &found) != TRUE)
+ if(H5B2_find(bt2, &record, find_cb, &found) != TRUE)
STACK_ERROR
if(found != 5352)
TEST_ERROR
@@ -9755,7 +9709,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
record = 5350;
found = 5350;
H5E_BEGIN_TRY {
- ret = H5B2_modify(bt2, dxpl, &record, modify_cb, &modify);
+ ret = H5B2_modify(bt2, &record, modify_cb, &modify);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -9766,33 +9720,33 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree modify: modify record in root node");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check status of B-tree */
ninfo.depth = 2;
ninfo.nrec = 2;
record = 9445; /* Record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to modify a record in a root node */
record = 9445;
modify = 9448;
- if(H5B2_modify(bt2, dxpl, &record, modify_cb, &modify) < 0)
+ if(H5B2_modify(bt2, &record, modify_cb, &modify) < 0)
FAIL_STACK_ERROR
/* Check status of B-tree */
ninfo.depth = 2;
ninfo.nrec = 2;
record = 9448; /* Record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to find modified record */
record = 9448;
found = 9448;
- if(H5B2_find(bt2, dxpl, &record, find_cb, &found) != TRUE)
+ if(H5B2_find(bt2, &record, find_cb, &found) != TRUE)
STACK_ERROR
if(found != 9448)
TEST_ERROR
@@ -9801,14 +9755,14 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
record = 9445;
found = 9445;
H5E_BEGIN_TRY {
- ret = H5B2_modify(bt2, dxpl, &record, modify_cb, &modify);
+ ret = H5B2_modify(bt2, &record, modify_cb, &modify);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -9823,24 +9777,24 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
} /* test_modify() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_open_twice_diff
+ * Function: test_open_twice_diff
*
- * Purpose: Open a v2 B-tree twice, through different "top" file
+ * Purpose: Open a v2 B-tree twice, through different "top" file
* handles, with an intermediate file open that takes the "shared"
* file handle from the first B-tree's file pointer.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, December 18, 2015
*
*-------------------------------------------------------------------------
@@ -9848,15 +9802,14 @@ error:
static unsigned
test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam)
{
- char filename[1024]; /* Filename to use */
+ char filename[1024]; /* Filename to use */
char filename_tmp[1024]; /* Temporary file name */
- hid_t file = -1; /* File ID */
- hid_t file2 = -1; /* File ID */
- hid_t file0 = -1; /* File ID */
- hid_t file00 = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- H5F_t *f2 = NULL; /* Internal file object pointer */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ hid_t file = -1; /* File ID */
+ hid_t file2 = -1; /* File ID */
+ hid_t file0 = -1; /* File ID */
+ hid_t file00 = -1; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
+ H5F_t *f2 = NULL; /* Internal file object pointer */
H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */
H5B2_t *bt2_2 = NULL; /* Second v2 B-tree wrapper */
haddr_t bt2_addr; /* Address of B-tree created */
@@ -9873,7 +9826,7 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -9881,15 +9834,15 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam)
FAIL_STACK_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Re-open v2 B-tree */
- if(NULL == (bt2_2 = H5B2_open(f, dxpl, bt2_addr, f)))
+ if(NULL == (bt2_2 = H5B2_open(f, bt2_addr, f)))
FAIL_STACK_ERROR
/* Close the second v2 B-tree wrapper */
- if(H5B2_close(bt2_2, dxpl) < 0)
+ if(H5B2_close(bt2_2) < 0)
FAIL_STACK_ERROR
bt2_2 = NULL;
@@ -9901,7 +9854,7 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam)
FAIL_STACK_ERROR
/* Close the first v2 B-tree wrapper */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -9927,11 +9880,11 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f2 = (H5F_t *)H5I_object(file2)))
+ if(NULL == (f2 = (H5F_t *)H5VL_object(file2)))
FAIL_STACK_ERROR
/* Open the B-tree through the second file handle */
- if(NULL == (bt2_2 = H5B2_open(f2, dxpl, bt2_addr, f2)))
+ if(NULL == (bt2_2 = H5B2_open(f2, bt2_addr, f2)))
FAIL_STACK_ERROR
/* Close the extra file handles */
@@ -9941,7 +9894,7 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam)
FAIL_STACK_ERROR
/* Close the second v2 B-tree */
- if(H5B2_close(bt2_2, dxpl) < 0)
+ if(H5B2_close(bt2_2) < 0)
FAIL_STACK_ERROR
bt2_2 = NULL;
@@ -9958,28 +9911,28 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam)
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
+ H5B2_close(bt2);
if(bt2)
- H5B2_close(bt2_2, dxpl);
- H5Fclose(file);
- H5Fclose(file2);
- H5Fclose(file0);
- H5Fclose(file00);
+ H5B2_close(bt2_2);
+ H5Fclose(file);
+ H5Fclose(file2);
+ H5Fclose(file0);
+ H5Fclose(file00);
} H5E_END_TRY;
return(1);
} /* test_open_twice_diff() */
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Test the B-tree v2 code
+ * Purpose: Test the B-tree v2 code
*
- * Return: Success:
+ * Return: Success:
*
- * Failure:
+ * Failure:
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, February 1, 2005
*
*-------------------------------------------------------------------------
@@ -9989,11 +9942,12 @@ main(void)
{
H5B2_create_t cparam, cparam2; /* Creation parameters for v2 B-tree */
bt2_test_param_t tparam; /* Test parameters for v2 B-tree */
- hid_t fapl = -1; /* File access property list for data files */
- unsigned nerrors = 0; /* Cumulative error count */
+ hid_t fapl = -1; /* File access property list for data files */
+ unsigned nerrors = 0; /* Cumulative error count */
unsigned reopen; /* Whether to reopen B-tree during tests */
- int ExpressMode;
+ int ExpressMode;
const char *envval = NULL;
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
envval = HDgetenv("HDF5_DRIVER");
if(envval == NULL)
@@ -10004,19 +9958,23 @@ main(void)
fapl = h5_fileaccess();
ExpressMode = GetTestExpress();
if(ExpressMode > 1)
- printf("***Express test mode on. Some tests may be skipped\n");
+ HDprintf("***Express test mode on. Some tests may be skipped\n");
/* Initialize v2 B-tree creation parameters */
init_cparam(&cparam, &cparam2);
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
+
/* Loop over re-opening B-tree during tests */
for(reopen = FALSE; reopen <= TRUE; reopen++) {
if(reopen) {
- fprintf(stdout, "Testing with reopening B-tree:\n");
+ HDfprintf(stdout, "Testing with reopening B-tree:\n");
tparam.reopen_btree = TRUE;
} /* end if */
else {
- fprintf(stdout, "Testing without reopening B-tree:\n");
+ HDfprintf(stdout, "Testing without reopening B-tree:\n");
tparam.reopen_btree = FALSE;
} /* end else */
@@ -10036,7 +9994,7 @@ main(void)
nerrors += test_insert_level2_3internal_redistrib(fapl, &cparam, &tparam);
nerrors += test_insert_level2_3internal_split(fapl, &cparam, &tparam);
if(ExpressMode > 1)
- printf("***Express test mode on. test_insert_lots skipped\n");
+ HDprintf("***Express test mode on. test_insert_lots skipped\n");
else
nerrors += test_insert_lots(fapl, &cparam, &tparam);
@@ -10050,7 +10008,7 @@ main(void)
nerrors += test_update_level1_middle_split(fapl, &cparam2, &tparam);
nerrors += test_update_make_level2(fapl, &cparam2, &tparam);
if(ExpressMode > 1)
- printf("***Express test mode on. test_update_lots skipped\n");
+ HDprintf("***Express test mode on. test_update_lots skipped\n");
else
nerrors += test_update_lots(fapl, &cparam2, &tparam);
@@ -10077,7 +10035,7 @@ main(void)
nerrors += test_remove_level2_3internal_merge(fapl, &cparam, &tparam);
nerrors += test_remove_level2_collapse_right(fapl, &cparam, &tparam);
if(ExpressMode > 1)
- printf("***Express test mode on. test_remove_lots skipped\n");
+ HDprintf("***Express test mode on. test_remove_lots skipped\n");
else
nerrors += test_remove_lots(envval, fapl, &cparam);
@@ -10097,6 +10055,10 @@ main(void)
/* Verify symbol table messages are cached */
nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
+
if(nerrors)
goto error;
@@ -10113,6 +10075,8 @@ error:
H5Pclose(fapl);
} H5E_END_TRY;
+ if(api_ctx_pushed) H5CX_pop();
+
return 1;
} /* end main() */