From 3e8948df52ce165edd3238a7e2ae3b047eac7836 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sun, 26 Feb 2006 22:30:22 -0500 Subject: [svn-r11966] Purpose: Code cleanup Description: Style fixes for consistency & other minor cleanups Platforms tested: FreeBSD 4.11 (sleipnir) Mac OSX (amazon) Linux 2.4 --- src/H5B2.c | 335 ++++---------------- src/H5B2cache.c | 152 +++++---- src/H5B2dbg.c | 95 +++--- src/H5B2pkg.h | 31 +- src/H5B2public.h | 3 +- src/H5B2test.c | 68 +++-- src/H5Spkg.h | 3 +- src/H5Stest.c | 51 ++-- src/H5Tconv.c | 16 +- test/btree2.c | 916 +++++++++++++++++++++++++------------------------------ test/tselect.c | 26 +- 11 files changed, 726 insertions(+), 970 deletions(-) diff --git a/src/H5B2.c b/src/H5B2.c index 7b81dbf..f1fd069 100644 --- a/src/H5B2.c +++ b/src/H5B2.c @@ -68,6 +68,7 @@ /********************/ /* Helper functions */ +static herr_t H5B2_shared_free(void *_shared); static herr_t H5B2_create_leaf(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, H5B2_node_ptr_t *node_ptr); static herr_t H5B2_create_internal(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, @@ -176,13 +177,13 @@ H5B2_shared_init (H5F_t *f, H5B2_t *bt2, const H5B2_class_t *type, { H5B2_shared_t *shared = NULL; /* Shared B-tree information */ unsigned u; /* Local index variable */ - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5B2_shared_init) /* Allocate space for the shared information */ - if(NULL==(shared = H5FL_CALLOC(H5B2_shared_t))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for B-tree shared information") + if(NULL == (shared = H5FL_CALLOC(H5B2_shared_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for B-tree shared information") /* Assign user's information */ shared->split_percent = split_percent; @@ -191,50 +192,50 @@ H5B2_shared_init (H5F_t *f, H5B2_t *bt2, const H5B2_class_t *type, shared->rrec_size = rrec_size; /* Compute derived information */ - shared->internal_nrec = H5B2_NUM_INT_REC(f,shared->node_size,shared->rrec_size); - shared->split_int_nrec = (shared->internal_nrec * shared->split_percent)/100; - shared->merge_int_nrec = (shared->internal_nrec * shared->merge_percent)/100; + shared->internal_nrec = H5B2_NUM_INT_REC(f, shared->node_size, shared->rrec_size); + shared->split_int_nrec = (shared->internal_nrec * shared->split_percent) / 100; + shared->merge_int_nrec = (shared->internal_nrec * shared->merge_percent) / 100; - shared->leaf_nrec = H5B2_NUM_LEAF_REC(shared->node_size,shared->rrec_size); - shared->split_leaf_nrec = (shared->leaf_nrec * shared->split_percent)/100; - shared->merge_leaf_nrec = (shared->leaf_nrec * shared->merge_percent)/100; + shared->leaf_nrec = H5B2_NUM_LEAF_REC(shared->node_size, shared->rrec_size); + shared->split_leaf_nrec = (shared->leaf_nrec * shared->split_percent) / 100; + shared->merge_leaf_nrec = (shared->leaf_nrec * shared->merge_percent) / 100; /* Assign common type information */ shared->type = type; /* Allocate "page" for node I/O */ - if((shared->page=H5FL_BLK_MALLOC(node_page,shared->node_size))==NULL) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); + if((shared->page = H5FL_BLK_MALLOC(node_page, shared->node_size)) == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") #ifdef H5_USING_PURIFY HDmemset(shared->page,0,shared->node_size); #endif /* H5_USING_PURIFY */ /* Create factory for internal node native record storage */ - if((shared->int_fac=H5FL_fac_init(type->nrec_size*shared->internal_nrec))==NULL) - HGOTO_ERROR (H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create internal node native key block factory") + if((shared->int_fac = H5FL_fac_init(type->nrec_size * shared->internal_nrec)) == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create internal node native key block factory") /* Create factory for leaf node native record storage */ - if((shared->leaf_fac=H5FL_fac_init(type->nrec_size*shared->leaf_nrec))==NULL) - HGOTO_ERROR (H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create leaf node native key block factory") + if((shared->leaf_fac = H5FL_fac_init(type->nrec_size * shared->leaf_nrec)) == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create leaf node native key block factory") /* Create factory for internal node node pointer storage */ - if((shared->node_ptr_fac=H5FL_fac_init(sizeof(H5B2_node_ptr_t)*(shared->internal_nrec+1)))==NULL) - HGOTO_ERROR (H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create internal node node pointer block factory") + if((shared->node_ptr_fac = H5FL_fac_init(sizeof(H5B2_node_ptr_t) * (shared->internal_nrec + 1))) == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create internal node node pointer block factory") /* Allocate array of pointers to internal node native keys */ - if((shared->nat_off=H5FL_SEQ_MALLOC(size_t,MAX(shared->internal_nrec,shared->leaf_nrec)))==NULL) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); + if((shared->nat_off = H5FL_SEQ_MALLOC(size_t, MAX(shared->internal_nrec, shared->leaf_nrec))) == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Initialize offsets in native key block */ - for(u=0; uinternal_nrec,shared->leaf_nrec); u++) + for(u = 0; u < MAX(shared->internal_nrec, shared->leaf_nrec); u++) shared->nat_off[u]=type->nrec_size*u; /* Make shared B-tree info reference counted */ - if(NULL==(bt2->shared=H5RC_create(shared,H5B2_shared_free))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't create ref-count wrapper for shared B-tree info") + if(NULL == (bt2->shared = H5RC_create(shared, H5B2_shared_free))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't create ref-count wrapper for shared B-tree info") done: - if(ret_value<0) + if(ret_value < 0) if(shared) H5B2_shared_free(shared); @@ -255,11 +256,11 @@ done: * *------------------------------------------------------------------------- */ -herr_t -H5B2_shared_free (void *_shared) +static herr_t +H5B2_shared_free(void *_shared) { H5B2_shared_t *shared = (H5B2_shared_t *)_shared; - herr_t ret_value=SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT(H5B2_shared_free) @@ -268,29 +269,29 @@ H5B2_shared_free (void *_shared) /* Free the B-tree node buffer */ if(shared->page) - H5FL_BLK_FREE(node_page,shared->page); + H5FL_BLK_FREE(node_page, shared->page); /* Destroy factory for internal node native record storage */ if(shared->int_fac) - if(H5FL_fac_term(shared->int_fac)<0) - HGOTO_ERROR (H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't destroy internal node native key block factory") + if(H5FL_fac_term(shared->int_fac) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't destroy internal node native key block factory") /* Destroy factory for leaf node native record storage */ if(shared->leaf_fac) - if(H5FL_fac_term(shared->leaf_fac)<0) - HGOTO_ERROR (H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't destroy leaf node native key block factory") + if(H5FL_fac_term(shared->leaf_fac) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't destroy leaf node native key block factory") /* Destroy factory for internal node node pointer storage */ if(shared->node_ptr_fac) - if(H5FL_fac_term(shared->node_ptr_fac)<0) - HGOTO_ERROR (H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't destroy internal node node pointer block factory") + if(H5FL_fac_term(shared->node_ptr_fac) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't destroy internal node node pointer block factory") /* Free the array of offsets into the native key block */ if(shared->nat_off) H5FL_SEQ_FREE(size_t,shared->nat_off); /* Free the shared B-tree info itself */ - H5FL_FREE(H5B2_shared_t,shared); + H5FL_FREE(H5B2_shared_t, shared); done: FUNC_LEAVE_NOAPI(ret_value) @@ -309,16 +310,6 @@ done: * koziol@ncsa.uiuc.edu * Jan 31 2005 * - * - * Modifications: - * - * John Mainzer 6/10/05 - * Removed code setting the is_dirty field of the cache info. - * This is no longer pemitted, as the cache code is now - * manageing this field. Since this function uses a call to - * H5AC_set() (which marks the entry dirty automaticly), no - * other change is required. - * *------------------------------------------------------------------------- */ herr_t @@ -327,7 +318,7 @@ H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, unsigned split_percent, unsigned merge_percent, haddr_t *addr_p) { H5B2_t *bt2 = NULL; /* The new B-tree header information */ - herr_t ret_value=SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(H5B2_create, FAIL) @@ -336,41 +327,42 @@ H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, */ HDassert(f); HDassert(type); - HDassert(node_size>0); - HDassert(rrec_size>0); - HDassert(merge_percent>0 && merge_percent<=100); - HDassert(split_percent>0 && split_percent<=100); - HDassert(merge_percent<(split_percent/2)); + HDassert(node_size > 0); + HDassert(rrec_size > 0); + HDassert(merge_percent > 0 && merge_percent <= 100); + HDassert(split_percent > 0 && split_percent <= 100); + HDassert(merge_percent < (split_percent / 2)); + HDassert(addr_p); /* * Allocate file and memory data structures. */ - if (NULL==(bt2 = H5FL_MALLOC(H5B2_t))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for B-tree header") + if(NULL == (bt2 = H5FL_MALLOC(H5B2_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for B-tree header") /* Assign internal information */ - HDmemset(&bt2->cache_info,0,sizeof(H5AC_info_t)); + HDmemset(&bt2->cache_info, 0, sizeof(H5AC_info_t)); bt2->depth = 0; bt2->root.addr = HADDR_UNDEF; bt2->root.node_nrec = 0; bt2->root.all_nrec = 0; /* Initialize shared B-tree info */ - if(H5B2_shared_init(f, bt2, type, node_size, rrec_size, split_percent, merge_percent)<0) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't create shared B-tree info") + if(H5B2_shared_init(f, bt2, type, node_size, rrec_size, split_percent, merge_percent) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't create shared B-tree info") /* Allocate space for the header on disk */ - if (HADDR_UNDEF==(*addr_p=H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)H5B2_HEADER_SIZE(f)))) + if(HADDR_UNDEF == (*addr_p = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)H5B2_HEADER_SIZE(f)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for B-tree header") /* Cache the new B-tree node */ - if (H5AC_set(f, dxpl_id, H5AC_BT2_HDR, *addr_p, bt2, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_set(f, dxpl_id, H5AC_BT2_HDR, *addr_p, bt2, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree header to cache") done: - if (ret_value<0) { - if (bt2) - (void)H5B2_cache_hdr_dest(f,bt2); + if(ret_value < 0) { + if(bt2) + (void)H5B2_cache_hdr_dest(f, bt2); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -436,16 +428,6 @@ H5B2_locate_record(const H5B2_class_t *type, unsigned nrec, size_t *rec_off, * koziol@ncsa.uiuc.edu * Feb 3 2005 * - * Modifications: - * - * John Mainzer, 6/10/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * - * In this case, that required adding the new bt2_dirtied_ptr - * parameter to the function's argument list. - * *------------------------------------------------------------------------- */ static herr_t @@ -640,11 +622,6 @@ done: * koziol@ncsa.uiuc.edu * Feb 9 2005 * - * John Mainzer, 6/14/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ static herr_t @@ -867,15 +844,6 @@ done: * koziol@ncsa.uiuc.edu * Feb 9 2005 * - * John Mainzer, 6/14/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * - * In this case, that required adding the new - * parent_cache_info_dirtied_ptr and internal_dirtied_ptr - * parameters to the function's argument list. - * *------------------------------------------------------------------------- */ static herr_t @@ -1146,17 +1114,6 @@ done: * koziol@ncsa.uiuc.edu * Feb 9 2005 * - * Modifications: - * - * John Mainzer, 6/14/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * - * In this case, that required adding the new - * internal_dirtied_ptr parameter to the function's - * argument list. - * *------------------------------------------------------------------------- */ static herr_t @@ -1527,17 +1484,6 @@ done: * koziol@ncsa.uiuc.edu * Feb 10 2005 * - * Modifications: - * - * John Mainzer, 6/15/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * - * In this case, that required adding the new - * parent_cache_info_dirtied_ptr and internal_dirtied_ptr - * parameters to the function's argument list. - * *------------------------------------------------------------------------- */ static herr_t @@ -1869,15 +1815,6 @@ done: * koziol@ncsa.uiuc.edu * Mar 4 2005 * - * John Mainzer, 6/15/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * - * In this case, that required adding the new - * parent_cache_info_dirtied_ptr and internal_dirtied_ptr - * parameters to the function's argument list. - * *------------------------------------------------------------------------- */ static herr_t @@ -2034,17 +1971,6 @@ done: * koziol@ncsa.uiuc.edu * Mar 4 2005 * - * Modifications: - * - * John Mainzer, 6/15/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * - * In this case, that required adding the new - * parent_cache_info_dirtied_ptr and internal_dirtied_ptr - * parameters to the function's argument list. - * *------------------------------------------------------------------------- */ static herr_t @@ -2269,17 +2195,6 @@ done: * koziol@ncsa.uiuc.edu * Mar 4 2005 * - * Modifications: - * - * John Mainzer, 6/15/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * - * In this case, that required adding the new - * internal_dirtied_ptr parameter to the function's - * argument list. - * *------------------------------------------------------------------------- */ static herr_t @@ -2373,13 +2288,6 @@ done: * koziol@ncsa.uiuc.edu * Mar 3 2005 * - * Modifications: - * - * John Mainzer, 6/15/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ static herr_t @@ -2461,16 +2369,6 @@ done: * koziol@ncsa.uiuc.edu * Mar 2 2005 * - * Modifications: - * - * John Mainzer, 6/14/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * - * In this case, that required adding the new dirtied_ptr - * parameter to the function's argument list. - * *------------------------------------------------------------------------- */ static herr_t @@ -2614,13 +2512,6 @@ done: * koziol@ncsa.uiuc.edu * Feb 2 2005 * - * Modifications: - * - * John Mainzer, 6/10/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ herr_t @@ -2698,16 +2589,6 @@ done: * koziol@ncsa.uiuc.edu * Feb 2 2005 * - * Modifications: - * - * John Mainzer, 6/15/05 - * Modified the function to avoid modifying the is_dirty - * field of the cache info, as that field is now maintained - * by the cache code. Since this function uses a call to - * H5AC_set(), and that function presumes that the newly - * inserted entry is dirty, we need only remove the reference - * to the is_dirty field. - * *------------------------------------------------------------------------- */ static herr_t @@ -2779,16 +2660,6 @@ done: * koziol@ncsa.uiuc.edu * Feb 3 2005 * - * Modifications: - * - * John Mainzer, 6/15/05 - * Modified the function to avoid modifying the is_dirty - * field of the cache info, as that field is now maintained - * by the cache code. Since this function uses a call to - * H5AC_set(), and that function presumes that the newly - * inserted entry is dirty, we need only remove the reference - * to the is_dirty field. - * *------------------------------------------------------------------------- */ static herr_t @@ -2870,13 +2741,6 @@ done: * koziol@ncsa.uiuc.edu * Feb 11 2005 * - * Modifications: - * - * John Mainzer, 6/16/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ static herr_t @@ -2973,13 +2837,6 @@ done: * koziol@ncsa.uiuc.edu * Feb 11 2005 * - * Modifications: - * - * John Mainzer, 6/16/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ herr_t @@ -3059,13 +2916,6 @@ done: * koziol@ncsa.uiuc.edu * Feb 23 2005 * - * Modifications: - * - * John Mainzer, 6/16/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ herr_t @@ -3230,13 +3080,6 @@ done: * koziol@ncsa.uiuc.edu * Feb 23 2005 * - * Modifications: - * - * John Mainzer, 6/16/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ herr_t @@ -3409,13 +3252,6 @@ done: * koziol@ncsa.uiuc.edu * Mar 3 2005 * - * Modifications: - * - * John Mainzer, 6/15/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ static herr_t @@ -3504,17 +3340,6 @@ done: * koziol@ncsa.uiuc.edu * Mar 3 2005 * - * Modifications: - * - * John Mainzer, 6/14/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * - * In this case, that required adding the new - * parent_cache_info_dirtied_ptr parameter to the - * function's argument list. - * *------------------------------------------------------------------------- */ static herr_t @@ -3724,13 +3549,6 @@ done: * koziol@ncsa.uiuc.edu * Feb 25 2005 * - * Modifications: - * - * John Mainzer, 6/15/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ herr_t @@ -3802,13 +3620,6 @@ done: * koziol@ncsa.uiuc.edu * Feb 25 2005 * - * Modifications: - * - * John Mainzer, 6/16/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ herr_t @@ -3866,13 +3677,6 @@ done: * koziol@ncsa.uiuc.edu * Mar 9 2005 * - * Modifications: - * - * John Mainzer, 6/16/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ static herr_t @@ -3966,13 +3770,6 @@ done: * koziol@ncsa.uiuc.edu * Mar 9 2005 * - * Modifications: - * - * John Mainzer, 6/16/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ static herr_t @@ -4063,13 +3860,6 @@ done: * koziol@ncsa.uiuc.edu * Mar 8 2005 * - * Modifications: - * - * John Mainzer, 6/16/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ herr_t @@ -4126,13 +3916,6 @@ done: * koziol@ncsa.uiuc.edu * Mar 9 2005 * - * Modifications: - * - * John Mainzer, 6/16/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ static herr_t @@ -4209,13 +3992,6 @@ done: * koziol@ncsa.uiuc.edu * Mar 9 2005 * - * Modifications: - * - * John Mainzer, 6/16/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ herr_t @@ -4270,13 +4046,6 @@ done: * koziol@ncsa.uiuc.edu * Mar 10 2005 * - * Modifications: - * - * John Mainzer, 6/16/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5B2cache.c b/src/H5B2cache.c index 7810aae..0ad3242 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -23,14 +23,22 @@ *------------------------------------------------------------------------- */ +/****************/ +/* Module Setup */ +/****************/ + #define H5B2_PACKAGE /*suppress error about including H5B2pkg */ -/* Private headers */ +/***********/ +/* Headers */ +/***********/ #include "H5private.h" /* Generic Functions */ #include "H5B2pkg.h" /* B-trees */ #include "H5Eprivate.h" /* Error handling */ -/* Local macros */ +/****************/ +/* Local Macros */ +/****************/ /* B-tree format version #'s */ #define H5B2_HDR_VERSION 0 /* Header */ @@ -38,9 +46,13 @@ #define H5B2_LEAF_VERSION 0 /* Leaf node */ -/* Local typedefs */ +/******************/ +/* Local Typedefs */ +/******************/ -/* Local prototypes */ +/********************/ +/* Local Prototypes */ +/********************/ /* Metadata cache callbacks */ static H5B2_t *H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata); @@ -56,7 +68,9 @@ static herr_t H5B2_cache_internal_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy static herr_t H5B2_cache_internal_clear(H5F_t *f, H5B2_internal_t *i, hbool_t destroy); static herr_t H5B2_cache_internal_size(const H5F_t *f, const H5B2_internal_t *i, size_t *size_ptr); -/* Package variables */ +/*********************/ +/* Package Variables */ +/*********************/ /* H5B2 inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_BT2_HDR[1] = {{ @@ -88,7 +102,14 @@ const H5AC_class_t H5AC_BT2_INT[1] = {{ (H5AC_size_func_t)H5B2_cache_internal_size, }}; -/* Static variables */ +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ /* Declare a free list to manage B-tree header data to/from disk */ H5FL_BLK_DEFINE_STATIC(header_block); @@ -113,14 +134,14 @@ H5FL_BLK_DEFINE_STATIC(header_block); static H5B2_t * H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void UNUSED *udata) { - const H5B2_class_t *type = (const H5B2_class_t *) _type; + const H5B2_class_t *type = (const H5B2_class_t *) _type; /* Type of B-tree */ size_t node_size, rrec_size; /* Size info for B-tree */ unsigned split_percent, merge_percent; /* Split & merge info for B-tree */ - H5B2_t *bt2 = NULL; - size_t size; - uint8_t *buf = NULL; + H5B2_t *bt2 = NULL; /* B-tree info */ + size_t size; /* Header size */ + uint8_t *buf = NULL; /* Temporary buffer */ uint8_t *p; /* Pointer into raw data buffer */ - H5B2_t *ret_value; + H5B2_t *ret_value; /* Return value */ FUNC_ENTER_NOAPI(H5B2_cache_hdr_load, NULL) @@ -129,68 +150,72 @@ H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, vo HDassert(H5F_addr_defined(addr)); HDassert(type); - if (NULL==(bt2 = H5FL_MALLOC(H5B2_t))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - HDmemset(&bt2->cache_info,0,sizeof(H5AC_info_t)); + /* Allocate space for the B-tree data structure */ + if(NULL == (bt2 = H5FL_MALLOC(H5B2_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HDmemset(&bt2->cache_info, 0, sizeof(H5AC_info_t)); /* Compute the size of the B-tree header on disk */ size = H5B2_HEADER_SIZE(f); /* Allocate temporary buffer */ - if ((buf=H5FL_BLK_MALLOC(header_block,size))==NULL) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); + if((buf = H5FL_BLK_MALLOC(header_block, size)) == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Read header from disk */ - if (H5F_block_read(f, H5FD_MEM_BTREE, addr, size, dxpl_id, buf)<0) + if(H5F_block_read(f, H5FD_MEM_BTREE, addr, size, dxpl_id, buf) < 0) HGOTO_ERROR(H5E_BTREE, H5E_READERROR, NULL, "can't read B-tree header") p = buf; - /* magic number */ - if (HDmemcmp(p, H5B2_HDR_MAGIC, H5B2_SIZEOF_MAGIC)) + /* Magic number */ + if(HDmemcmp(p, H5B2_HDR_MAGIC, H5B2_SIZEOF_MAGIC)) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "wrong B-tree header signature") p += H5B2_SIZEOF_MAGIC; - /* version */ - if (*p++ != H5B2_HDR_VERSION) + /* Version */ + if(*p++ != H5B2_HDR_VERSION) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "wrong B-tree header version") +/* XXX: Add metadata flags & checksum to v2 B-tree metadata (like fractal heap) */ + /* B-tree type */ - if (*p++ != (uint8_t)type->id) + if(*p++ != (uint8_t)type->id) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "incorrect B-tree type") - /* node size (in bytes) */ + /* Node size (in bytes) */ UINT32DECODE(p, node_size); - /* raw key size (in bytes) */ + /* Raw key size (in bytes) */ UINT16DECODE(p, rrec_size); - /* depth of tree */ + /* Depth of tree */ UINT16DECODE(p, bt2->depth); - /* split & merge %s */ + /* Split & merge %s */ UINT16DECODE(p, split_percent); UINT16DECODE(p, merge_percent); - /* root node pointer */ + /* Root node pointer */ H5F_addr_decode(f, (const uint8_t **)&p, &(bt2->root.addr)); UINT16DECODE(p, bt2->root.node_nrec); H5F_DECODE_LENGTH(f, p, bt2->root.all_nrec); /* Initialize shared B-tree info */ - if(H5B2_shared_init(f, bt2, type, node_size, rrec_size, split_percent, merge_percent)<0) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "can't create shared B-tree info") + if(H5B2_shared_init(f, bt2, type, node_size, rrec_size, split_percent, merge_percent) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't create shared B-tree info") /* Set return value */ ret_value = bt2; done: if(buf) - H5FL_BLK_FREE(header_block,buf); - if (!ret_value && bt2) - (void)H5B2_cache_hdr_dest(f,bt2); + H5FL_BLK_FREE(header_block, buf); + if(!ret_value && bt2) + (void)H5B2_cache_hdr_dest(f, bt2); + FUNC_LEAVE_NOAPI(ret_value) -} /*lint !e818 Can't make udata a pointer to const */ +} /* end H5B2_cache_hdr_load() */ /*lint !e818 Can't make udata a pointer to const */ /*------------------------------------------------------------------------- @@ -220,62 +245,63 @@ H5B2_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B if (bt2->cache_info.is_dirty) { H5B2_shared_t *shared; /* Shared B-tree information */ - uint8_t *buf = NULL; + uint8_t *buf = NULL; /* Temporary raw data buffer */ uint8_t *p; /* Pointer into raw data buffer */ - size_t size; + size_t size; /* Header size on disk */ /* Get the pointer to the shared B-tree info */ - shared=H5RC_GET_OBJ(bt2->shared); + shared = H5RC_GET_OBJ(bt2->shared); HDassert(shared); /* Compute the size of the B-tree header on disk */ size = H5B2_HEADER_SIZE(f); /* Allocate temporary buffer */ - if ((buf=H5FL_BLK_MALLOC(header_block,size))==NULL) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); + if((buf = H5FL_BLK_MALLOC(header_block, size)) == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") p = buf; - /* magic number */ + /* Magic number */ HDmemcpy(p, H5B2_HDR_MAGIC, H5B2_SIZEOF_MAGIC); p += H5B2_SIZEOF_MAGIC; - /* version # */ + /* Version # */ *p++ = H5B2_HDR_VERSION; - /* b-tree type */ + /* B-tree type */ *p++ = shared->type->id; - /* node size (in bytes) */ + /* Node size (in bytes) */ UINT32ENCODE(p, shared->node_size); - /* raw key size (in bytes) */ + /* Raw key size (in bytes) */ UINT16ENCODE(p, shared->rrec_size); - /* depth of tree */ + /* Depth of tree */ UINT16ENCODE(p, bt2->depth); - /* split & merge %s */ + /* Split & merge %s */ UINT16ENCODE(p, shared->split_percent); UINT16ENCODE(p, shared->merge_percent); - /* root node pointer */ + /* Root node pointer */ H5F_addr_encode(f, &p, bt2->root.addr); UINT16ENCODE(p, bt2->root.node_nrec); H5F_ENCODE_LENGTH(f, p, bt2->root.all_nrec); /* Write the B-tree header. */ - if (H5F_block_write(f, H5FD_MEM_BTREE, addr, size, dxpl_id, buf) < 0) + HDassert((p - buf) == size); + if(H5F_block_write(f, H5FD_MEM_BTREE, addr, size, dxpl_id, buf) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to save B-tree header to disk") - H5FL_BLK_FREE(header_block,buf); + H5FL_BLK_FREE(header_block, buf); bt2->cache_info.is_dirty = FALSE; } /* end if */ - if (destroy) - if (H5B2_cache_hdr_dest(f,bt2) < 0) + if(destroy) + if(H5B2_cache_hdr_dest(f, bt2) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree header") done: @@ -312,7 +338,7 @@ H5B2_cache_hdr_dest(H5F_t UNUSED *f, H5B2_t *bt2) H5RC_DEC(bt2->shared); /* Free B-tree header info */ - H5FL_FREE(H5B2_t,bt2); + H5FL_FREE(H5B2_t, bt2); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5B2_cache_hdr_dest() */ @@ -334,7 +360,7 @@ H5B2_cache_hdr_dest(H5F_t UNUSED *f, H5B2_t *bt2) static herr_t H5B2_cache_hdr_clear(H5F_t *f, H5B2_t *bt2, hbool_t destroy) { - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_hdr_clear) @@ -346,8 +372,8 @@ H5B2_cache_hdr_clear(H5F_t *f, H5B2_t *bt2, hbool_t destroy) /* Reset the dirty flag. */ bt2->cache_info.is_dirty = FALSE; - if (destroy) - if (H5B2_cache_hdr_dest(f, bt2) < 0) + if(destroy) + if(H5B2_cache_hdr_dest(f, bt2) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree header") done: @@ -421,7 +447,7 @@ H5B2_cache_leaf_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_nrec, v HDassert(bt2_shared); if (NULL==(leaf = H5FL_MALLOC(H5B2_leaf_t))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") HDmemset(&leaf->cache_info,0,sizeof(H5AC_info_t)); /* Share common B-tree information */ @@ -453,7 +479,7 @@ H5B2_cache_leaf_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_nrec, v /* Allocate space for the native keys in memory */ if((leaf->leaf_native=H5FL_FAC_MALLOC(shared->leaf_fac))==NULL) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for B-tree leaf native keys") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for B-tree leaf native keys") /* Set the number of records in the leaf */ leaf->nrec = *nrec; @@ -463,7 +489,7 @@ H5B2_cache_leaf_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_nrec, v for(u=0; unrec; u++) { /* Decode record */ if((shared->type->decode)(f,p,native)<0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, NULL, "unable to decode B-tree record"); + HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, NULL, "unable to decode B-tree record") /* Move to next record */ p += shared->rrec_size; @@ -532,7 +558,7 @@ H5B2_cache_leaf_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5 for(u=0; unrec; u++) { /* Encode record */ if((shared->type->encode)(f,p,native)<0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree record"); + HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree record") /* Move to next record */ p += shared->rrec_size; @@ -710,7 +736,7 @@ H5B2_cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_nre HDassert(bt2_shared); if (NULL==(internal = H5FL_MALLOC(H5B2_internal_t))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") HDmemset(&internal->cache_info,0,sizeof(H5AC_info_t)); /* Share common B-tree information */ @@ -742,11 +768,11 @@ H5B2_cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_nre /* Allocate space for the native keys in memory */ if((internal->int_native=H5FL_FAC_MALLOC(shared->int_fac))==NULL) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for B-tree internal native keys") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for B-tree internal native keys") /* Allocate space for the node pointers in memory */ if((internal->node_ptrs=H5FL_FAC_MALLOC(shared->node_ptr_fac))==NULL) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for B-tree internal node pointers") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for B-tree internal node pointers") /* Set the number of records in the leaf */ internal->nrec = *nrec; @@ -756,7 +782,7 @@ H5B2_cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_nre for(u=0; unrec; u++) { /* Decode record */ if((shared->type->decode)(f,p,native)<0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, NULL, "unable to decode B-tree record"); + HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, NULL, "unable to decode B-tree record") /* Move to next record */ p += shared->rrec_size; @@ -838,7 +864,7 @@ H5B2_cache_internal_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr for(u=0; unrec; u++) { /* Encode record */ if((shared->type->encode)(f,p,native)<0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree record"); + HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree record") /* Move to next record */ p += shared->rrec_size; diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c index 98abd60..687c731 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -23,14 +23,49 @@ *------------------------------------------------------------------------- */ +/****************/ +/* Module Setup */ +/****************/ + #define H5B2_PACKAGE /*suppress error about including H5B2pkg */ -/* Private headers */ +/***********/ +/* Headers */ +/***********/ #include "H5private.h" /* Generic Functions */ #include "H5B2pkg.h" /* B-trees */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ +/****************/ +/* Local Macros */ +/****************/ + + +/******************/ +/* Local Typedefs */ +/******************/ + + +/********************/ +/* Local Prototypes */ +/********************/ + + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + /*------------------------------------------------------------------------- * Function: H5B2_hdr_debug @@ -43,50 +78,46 @@ * koziol@ncsa.uiuc.edu * Feb 2 2005 * - * Modifications: - * - * John Mainzer, 6/16/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ herr_t H5B2_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B2_class_t *type) { - H5B2_t *bt2 = NULL; - H5B2_shared_t *shared; /* Shared B-tree information */ - herr_t ret_value=SUCCEED; /* Return value */ + H5B2_t *bt2 = NULL; /* B-tree header info */ + H5B2_shared_t *shared; /* Shared B-tree information */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5B2_hdr_debug, FAIL) /* * Check arguments. */ - assert(f); - assert(H5F_addr_defined(addr)); - assert(stream); - assert(indent >= 0); - assert(fwidth >= 0); + HDassert(f); + HDassert(H5F_addr_defined(addr)); + HDassert(stream); + HDassert(indent >= 0); + HDassert(fwidth >= 0); /* - * Load the b-tree header. + * Load the B-tree header. */ - if (NULL == (bt2 = H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, type, NULL, H5AC_READ))) + if(NULL == (bt2 = H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, type, NULL, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree header") /* Get the pointer to the shared B-tree info */ - shared=H5RC_GET_OBJ(bt2->shared); - assert(shared); + shared = H5RC_GET_OBJ(bt2->shared); + HDassert(shared); + + /* Print opening message */ + HDfprintf(stream, "%*sv2 B-tree Header...\n", indent, ""); /* * Print the values. */ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Tree type ID:", - ((shared->type->id)==H5B2_TEST_ID ? "H5B2_TEST_ID" : + ((shared->type->id) == H5B2_TEST_ID ? "H5B2_TEST_ID" : "Unknown!")); HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, "Size of node:", @@ -135,7 +166,7 @@ H5B2_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, shared->merge_leaf_nrec); done: - if (bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__NO_FLAGS_SET) < 0) + if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree header") FUNC_LEAVE_NOAPI(ret_value) @@ -153,13 +184,6 @@ done: * koziol@ncsa.uiuc.edu * Feb 4 2005 * - * Modifications: - * - * John Mainzer, 6/16/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ herr_t @@ -205,6 +229,9 @@ H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree header") bt2 = NULL; + /* Print opening message */ + HDfprintf(stream, "%*sv2 B-tree Internal Node...\n", indent, ""); + /* * Print the values. */ @@ -271,13 +298,6 @@ done: * koziol@ncsa.uiuc.edu * Feb 7 2005 * - * Modifications: - * - * John Mainzer, 6/16/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ herr_t @@ -323,6 +343,9 @@ H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree header") bt2 = NULL; + /* Print opening message */ + HDfprintf(stream, "%*sv2 B-tree Leaf Node...\n", indent, ""); + /* * Print the values. */ diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index b49ed45..4abf5aa 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -55,15 +55,15 @@ /* Size of the B-tree header on disk */ #define H5B2_HEADER_SIZE(f) ( \ - 4 + /* Signature */ \ - 1 + /* Version */ \ - 1 + /* Tree type */ \ - 4 + /* Node size, in bytes */ \ - 2 + /* Key size, in bytes */ \ - 2 + /* Depth of tree */ \ - 2 + /* Split % of full (as integer, ie. "98" means 98%) */ \ - 2 + /* Merge % of full (as integer, ie. "98" means 98%) */ \ - H5B2_NODE_POINTER_SIZE(f)) /* Node pointer to root node in tree */ + 4 /* Signature */ \ + + 1 /* Version */ \ + + 1 /* Tree type */ \ + + 4 /* Node size, in bytes */ \ + + 2 /* Key size, in bytes */ \ + + 2 /* Depth of tree */ \ + + 2 /* Split % of full (as integer, ie. "98" means 98%) */ \ + + 2 /* Merge % of full (as integer, ie. "98" means 98%) */ \ + + H5B2_NODE_POINTER_SIZE(f)) /* Node pointer to root node in tree */ /* Macro to retrieve pointer to i'th native record for native record buffer */ #define H5B2_NAT_NREC(b,shared,idx) (b+(shared)->nat_off[(idx)]) @@ -179,12 +179,17 @@ H5_DLLVAR const H5B2_class_t H5B2_TEST[1]; /******************************/ /* Package Private Prototypes */ /******************************/ -H5_DLL herr_t H5B2_shared_free (void *_shared); -H5_DLL herr_t H5B2_shared_init (H5F_t *f, H5B2_t *bt2, const H5B2_class_t *type, + +/* Routines for managing shared B-tree info */ +H5_DLL herr_t H5B2_shared_init(H5F_t *f, H5B2_t *bt2, const H5B2_class_t *type, size_t node_size, size_t rrec_size, unsigned split_percent, unsigned merge_percent); + +/* Metadata cache callbacks */ H5_DLL herr_t H5B2_cache_hdr_dest(H5F_t *f, H5B2_t *b); H5_DLL herr_t H5B2_cache_leaf_dest(H5F_t *f, H5B2_leaf_t *l); H5_DLL herr_t H5B2_cache_internal_dest(H5F_t *f, H5B2_internal_t *i); + +/* Debugging routines for dumping file structures */ H5_DLL herr_t H5B2_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B2_class_t *type); H5_DLL herr_t H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, @@ -193,8 +198,10 @@ H5_DLL herr_t H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5_DLL herr_t H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec); + +/* Testing routines */ #ifdef H5B2_TESTING -H5_DLL herr_t H5B2_get_root_addr(H5F_t *f, hid_t dxpl_id, +H5_DLL herr_t H5B2_get_root_addr_test(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, haddr_t *root_addr); #endif /* H5B2_TESTING */ diff --git a/src/H5B2public.h b/src/H5B2public.h index 55a866b..d48aa43 100644 --- a/src/H5B2public.h +++ b/src/H5B2public.h @@ -18,10 +18,11 @@ * Jan 31 2005 * Quincey Koziol * - * Purpose: Public declarations for the H5B2 package. + * Purpose: Public declarations for the v2 B-tree package. * *------------------------------------------------------------------------- */ + #ifndef _H5B2public_H #define _H5B2public_H diff --git a/src/H5B2test.c b/src/H5B2test.c index 0428b35..26924e7 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -18,15 +18,33 @@ * Purpose: v2 B-tree testing functions. */ +/****************/ +/* Module Setup */ +/****************/ + #define H5B2_PACKAGE /*suppress error about including H5B2pkg */ #define H5B2_TESTING /*suppress warning about H5B2 testing funcs*/ -/* Private headers */ +/***********/ +/* Headers */ +/***********/ #include "H5private.h" /* Generic Functions */ #include "H5B2pkg.h" /* B-trees */ #include "H5Eprivate.h" /* Error handling */ -/* Static Prototypes */ +/****************/ +/* Local Macros */ +/****************/ + + +/******************/ +/* Local Typedefs */ +/******************/ + + +/********************/ +/* Local Prototypes */ +/********************/ static herr_t H5B2_test_store(void *nrecord, const void *udata); static herr_t H5B2_test_retrieve(void *udata, const void *nrecord); static herr_t H5B2_test_compare(const void *rec1, const void *rec2); @@ -37,7 +55,9 @@ static herr_t H5B2_test_decode(const H5F_t *f, const uint8_t *raw, static herr_t H5B2_test_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, int indent, int fwidth, const void *record, const void *_udata); -/* Package variables */ +/*********************/ +/* Package Variables */ +/*********************/ const H5B2_class_t H5B2_TEST[1]={{ /* B-tree class information */ H5B2_TEST_ID, /* Type of B-tree */ sizeof(hsize_t), /* Size of native key */ @@ -49,6 +69,15 @@ const H5B2_class_t H5B2_TEST[1]={{ /* B-tree class information */ H5B2_test_debug /* Record debugging callback */ }}; +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + /*------------------------------------------------------------------------- * Function: H5B2_test_store @@ -62,8 +91,6 @@ const H5B2_class_t H5B2_TEST[1]={{ /* B-tree class information */ * Programmer: Quincey Koziol * Thursday, February 3, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -89,8 +116,6 @@ H5B2_test_store(void *nrecord, const void *udata) * Programmer: Quincey Koziol * Friday, February 25, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -116,8 +141,6 @@ H5B2_test_retrieve(void *udata, const void *nrecord) * Programmer: Quincey Koziol * Thursday, February 3, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -141,8 +164,6 @@ H5B2_test_compare(const void *rec1, const void *rec2) * Programmer: Quincey Koziol * Thursday, February 3, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -168,8 +189,6 @@ H5B2_test_encode(const H5F_t *f, uint8_t *raw, const void *nrecord) * Programmer: Quincey Koziol * Friday, February 4, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -195,8 +214,6 @@ H5B2_test_decode(const H5F_t *f, const uint8_t *raw, void *nrecord) * Programmer: Quincey Koziol * Friday, February 4, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -226,23 +243,16 @@ H5B2_test_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, int i * Programmer: Quincey Koziol * Saturday, February 26, 2005 * - * Modifications: - * - * John Mainzer, 6/17/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ herr_t -H5B2_get_root_addr(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, +H5B2_get_root_addr_test(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, haddr_t *root_addr) { - H5B2_t *bt2=NULL; /* Pointer to the B-tree header */ - herr_t ret_value = SUCCEED; + H5B2_t *bt2 = NULL; /* Pointer to the B-tree header */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_get_root_addr) + FUNC_ENTER_NOAPI_NOINIT(H5B2_get_root_addr_test) /* Check arguments. */ HDassert(f); @@ -251,7 +261,7 @@ H5B2_get_root_addr(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, HDassert(root_addr); /* Look up the B-tree header */ - if (NULL == (bt2 = H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, type, NULL, H5AC_WRITE))) + if(NULL == (bt2 = H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, type, NULL, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree header") /* Get B-tree root addr */ @@ -259,9 +269,9 @@ H5B2_get_root_addr(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, done: /* Release B-tree header node */ - if (bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__NO_FLAGS_SET) < 0) + if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info") FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_get_root_addr() */ +} /* H5B2_get_root_addr_test() */ diff --git a/src/H5Spkg.h b/src/H5Spkg.h index 69330c5..8764fb6 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -220,7 +220,8 @@ H5_DLL herr_t H5S_extent_copy(H5S_extent_t *dst, const H5S_extent_t *src); /* Testing functions */ #ifdef H5S_TESTING H5_DLL htri_t H5S_select_shape_same_test(hid_t sid1, hid_t sid2); -H5_DLL htri_t H5S_inquiry_rebuild_status(hid_t space_id); +H5_DLL htri_t H5S_get_rebuild_status_test(hid_t space_id); #endif /* H5S_TESTING */ #endif /*_H5Spkg_H*/ + diff --git a/src/H5Stest.c b/src/H5Stest.c index 6df626c..5a1d2b0 100644 --- a/src/H5Stest.c +++ b/src/H5Stest.c @@ -44,39 +44,39 @@ dimensionality and shape. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS - DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING H5P_get_class_path() + DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ htri_t H5S_select_shape_same_test(hid_t sid1, hid_t sid2) { - H5S_t *space1 = NULL; /* Pointer to 1st dataspace */ - H5S_t *space2 = NULL; /* Pointer to 2nd dataspace */ - htri_t ret_value; /* return value */ + H5S_t *space1 = NULL; /* Pointer to 1st dataspace */ + H5S_t *space2 = NULL; /* Pointer to 2nd dataspace */ + htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5S_select_shape_same_test, FAIL); + FUNC_ENTER_NOAPI(H5S_select_shape_same_test, FAIL) /* Get dataspace structures */ - if (NULL == (space1=H5I_object_verify(sid1, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace"); - if (NULL == (space2=H5I_object_verify(sid2, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace"); + if(NULL == (space1 = H5I_object_verify(sid1, H5I_DATASPACE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") + if(NULL == (space2 = H5I_object_verify(sid2, H5I_DATASPACE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") /* Check if the dataspace selections are the same shape */ - if ((ret_value=H5S_select_shape_same(space1,space2))<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOMPARE, FAIL, "unable to compare dataspace selections"); + if((ret_value = H5S_select_shape_same(space1, space2)) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOMPARE, FAIL, "unable to compare dataspace selections") done: - FUNC_LEAVE_NOAPI(ret_value); -} /* H5S_select_shape_same_test() */ + FUNC_LEAVE_NOAPI(ret_value) +} /* H5S_select_shape_same_test() */ /*-------------------------------------------------------------------------- NAME - H5S_inquiry_rebuild_status + H5S_get_rebuild_status_test PURPOSE - Determine the status of rebuild + Determine the status of hyperslab rebuild USAGE htri_t H5S_inquiry_rebuild_status(hid_t space_id) hid_t space_id; IN: dataspace id @@ -86,24 +86,25 @@ done: Query the status of rebuilding the hyperslab GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS - DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING H5P_get_class_path() + DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ htri_t -H5S_inquiry_rebuild_status(hid_t space_id) +H5S_get_rebuild_status_test(hid_t space_id) { - static htri_t ret_value = FAIL; /* return value */ + H5S_t *space = NULL; /* Pointer to 1st dataspace */ + htri_t ret_value; /* Return value */ - H5S_t *space1 = NULL; /* Pointer to 1st dataspace */ + FUNC_ENTER_NOAPI(H5S_get_rebuild_status_test, FAIL) - FUNC_ENTER_NOAPI(H5S_inquiry_rebuild_status, FAIL); /* Get dataspace structures */ -if (NULL == (space1=H5I_object_verify(space_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace"); + if(NULL == (space = H5I_object_verify(space_id, H5I_DATASPACE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") - ret_value= space1->select.sel_info.hslab->diminfo_valid; + ret_value = space->select.sel_info.hslab->diminfo_valid; done: - FUNC_LEAVE_NOAPI(ret_value); -} /* H5S_inquiry_rebuild_status() */ + FUNC_LEAVE_NOAPI(ret_value) +} /* H5S_get_rebuild_status_test() */ + diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 32f647e..be72c81 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -18,15 +18,15 @@ #define H5T_PACKAGE /*suppress error about including H5Tpkg */ -#include "H5private.h" /*generic functions */ -#include "H5Eprivate.h" /*error handling */ -#include "H5FLprivate.h" /*Free Lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5HGprivate.h" /* Global Heaps */ -#include "H5Iprivate.h" /*ID functions */ -#include "H5MMprivate.h" /*memory management */ -#include "H5Pprivate.h" /* Property Lists */ -#include "H5Dprivate.h" /* Dataset */ -#include "H5Tpkg.h" /*data-type functions */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ +#include "H5Tpkg.h" /* Datatypes */ /* Conversion data for H5T_conv_struct() */ typedef struct H5T_conv_struct_t { diff --git a/test/btree2.c b/test/btree2.c index 9ac6571..dfb024a 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -54,8 +54,6 @@ const char *FILENAME[] = { * Programmer: Quincey Koziol * Wednesday, February 16, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -84,8 +82,6 @@ iter_cb(const void *_record, void *_op_data) * Programmer: Quincey Koziol * Thursday, February 24, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -113,8 +109,6 @@ find_cb(const void *_record, void *_op_data) * Programmer: Quincey Koziol * Tuesday, March 8, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -141,8 +135,6 @@ neighbor_cb(const void *_record, void *_op_data) * Programmer: Quincey Koziol * Friday, March 10, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -170,52 +162,47 @@ modify_cb(void *_record, void *_op_data, hbool_t *changed) * Programmer: Quincey Koziol * Thursday, February 3, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int test_insert_basic(hid_t fapl) { - hid_t file=-1; - char filename[1024]; - H5F_t *f=NULL; + hid_t file = -1; /* File ID */ + char filename[1024]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ hsize_t record; /* Record to insert into tree */ hsize_t idx; /* Index within B-tree, for iterator */ haddr_t bt2_addr; /* Address of B-tree created */ herr_t ret; /* Generic error return value */ - h5_fixname(FILENAME[0], fapl, filename, sizeof filename); + /* Set the filename to use for this test (dependent on fapl) */ + h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR /* Get a pointer to the internal file object */ - if (NULL==(f=H5I_object(file))) { - H5Eprint_stack(H5E_DEFAULT, stdout); - TEST_ERROR; - } + if(NULL == (f = H5I_object(file))) + STACK_ERROR /* * Test v2 B-tree creation */ TESTING("B-tree creation"); - if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { - H5_FAILED(); - H5Eprint_stack(H5E_DEFAULT, stdout); - goto error; - } + if(H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/) < 0) + FAIL_STACK_ERROR + if(!H5F_addr_defined(bt2_addr)) + FAIL_STACK_ERROR PASSED(); /* Attempt to iterate over a B-tree with no records */ idx = 0; - if(H5B2_iterate(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, iter_cb, &idx)<0) { - H5_FAILED(); - H5Eprint_stack(H5E_DEFAULT, stdout); - goto error; - } + if(H5B2_iterate(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, iter_cb, &idx) < 0) + FAIL_STACK_ERROR /* Make certain that the index hasn't changed */ - if(idx != 0) TEST_ERROR; + if(idx != 0) + TEST_ERROR /* Attempt to find record in B-tree with no records */ idx = 0; @@ -223,7 +210,8 @@ test_insert_basic(hid_t fapl) ret = H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, NULL); } H5E_END_TRY; /* Should fail */ - if(ret != FAIL) TEST_ERROR; + if(ret != FAIL) + TEST_ERROR /* Attempt to index record in B-tree with no records */ idx = 0; @@ -231,18 +219,16 @@ test_insert_basic(hid_t fapl) ret = H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)0, find_cb, NULL); } H5E_END_TRY; /* Should fail */ - if(ret != FAIL) TEST_ERROR; + if(ret != FAIL) + TEST_ERROR /* * Test inserting record into v2 B-tree */ TESTING("B-tree insert: several records"); - record=42; - if (H5B2_insert(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &record)<0) { - H5_FAILED(); - H5Eprint_stack(H5E_DEFAULT, stdout); - goto error; - } + record = 42; + if(H5B2_insert(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &record) < 0) + FAIL_STACK_ERROR /* Attempt to find non-existant record in B-tree with 1 record */ idx = 41; @@ -250,21 +236,25 @@ test_insert_basic(hid_t fapl) ret = H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx); } H5E_END_TRY; /* Should fail */ - if(ret != FAIL) TEST_ERROR; + if(ret != FAIL) + TEST_ERROR /* Try again with NULL 'op' */ H5E_BEGIN_TRY { ret = H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, NULL, NULL); } H5E_END_TRY; /* Should fail */ - if(ret != FAIL) TEST_ERROR; + if(ret != FAIL) + TEST_ERROR /* Attempt to find existant record in B-tree with 1 record */ idx = 42; - if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx)<0) TEST_ERROR; + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx)<0) + TEST_ERROR /* Try again with NULL 'op' */ - if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, NULL, NULL)<0) TEST_ERROR; + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, NULL, NULL)<0) + TEST_ERROR /* Attempt to index non-existant record in B-tree with 1 record */ idx = 0; @@ -272,41 +262,34 @@ test_insert_basic(hid_t fapl) ret = H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)1, find_cb, NULL); } H5E_END_TRY; /* Should fail */ - if(ret != FAIL) TEST_ERROR; + if(ret != FAIL) + TEST_ERROR /* Attempt to index existing record in B-tree with 1 record */ idx = 42; - if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)0, find_cb, &idx)<0) TEST_ERROR; + if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)0, find_cb, &idx)<0) + TEST_ERROR /* * Test inserting second record into v2 B-tree, before all other records */ - record=34; - if (H5B2_insert(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &record)<0) { - H5_FAILED(); - H5Eprint_stack(H5E_DEFAULT, stdout); - goto error; - } + record = 34; + if(H5B2_insert(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &record) < 0) + FAIL_STACK_ERROR /* * Test inserting third record into v2 B-tree, after all other records */ - record=56; - if (H5B2_insert(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &record)<0) { - H5_FAILED(); - H5Eprint_stack(H5E_DEFAULT, stdout); - goto error; - } + record = 56; + if(H5B2_insert(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &record) < 0) + FAIL_STACK_ERROR /* * Test inserting fourth record into v2 B-tree, in the middle of other records */ - record=38; - if (H5B2_insert(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &record)<0) { - H5_FAILED(); - H5Eprint_stack(H5E_DEFAULT, stdout); - goto error; - } + record = 38; + if(H5B2_insert(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &record) < 0) + FAIL_STACK_ERROR /* Attempt to find non-existant record in level-0 B-tree with several records */ idx = 41; @@ -314,11 +297,13 @@ test_insert_basic(hid_t fapl) ret = H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx); } H5E_END_TRY; /* Should fail */ - if(ret != FAIL) TEST_ERROR; + if(ret != FAIL) + TEST_ERROR /* Attempt to find existant record in level-0 B-tree with several record */ idx = 56; - if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx)<0) TEST_ERROR; + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx)<0) + TEST_ERROR /* Attempt to index non-existant record in B-tree with several records */ idx = 0; @@ -326,29 +311,37 @@ test_insert_basic(hid_t fapl) ret = H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)4, find_cb, NULL); } H5E_END_TRY; /* Should fail */ - if(ret != FAIL) TEST_ERROR; + if(ret != FAIL) + TEST_ERROR /* Attempt to index existing record in B-tree with several records */ idx = 34; - if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)0, find_cb, &idx)<0) TEST_ERROR; + if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)0, find_cb, &idx)<0) + TEST_ERROR idx = 38; - if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)1, find_cb, &idx)<0) TEST_ERROR; + if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)1, find_cb, &idx)<0) + TEST_ERROR idx = 42; - if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)2, find_cb, &idx)<0) TEST_ERROR; + if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)2, find_cb, &idx)<0) + TEST_ERROR idx = 56; - if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)3, find_cb, &idx)<0) TEST_ERROR; + if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)3, find_cb, &idx)<0) + TEST_ERROR PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + /* Close the file */ + if(H5Fclose(file)<0) + TEST_ERROR - return 0; + /* All tests passed */ + return(0); error: H5E_BEGIN_TRY { H5Fclose(file); } H5E_END_TRY; - return 1; + return(1); } /* test_insert_basic() */ @@ -367,8 +360,6 @@ error: * Programmer: Quincey Koziol * Thursday, February 3, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -386,7 +377,7 @@ test_insert_split_root(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { @@ -438,7 +429,7 @@ test_insert_split_root(hid_t fapl) } /* Make certain that the index is correct */ - if(idx != (INSERT_SPLIT_ROOT_NREC+2)) TEST_ERROR; + if(idx != (INSERT_SPLIT_ROOT_NREC+2)) TEST_ERROR /* Attempt to find non-existant record in level-1 B-tree */ idx = INSERT_SPLIT_ROOT_NREC + 10; @@ -446,15 +437,15 @@ test_insert_split_root(hid_t fapl) ret = H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx); } H5E_END_TRY; /* Should fail */ - if(ret != FAIL) TEST_ERROR; + if(ret != FAIL) TEST_ERROR /* Attempt to find existant record in root of level-1 B-tree */ idx = 33; - if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx)<0) TEST_ERROR; + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx)<0) TEST_ERROR /* Attempt to find existant record in leaf of level-1 B-tree */ idx = 56; - if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx)<0) TEST_ERROR; + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx)<0) TEST_ERROR /* Attempt to index non-existant record in level-1 B-tree */ idx = 0; @@ -462,23 +453,23 @@ test_insert_split_root(hid_t fapl) ret = H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)(INSERT_SPLIT_ROOT_NREC+2), find_cb, NULL); } H5E_END_TRY; /* Should fail */ - if(ret != FAIL) TEST_ERROR; + if(ret != FAIL) TEST_ERROR /* Attempt to index existing record in root of level-1 B-tree */ idx = 33; - if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)33, find_cb, &idx)<0) TEST_ERROR; + if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)33, find_cb, &idx)<0) TEST_ERROR /* Attempt to index existing record in left leaf of level-1 B-tree */ idx = 0; - if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)0, find_cb, &idx)<0) TEST_ERROR; + if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)0, find_cb, &idx)<0) TEST_ERROR /* Attempt to index existing record in right leaf of level-1 B-tree */ idx = 50; - if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)50, find_cb, &idx)<0) TEST_ERROR; + if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)50, find_cb, &idx)<0) TEST_ERROR PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -506,8 +497,6 @@ error: * Programmer: Quincey Koziol * Tuesday, February 8, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -523,7 +512,7 @@ test_insert_level1_2leaf_redistrib(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { @@ -601,7 +590,7 @@ test_insert_level1_2leaf_redistrib(hid_t fapl) } PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -629,8 +618,6 @@ error: * Programmer: Quincey Koziol * Tuesday, February 9, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -646,7 +633,7 @@ test_insert_level1_2leaf_split(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { @@ -724,7 +711,7 @@ test_insert_level1_2leaf_split(hid_t fapl) } PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -753,8 +740,6 @@ error: * Programmer: Quincey Koziol * Thursday, February 10, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -771,7 +756,7 @@ test_insert_level1_3leaf_redistrib(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { @@ -822,11 +807,11 @@ test_insert_level1_3leaf_redistrib(hid_t fapl) } /* Make certain that the index is correct */ - if(idx != (INSERT_SPLIT_ROOT_NREC*2)) TEST_ERROR; + if(idx != (INSERT_SPLIT_ROOT_NREC*2)) TEST_ERROR PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -855,8 +840,6 @@ error: * Programmer: Quincey Koziol * Thursday, February 10, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -872,7 +855,7 @@ test_insert_level1_3leaf_split(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { @@ -915,7 +898,7 @@ test_insert_level1_3leaf_split(hid_t fapl) } PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -940,8 +923,6 @@ error: * Programmer: Quincey Koziol * Friday, February 11, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -959,7 +940,7 @@ test_insert_make_level2(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { @@ -1037,7 +1018,7 @@ test_insert_make_level2(hid_t fapl) } /* Make certain that the index is correct */ - if(idx != (INSERT_SPLIT_ROOT_NREC*11)+4) TEST_ERROR; + if(idx != (INSERT_SPLIT_ROOT_NREC*11)+4) TEST_ERROR /* Attempt to find non-existant record in level-1 B-tree */ idx = INSERT_SPLIT_ROOT_NREC*12; @@ -1045,19 +1026,19 @@ test_insert_make_level2(hid_t fapl) ret = H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx); } H5E_END_TRY; /* Should fail */ - if(ret != FAIL) TEST_ERROR; + if(ret != FAIL) TEST_ERROR /* Attempt to find existant record in root of level-2 B-tree */ idx = 433; - if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx)<0) TEST_ERROR; + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx)<0) TEST_ERROR /* Attempt to find existant record in internal node of level-2 B-tree */ idx = 259; - if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx)<0) TEST_ERROR; + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx)<0) TEST_ERROR /* Attempt to find existant record in leaf of level-2 B-tree */ idx = 346; - if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx)<0) TEST_ERROR; + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx)<0) TEST_ERROR /* Attempt to index non-existant record in level-1 B-tree */ idx = 0; @@ -1065,23 +1046,23 @@ test_insert_make_level2(hid_t fapl) ret = H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)(INSERT_SPLIT_ROOT_NREC*12), find_cb, NULL); } H5E_END_TRY; /* Should fail */ - if(ret != FAIL) TEST_ERROR; + if(ret != FAIL) TEST_ERROR /* Attempt to index existing record in root of level-2 B-tree */ idx = 433; - if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)433, find_cb, &idx)<0) TEST_ERROR; + if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)433, find_cb, &idx)<0) TEST_ERROR /* Attempt to index existing record in internal node of level-2 B-tree */ idx = 734; - if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)734, find_cb, &idx)<0) TEST_ERROR; + if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)734, find_cb, &idx)<0) TEST_ERROR /* Attempt to index existing record in leaf of level-2 B-tree */ idx = 883; - if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)883, find_cb, &idx)<0) TEST_ERROR; + if(H5B2_index(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, (hsize_t)883, find_cb, &idx)<0) TEST_ERROR PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -1107,8 +1088,6 @@ error: * Programmer: Quincey Koziol * Thursday, February 17, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1125,7 +1104,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { @@ -1203,11 +1182,11 @@ test_insert_level2_leaf_redistrib(hid_t fapl) } /* Make certain that the index is correct */ - if(idx != (INSERT_SPLIT_ROOT_NREC*12)) TEST_ERROR; + if(idx != (INSERT_SPLIT_ROOT_NREC*12)) TEST_ERROR PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -1233,8 +1212,6 @@ error: * Programmer: Quincey Koziol * Thursday, February 17, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1251,7 +1228,7 @@ test_insert_level2_leaf_split(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { @@ -1329,11 +1306,11 @@ test_insert_level2_leaf_split(hid_t fapl) } /* Make certain that the index is correct */ - if(idx != (INSERT_SPLIT_ROOT_NREC*14)) TEST_ERROR; + if(idx != (INSERT_SPLIT_ROOT_NREC*14)) TEST_ERROR PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -1360,8 +1337,6 @@ error: * Programmer: Quincey Koziol * Friday, February 18, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1378,7 +1353,7 @@ test_insert_level2_2internal_redistrib(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { @@ -1434,11 +1409,11 @@ test_insert_level2_2internal_redistrib(hid_t fapl) } /* Make certain that the index is correct */ - if(idx != (INSERT_SPLIT_ROOT_NREC*19)) TEST_ERROR; + if(idx != (INSERT_SPLIT_ROOT_NREC*19)) TEST_ERROR PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -1465,8 +1440,6 @@ error: * Programmer: Quincey Koziol * Friday, February 18, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1483,7 +1456,7 @@ test_insert_level2_2internal_split(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { @@ -1539,11 +1512,11 @@ test_insert_level2_2internal_split(hid_t fapl) } /* Make certain that the index is correct */ - if(idx != (INSERT_SPLIT_ROOT_NREC*29)) TEST_ERROR; + if(idx != (INSERT_SPLIT_ROOT_NREC*29)) TEST_ERROR PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -1571,8 +1544,6 @@ error: * Programmer: Quincey Koziol * Saturday, February 19, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1589,7 +1560,7 @@ test_insert_level2_3internal_redistrib(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { @@ -1642,11 +1613,11 @@ test_insert_level2_3internal_redistrib(hid_t fapl) } /* Make certain that the index is correct */ - if(idx != (INSERT_SPLIT_ROOT_NREC*34)) TEST_ERROR; + if(idx != (INSERT_SPLIT_ROOT_NREC*34)) TEST_ERROR PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -1674,8 +1645,6 @@ error: * Programmer: Quincey Koziol * Saturday, February 19, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1692,7 +1661,7 @@ test_insert_level2_3internal_split(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { @@ -1745,11 +1714,11 @@ test_insert_level2_3internal_split(hid_t fapl) } /* Make certain that the index is correct */ - if(idx != (INSERT_SPLIT_ROOT_NREC*41)) TEST_ERROR; + if(idx != (INSERT_SPLIT_ROOT_NREC*41)) TEST_ERROR PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -1774,8 +1743,6 @@ error: * Programmer: Quincey Koziol * Saturday, February 19, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1804,7 +1771,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); HDsrandom((unsigned long)curr_time); /* Allocate space for the records */ - if((records = HDmalloc(sizeof(hsize_t)*INSERT_MANY))==NULL) TEST_ERROR; + if((records = HDmalloc(sizeof(hsize_t)*INSERT_MANY))==NULL) TEST_ERROR /* Initialize record #'s */ for(u=0; ul)"); @@ -2544,7 +2505,7 @@ test_remove_level1_redistrib(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR; + if(record != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -2554,7 +2515,7 @@ test_remove_level1_redistrib(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR; + if(nrec != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR } /* end for */ PASSED(); @@ -2570,7 +2531,7 @@ test_remove_level1_redistrib(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != u) TEST_ERROR; + if(record != u) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -2580,7 +2541,7 @@ test_remove_level1_redistrib(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (((INSERT_SPLIT_ROOT_NREC*2)-(INSERT_SPLIT_ROOT_NREC/2))-(u+1))) TEST_ERROR; + if(nrec != (((INSERT_SPLIT_ROOT_NREC*2)-(INSERT_SPLIT_ROOT_NREC/2))-(u+1))) TEST_ERROR } /* end for */ PASSED(); @@ -2596,7 +2557,7 @@ test_remove_level1_redistrib(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != (((INSERT_SPLIT_ROOT_NREC/4)*3) + u)) TEST_ERROR; + if(record != (((INSERT_SPLIT_ROOT_NREC/4)*3) + u)) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -2606,12 +2567,12 @@ test_remove_level1_redistrib(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (((INSERT_SPLIT_ROOT_NREC*2)-(3*(INSERT_SPLIT_ROOT_NREC/4)))-(u+1))) TEST_ERROR; + if(nrec != (((INSERT_SPLIT_ROOT_NREC*2)-(3*(INSERT_SPLIT_ROOT_NREC/4)))-(u+1))) TEST_ERROR } /* end for */ PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -2635,8 +2596,6 @@ error: * Programmer: Quincey Koziol * Friday, March 4, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2654,12 +2613,12 @@ test_remove_level1_2leaf_merge(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); - TEST_ERROR; + TEST_ERROR } /* @@ -2689,17 +2648,17 @@ test_remove_level1_2leaf_merge(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*2)) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*2)) TEST_ERROR /* Query the address of the root node in the B-tree */ - if (H5B2_get_root_addr(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { + if (H5B2_get_root_addr_test(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ /* Make certain that the address of the root node is defined */ - if(!H5F_addr_defined(root_addr)) TEST_ERROR; + if(!H5F_addr_defined(root_addr)) TEST_ERROR /* Attempt to remove enough records from right leaf of a level-1 B-tree to force redistribution */ TESTING("B-tree remove: merge 2 leaves to 1 in level-1 B-tree (r->l)"); @@ -2712,7 +2671,7 @@ test_remove_level1_2leaf_merge(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR; + if(record != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -2722,7 +2681,7 @@ test_remove_level1_2leaf_merge(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR; + if(nrec != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR } /* end for */ PASSED(); @@ -2750,7 +2709,7 @@ test_remove_level1_2leaf_merge(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != u) TEST_ERROR; + if(record != u) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -2760,12 +2719,12 @@ test_remove_level1_2leaf_merge(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR; + if(nrec != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR } /* end for */ PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -2789,8 +2748,6 @@ error: * Programmer: Quincey Koziol * Friday, March 4, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2808,12 +2765,12 @@ test_remove_level1_3leaf_merge(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); - TEST_ERROR; + TEST_ERROR } /* @@ -2843,17 +2800,17 @@ test_remove_level1_3leaf_merge(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*2)) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*2)) TEST_ERROR /* Query the address of the root node in the B-tree */ - if (H5B2_get_root_addr(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { + if (H5B2_get_root_addr_test(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ /* Make certain that the address of the root node is defined */ - if(!H5F_addr_defined(root_addr)) TEST_ERROR; + if(!H5F_addr_defined(root_addr)) TEST_ERROR /* Attempt to remove enough records from middle leaf of a level-1 B-tree to force merge */ TESTING("B-tree remove: merge 3 leaves to 2 in level-1 B-tree"); @@ -2866,7 +2823,7 @@ test_remove_level1_3leaf_merge(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != ((INSERT_SPLIT_ROOT_NREC/2)+3+u)) TEST_ERROR; + if(record != ((INSERT_SPLIT_ROOT_NREC/2)+3+u)) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -2876,12 +2833,12 @@ test_remove_level1_3leaf_merge(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR; + if(nrec != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR } /* end for */ PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -2905,8 +2862,6 @@ error: * Programmer: Quincey Koziol * Friday, March 4, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2924,12 +2879,12 @@ test_remove_level1_promote(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); - TEST_ERROR; + TEST_ERROR } /* @@ -2959,17 +2914,17 @@ test_remove_level1_promote(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*3)) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*3)) TEST_ERROR /* Query the address of the root node in the B-tree */ - if (H5B2_get_root_addr(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { + if (H5B2_get_root_addr_test(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ /* Make certain that the address of the root node is defined */ - if(!H5F_addr_defined(root_addr)) TEST_ERROR; + if(!H5F_addr_defined(root_addr)) TEST_ERROR /* Attempt to remove record from root node of a level-1 B-tree to force promotion from right leaf */ TESTING("B-tree remove: promote from right leaf of level-1 B-tree"); @@ -2981,7 +2936,7 @@ test_remove_level1_promote(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != 181) TEST_ERROR; + if(record != 181) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -2991,7 +2946,7 @@ test_remove_level1_promote(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*3)-1) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*3)-1) TEST_ERROR PASSED(); @@ -3005,7 +2960,7 @@ test_remove_level1_promote(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != 42) TEST_ERROR; + if(record != 42) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -3015,7 +2970,7 @@ test_remove_level1_promote(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*3)-2) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*3)-2) TEST_ERROR PASSED(); @@ -3029,7 +2984,7 @@ test_remove_level1_promote(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != 85) TEST_ERROR; + if(record != 85) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -3039,11 +2994,11 @@ test_remove_level1_promote(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*3)-3) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*3)-3) TEST_ERROR PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -3067,8 +3022,6 @@ error: * Programmer: Quincey Koziol * Friday, March 4, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3086,12 +3039,12 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); - TEST_ERROR; + TEST_ERROR } /* @@ -3121,17 +3074,17 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*2)) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*2)) TEST_ERROR /* Query the address of the root node in the B-tree */ - if (H5B2_get_root_addr(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { + if (H5B2_get_root_addr_test(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ /* Make certain that the address of the root node is defined */ - if(!H5F_addr_defined(root_addr)) TEST_ERROR; + if(!H5F_addr_defined(root_addr)) TEST_ERROR /* Attempt to remove record from root node of a level-1 B-tree to force promotion from right leaf */ TESTING("B-tree remove: promote from leaf of level-1 B-tree w/2 node redistrib"); @@ -3146,7 +3099,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR; + if(record != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -3156,7 +3109,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR; + if(nrec != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR } /* end for */ record = 101; @@ -3167,7 +3120,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != 101) TEST_ERROR; + if(record != 101) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -3177,11 +3130,11 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*2)-34) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*2)-34) TEST_ERROR PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -3205,8 +3158,6 @@ error: * Programmer: Quincey Koziol * Friday, March 4, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3224,12 +3175,12 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); - TEST_ERROR; + TEST_ERROR } /* @@ -3259,17 +3210,17 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*2)) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*2)) TEST_ERROR /* Query the address of the root node in the B-tree */ - if (H5B2_get_root_addr(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { + if (H5B2_get_root_addr_test(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ /* Make certain that the address of the root node is defined */ - if(!H5F_addr_defined(root_addr)) TEST_ERROR; + if(!H5F_addr_defined(root_addr)) TEST_ERROR /* Attempt to remove record from root node of a level-1 B-tree to force promotion from middle leaf */ TESTING("B-tree remove: promote from leaf of level-1 B-tree w/3 node redistrib"); @@ -3284,7 +3235,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != (43 + u)) TEST_ERROR; + if(record != (43 + u)) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -3294,7 +3245,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR; + if(nrec != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR } /* end for */ record = 42; @@ -3305,7 +3256,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != 42) TEST_ERROR; + if(record != 42) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -3315,11 +3266,11 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*2)-34) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*2)-34) TEST_ERROR PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -3343,8 +3294,6 @@ error: * Programmer: Quincey Koziol * Friday, March 4, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3362,12 +3311,12 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); - TEST_ERROR; + TEST_ERROR } /* @@ -3397,17 +3346,17 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*2)) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*2)) TEST_ERROR /* Query the address of the root node in the B-tree */ - if (H5B2_get_root_addr(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { + if (H5B2_get_root_addr_test(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ /* Make certain that the address of the root node is defined */ - if(!H5F_addr_defined(root_addr)) TEST_ERROR; + if(!H5F_addr_defined(root_addr)) TEST_ERROR /* Attempt to remove record from root node of a level-1 B-tree to force promotion from right leaf */ TESTING("B-tree remove: promote from leaf of level-1 B-tree w/2->1 merge"); @@ -3422,7 +3371,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR; + if(record != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -3432,7 +3381,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR; + if(nrec != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR } /* end for */ record = 68; @@ -3443,7 +3392,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != 68) TEST_ERROR; + if(record != 68) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -3453,11 +3402,11 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*2)-67) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*2)-67) TEST_ERROR PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -3481,8 +3430,6 @@ error: * Programmer: Quincey Koziol * Friday, March 4, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3500,12 +3447,12 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); - TEST_ERROR; + TEST_ERROR } /* @@ -3535,17 +3482,17 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*2)) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*2)) TEST_ERROR /* Query the address of the root node in the B-tree */ - if (H5B2_get_root_addr(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { + if (H5B2_get_root_addr_test(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ /* Make certain that the address of the root node is defined */ - if(!H5F_addr_defined(root_addr)) TEST_ERROR; + if(!H5F_addr_defined(root_addr)) TEST_ERROR /* Attempt to remove record from root node of a level-1 B-tree to force promotion from middle leaf */ TESTING("B-tree remove: promote from leaf of level-1 B-tree w/3->2 merge"); @@ -3560,7 +3507,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != (43 + u)) TEST_ERROR; + if(record != (43 + u)) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -3570,7 +3517,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR; + if(nrec != ((INSERT_SPLIT_ROOT_NREC*2)-(u+1))) TEST_ERROR } /* end for */ record = 26; @@ -3581,7 +3528,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != 26) TEST_ERROR; + if(record != 26) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -3591,11 +3538,11 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*2)-82) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*2)-82) TEST_ERROR PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -3619,8 +3566,6 @@ error: * Programmer: Quincey Koziol * Friday, March 4, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3638,12 +3583,12 @@ test_remove_level1_collapse(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); - TEST_ERROR; + TEST_ERROR } /* @@ -3673,17 +3618,17 @@ test_remove_level1_collapse(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC)) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC)) TEST_ERROR /* Query the address of the root node in the B-tree */ - if (H5B2_get_root_addr(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { + if (H5B2_get_root_addr_test(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ /* Make certain that the address of the root node is defined */ - if(!H5F_addr_defined(root_addr)) TEST_ERROR; + if(!H5F_addr_defined(root_addr)) TEST_ERROR /* Attempt to remove records from B-tree to force a single leaf for the B-tree */ TESTING("B-tree remove: collapse level-1 B-tree back to level-0"); @@ -3696,7 +3641,7 @@ test_remove_level1_collapse(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != (INSERT_SPLIT_ROOT_NREC - (u+1))) TEST_ERROR; + if(record != (INSERT_SPLIT_ROOT_NREC - (u+1))) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -3706,12 +3651,12 @@ test_remove_level1_collapse(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC-(u+1))) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC-(u+1))) TEST_ERROR } /* end for */ PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -3735,8 +3680,6 @@ error: * Programmer: Quincey Koziol * Friday, March 4, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3754,12 +3697,12 @@ test_remove_level2_promote(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); - TEST_ERROR; + TEST_ERROR } /* @@ -3789,17 +3732,17 @@ test_remove_level2_promote(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*21)) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*21)) TEST_ERROR /* Query the address of the root node in the B-tree */ - if (H5B2_get_root_addr(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { + if (H5B2_get_root_addr_test(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ /* Make certain that the address of the root node is defined */ - if(!H5F_addr_defined(root_addr)) TEST_ERROR; + if(!H5F_addr_defined(root_addr)) TEST_ERROR /* Attempt to remove record from right internal node of a level-2 B-tree to force promotion */ TESTING("B-tree remove: promote from right internal of level-2 B-tree"); @@ -3811,7 +3754,7 @@ test_remove_level2_promote(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != 1632) TEST_ERROR; + if(record != 1632) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -3821,7 +3764,7 @@ test_remove_level2_promote(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*21)-1) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*21)-1) TEST_ERROR PASSED(); @@ -3835,7 +3778,7 @@ test_remove_level2_promote(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != 1117) TEST_ERROR; + if(record != 1117) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -3845,7 +3788,7 @@ test_remove_level2_promote(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*21)-2) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*21)-2) TEST_ERROR PASSED(); @@ -3859,7 +3802,7 @@ test_remove_level2_promote(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != 1246) TEST_ERROR; + if(record != 1246) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -3869,7 +3812,7 @@ test_remove_level2_promote(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*21)-3) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*21)-3) TEST_ERROR PASSED(); @@ -3883,7 +3826,7 @@ test_remove_level2_promote(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != 1074) TEST_ERROR; + if(record != 1074) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -3893,7 +3836,7 @@ test_remove_level2_promote(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*21)-4) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*21)-4) TEST_ERROR record = 558; if(H5B2_remove(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &record)<0) { @@ -3903,7 +3846,7 @@ test_remove_level2_promote(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != 558) TEST_ERROR; + if(record != 558) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -3913,11 +3856,11 @@ test_remove_level2_promote(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*21)-5) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*21)-5) TEST_ERROR PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -3941,8 +3884,6 @@ error: * Programmer: Quincey Koziol * Monday, March 7, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3960,12 +3901,12 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); - TEST_ERROR; + TEST_ERROR } /* @@ -3995,17 +3936,17 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*21)) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*21)) TEST_ERROR /* Query the address of the root node in the B-tree */ - if (H5B2_get_root_addr(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { + if (H5B2_get_root_addr_test(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ /* Make certain that the address of the root node is defined */ - if(!H5F_addr_defined(root_addr)) TEST_ERROR; + if(!H5F_addr_defined(root_addr)) TEST_ERROR /* Attempt to remove record from right internal node of a level-2 B-tree to force promotion w/redistribution */ TESTING("B-tree remove: promote from right internal of level-2 B-tree w/redistrib"); @@ -4018,7 +3959,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != ((INSERT_SPLIT_ROOT_NREC*21) - (u+1))) TEST_ERROR; + if(record != ((INSERT_SPLIT_ROOT_NREC*21) - (u+1))) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -4028,7 +3969,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != ((INSERT_SPLIT_ROOT_NREC*21)-(u+1))) TEST_ERROR; + if(nrec != ((INSERT_SPLIT_ROOT_NREC*21)-(u+1))) TEST_ERROR } /* end for */ record = 1632; @@ -4039,7 +3980,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != 1632) TEST_ERROR; + if(record != 1632) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -4049,11 +3990,11 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*21)-23) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*21)-23) TEST_ERROR PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -4077,8 +4018,6 @@ error: * Programmer: Quincey Koziol * Monday, March 7, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4096,12 +4035,12 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); - TEST_ERROR; + TEST_ERROR } /* @@ -4131,17 +4070,17 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*21)) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*21)) TEST_ERROR /* Query the address of the root node in the B-tree */ - if (H5B2_get_root_addr(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { + if (H5B2_get_root_addr_test(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ /* Make certain that the address of the root node is defined */ - if(!H5F_addr_defined(root_addr)) TEST_ERROR; + if(!H5F_addr_defined(root_addr)) TEST_ERROR /* Attempt to remove record from right internal node of a level-2 B-tree to force promotion w/redistribution */ TESTING("B-tree remove: promote from right internal of level-2 B-tree w/redistrib"); @@ -4154,7 +4093,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != (43 + u)) TEST_ERROR; + if(record != (43 + u)) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -4164,7 +4103,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != ((INSERT_SPLIT_ROOT_NREC*21)-(u+1))) TEST_ERROR; + if(nrec != ((INSERT_SPLIT_ROOT_NREC*21)-(u+1))) TEST_ERROR } /* end for */ record = 42; @@ -4175,7 +4114,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != 42) TEST_ERROR; + if(record != 42) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -4185,11 +4124,11 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*21)-18) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*21)-18) TEST_ERROR PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -4213,8 +4152,6 @@ error: * Programmer: Quincey Koziol * Monday, March 7, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4232,12 +4169,12 @@ test_remove_level2_promote_2internal_merge(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); - TEST_ERROR; + TEST_ERROR } /* @@ -4267,17 +4204,17 @@ test_remove_level2_promote_2internal_merge(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*21)) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*21)) TEST_ERROR /* Query the address of the root node in the B-tree */ - if (H5B2_get_root_addr(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { + if (H5B2_get_root_addr_test(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ /* Make certain that the address of the root node is defined */ - if(!H5F_addr_defined(root_addr)) TEST_ERROR; + if(!H5F_addr_defined(root_addr)) TEST_ERROR /* Attempt to remove record from right internal node of a level-2 B-tree to force promotion w/redistribution */ TESTING("B-tree remove: promote from right internal of level-2 B-tree w/redistrib"); @@ -4290,7 +4227,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != ((INSERT_SPLIT_ROOT_NREC*21) - (u+1))) TEST_ERROR; + if(record != ((INSERT_SPLIT_ROOT_NREC*21) - (u+1))) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -4300,7 +4237,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != ((INSERT_SPLIT_ROOT_NREC*21)-(u+1))) TEST_ERROR; + if(nrec != ((INSERT_SPLIT_ROOT_NREC*21)-(u+1))) TEST_ERROR } /* end for */ record = 1616; @@ -4311,7 +4248,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != 1616) TEST_ERROR; + if(record != 1616) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -4321,11 +4258,11 @@ test_remove_level2_promote_2internal_merge(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*21)-39) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*21)-39) TEST_ERROR PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -4349,8 +4286,6 @@ error: * Programmer: Quincey Koziol * Monday, March 7, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4368,12 +4303,12 @@ test_remove_level2_promote_3internal_merge(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); - TEST_ERROR; + TEST_ERROR } /* @@ -4403,17 +4338,17 @@ test_remove_level2_promote_3internal_merge(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*21)) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*21)) TEST_ERROR /* Query the address of the root node in the B-tree */ - if (H5B2_get_root_addr(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { + if (H5B2_get_root_addr_test(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ /* Make certain that the address of the root node is defined */ - if(!H5F_addr_defined(root_addr)) TEST_ERROR; + if(!H5F_addr_defined(root_addr)) TEST_ERROR /* Attempt to remove record from right internal node of a level-2 B-tree to force promotion w/redistribution */ TESTING("B-tree remove: promote from right internal of level-2 B-tree w/redistrib"); @@ -4426,7 +4361,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != (43 + u)) TEST_ERROR; + if(record != (43 + u)) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -4436,7 +4371,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != ((INSERT_SPLIT_ROOT_NREC*21)-(u+1))) TEST_ERROR; + if(nrec != ((INSERT_SPLIT_ROOT_NREC*21)-(u+1))) TEST_ERROR } /* end for */ record = 26; @@ -4447,7 +4382,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != 26) TEST_ERROR; + if(record != 26) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -4457,11 +4392,11 @@ test_remove_level2_promote_3internal_merge(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*21)-50) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*21)-50) TEST_ERROR PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -4485,8 +4420,6 @@ error: * Programmer: Quincey Koziol * Tuesday, March 8, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4504,12 +4437,12 @@ test_remove_level2_2internal_merge_left(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); - TEST_ERROR; + TEST_ERROR } /* @@ -4539,17 +4472,17 @@ test_remove_level2_2internal_merge_left(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*21)) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*21)) TEST_ERROR /* Query the address of the root node in the B-tree */ - if (H5B2_get_root_addr(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { + if (H5B2_get_root_addr_test(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ /* Make certain that the address of the root node is defined */ - if(!H5F_addr_defined(root_addr)) TEST_ERROR; + if(!H5F_addr_defined(root_addr)) TEST_ERROR /* Attempt to remove records from a level-2 B-tree to force 2 internal nodes to merge */ TESTING("B-tree remove: merge 2 internal nodes to 1 in level-2 B-tree (l->r)"); @@ -4562,7 +4495,7 @@ test_remove_level2_2internal_merge_left(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != u) TEST_ERROR; + if(record != u) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -4572,12 +4505,12 @@ test_remove_level2_2internal_merge_left(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != ((INSERT_SPLIT_ROOT_NREC*21)-(u+1))) TEST_ERROR; + if(nrec != ((INSERT_SPLIT_ROOT_NREC*21)-(u+1))) TEST_ERROR } /* end for */ PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -4601,8 +4534,6 @@ error: * Programmer: Quincey Koziol * Tuesday, March 8, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4620,12 +4551,12 @@ test_remove_level2_2internal_merge_right(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); - TEST_ERROR; + TEST_ERROR } /* @@ -4655,17 +4586,17 @@ test_remove_level2_2internal_merge_right(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*21)) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*21)) TEST_ERROR /* Query the address of the root node in the B-tree */ - if (H5B2_get_root_addr(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { + if (H5B2_get_root_addr_test(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ /* Make certain that the address of the root node is defined */ - if(!H5F_addr_defined(root_addr)) TEST_ERROR; + if(!H5F_addr_defined(root_addr)) TEST_ERROR /* Attempt to remove records from a level-2 B-tree to force 2 internal nodes to merge */ TESTING("B-tree remove: merge 2 internal nodes to 1 in level-2 B-tree (r->l)"); @@ -4678,7 +4609,7 @@ test_remove_level2_2internal_merge_right(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != ((INSERT_SPLIT_ROOT_NREC*21) - (u + 1))) TEST_ERROR; + if(record != ((INSERT_SPLIT_ROOT_NREC*21) - (u + 1))) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -4688,12 +4619,12 @@ test_remove_level2_2internal_merge_right(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != ((INSERT_SPLIT_ROOT_NREC*21)-(u+1))) TEST_ERROR; + if(nrec != ((INSERT_SPLIT_ROOT_NREC*21)-(u+1))) TEST_ERROR } /* end for */ PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -4717,8 +4648,6 @@ error: * Programmer: Quincey Koziol * Tuesday, March 8, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4736,12 +4665,12 @@ test_remove_level2_3internal_merge(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); - TEST_ERROR; + TEST_ERROR } /* @@ -4771,17 +4700,17 @@ test_remove_level2_3internal_merge(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*21)) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*21)) TEST_ERROR /* Query the address of the root node in the B-tree */ - if (H5B2_get_root_addr(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { + if (H5B2_get_root_addr_test(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ /* Make certain that the address of the root node is defined */ - if(!H5F_addr_defined(root_addr)) TEST_ERROR; + if(!H5F_addr_defined(root_addr)) TEST_ERROR /* Attempt to remove record from right internal node of a level-2 B-tree to force promotion w/redistribution */ TESTING("B-tree remove: merge 3 internal nodes to 2 in level-2 B-tree"); @@ -4794,7 +4723,7 @@ test_remove_level2_3internal_merge(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != (559 + u)) TEST_ERROR; + if(record != (559 + u)) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -4804,12 +4733,12 @@ test_remove_level2_3internal_merge(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != ((INSERT_SPLIT_ROOT_NREC*21)-(u+1))) TEST_ERROR; + if(nrec != ((INSERT_SPLIT_ROOT_NREC*21)-(u+1))) TEST_ERROR } /* end for */ PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -4833,8 +4762,6 @@ error: * Programmer: Quincey Koziol * Tuesday, March 8, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4852,12 +4779,12 @@ test_remove_level2_collapse_right(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create the file to work on */ - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); - TEST_ERROR; + TEST_ERROR } /* @@ -4887,17 +4814,17 @@ test_remove_level2_collapse_right(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != (INSERT_SPLIT_ROOT_NREC*21)) TEST_ERROR; + if(nrec != (INSERT_SPLIT_ROOT_NREC*21)) TEST_ERROR /* Query the address of the root node in the B-tree */ - if (H5B2_get_root_addr(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { + if (H5B2_get_root_addr_test(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &root_addr)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ /* Make certain that the address of the root node is defined */ - if(!H5F_addr_defined(root_addr)) TEST_ERROR; + if(!H5F_addr_defined(root_addr)) TEST_ERROR /* Attempt to remove records from a level-2 B-tree to force back to level-1 */ TESTING("B-tree remove: collapse level-1 B-tree back to level-0 (r->l)"); @@ -4910,7 +4837,7 @@ test_remove_level2_collapse_right(hid_t fapl) } /* end if */ /* Make certain that the record value is correct */ - if(record != ((INSERT_SPLIT_ROOT_NREC*21)-(u+1))) TEST_ERROR; + if(record != ((INSERT_SPLIT_ROOT_NREC*21)-(u+1))) TEST_ERROR /* Query the number of records in the B-tree */ if (H5B2_get_nrec(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &nrec)<0) { @@ -4920,12 +4847,12 @@ test_remove_level2_collapse_right(hid_t fapl) } /* end if */ /* Make certain that the # of records is correct */ - if(nrec != ((INSERT_SPLIT_ROOT_NREC*21)-(u+1))) TEST_ERROR; + if(nrec != ((INSERT_SPLIT_ROOT_NREC*21)-(u+1))) TEST_ERROR } /* end for */ PASSED(); - if (H5Fclose(file)<0) TEST_ERROR; + if (H5Fclose(file)<0) TEST_ERROR return 0; @@ -4951,8 +4878,6 @@ error: * Programmer: Quincey Koziol * Tuesday, March 8, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4979,7 +4904,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); HDsrandom((unsigned long)curr_time); /* Allocate space for the records */ - if((records = HDmalloc(sizeof(hsize_t)*INSERT_MANY))==NULL) TEST_ERROR; + if((records = HDmalloc(sizeof(hsize_t)*INSERT_MANY))==NULL) TEST_ERROR /* Initialize record #'s */ for(u=0; u