summaryrefslogtreecommitdiffstats
path: root/src/H5Gtest.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-11-16 00:52:42 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-11-16 00:52:42 (GMT)
commite70783203ab603627147c565d0fe08ddbe103981 (patch)
treec9b996abe51516c398e16da488b226234e1a6d3b /src/H5Gtest.c
parentda16ec38eb79823243f5bcc6d70905ddfed31c53 (diff)
downloadhdf5-e70783203ab603627147c565d0fe08ddbe103981.zip
hdf5-e70783203ab603627147c565d0fe08ddbe103981.tar.gz
hdf5-e70783203ab603627147c565d0fe08ddbe103981.tar.bz2
[svn-r11732] Purpose:
More tests Description: Add more tests for proper behavior of groups with different group creation property settings. Platforms tested: FreeBSD 4.11 (sleipnir) Linux 2.4 Solaris 2.8
Diffstat (limited to 'src/H5Gtest.c')
-rw-r--r--src/H5Gtest.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/H5Gtest.c b/src/H5Gtest.c
index 6c7d3ee..73511a2 100644
--- a/src/H5Gtest.c
+++ b/src/H5Gtest.c
@@ -25,6 +25,7 @@
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Gpkg.h" /* Groups */
+#include "H5HLprivate.h" /* Local Heaps */
#include "H5Iprivate.h" /* IDs */
@@ -183,3 +184,48 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5G_has_stab_test() */
+
+/*--------------------------------------------------------------------------
+ NAME
+ H5G_lheap_size_test
+ PURPOSE
+ Determine the size of a local heap for a group
+ USAGE
+ herr_t H5G_lheap_size_test(gid, lheap_size)
+ hid_t gid; IN: group to check
+ size_t *lheap_size; OUT: Size of local heap
+ RETURNS
+ Non-negative on success, negative on failure
+ DESCRIPTION
+ Checks the size of the local heap for a group
+ GLOBAL VARIABLES
+ COMMENTS, BUGS, ASSUMPTIONS
+ DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING
+ EXAMPLES
+ REVISION LOG
+--------------------------------------------------------------------------*/
+herr_t
+H5G_lheap_size_test(hid_t gid, size_t *lheap_size)
+{
+ H5G_t *grp = NULL; /* Pointer to group */
+ H5O_stab_t stab; /* Symbol table message */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(H5G_lheap_size_test, FAIL)
+
+ /* Get group structure */
+ if(NULL == (grp = H5I_object_verify(gid, H5I_GROUP)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group")
+
+ /* Make certain the group has a symbol table message */
+ if(NULL == H5O_read(&(grp->oloc), H5O_STAB_ID, 0, &stab, H5AC_dxpl_id))
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read symbol table message")
+
+ /* Check the size of the local heap for the group */
+ if(H5HL_get_size(grp->oloc.file, H5AC_dxpl_id, stab.heap_addr, lheap_size) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't query local heap size")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5G_lheap_size_test() */
+