summaryrefslogtreecommitdiffstats
path: root/src/H5Ftest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Ftest.c')
-rw-r--r--src/H5Ftest.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/H5Ftest.c b/src/H5Ftest.c
index 1d7e514..8cbc133 100644
--- a/src/H5Ftest.c
+++ b/src/H5Ftest.c
@@ -32,6 +32,8 @@
#define H5F_TESTING /*suppress warning about H5F testing funcs*/
#define H5SM_PACKAGE /*suppress error about including H5SMpkg */
#define H5SM_TESTING /*suppress warning about H5SM testing funcs*/
+#define H5G_PACKAGE /*suppress error about including H5Gpkg */
+#define H5G_TESTING /*suppress warning about H5G testing funcs*/
/***********/
@@ -40,6 +42,7 @@
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fpkg.h" /* File access */
+#include "H5Gpkg.h" /* Groups */
#include "H5Iprivate.h" /* IDs */
#include "H5SMpkg.h" /* Shared object header messages */
@@ -113,3 +116,40 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_get_sohm_mesg_count_test() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5F_check_cached_stab_test
+ *
+ * Purpose: Check that a file's superblock contains a cached symbol
+ * table entry, that the entry matches that in the root
+ * group's object header, and check that the addresses are
+ * valid.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Neil Fortner
+ * Mar 31, 2009
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5F_check_cached_stab_test(hid_t file_id)
+{
+ H5F_t *file; /* File info */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT(H5F_check_cached_stab_test)
+
+ /* Check arguments */
+ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file")
+
+ /* Verify the cached stab info */
+ if(H5G_verify_cached_stab_test(H5G_oloc(file->shared->root_grp), file->shared->root_ent) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to verify cached symbol table info")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5F_check_cached_stab_test() */
+