summaryrefslogtreecommitdiffstats
path: root/src/H5Gtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Gtest.c')
-rw-r--r--src/H5Gtest.c103
1 files changed, 103 insertions, 0 deletions
diff --git a/src/H5Gtest.c b/src/H5Gtest.c
index a142dfd..f84f30b 100644
--- a/src/H5Gtest.c
+++ b/src/H5Gtest.c
@@ -18,10 +18,17 @@
* Purpose: Group testing functions.
*/
+/****************/
+/* Module Setup */
+/****************/
+
#define H5G_PACKAGE /*suppress error about including H5Gpkg */
#define H5G_TESTING /*suppress warning about H5G testing funcs*/
+/***********/
+/* Headers */
+/***********/
#include "H5private.h" /* Generic Functions */
#include "H5Dprivate.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
@@ -29,6 +36,40 @@
#include "H5HLprivate.h" /* Local Heaps */
#include "H5Iprivate.h" /* IDs */
+/****************/
+/* Local Macros */
+/****************/
+
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+
+/********************/
+/* Package Typedefs */
+/********************/
+
+
+/********************/
+/* Local Prototypes */
+/********************/
+
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+
+/*******************/
+/* Local Variables */
+/*******************/
+
/*--------------------------------------------------------------------------
NAME
@@ -318,6 +359,68 @@ done:
/*--------------------------------------------------------------------------
NAME
+ H5G_new_dense_info_test
+ PURPOSE
+ Retrieve information about the state of the new "dense" storage for groups
+ USAGE
+ herr_t H5G_new_dense_info_test(gid, name_count, corder_count)
+ hid_t gid; IN: group to check
+ hsize_t *name_count; OUT: Number of links in name index
+ hsize_t *corder_count; OUT: Number of links in creation order index
+ RETURNS
+ Non-negative on success, negative on failure
+ DESCRIPTION
+ Currently, just retrieves the number of links in each index and returns
+ them.
+ GLOBAL VARIABLES
+ COMMENTS, BUGS, ASSUMPTIONS
+ DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING
+ EXAMPLES
+ REVISION LOG
+--------------------------------------------------------------------------*/
+herr_t
+H5G_new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count)
+{
+ H5O_linfo_t linfo; /* Link info message */
+ H5G_t *grp = NULL; /* Pointer to group */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(H5G_new_dense_info_test, FAIL)
+
+ /* Get group structure */
+ if(NULL == (grp = H5I_object_verify(gid, H5I_GROUP)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group")
+
+ /* Get the link info */
+ if(NULL == H5O_read(&(grp->oloc), H5O_LINFO_ID, 0, &linfo, H5AC_dxpl_id))
+ HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get link info")
+
+ /* Check for 'dense' link storage file addresses being defined */
+ if(!H5F_addr_defined(linfo.link_fheap_addr))
+ HGOTO_DONE(FAIL)
+ if(!H5F_addr_defined(linfo.name_bt2_addr))
+ HGOTO_DONE(FAIL)
+
+ /* Retrieve # of records in name index */
+ if(H5B2_get_nrec(grp->oloc.file, H5AC_dxpl_id, H5G_BT2_NAME, linfo.name_bt2_addr, name_count) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "unable to retrieve # of records from name index")
+
+ /* Check if there is a creation order index */
+ if(H5F_addr_defined(linfo.corder_bt2_addr)) {
+ /* Retrieve # of records in creation order index */
+ if(H5B2_get_nrec(grp->oloc.file, H5AC_dxpl_id, H5G_BT2_CORDER, linfo.corder_bt2_addr, corder_count) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "unable to retrieve # of records from creation order index")
+ } /* end if */
+ else
+ *corder_count = 0;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5G_new_dense_info_test() */
+
+
+/*--------------------------------------------------------------------------
+ NAME
H5G_lheap_size_test
PURPOSE
Determine the size of a local heap for a group