diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2005-11-16 00:52:42 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2005-11-16 00:52:42 (GMT) |
commit | e70783203ab603627147c565d0fe08ddbe103981 (patch) | |
tree | c9b996abe51516c398e16da488b226234e1a6d3b /src | |
parent | da16ec38eb79823243f5bcc6d70905ddfed31c53 (diff) | |
download | hdf5-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')
-rw-r--r-- | src/H5Gpkg.h | 1 | ||||
-rw-r--r-- | src/H5Gtest.c | 46 | ||||
-rw-r--r-- | src/H5Pgcpl.c | 16 |
3 files changed, 49 insertions, 14 deletions
diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index ad65fc1..80a3413 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -404,6 +404,7 @@ H5_DLL herr_t H5G_loc_remove(H5G_loc_t *grp_loc, const char *name, H5_DLL htri_t H5G_is_empty_test(hid_t gid); H5_DLL htri_t H5G_has_links_test(hid_t gid, unsigned *nmsgs); H5_DLL htri_t H5G_has_stab_test(hid_t gid); +H5_DLL herr_t H5G_lheap_size_test(hid_t gid, size_t *lheap_size); #endif /* H5G_TESTING */ #endif 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() */ + diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c index 388d453..c2a5688 100644 --- a/src/H5Pgcpl.c +++ b/src/H5Pgcpl.c @@ -30,8 +30,6 @@ * * Purpose: Set the "size hint" for creating local heaps for a group. * - * Note: XXX: Add [meaningful] tests for this routine! -QAK - * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol @@ -73,8 +71,6 @@ done: * Purpose: Returns the local heap size hint, which is used for creating * groups * - * Note: XXX: Add [meaningful] tests for this routine! -QAK - * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol @@ -118,8 +114,6 @@ done: * * Note: Currently both of these must be updated at the same time. * - * Note: XXX: Add [meaningful] tests for this routine! -QAK - * * Note: Come up with better name & description! -QAK * * Return: Non-negative on success/Negative on failure @@ -164,8 +158,6 @@ done: * Purpose: Returns the max. # of compact links & the min. # of dense * links, which are used for storing groups * - * Note: XXX: Add [meaningful] tests for this routine! -QAK - * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol @@ -211,10 +203,8 @@ done: * * Note: Currently both of these must be updated at the same time. * - * Note: EST_NUM_ENTRIES applies only when the number of entries than - * the MAX_COMPACT # of entries (from H5Pset_link_phase_change). - * - * Note: XXX: Add [meaningful] tests for this routine! -QAK + * Note: EST_NUM_ENTRIES applies only when the number of entries is less + * than the MAX_COMPACT # of entries (from H5Pset_link_phase_change). * * Note: Come up with better name & description? -QAK * @@ -260,8 +250,6 @@ done: * Purpose: Returns the est. # of links in a group & the est. length of * the name of each link. * - * Note: XXX: Add [meaningful] tests for this routine! -QAK - * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol |