summaryrefslogtreecommitdiffstats
path: root/test/cache_tagging.c
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2019-12-09 16:30:58 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2019-12-09 16:30:58 (GMT)
commitc8f533cfc33ac743227cbed8eba361c715a2976f (patch)
treebcae5320f80bac774647cacbbd8493604f9384d2 /test/cache_tagging.c
parentadcf8a315e82c0848d126e7e46b662930c081896 (diff)
downloadhdf5-c8f533cfc33ac743227cbed8eba361c715a2976f.zip
hdf5-c8f533cfc33ac743227cbed8eba361c715a2976f.tar.gz
hdf5-c8f533cfc33ac743227cbed8eba361c715a2976f.tar.bz2
Merge all of my changes from merge-back-to-feature-vfd_swmr-attempt-1,
including the merge of `hdffv/hdf5/develop`, back to the branch that Vailin and I share. Now I need to put this branch on a fork with a less confusing name than vchoi_fork!
Diffstat (limited to 'test/cache_tagging.c')
-rw-r--r--test/cache_tagging.c501
1 files changed, 320 insertions, 181 deletions
diff --git a/test/cache_tagging.c b/test/cache_tagging.c
index 0160607..7ce4e88 100644
--- a/test/cache_tagging.c
+++ b/test/cache_tagging.c
@@ -15,7 +15,7 @@
*
* This file contains tests for metadata tagging.
*/
-#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
#define H5F_TESTING
#include "H5Fpkg.h"
@@ -47,7 +47,7 @@
#define TEST_DEFAULT 0
#define TEST_SHMESG 1
#define NUM_TEST_TYPES 2
-
+
/* ===================== */
/* Function Declarations */
/* ===================== */
@@ -98,7 +98,7 @@ static unsigned check_invalid_tag_application(void);
#ifndef NDEBUG
-
+
/*-------------------------------------------------------------------------
* Function: dump_cache()
*
@@ -119,7 +119,7 @@ static int dump_cache(hid_t fid)
H5F_t *f; /* File Pointer */
/* Get Internal File / Cache Pointers */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR;
/* Dump the cache */
@@ -127,19 +127,19 @@ static int dump_cache(hid_t fid)
TEST_ERROR;
return 0;
-
+
error:
return -1;
} /* dump_cache */
#endif /* NDEBUG */ /* end debugging functions */
-
+
/*-------------------------------------------------------------------------
* Function: verify_no_unknown_tags()
*
* Purpose: Verifies that all tags in the provided cache have the
- * 'dirtied' flag set. Other verification functions in this
- * test file set this flag after checking them, so
+ * 'dirtied' flag set. Other verification functions in this
+ * test file set this flag after checking them, so
* this is handy to verify that tests have checked all entries
* in the cache.
*
@@ -159,7 +159,7 @@ verify_no_unknown_tags(hid_t fid)
int i; /* Iterator */
/* Get Internal File / Cache Pointers */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR;
cache_ptr = f->shared->cache;
@@ -181,7 +181,7 @@ error:
return -1;
} /* verify_no_unknown_tags */
-
+
/*-------------------------------------------------------------------------
* Function: mark_all_entries_investigated()
*
@@ -207,7 +207,7 @@ mark_all_entries_investigated(hid_t fid)
int i; /* Iterator */
/* Get Internal File / Cache Pointers */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR;
cache_ptr = f->shared->cache;
@@ -229,7 +229,7 @@ error:
return -1;
} /* mark_all_entries_investigated */
-
+
/*-------------------------------------------------------------------------
* Function: reset_all_entries_investigated()
*
@@ -253,7 +253,7 @@ reset_all_entries_investigated(hid_t fid)
int i; /* Iterator */
/* Get Internal File / Cache Pointers */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR;
cache_ptr = f->shared->cache;
@@ -275,15 +275,15 @@ error:
return -1;
} /* reset_all_entries_investigated */
-
+
/*-------------------------------------------------------------------------
* Function: verify_tag()
*
* Purpose: Asserts that there is an entry in the specified cache with
* the provided entry id and provided tag. The function will
- * fail if this is not the case. If found, this function will
- * set the entry's flush_marker flag, so future verification
- * attempts can skip over this entry, knowing it has already been
+ * fail if this is not the case. If found, this function will
+ * set the entry's flush_marker flag, so future verification
+ * attempts can skip over this entry, knowing it has already been
* checked.
*
* Return: 0 on Success, -1 on Failure
@@ -301,7 +301,7 @@ verify_tag(hid_t fid, int id, haddr_t tag)
int i; /* Iterator */
/* Get Internal File / Cache Pointers */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR;
cache_ptr = f->shared->cache;
@@ -327,7 +327,7 @@ verify_tag(hid_t fid, int id, haddr_t tag)
/* Didn't find the tagged entry, throw an error */
TEST_ERROR;
-
+
done:
return 0;
@@ -341,7 +341,7 @@ evict_entries(hid_t fid)
H5F_t *f; /* File Pointer */
/* Get Internal File / Cache Pointers */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR;
/* Mark all entries investigated */
@@ -358,7 +358,7 @@ error:
return -1;
} /* evict entries */
-
+
/*-------------------------------------------------------------------------
* Function: get_object_header_tag()
*
@@ -389,7 +389,7 @@ error:
return -1;
} /* get_object_header_tag */
-
+
/*-------------------------------------------------------------------------
* Function: get_sbe_tag()
*
@@ -420,7 +420,7 @@ error:
/* Test Functions */
/* ============== */
-
+
/*-------------------------------------------------------------------------
* Function: check_file_creation_tags
*
@@ -434,20 +434,26 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_file_creation_tags(hid_t fcpl_id, int type)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
int verbose = FALSE; /* verbose test outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t sbe_tag = 0;
/* Testing Macro */
TESTING("tag application during file creation");
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
#ifndef NDEBUG
/* if verbose, print cache index to screen before verification . */
@@ -501,7 +507,7 @@ error:
return 1;
} /* check_file_creation_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_file_open_tags
*
@@ -515,12 +521,13 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_file_open_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
int verbose = FALSE; /* verbose file outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag; /* Root Group Tag */
haddr_t sbe_tag; /* Sblock Extension Tag */
@@ -531,20 +538,25 @@ check_file_open_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
/* Retrieve various tags */
if ( type == TEST_SHMESG ) {
-
+
/* determine tag value of superblock extension object header */
if ( get_sbe_tag(fid, &sbe_tag) < 0 ) TEST_ERROR;
} /* end if */
-
+
/* Close the file */
if ( H5Fclose(fid) < 0 ) TEST_ERROR;
@@ -607,7 +619,7 @@ error:
return 1;
} /* check_file_open_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_group_creation_tags
*
@@ -621,25 +633,31 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_group_creation_tags(void)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
int verbose = FALSE; /* verbose file outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = HADDR_UNDEF; /* Root Group Tag */
haddr_t g_tag; /* Group Tag */
/* Testing Macro */
TESTING("tag application during group creation");
-
+
/* ===== */
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -665,7 +683,7 @@ check_group_creation_tags(void)
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
#endif /* NDEBUG */ /* end debugging functions */
-
+
/* Verify root group's tagged metadata */
if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR;
if ( verify_tag(fid, H5AC_SNODE_ID, root_tag) < 0 ) TEST_ERROR;
@@ -702,7 +720,7 @@ error:
return 1;
} /* check_group_creation_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_multi_group_creation_tags
*
@@ -716,14 +734,14 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_multi_group_creation_tags(void)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
int verbose = FALSE; /* verbose file outout */
- char gname[10]; /* group name buffer */
+ char gname[16]; /* group name buffer */
int i = 0; /* iterator */
hid_t fapl = -1; /* File access prop list */
haddr_t g_tag = 0; /* Group tag value */
@@ -733,7 +751,7 @@ check_multi_group_creation_tags(void)
TESTING("tag application during multiple group creation");
/* Create Fapl */
- if ( (fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Set latest version of library */
if ( H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) TEST_ERROR;
@@ -756,7 +774,7 @@ check_multi_group_creation_tags(void)
for (i = 0; i < MULTIGROUPS; i++) {
- sprintf(gname, "%d", i);
+ HDsprintf(gname, "%d", i);
if ( (gid = H5Gcreate2(fid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
if ( H5Gclose(gid) < 0 ) TEST_ERROR;
@@ -775,7 +793,7 @@ check_multi_group_creation_tags(void)
for (i = 0; i < MULTIGROUPS; i++) {
/* Re-open the group */
- sprintf(gname, "%d", i);
+ HDsprintf(gname, "%d", i);
if ( (gid = H5Gopen2(fid, gname, H5P_DEFAULT)) < 0 ) TEST_ERROR;
/* Verify object header for root group */
@@ -816,6 +834,7 @@ check_multi_group_creation_tags(void)
/* Close open objects and file */
/* =========================== */
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
if ( H5Fclose(fid) < 0 ) TEST_ERROR;
/* ========================================== */
@@ -829,7 +848,7 @@ error:
return 1;
} /* check_multi_group_creation_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_link_iteration_tags
*
@@ -843,7 +862,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_link_iteration_tags(void)
{
/* Variable Declarations */
@@ -855,15 +874,21 @@ check_link_iteration_tags(void)
haddr_t root_tag = 0; /* Root Group Tag Value */
char dsetname[500]; /* Name of dataset */
H5G_info_t ginfo; /* Group Info Struct */
+ hid_t fapl = -1; /* File access prop list */
hid_t root_group = -1; /* Root Group Identifier */
/* Testing Macro */
TESTING("tag application during iteration over links in a group");
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* =========== */
/* Create File */
/* =========== */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* Get root group tag */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -874,7 +899,7 @@ check_link_iteration_tags(void)
/* Create many datasets in root group */
for (i=0;i<500;i++) {
- sprintf(dsetname, "Dset %d", i);
+ HDsprintf(dsetname, "Dset %d", i);
if ( (did = H5Dcreate2(fid, dsetname, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
if ( H5Dclose(did) < 0 ) TEST_ERROR;
}
@@ -941,7 +966,7 @@ error:
return 1;
} /* check_link_iteration_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dense_attribute_tags
*
@@ -955,7 +980,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dense_attribute_tags(void)
{
/* Variable Declarations */
@@ -969,13 +994,13 @@ check_dense_attribute_tags(void)
hid_t fapl = -1; /* File access property list */
haddr_t d_tag = 0; /* Dataset tag value */
haddr_t root_tag = 0; /* Root group tag value */
- char attrname[500]; /* Name of attribute */
+ char attrname[500]; /* Name of attribute */
/* Testing Macro */
TESTING("tag application during dense attribute manipulation");
/* Create Fapl */
- if ( (fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
if ( H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) TEST_ERROR;
/* Create Dcpl */
@@ -986,6 +1011,8 @@ check_dense_attribute_tags(void)
/* =========== */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
+
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -995,10 +1022,10 @@ check_dense_attribute_tags(void)
/* Create dataset */
if ( (did = H5Dcreate2(fid, DATASETNAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
if ( H5Pclose(dcpl) < 0 ) TEST_ERROR;
-
+
/* get dataset object header */
if ( get_object_header_tag(did, &d_tag) < 0 ) TEST_ERROR;
-
+
/* Clear Metadata Tags (don't care about them for this test */
mark_all_entries_investigated(fid);
@@ -1008,7 +1035,7 @@ check_dense_attribute_tags(void)
for (i=0;i<50;i++) {
- sprintf(attrname, "attr %d", i);
+ HDsprintf(attrname, "attr %d", i);
if ( (aid = H5Acreate2(did, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
if ( H5Awrite(aid, H5T_NATIVE_UINT, &i) < 0 ) TEST_ERROR;
if ( H5Aclose(aid) < 0 ) TEST_ERROR;
@@ -1124,7 +1151,7 @@ error:
return 1;
} /* check_dense_attribute_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_group_open_tags
*
@@ -1138,25 +1165,31 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_group_open_tags(void)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
int verbose = FALSE; /* verbose file output */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = HADDR_UNDEF;
haddr_t g_tag;
/* Testing Macro */
TESTING("tag application during group open");
-
+
/* ===== */
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1225,7 +1258,7 @@ error:
return 1;
} /* check_group_open_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_attribute_creation_tags
*
@@ -1239,7 +1272,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_attribute_creation_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@@ -1248,6 +1281,7 @@ check_attribute_creation_tags(hid_t fcpl, int type)
hid_t gid = -1; /* Group Identifier */
hid_t sid = -1; /* Dataspace Identifier */
int verbose = FALSE; /* verbose file outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0; /* Root group tag */
haddr_t g_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1260,8 +1294,11 @@ check_attribute_creation_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1312,7 +1349,7 @@ check_attribute_creation_tags(hid_t fcpl, int type)
/* verify shared message index tagged with sohm */
if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
if ( verify_tag(fid, H5AC_SOHM_TABLE_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
-
+
/* verify fractal heap header belonging to group */
if ( verify_tag(fid, H5AC_FHEAP_HDR_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
@@ -1331,7 +1368,7 @@ check_attribute_creation_tags(hid_t fcpl, int type)
/* verify no other entries present */
if ( verify_no_unknown_tags(fid) < 0 ) TEST_ERROR;
-
+
/* Reset the changes we've made to the cache's data structures */
if(reset_all_entries_investigated(fid) < 0) TEST_ERROR;
@@ -1341,6 +1378,7 @@ check_attribute_creation_tags(hid_t fcpl, int type)
if ( H5Aclose(aid) < 0 ) TEST_ERROR;
if ( H5Gclose(gid) < 0 ) TEST_ERROR;
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
if ( H5Fclose(fid) < 0 ) TEST_ERROR;
/* ========================================== */
@@ -1354,7 +1392,7 @@ error:
return 1;
} /* check_attribute_creation_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_attribute_open_tags
*
@@ -1368,7 +1406,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_attribute_open_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@@ -1377,6 +1415,7 @@ check_attribute_open_tags(hid_t fcpl, int type)
hid_t gid = -1; /* Group Identifier */
hid_t sid = -1; /* Dataspace Identifier */
int verbose = FALSE; /* verbose file outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t g_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1389,8 +1428,13 @@ check_attribute_open_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1439,7 +1483,7 @@ check_attribute_open_tags(hid_t fcpl, int type)
/* verify object header chunk belonging to group */
if ( verify_tag(fid, H5AC_OHDR_CHK_ID, g_tag) < 0 ) TEST_ERROR;
-
+
if ( type == TEST_SHMESG ) {
/* verify (another) object header chunk belonging to group */
@@ -1485,7 +1529,7 @@ error:
return 1;
} /* check_attribute_open_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_attribute_rename_tags
*
@@ -1499,7 +1543,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_attribute_rename_tags(hid_t fcpl, int type)
{
/* Variable declarations */
@@ -1510,6 +1554,7 @@ check_attribute_rename_tags(hid_t fcpl, int type)
int verbose = FALSE; /* verbose file outout */
int *data = NULL; /* data buffer */
int i,j,k = 0; /* iterators */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t g_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1530,8 +1575,13 @@ check_attribute_rename_tags(hid_t fcpl, int type)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1547,7 +1597,7 @@ check_attribute_rename_tags(hid_t fcpl, int type)
/* Create attribute */
if ( (aid = H5Acreate2(gid, ATTRNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
-
+
/* fill out data buffer */
for(i = 0; i < DIMS; i++)
for(j = 0; j < DIMS; j++)
@@ -1613,22 +1663,12 @@ check_attribute_rename_tags(hid_t fcpl, int type)
/* verify shared header message stored as a list */
if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
- /*
- * 3 calls to verify_tag() for verifying free space:
- * one freespace header tag for H5FD_MEM_DRAW manager,
- * one freespace header tag for H5FD_MEM_SUPER manager
- * one freespace section info tag for H5FD_MEM_SUPER manager
+ /*
+ * one freespace header tag for H5FD_MEM_DRAW manager,
+ * one freespace header tag for H5FD_MEM_SUPER manager
*/
if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) TEST_ERROR;
-
- /* If the free space managers are persistent, the
- * H5MF_tidy_self_referential_fsm_hack() must have been run.
- * Since this function floats all self referential free space
- * managers, the H5FD_MEM_SUPER FSM will not be in the metadata
- * cache.
- */
- if(!persistent_fsms && verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0) TEST_ERROR;
- if(!persistent_fsms && verify_tag(fid, H5AC_FSPACE_SINFO_ID, H5AC__FREESPACE_TAG) < 0) TEST_ERROR;
+ if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) TEST_ERROR;
/* verify btree header and leaf node belonging to group */
if ( verify_tag(fid, H5AC_BT2_HDR_ID, g_tag) < 0 ) TEST_ERROR;
@@ -1664,7 +1704,7 @@ error:
return 1;
} /* check_attribute_rename_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_attribute_delete_tags
*
@@ -1678,7 +1718,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_attribute_delete_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@@ -1689,6 +1729,7 @@ check_attribute_delete_tags(hid_t fcpl, int type)
int verbose = FALSE; /* verbose file outout */
int *data = NULL; /* data buffer */
int i,j,k = 0; /* iterators */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t g_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1709,8 +1750,13 @@ check_attribute_delete_tags(hid_t fcpl, int type)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1726,7 +1772,7 @@ check_attribute_delete_tags(hid_t fcpl, int type)
/* Create attribute */
if ( (aid = H5Acreate2(gid, ATTRNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
-
+
/* fill out data buffer */
for(i = 0;i < DIMS; i++)
for(j = 0;j < DIMS; j++)
@@ -1764,30 +1810,33 @@ check_attribute_delete_tags(hid_t fcpl, int type)
/* verify object header belonging to group */
if ( verify_tag(fid, H5AC_OHDR_ID, g_tag) < 0 ) TEST_ERROR;
-
+
if ( type == TEST_SHMESG ) {
/* verify shared header message master table */
if ( verify_tag(fid, H5AC_SOHM_TABLE_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
- /*
- * 2 calls to verify_tag() for verifying free space:
- * one freespace header tag for free-space header,
- * one freespace header tag for free-space section info
+ /*
+ * 2 calls to verify_tag() for verifying free space:
+ * one freespace header tag for free-space header raw data
+ * one freespace header tag for free-space section info raw data
+ * one freespace header tag for free-space header metadata
*/
- if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 )
+ if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 )
+ TEST_ERROR;
+ if ( verify_tag(fid, H5AC_FSPACE_SINFO_ID, H5AC__FREESPACE_TAG) < 0 )
TEST_ERROR;
- if ( verify_tag(fid, H5AC_FSPACE_SINFO_ID, H5AC__FREESPACE_TAG) < 0 )
+ if ( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 )
TEST_ERROR;
#if 0
- /* If the free space managers are persistent, the
+ /* If the free space managers are persistent, the
* H5MF_tidy_self_referential_fsm_hack() must have been run.
- * Since this function floats all self referential free space
- * managers, the H5FD_MEM_SUPER FSM will not be in the metadata
+ * Since this function floats all self referential free space
+ * managers, the H5FD_MEM_SUPER FSM will not be in the metadata
* cache.
*/
- if ( ( ! persistent_fsms ) &&
+ if ( ( ! persistent_fsms ) &&
( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) )
TEST_ERROR;
#endif
@@ -1822,7 +1871,7 @@ error:
return 1;
} /* check_attribute_delete_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_creation_tags
*
@@ -1836,7 +1885,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_creation_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@@ -1847,6 +1896,7 @@ check_dataset_creation_tags(hid_t fcpl, int type)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1859,7 +1909,12 @@ check_dataset_creation_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1874,10 +1929,10 @@ check_dataset_creation_tags(hid_t fcpl, int type)
/* ============================ */
/* Create Dataset in Root Group */
/* ============================ */
-
+
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -1919,7 +1974,7 @@ check_dataset_creation_tags(hid_t fcpl, int type)
/* Verify dataset's tagged metadata */
if ( verify_tag(fid, H5AC_FHEAP_HDR_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
-
+
/* Verify shared object header message tags */
if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
@@ -1949,7 +2004,7 @@ error:
return 1;
} /* check_dataset_creation_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_creation_earlyalloc_tags
*
@@ -1963,7 +2018,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@@ -1974,6 +2029,7 @@ check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1987,7 +2043,12 @@ check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -2046,7 +2107,7 @@ check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type)
/* Verify dataset's tagged metadata */
if ( verify_tag(fid, H5AC_FHEAP_HDR_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
-
+
/* Verify shared object header message tags */
if ( verify_tag(fid, H5AC_SOHM_LIST_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
@@ -2080,7 +2141,7 @@ error:
return 1;
} /* check_dataset_creation_earlyalloc_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_open_tags
*
@@ -2094,7 +2155,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_open_tags(void)
{
/* Variable Declarations */
@@ -2105,6 +2166,7 @@ check_dataset_open_tags(void)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2117,15 +2179,20 @@ check_dataset_open_tags(void)
/* Open File */
/* ========= */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -2155,7 +2222,7 @@ check_dataset_open_tags(void)
/* ========================== */
/* Open Dataset in Root Group */
/* ========================== */
-
+
if (( did = H5Dopen2(fid, DATASETNAME, H5P_DEFAULT)) < 0 ) TEST_ERROR;
/* =================================== */
@@ -2200,7 +2267,7 @@ error:
return 1;
} /* check_dataset_open_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_write_tags
*
@@ -2214,7 +2281,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_write_tags(void)
{
/* Variable Declarations */
@@ -2225,6 +2292,7 @@ check_dataset_write_tags(void)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2242,15 +2310,20 @@ check_dataset_write_tags(void)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -2299,7 +2372,7 @@ check_dataset_write_tags(void)
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
#endif /* NDEBUG */ /* end debugging functions */
-
+
/* Verify 10 b-tree nodes belonging to dataset */
for (i=0; i<10; i++)
if ( verify_tag(fid, H5AC_BT_ID, d_tag) < 0 ) TEST_ERROR;
@@ -2335,7 +2408,7 @@ error:
return 1;
} /* check_dataset_write_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_attribute_write_tags
*
@@ -2349,7 +2422,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_attribute_write_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@@ -2360,6 +2433,7 @@ check_attribute_write_tags(hid_t fcpl, int type)
int verbose = FALSE; /* verbose file outout */
int *data = NULL; /* data buffer */
int i,j,k = 0; /* iterators */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t g_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2375,8 +2449,13 @@ check_attribute_write_tags(hid_t fcpl, int type)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -2424,7 +2503,7 @@ check_attribute_write_tags(hid_t fcpl, int type)
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
#endif /* NDEBUG */ /* end debugging functions */
-
+
/* Verify object header of group */
if ( verify_tag(fid, H5AC_OHDR_ID, g_tag) < 0 ) TEST_ERROR;
@@ -2483,7 +2562,7 @@ error:
return 1;
} /* check_attribute_write_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_read_tags
*
@@ -2497,7 +2576,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_read_tags(void)
{
/* Variable Declarations */
@@ -2508,6 +2587,7 @@ check_dataset_read_tags(void)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2525,15 +2605,20 @@ check_dataset_read_tags(void)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -2581,7 +2666,7 @@ check_dataset_read_tags(void)
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
#endif /* NDEBUG */ /* end debugging functions */
-
+
/* Verify 19 b-tree nodes belonging to dataset */
for (i=0; i<19; i++)
if ( verify_tag(fid, H5AC_BT_ID, d_tag) < 0 ) TEST_ERROR;
@@ -2614,7 +2699,7 @@ error:
return 1;
} /* check_dataset_read_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_size_retrieval
*
@@ -2628,7 +2713,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_size_retrieval(void)
{
/* Variable Declarations */
@@ -2639,6 +2724,7 @@ check_dataset_size_retrieval(void)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2657,15 +2743,20 @@ check_dataset_size_retrieval(void)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -2746,7 +2837,7 @@ error:
return 1;
} /* check_dataset_size_retrieval */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_extend_tags
*
@@ -2760,7 +2851,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_extend_tags(void)
{
@@ -2772,6 +2863,7 @@ check_dataset_extend_tags(void)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2790,15 +2882,20 @@ check_dataset_extend_tags(void)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -2879,7 +2976,7 @@ error:
return 1;
} /* check_dataset_extend_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_object_info_tags
*
@@ -2893,16 +2990,17 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_object_info_tags(void)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
int verbose = FALSE; /* verbose file output */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = HADDR_UNDEF;
haddr_t g_tag;
- H5O_info_t oinfo; /* Object info struct */
+ H5O_info_t oinfo; /* Object info struct */
/* Testing Macro */
TESTING("tag application during object info retrieval");
@@ -2911,8 +3009,13 @@ check_object_info_tags(void)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -2982,7 +3085,7 @@ error:
return 1;
} /* check_object_info_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_object_copy_tags
*
@@ -2996,13 +3099,14 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_object_copy_tags(void)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
int verbose = FALSE; /* verbose file output */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = HADDR_UNDEF;
haddr_t g_tag;
haddr_t copy_tag;
@@ -3014,8 +3118,13 @@ check_object_copy_tags(void)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -3046,7 +3155,7 @@ check_object_copy_tags(void)
if ( (gid = H5Gopen2(fid, GROUPNAMECOPY, H5P_DEFAULT)) < 0 ) TEST_ERROR;
if ( get_object_header_tag(gid, &copy_tag) < 0 ) TEST_ERROR;
if (H5Gclose(gid) < 0) TEST_ERROR;
-
+
/* =================================== */
/* Verification of Metadata Tag Values */
/* =================================== */
@@ -3095,7 +3204,7 @@ error:
return 1;
} /* check_object_copy_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_link_removal_tags
*
@@ -3109,7 +3218,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_link_removal_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@@ -3121,6 +3230,7 @@ check_link_removal_tags(hid_t fcpl, int type)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
haddr_t g_tag = 0;
@@ -3139,8 +3249,13 @@ check_link_removal_tags(hid_t fcpl, int type)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -3156,7 +3271,7 @@ check_link_removal_tags(hid_t fcpl, int type)
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -3219,7 +3334,7 @@ check_link_removal_tags(hid_t fcpl, int type)
if ( verify_tag(fid, H5AC_SOHM_TABLE_ID, H5AC__SOHM_TAG) < 0 ) TEST_ERROR;
} /* end if */
-
+
/* verify no other entries present */
if ( verify_no_unknown_tags(fid) < 0 ) TEST_ERROR;
@@ -3247,7 +3362,7 @@ error:
return 1;
} /* check_link_removal_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_link_getname_tags
*
@@ -3261,7 +3376,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_link_getname_tags(void)
{
/* Variable Declarations */
@@ -3274,6 +3389,7 @@ check_link_getname_tags(void)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
haddr_t g_tag = 0;
@@ -3292,8 +3408,13 @@ check_link_getname_tags(void)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -3309,7 +3430,7 @@ check_link_getname_tags(void)
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -3392,7 +3513,7 @@ error:
return 1;
} /* check_link_getname_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_external_link_creation_tags
*
@@ -3406,7 +3527,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_external_link_creation_tags(void)
{
/* Variable Declarations */
@@ -3414,6 +3535,7 @@ check_external_link_creation_tags(void)
hid_t fid2 = -1; /* File Identifier */
hid_t gid = -1; /* Dataspace Identifier */
int verbose = FALSE; /* verbose file outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
/* Testing Macro */
@@ -3423,21 +3545,26 @@ check_external_link_creation_tags(void)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
/* Close and Reopen the file */
if ( H5Fclose(fid) < 0 ) TEST_ERROR;
- if ( (fid = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl)) < 0 ) TEST_ERROR;
/* Evict as much as we can from the cache so we can track full tag path */
if ( evict_entries(fid) < 0 ) TEST_ERROR;
/* Create a second file */
- if ( (fid2 = H5Fcreate(FILENAME2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid2 = H5Fcreate(FILENAME2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* Create group in second file */
if ( (gid = H5Gcreate2(fid2, GROUPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
@@ -3449,7 +3576,7 @@ check_external_link_creation_tags(void)
/* ==================== */
/* Create External Link */
/* ==================== */
-
+
if (H5Lcreate_external(FILENAME2, GROUPNAMEPATH, fid, LINKNAME, H5P_DEFAULT, H5P_DEFAULT) < 0 ) TEST_ERROR;
/* =================================== */
@@ -3460,7 +3587,7 @@ check_external_link_creation_tags(void)
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
#endif /* NDEBUG */ /* end debugging functions */
-
+
/* Verify root group metadata */
if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR;
if ( verify_tag(fid, H5AC_OHDR_CHK_ID, root_tag) < 0 ) TEST_ERROR;
@@ -3490,7 +3617,7 @@ error:
return 1;
} /* check_external_link_creation_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_external_link_open_tags
*
@@ -3504,7 +3631,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_external_link_open_tags(void)
{
/* Variable Declarations */
@@ -3514,6 +3641,7 @@ check_external_link_open_tags(void)
hid_t gid = -1; /* Dataspace Identifier */
hid_t xid = -1; /* Dataspace Identifier */
int verbose = FALSE; /* verbose file outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t root2_tag = 0;
@@ -3524,14 +3652,17 @@ check_external_link_open_tags(void)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
/* Create a second file */
- if ( (fid2 = H5Fcreate(FILENAME2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid2 = H5Fcreate(FILENAME2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid2, &root2_tag) < 0 ) TEST_ERROR;
@@ -3548,7 +3679,9 @@ check_external_link_open_tags(void)
/* Close and Reopen the file */
if ( H5Fclose(fid) < 0 ) TEST_ERROR;
- if ( (fid = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* Evict as much as we can from the cache so we can track full tag path */
if ( evict_entries(fid) < 0 ) TEST_ERROR;
@@ -3556,11 +3689,11 @@ check_external_link_open_tags(void)
/* ================== */
/* Open External Link */
/* ================== */
-
+
if ( (xid = H5Gopen2(fid, LINKNAME, H5P_DEFAULT)) < 0 ) TEST_ERROR;
if ( (fid2 = H5Iget_file_id(xid)) < 0) TEST_ERROR;
if ( get_object_header_tag(xid, &link_tag) < 0 ) TEST_ERROR;
-
+
/* =================================== */
/* Verification of Metadata Tag Values */
/* =================================== */
@@ -3614,12 +3747,12 @@ error:
return 1;
} /* check_external_link_open_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_invalid_tag_application
*
* Purpose: This function verifies that an error occurs if a tag
- * has not been set up during a protect or set of
+ * has not been set up during a protect or set of
* a new piece of metadata.
*
* Return: 0 on Success, 1 on Failure
@@ -3638,22 +3771,28 @@ check_invalid_tag_application(void)
hid_t fid = -1;
haddr_t addr;
H5HL_t * lheap = NULL;
+ hid_t fapl = -1; /* File access prop list */
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
#endif /* H5C_DO_TAGGING_SANITY_CHECKS */
/* Testing Macro */
TESTING("failure on invalid tag application");
-
+
#if H5C_DO_TAGGING_SANITY_CHECKS
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* Push API context */
if(H5CX_push() < 0) TEST_ERROR
api_ctx_pushed = TRUE;
/* Get internal file pointer*/
- if ( NULL == (f = (H5F_t *)H5I_object(fid)) ) TEST_ERROR;
+ if ( NULL == (f = (H5F_t *)H5VL_object(fid)) ) TEST_ERROR;
/* Call H5HL_create, an internal function that calls H5AC_insert_entry without setting up a tag */
/* Ensure this returns FAILURE, as a tag has not been set up. */
@@ -3705,7 +3844,7 @@ error:
return 1;
} /* check_invalid_tag_application */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -3718,8 +3857,8 @@ error:
*
*-------------------------------------------------------------------------
*/
-int
-main(void)
+int
+main(void)
{
/* Variable Declarations */
hid_t fcpl_default = -1; /* file creation prop list */
@@ -3727,13 +3866,13 @@ main(void)
hid_t fcpl = -1; /* file creation prop list */
unsigned nerrs = 0; /* Error Encountered */
int test_type = 0; /* test type iterator */
-
+
/* Open the HDF5 Library */
H5open();
-
- /* ========== */
+
+ /* ========== */
/* Test Setup */
- /* ========== */
+ /* ========== */
/* Create a standard file creation property list */
fcpl_default = H5Pcreate(H5P_FILE_CREATE);
@@ -3749,13 +3888,13 @@ main(void)
/* ========= */
for (test_type=0; test_type<NUM_TEST_TYPES; test_type++) {
-
+
/* Run tests on each fcpl set up above. */
if (test_type == TEST_DEFAULT) {
if (!nerrs) HDprintf("Testing standard tag application cases w/ default fcpl:\n");
fcpl = fcpl_default;
-
+
} else if (test_type == TEST_SHMESG) {
if (!nerrs) HDprintf("Testing standard tag application cases w/ shared messages:\n");
@@ -3792,7 +3931,7 @@ main(void)
if (!nerrs) nerrs += check_link_getname_tags();
if (!nerrs) nerrs += check_external_link_creation_tags();
if (!nerrs) nerrs += check_external_link_open_tags();
-
+
if (!nerrs) nerrs += check_dense_attribute_tags();
if (!nerrs) nerrs += check_link_iteration_tags();
if (!nerrs) nerrs += check_invalid_tag_application();