summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2015-12-05 20:20:39 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2015-12-05 20:20:39 (GMT)
commitb419141463df5c7883bb1839e08c99dce582bab6 (patch)
tree7d3fd93cd9bb7465f1548e9044d652e164d14bd1 /test
parentee0ecca9d85c08fd59f93b15ad4b37be33e43a90 (diff)
downloadhdf5-b419141463df5c7883bb1839e08c99dce582bab6.zip
hdf5-b419141463df5c7883bb1839e08c99dce582bab6.tar.gz
hdf5-b419141463df5c7883bb1839e08c99dce582bab6.tar.bz2
[svn-r28518] Re-enabled the cork test and fixed it to pass on Windows.
Tested on: 64-bit Windows 10 Pro w/ VS2015 Pro & CMake 3.3.1
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt2
-rw-r--r--test/cork.c762
2 files changed, 386 insertions, 378 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 6cb1c4e..100f34f 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -210,7 +210,7 @@ set (H5_TESTS
stab
gheap
#cache_logging
- #cork
+ cork
pool
istore
bittests
diff --git a/test/cork.c b/test/cork.c
index 974270a..6478723 100644
--- a/test/cork.c
+++ b/test/cork.c
@@ -15,9 +15,9 @@
* Feb 20, 2014
*
* This file contains tests for:
- * H5Odisable_mdc_flushes()
- * H5Oenable_mdc_flushes()
- * H5Oare_mdc_flushes_disabled()
+ * H5Odisable_mdc_flushes()
+ * H5Oenable_mdc_flushes()
+ * H5Oare_mdc_flushes_disabled()
*/
#include "hdf5.h"
#include "testhdf5.h"
@@ -32,29 +32,29 @@
/* Test Defines */
/* ============ */
-#define FILENAME "test_cork.h5"
-#define ATTR "ATTR"
-#define DSET "DSET"
-#define DSET_BT1 "DSET_BT1"
-#define DSET_COMPACT "DSET_COMPACT"
-#define DSET_CONTIG "DSET_CONTIG"
-#define DSET_EA "DSET_EA"
-#define DSET_BT2 "DSET_BT2"
-#define DSET_FA "DSET_FA"
-#define DSET_NONE "DSET_NONE"
-#define GRP "GRP"
-#define GRP2 "GRP2"
-#define GRP3 "GRP3"
-#define DT "DT"
-#define DT2 "DT2"
-#define DT3 "DT3"
-#define GRP_ATTR "GRP_ATTR"
-#define DSET_ATTR "DSET_ATTR"
-#define DT_ATTR "DT_ATTR"
-
-#define RANK 2
-#define DIM0 5
-#define DIM1 10
+#define FILENAME "test_cork.h5"
+#define ATTR "ATTR"
+#define DSET "DSET"
+#define DSET_BT1 "DSET_BT1"
+#define DSET_COMPACT "DSET_COMPACT"
+#define DSET_CONTIG "DSET_CONTIG"
+#define DSET_EA "DSET_EA"
+#define DSET_BT2 "DSET_BT2"
+#define DSET_FA "DSET_FA"
+#define DSET_NONE "DSET_NONE"
+#define GRP "GRP"
+#define GRP2 "GRP2"
+#define GRP3 "GRP3"
+#define DT "DT"
+#define DT2 "DT2"
+#define DT3 "DT3"
+#define GRP_ATTR "GRP_ATTR"
+#define DSET_ATTR "DSET_ATTR"
+#define DT_ATTR "DT_ATTR"
+
+#define RANK 2
+#define DIM0 5
+#define DIM1 10
#define DIMS0 50
#define DIMS1 100
@@ -86,7 +86,7 @@ static int verify_multiple_cork(hbool_t swmr);
/*-------------------------------------------------------------------------
*
* Function: print_entry_type_to_screen
- * (copied from cache_tagging.c)
+ * (copied from cache_tagging.c)
*
* Purpose: DEBUG CODE (for when verbose is set).
*
@@ -206,7 +206,7 @@ print_entry_type_to_screen(int id)
* Function: print_index()
*
* Purpose: DEBUG CODE (for when verbose is set).
- * (copied from cache_tagging.c)
+ * (copied from cache_tagging.c)
*
* Prints cache index to screen, including address of entries,
* tag values of entries, and entry types.
@@ -264,7 +264,7 @@ error:
* Function: verify_cork_tag()
*
* Purpose: This routine verifies that all cache entries associated with
- * the object tag are marked with the desired "cork" status.
+ * the object tag are marked with the desired "cork" status.
*
* Return: 0 on Success, -1 on Failure
*
@@ -291,7 +291,7 @@ verify_cork_tag(hid_t fid, haddr_t tag, hbool_t status)
while (next_entry_ptr != NULL) {
if (next_entry_ptr->tag == tag && next_entry_ptr->is_corked != status)
- TEST_ERROR;
+ TEST_ERROR;
next_entry_ptr = next_entry_ptr->ht_next;
@@ -310,8 +310,8 @@ error:
* Function: verify_old_dset_cork
*
* Purpose: This function verifies corking operation for datasets
- * created with old library format. Cache entries associated with the
- * object tag are checked for the correct cork status.
+ * created with old library format. Cache entries associated with the
+ * object tag are checked for the correct cork status.
*
* Return: 0 on Success, 1 on Failure
*
@@ -323,24 +323,24 @@ static int
verify_old_dset_cork(void)
{
/* Variable Declarations */
- hid_t fid = -1; /* File ID */
- hid_t did = -1, did2 = -1, did3 = -1; /* Dataset IDs */
+ hid_t fid = -1; /* File ID */
+ hid_t did = -1, did2 = -1, did3 = -1; /* Dataset IDs */
hid_t dcpl = -1, dcpl2 = -1, dcpl3 = -1; /* Dataset creation property lists */
- hid_t sid = -1, sid2 = -1, sid3 = -1; /* Dataspace IDs */
- hsize_t dims[2] = {100, 20}; /* Dataset dimension sizes */
- hsize_t max_dims[2] = {100, H5S_UNLIMITED}; /* Dataset maximum dimension sizes */
- hsize_t chunk_dims[2] = {2, 5}; /* Dataset chunked dimension sizes */
- int buf[100][20]; /* Data buffer */
- int i = 0, j = 0; /* Local index variable */
- H5O_info_t oinfo, oinfo2, oinfo3; /* Object metadata information */
- hsize_t dims2[2] = {8, 16}; /* Dataset dimension sizes */
+ hid_t sid = -1, sid2 = -1, sid3 = -1; /* Dataspace IDs */
+ hsize_t dims[2] = {100, 20}; /* Dataset dimension sizes */
+ hsize_t max_dims[2] = {100, H5S_UNLIMITED}; /* Dataset maximum dimension sizes */
+ hsize_t chunk_dims[2] = {2, 5}; /* Dataset chunked dimension sizes */
+ int buf[100][20]; /* Data buffer */
+ int i = 0, j = 0; /* Local index variable */
+ H5O_info_t oinfo, oinfo2, oinfo3; /* Object metadata information */
+ hsize_t dims2[2] = {8, 16}; /* Dataset dimension sizes */
/* Testing Macro */
TESTING("cork status for datasets with old format");
/* Create the file */
if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Create dcpl */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
@@ -351,9 +351,9 @@ verify_old_dset_cork(void)
/* Create chunked dataset with v1-btree indexing: DSET_BT1 */
if((sid = H5Screate_simple(2, dims, max_dims)) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if((did = H5Dcreate2(fid, DSET_BT1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Get dataset object header address: DSET_BT1 */
if(H5Oget_info(did, &oinfo) < 0 ) TEST_ERROR;
@@ -363,7 +363,7 @@ verify_old_dset_cork(void)
/* Verify cork status */
if(verify_cork_tag(fid, oinfo.addr, TRUE) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Initialize data buffer */
for(i = 0; i < (int)dims[0]; i++) {
@@ -378,7 +378,7 @@ verify_old_dset_cork(void)
/* Verify the cork status for DSET_BT1 */
if(verify_cork_tag(fid, oinfo.addr, TRUE) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Create compact dataset: DSET_COMPACT */
if((sid2 = H5Screate_simple(2, dims2, NULL)) < 0)
@@ -400,7 +400,7 @@ verify_old_dset_cork(void)
/* Verify cork status */
if(verify_cork_tag(fid, oinfo2.addr, TRUE) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Closing */
if(H5Dclose(did) < 0 ) TEST_ERROR;
@@ -444,18 +444,18 @@ verify_old_dset_cork(void)
/* Verify the cork status for DSET_CONTIG */
if(verify_cork_tag(fid, oinfo3.addr, TRUE) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Verify the cork status for DSET_BT1 */
if(verify_cork_tag(fid, oinfo.addr, FALSE) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Un-cork the dataset: DSET_CONTIG */
if(H5Oenable_mdc_flushes(did3) < 0 ) TEST_ERROR;
/* Verify the cork status for DSET_CONTIG */
if(verify_cork_tag(fid, oinfo3.addr, FALSE) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Closing */
if(H5Dclose(did3) < 0 ) TEST_ERROR;
@@ -487,7 +487,7 @@ error:
* Function: verify_obj_dset_cork
*
* Purpose: This function verifies corking operations for dataset objects.
- * Cache entries associated with the object tag are checked
+ * Cache entries associated with the object tag are checked
* for the correct cork status.
*
* Return: 0 on Success, 1 on Failure
@@ -500,105 +500,113 @@ static int
verify_obj_dset_cork(hbool_t swmr)
{
/* Variable Declarations */
- hid_t fid = -1; /* File ID */
- hid_t fapl = -1; /* File access property list */
- hid_t aid = -1; /* Attribute ID */
- hid_t sid = -1, sid2 = -1; /* Dataspace IDs */
- hid_t did = -1, did2 = -1; /* Dataset IDs */
- hid_t oid = -1; /* Object ID */
- hid_t dcpl2; /* Dataset creation property list */
- int i = 0; /* Local index variable */
- hsize_t dim[1] = {100}; /* Dataset dimension size */
- hsize_t chunk_dim[1] = {7}; /* Dataset chunk dimension size */
- H5O_info_t oinfo, oinfo2; /* Object metadata information */
- char attrname[500]; /* Name of attribute */
- unsigned flags; /* File access flags */
+ hid_t fid = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list */
+ hid_t aid = -1; /* Attribute ID */
+ hid_t sid = -1, sid2 = -1; /* Dataspace IDs */
+ hid_t did = -1, did2 = -1; /* Dataset IDs */
+ hid_t oid = -1; /* Object ID */
+ hid_t dcpl2; /* Dataset creation property list */
+ int i = 0; /* Local index variable */
+ hsize_t dim[1] = {100}; /* Dataset dimension size */
+ hsize_t chunk_dim[1] = {7}; /* Dataset chunk dimension size */
+ H5O_info_t oinfo, oinfo2; /* Object metadata information */
+ char attrname[500]; /* Name of attribute */
+ unsigned flags; /* File access flags */
if(swmr) {
- TESTING("cork status for dataset objects with attributes (SWMR)");
+ TESTING("cork status for dataset objects with attributes (SWMR)");
} else {
- TESTING("cork status for dataset objects with attributes");
+ TESTING("cork status for dataset objects with attributes");
}
/* Create fapl */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Set to use latest format */
if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Create the file with/without SWMR access */
flags = H5F_ACC_TRUNC;
if(swmr)
- flags |= H5F_ACC_SWMR_WRITE;
+ flags |= H5F_ACC_SWMR_WRITE;
if((fid = H5Fcreate(FILENAME, flags, H5P_DEFAULT, fapl)) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Create dataspace */
- if((sid = H5Screate(H5S_SCALAR)) < 0 ) TEST_ERROR;
+ if((sid = H5Screate(H5S_SCALAR)) < 0 )
+ TEST_ERROR;
/* Create dataset: DSET */
if((did = H5Dcreate2(fid, DSET, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- TEST_ERROR;
+ TEST_ERROR;
+ /* Get dataset object header address */
+ if(H5Oget_info(did, &oinfo) < 0 )
+ TEST_ERROR;
+
/* Verify cork status of the dataset: DSET */
if(verify_cork_tag(fid, oinfo.addr, FALSE) < 0 )
- TEST_ERROR;
-
- /* Get dataset object header address */
- if(H5Oget_info(did, &oinfo) < 0 ) TEST_ERROR;
+ TEST_ERROR;
/* Cork the dataset: DSET */
- if(H5Odisable_mdc_flushes(did) < 0 ) TEST_ERROR;
+ if(H5Odisable_mdc_flushes(did) < 0 )
+ TEST_ERROR;
/* Attach and write to an attribute to the dataset: DSET */
if((aid = H5Acreate2(did, ATTR, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Verify cork status of the dataset: DSET */
if(verify_cork_tag(fid, oinfo.addr, TRUE) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Close the attribute */
if(H5Aclose(aid) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Verify cork status of the dataset: DSET */
if(verify_cork_tag(fid, oinfo.addr, TRUE) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Create dcpl */
- if((dcpl2 = H5Pcreate(H5P_DATASET_CREATE)) < 0 ) TEST_ERROR;
+ if((dcpl2 = H5Pcreate(H5P_DATASET_CREATE)) < 0 )
+ TEST_ERROR;
/* Set to early allocation for dataset space */
if(H5Pset_alloc_time(dcpl2, H5D_ALLOC_TIME_EARLY) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Create chunked dataset with implicit indexing: DSET_NONE */
- if(H5Pset_chunk(dcpl2, 1, chunk_dim) < 0) FAIL_STACK_ERROR
+ if(H5Pset_chunk(dcpl2, 1, chunk_dim) < 0)
+ FAIL_STACK_ERROR
if((sid2 = H5Screate_simple(1, dim, NULL)) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if((did2 = H5Dcreate2(fid, DSET_NONE, H5T_NATIVE_INT, sid2, H5P_DEFAULT, dcpl2, H5P_DEFAULT)) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Get dataset object header address */
- if(H5Oget_info(did2, &oinfo2) < 0 ) TEST_ERROR;
+ if(H5Oget_info(did2, &oinfo2) < 0 )
+ TEST_ERROR;
/* Cork the dataset: DSET_NONE */
- if(H5Odisable_mdc_flushes(did2) < 0 ) TEST_ERROR;
+ if(H5Odisable_mdc_flushes(did2) < 0 )
+ TEST_ERROR;
/* Attach 8 attributes to the dataset */
for(i = 0;i < 8; i++) {
sprintf(attrname, "attr %d", i);
if((aid = H5Acreate2(did2, attrname, H5T_NATIVE_UINT, sid2, H5P_DEFAULT, H5P_DEFAULT)) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
if(H5Awrite(aid, H5T_NATIVE_UINT, &i) < 0 )
- TEST_ERROR;
- if(H5Aclose(aid) < 0 ) TEST_ERROR;
+ TEST_ERROR;
+ if(H5Aclose(aid) < 0 )
+ TEST_ERROR;
} /* end for */
/* Verify cork status of the dataset: DSET_NONE */
if(verify_cork_tag(fid, oinfo2.addr, TRUE) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Closing */
if(H5Oclose(did) < 0 ) TEST_ERROR;
@@ -611,35 +619,35 @@ verify_obj_dset_cork(hbool_t swmr)
/* Re-open the file */
flags = H5F_ACC_RDWR;
if(swmr)
- flags |= H5F_ACC_SWMR_WRITE;
+ flags |= H5F_ACC_SWMR_WRITE;
if((fid = H5Fopen(FILENAME, flags, fapl)) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Open the dataset object: DSET_NONE */
if((oid = H5Oopen(fid, DSET_NONE, H5P_DEFAULT)) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Verify cork status of the dataset: DSET */
if(verify_cork_tag(fid, oinfo2.addr, FALSE) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Open the attribute attached to the dataset object: DSET_NONE */
if((aid = H5Aopen_by_idx(oid, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)4, H5P_DEFAULT, H5P_DEFAULT)) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Cork the dataset: DSET_NONE */
if(H5Odisable_mdc_flushes(oid) < 0) TEST_ERROR
/* Verify cork status of the dataset: DSET_NONE */
if(verify_cork_tag(fid, oinfo2.addr, TRUE) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Close the attribute */
if(H5Aclose(aid) < 0 ) TEST_ERROR;
/* Verify cork status of the dataset: DSET */
if(verify_cork_tag(fid, oinfo.addr, TRUE) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Closing */
if(H5Oclose(oid) < 0 ) TEST_ERROR;
@@ -669,8 +677,8 @@ error:
* Function: verify_dset_cork
*
* Purpose: This function verifies corking operations for chunked datasets
- * with different indexing types.
- * Cache entries associated with the object tag are checked
+ * with different indexing types.
+ * Cache entries associated with the object tag are checked
* for the correct cork status.
*
* Return: 0 on Success, 1 on Failure
@@ -683,44 +691,44 @@ static int
verify_dset_cork(hbool_t swmr, hbool_t new_format)
{
/* Variable Declarations */
- hid_t fid = -1; /* File ID */
- hid_t fapl = -1; /* File access property list */
- hid_t did = -1, did2 = -1, did3 = -1; /* Dataset IDs */
- hid_t dcpl = -1; /* Dataset creation property list */
- hid_t sid = -1, sid2 = -1, sid3 = -1; /* Dataspace IDs */
- hsize_t dims[2] = {100, 20}; /* Dataset dimension sizes */
- hsize_t max_dims[2] = {100, H5S_UNLIMITED}; /* Dataset maximum dimension sizes */
- hsize_t chunk_dims[2] = {2, 5}; /* Dataset chunked dimension sizes */
- int buf[100][20]; int i = 0, j = 0; /* Data buffer */
- H5O_info_t oinfo, oinfo2, oinfo3; /* Object metadata information */
- unsigned flags; /* File access flags */
+ hid_t fid = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list */
+ hid_t did = -1, did2 = -1, did3 = -1; /* Dataset IDs */
+ hid_t dcpl = -1; /* Dataset creation property list */
+ hid_t sid = -1, sid2 = -1, sid3 = -1; /* Dataspace IDs */
+ hsize_t dims[2] = {100, 20}; /* Dataset dimension sizes */
+ hsize_t max_dims[2] = {100, H5S_UNLIMITED}; /* Dataset maximum dimension sizes */
+ hsize_t chunk_dims[2] = {2, 5}; /* Dataset chunked dimension sizes */
+ int buf[100][20]; int i = 0, j = 0; /* Data buffer */
+ H5O_info_t oinfo, oinfo2, oinfo3; /* Object metadata information */
+ unsigned flags; /* File access flags */
/* Testing Macro */
if(swmr) {
- if(new_format) {
- TESTING("cork status for chunked datasets with different indexing types (SWMR & latest)");
- } else {
- TESTING("cork status for chunked datasets with different indexing types (SWMR & non-latest)");
- } /* end if */
+ if(new_format) {
+ TESTING("cork status for chunked datasets with different indexing types (SWMR & latest)");
+ } else {
+ TESTING("cork status for chunked datasets with different indexing types (SWMR & non-latest)");
+ } /* end if */
} else {
- TESTING("cork status for chunked datasets with different indexing types (non-SWMR)");
+ TESTING("cork status for chunked datasets with different indexing types (non-SWMR)");
} /* end if */
/* Create fapl */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
if(new_format) {
- /* Set to use latest format */
- if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 )
- TEST_ERROR;
+ /* Set to use latest format */
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 )
+ TEST_ERROR;
} /* end if */
/* Create the file */
flags = H5F_ACC_TRUNC;
if(swmr)
- flags |= H5F_ACC_SWMR_WRITE;
+ flags |= H5F_ACC_SWMR_WRITE;
if((fid = H5Fcreate(FILENAME, flags, H5P_DEFAULT, fapl)) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Create dcpl */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
@@ -731,9 +739,9 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
/* Create chunked dataset with extensive array indexing: DSET_EA */
if((sid = H5Screate_simple(2, dims, max_dims)) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if((did = H5Dcreate2(fid, DSET_EA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Get dataset object header address: DSET_EA */
if(H5Oget_info(did, &oinfo) < 0 ) TEST_ERROR;
@@ -743,17 +751,17 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
/* Verify cork status */
if(verify_cork_tag(fid, oinfo.addr, TRUE) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Create chunked dataset with fixed array indexing: DSET_FA */
if((sid2 = H5Screate_simple(2, dims, NULL)) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if((did2 = H5Dcreate2(fid, DSET_FA, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Get dataset object header address: DSET_FA */
if(H5Oget_info(did2, &oinfo2) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Cork the dataset: DSET_FA */
if(H5Odisable_mdc_flushes(did2) < 0 ) TEST_ERROR;
@@ -763,29 +771,29 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
/* Verify the cork status for DSET_FA */
if(verify_cork_tag(fid, oinfo2.addr, TRUE) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Verify the cork status for DSET_EA */
if(verify_cork_tag(fid, oinfo.addr, FALSE) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Create chunked dataset with v2-Btree indexing */
max_dims[0] = H5S_UNLIMITED;
if((sid3 = H5Screate_simple(2, dims, max_dims)) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if((did3 = H5Dcreate2(fid, DSET_BT2, H5T_NATIVE_INT, sid3, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Get dataset object header address: DSET_BT2 */
if(H5Oget_info(did3, &oinfo3) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Cork the dataset: DSET_BT2 */
if(H5Odisable_mdc_flushes(did3) < 0 ) TEST_ERROR;
/* Verify the cork status for DSET_BT2 */
if(verify_cork_tag(fid, oinfo3.addr, TRUE) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Closing */
if(H5Dclose(did3) < 0 ) TEST_ERROR;
@@ -803,7 +811,7 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
/* Reopen the file */
flags = H5F_ACC_RDWR;
if(swmr)
- flags |= H5F_ACC_SWMR_WRITE;
+ flags |= H5F_ACC_SWMR_WRITE;
if((fid = H5Fopen(FILENAME, flags, fapl)) < 0 ) TEST_ERROR;
/* Initialize data buffer */
@@ -820,7 +828,7 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
/* Verify the cork status for DSET_EA */
if(verify_cork_tag(fid, oinfo.addr, FALSE) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Open and write to the dataset: DSET_FA */
if((did2 = H5Dopen2(fid, DSET_FA, H5P_DEFAULT)) < 0 ) TEST_ERROR;
@@ -832,7 +840,7 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
/* Verify the cork status for DSET_FA */
if(verify_cork_tag(fid, oinfo2.addr, TRUE) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Open and write to the dataset: DSET_BT2 */
if((did3 = H5Dopen2(fid, DSET_BT2, H5P_DEFAULT)) < 0 ) TEST_ERROR;
@@ -841,14 +849,14 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
/* Verify the cork status for DSET_BT2 */
if(verify_cork_tag(fid, oinfo3.addr, FALSE) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Cork the dataset: DSET_BT2 */
if(H5Odisable_mdc_flushes(did3) < 0 ) TEST_ERROR;
/* Verify the cork status for DSET_BT2 */
if(verify_cork_tag(fid, oinfo3.addr, TRUE) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Closing */
if(H5Dclose(did) < 0 ) TEST_ERROR;
@@ -881,7 +889,7 @@ error:
* Function: verify_group_cork
*
* Purpose: This function verifies corking operations for groups.
- * Cache entries associated with the object tag are checked
+ * Cache entries associated with the object tag are checked
* for the correct cork status.
*
* Return: 0 on Success, 1 on Failure
@@ -894,44 +902,44 @@ static int
verify_group_cork(hbool_t swmr)
{
/* Variable Declarations */
- hid_t fid = -1; /* File ID */
- hid_t fapl = -1; /* File access property list */
- hid_t gid = -1, gid2 = -1, gid3 = -1; /* Group IDs */
- H5O_info_t oinfo, oinfo2, oinfo3; /* Object metadata information */
- hid_t aid; /* Attribute ID */
- hid_t sid; /* Dataspace ID */
- char attrname[500]; /* Name of attribute */
- unsigned flags; /* File access flags */
- int i = 0; /* Local index variable */
+ hid_t fid = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list */
+ hid_t gid = -1, gid2 = -1, gid3 = -1; /* Group IDs */
+ H5O_info_t oinfo, oinfo2, oinfo3; /* Object metadata information */
+ hid_t aid; /* Attribute ID */
+ hid_t sid; /* Dataspace ID */
+ char attrname[500]; /* Name of attribute */
+ unsigned flags; /* File access flags */
+ int i = 0; /* Local index variable */
/* Testing Macro */
if(swmr) {
- TESTING("cork status for groups (SWMR)");
+ TESTING("cork status for groups (SWMR)");
} else {
- TESTING("cork status for groups");
+ TESTING("cork status for groups");
}
/* Create fapl */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Set to use latest format */
if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Create the file */
flags = H5F_ACC_TRUNC;
if(swmr)
- flags |= H5F_ACC_SWMR_WRITE;
+ flags |= H5F_ACC_SWMR_WRITE;
if((fid = H5Fcreate(FILENAME, flags, H5P_DEFAULT, fapl)) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Create 3 groups */
if((gid = H5Gcreate2(fid, GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if((gid2 = H5Gcreate2(gid, GRP2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if((gid3 = H5Gcreate2(gid2, GRP3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Cork the second group: GRP2 */
if(H5Odisable_mdc_flushes(gid2) < 0) TEST_ERROR
@@ -943,22 +951,22 @@ verify_group_cork(hbool_t swmr)
/* Verify cork status of the groups */
if(verify_cork_tag(fid, oinfo.addr, FALSE) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if(verify_cork_tag(fid, oinfo2.addr, TRUE) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if(verify_cork_tag(fid, oinfo3.addr, FALSE) < 0)
- TEST_ERROR;
-
+ TEST_ERROR;
+
/* Close the second group: GRP2 */
if(H5Gclose(gid2) < 0 ) TEST_ERROR;
/* Re-open the second group: GRP2 */
if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Verify cork status of the second group: GRP2 */
if(verify_cork_tag(fid, oinfo2.addr, FALSE) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Closing */
if(H5Gclose(gid) < 0 ) TEST_ERROR;
@@ -969,15 +977,15 @@ verify_group_cork(hbool_t swmr)
/* Re-open the file and the three groups */
flags = H5F_ACC_RDWR;
if(swmr)
- flags |= H5F_ACC_SWMR_WRITE;
+ flags |= H5F_ACC_SWMR_WRITE;
if((fid = H5Fopen(FILENAME, flags, fapl)) < 0 )
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((gid = H5Gopen2(fid, GRP, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((gid3 = H5Gopen2(gid2, GRP3, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Create dataspace */
if((sid = H5Screate(H5S_SCALAR)) < 0 ) TEST_ERROR;
@@ -986,21 +994,21 @@ verify_group_cork(hbool_t swmr)
for(i = 0;i < 8; i++) {
sprintf(attrname, "attr %d", i);
if((aid = H5Acreate2(gid3, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
if(H5Awrite(aid, H5T_NATIVE_UINT, &i) < 0)
- TEST_ERROR;
- /* Cork the third group while attaching attributes */
- if(i == 3) {
- if(H5Odisable_mdc_flushes(gid3) < 0) TEST_ERROR
- if(verify_cork_tag(fid, oinfo3.addr, TRUE) < 0)
- TEST_ERROR;
- }
+ TEST_ERROR;
+ /* Cork the third group while attaching attributes */
+ if(i == 3) {
+ if(H5Odisable_mdc_flushes(gid3) < 0) TEST_ERROR
+ if(verify_cork_tag(fid, oinfo3.addr, TRUE) < 0)
+ TEST_ERROR;
+ }
if(H5Aclose(aid) < 0 ) TEST_ERROR;
} /* end for */
/* Verify cork status of the third group: GRP3 */
if(verify_cork_tag(fid, oinfo3.addr, TRUE) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Closing */
if(H5Gclose(gid) < 0) TEST_ERROR;
@@ -1015,10 +1023,10 @@ verify_group_cork(hbool_t swmr)
error:
H5E_BEGIN_TRY {
- H5Gclose(gid);
- H5Gclose(gid2);
- H5Gclose(gid3);
- H5Sclose(sid);
+ H5Gclose(gid);
+ H5Gclose(gid2);
+ H5Gclose(gid3);
+ H5Sclose(sid);
H5Pclose(fapl);
H5Fclose(fid);
} H5E_END_TRY;
@@ -1030,7 +1038,7 @@ error:
* Function: verify_named_cork
*
* Purpose: This function verifies corking operations for named datatypes.
- * Cache entries associated with the object tag are checked
+ * Cache entries associated with the object tag are checked
* for the correct cork status.
*
* Return: 0 on Success, 1 on Failure
@@ -1043,38 +1051,38 @@ static int
verify_named_cork(hbool_t swmr)
{
/* Variable Declarations */
- hid_t fid = -1; /* File ID */
- hid_t fapl = -1; /* File access property list */
- hid_t tid = -1, tid2 = -1, tid3 = -1; /* Datatype IDs */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
- H5O_info_t oinfo, oinfo2, oinfo3, oinfo4; /* Object metadata information */
- hid_t aid = -1; /* Attribute ID */
- hid_t sid; /* Dataspace ID */
- hid_t did; /* Dataset ID */
- char attrname[500]; /* Name of attribute */
- unsigned flags; /* File access flags */
- int i = 0; /* Local index variable */
+ hid_t fid = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list */
+ hid_t tid = -1, tid2 = -1, tid3 = -1; /* Datatype IDs */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
+ H5O_info_t oinfo, oinfo2, oinfo3, oinfo4; /* Object metadata information */
+ hid_t aid = -1; /* Attribute ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t did; /* Dataset ID */
+ char attrname[500]; /* Name of attribute */
+ unsigned flags; /* File access flags */
+ int i = 0; /* Local index variable */
/* Testing Macro */
if(swmr) {
- TESTING("cork status for named datatypes (SWMR)");
+ TESTING("cork status for named datatypes (SWMR)");
} else {
- TESTING("cork status for named datatypes");
+ TESTING("cork status for named datatypes");
}
/* Create fapl */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Set to use latest format */
if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Create the file */
flags = H5F_ACC_TRUNC;
if(swmr)
- flags |= H5F_ACC_SWMR_WRITE;
+ flags |= H5F_ACC_SWMR_WRITE;
if((fid = H5Fcreate(FILENAME, flags, H5P_DEFAULT, fapl)) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Create 3 copies of datatypes */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR;
@@ -1083,21 +1091,21 @@ verify_named_cork(hbool_t swmr)
/* Commit datatype /DT */
if(H5Tcommit2(fid, DT, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Create /GRP */
if((gid = H5Gcreate2(fid, GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Commit datatype /GRP/DT2 */
if(H5Tcommit2(gid, DT2, tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Create /GRP/GRP2 */
if((gid2 = H5Gcreate2(gid, GRP2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Commit datatype /GRP/GRP2/DT3 */
if(H5Tcommit2(gid2, DT3, tid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Cork 2 named datatypes: /DT and /GRP/GRP2/DT3 */
if(H5Odisable_mdc_flushes(tid) < 0) TEST_ERROR
@@ -1110,11 +1118,11 @@ verify_named_cork(hbool_t swmr)
/* Verify cork status of the named datatypes */
if(verify_cork_tag(fid, oinfo.addr, TRUE) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if(verify_cork_tag(fid, oinfo2.addr, FALSE) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if(verify_cork_tag(fid, oinfo3.addr, TRUE) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Close the datatypes */
if(H5Tclose(tid) < 0 ) TEST_ERROR;
@@ -1123,19 +1131,19 @@ verify_named_cork(hbool_t swmr)
/* Re-open the named datatypes */
if((tid = H5Topen2(fid, DT, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((tid2 = H5Topen2(gid, DT2, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((tid3 = H5Topen2(gid2, DT3, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Verify cork status of the named datatypes */
if(verify_cork_tag(fid, oinfo.addr, FALSE) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if(verify_cork_tag(fid, oinfo2.addr, FALSE) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if(verify_cork_tag(fid, oinfo3.addr, FALSE) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Closing */
if(H5Tclose(tid) < 0 ) TEST_ERROR;
@@ -1149,21 +1157,21 @@ verify_named_cork(hbool_t swmr)
/* Re-open the file and the three groups */
flags = H5F_ACC_RDWR;
if(swmr)
- flags |= H5F_ACC_SWMR_WRITE;
+ flags |= H5F_ACC_SWMR_WRITE;
if((fid = H5Fopen(FILENAME, flags, fapl)) < 0 )
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((gid = H5Gopen2(fid, GRP, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((gid2 = H5Gopen2(gid, GRP2, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Re-open the named datatypes */
if((tid = H5Topen2(fid, DT, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((tid2 = H5Topen2(gid, DT2, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((tid3 = H5Topen2(gid2, DT3, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Cork the datatype: DT2 */
if(H5Odisable_mdc_flushes(tid2) < 0) TEST_ERROR
@@ -1175,15 +1183,15 @@ verify_named_cork(hbool_t swmr)
for(i = 0;i < 8; i++) {
sprintf(attrname, "attr %d", i);
if((aid = H5Acreate2(tid3, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
if(H5Awrite(aid, H5T_NATIVE_UINT, &i) < 0)
- TEST_ERROR;
- /* Cork the datatype while attaching attributes */
- if(i == 3) {
- if(H5Odisable_mdc_flushes(tid3) < 0) TEST_ERROR
- if(verify_cork_tag(fid, oinfo3.addr, TRUE) < 0)
- TEST_ERROR;
- }
+ TEST_ERROR;
+ /* Cork the datatype while attaching attributes */
+ if(i == 3) {
+ if(H5Odisable_mdc_flushes(tid3) < 0) TEST_ERROR
+ if(verify_cork_tag(fid, oinfo3.addr, TRUE) < 0)
+ TEST_ERROR;
+ }
if(H5Aclose(aid) < 0 ) TEST_ERROR;
} /* end for */
@@ -1199,44 +1207,44 @@ verify_named_cork(hbool_t swmr)
/* Verify cork status of the datatype: DT */
if(verify_cork_tag(fid, oinfo.addr, FALSE) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Verify cork status of the datatype: DT2 */
if(verify_cork_tag(fid, oinfo2.addr, TRUE) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Verify cork status of the datatype: DT3 */
if(verify_cork_tag(fid, oinfo3.addr, TRUE) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Un-cork the datatype: DT3 */
if(H5Oenable_mdc_flushes(tid3) < 0) TEST_ERROR
/* Verify cork status of the datatype: DT3 */
if(verify_cork_tag(fid, oinfo3.addr, FALSE) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Cork the datatype: DT */
if(H5Odisable_mdc_flushes(tid) < 0) TEST_ERROR
/* Verify cork status of the datatype: DT */
if(verify_cork_tag(fid, oinfo.addr, TRUE) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Verify cork status of the datatype: DT2 */
if(verify_cork_tag(fid, oinfo2.addr, TRUE) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Verify cork status of the dataset: DSET */
if(verify_cork_tag(fid, oinfo4.addr, TRUE) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
/* Verify cork status of the datatype: DT */
if(verify_cork_tag(fid, oinfo.addr, TRUE) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Verify cork status of the dataset: DSET */
if(verify_cork_tag(fid, oinfo4.addr, FALSE) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Closing */
if(H5Tclose(tid) < 0 ) TEST_ERROR;
@@ -1253,12 +1261,12 @@ verify_named_cork(hbool_t swmr)
error:
H5E_BEGIN_TRY {
- H5Tclose(tid);
- H5Tclose(tid2);
- H5Tclose(tid3);
- H5Gclose(gid);
- H5Gclose(gid2);
- H5Dclose(did);
+ H5Tclose(tid);
+ H5Tclose(tid2);
+ H5Tclose(tid3);
+ H5Gclose(gid);
+ H5Gclose(gid2);
+ H5Dclose(did);
H5Pclose(fapl);
H5Fclose(fid);
} H5E_END_TRY;
@@ -1270,9 +1278,9 @@ error:
* Function: verify_multiple_cork
*
* Purpose: This function verifies corking operations when there are
- * multiple opens of files, objects, attributes.
- * (based on test_attr_bug5() in tattr.c)
- * Cache entries associated with the object tag are checked
+ * multiple opens of files, objects, attributes.
+ * (based on test_attr_bug5() in tattr.c)
+ * Cache entries associated with the object tag are checked
* for the correct cork status.
*
* Return: 0 on Success, 1 on Failure
@@ -1285,69 +1293,69 @@ static int
verify_multiple_cork(hbool_t swmr)
{
/* Variable Declarations */
- hid_t fid1 = -1, fid2 = -1; /* File ID */
- hid_t fapl = -1; /* File access property list */
- hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */
- hid_t gid1 = -1, gid2 = -1; /* Group IDs */
- hid_t did1 = -1, did2 = -1; /* Dataset ID */
- hid_t aidg1 = -1, aidg2 = -1; /* Attribute ID */
- hid_t aidd1 = -1, aidd2 = -1; /* Attribute ID */
- hid_t aidt1 = -1, aidt2 = -1; /* Attribute ID */
- hid_t sid = -1; /* Dataspace ID */
- H5O_info_t oinfo1, oinfo2, oinfo3; /* Object metadata information */
- hsize_t dim[1] = {5}; /* Dimension sizes */
- unsigned flags; /* File access flags */
- hbool_t corked; /* Cork status */
- herr_t ret; /* Return value */
+ hid_t fid1 = -1, fid2 = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list */
+ hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */
+ hid_t gid1 = -1, gid2 = -1; /* Group IDs */
+ hid_t did1 = -1, did2 = -1; /* Dataset ID */
+ hid_t aidg1 = -1, aidg2 = -1; /* Attribute ID */
+ hid_t aidd1 = -1, aidd2 = -1; /* Attribute ID */
+ hid_t aidt1 = -1, aidt2 = -1; /* Attribute ID */
+ hid_t sid = -1; /* Dataspace ID */
+ H5O_info_t oinfo1, oinfo2, oinfo3; /* Object metadata information */
+ hsize_t dim[1] = {5}; /* Dimension sizes */
+ unsigned flags; /* File access flags */
+ hbool_t corked; /* Cork status */
+ herr_t ret; /* Return value */
/* Testing Macro */
if(swmr) {
- TESTING("cork status for multiple opens (SWMR)");
+ TESTING("cork status for multiple opens (SWMR)");
} else {
- TESTING("cork status for multiple opens");
+ TESTING("cork status for multiple opens");
}
/* Create fapl */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0 )
- TEST_ERROR
+ TEST_ERROR
/* Set to use latest format */
if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 )
- TEST_ERROR
+ TEST_ERROR
/* Create the file */
flags = H5F_ACC_TRUNC;
if(swmr)
- flags |= H5F_ACC_SWMR_WRITE;
+ flags |= H5F_ACC_SWMR_WRITE;
if((fid1 = H5Fcreate(FILENAME, flags, H5P_DEFAULT, fapl)) < 0 )
- TEST_ERROR
+ TEST_ERROR
/* Open root group */
if((gid1 = H5Gopen2(fid1, "/", H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Create and commit datatype */
if((tid1 = H5Tcopy(H5T_STD_I32LE)) < 0)
- TEST_ERROR
+ TEST_ERROR
if(H5Tcommit2(fid1, DT, tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Create dataset */
if((sid = H5Screate_simple(1, dim, NULL)) < 0)
- TEST_ERROR
+ TEST_ERROR
if((did1 = H5Dcreate2(fid1, DSET, tid1, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Create attribute on root group */
if((aidg1 = H5Acreate2(gid1, GRP_ATTR, tid1, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Create attribute on dataset */
if((aidd1 = H5Acreate2(did1, DSET_ATTR, tid1, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Create attribute on datatype */
if((aidt1 = H5Acreate2(tid1, DT_ATTR, tid1, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Closing */
if(H5Aclose(aidt1) < 0) TEST_ERROR
@@ -1362,102 +1370,102 @@ verify_multiple_cork(hbool_t swmr)
/* Open the file twice: fid1, fid2 */
flags = H5F_ACC_RDWR;
if(swmr)
- flags |= H5F_ACC_SWMR_WRITE;
+ flags |= H5F_ACC_SWMR_WRITE;
if((fid1 = H5Fopen(FILENAME, flags, fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR
if((fid2 = H5Fopen(FILENAME, flags, fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Open the root group twice: gid1, gid2 */
if((gid1 = H5Gopen2(fid1, "/", H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
if((gid2 = H5Gopen2(fid2, "/", H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Open the root group attribute twice: aidg1, aidg2 */
if((aidg1 = H5Aopen(gid1, GRP_ATTR, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
if((aidg2 = H5Aopen(gid2, GRP_ATTR, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Cork the group: gid2 */
if(H5Odisable_mdc_flushes(gid2) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Verify cork status of the group: gid2 */
if(H5Oget_info(gid2, &oinfo1) < 0) TEST_ERROR;
if(verify_cork_tag(fid2, oinfo1.addr, TRUE) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Check cork status of the group: gid1 */
if(H5Oare_mdc_flushes_disabled(gid1, &corked) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if(!corked) TEST_ERROR
/* Open the dataset twice: did1, did2 */
if((did1 = H5Dopen2(fid1, DSET, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
if((did2 = H5Dopen2(fid2, DSET, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Open the dataset attribute twice: aidd1, aidd2 */
if((aidd1 = H5Aopen(did1, DSET_ATTR, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
if((aidd2 = H5Aopen(did2, DSET_ATTR, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Cork the dataset: did1 */
if(H5Odisable_mdc_flushes(did1) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Verify cork status of the dataset: did1 */
if(H5Oget_info(did1, &oinfo2) < 0) TEST_ERROR;
if(verify_cork_tag(fid1, oinfo2.addr, TRUE) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Check cork status of the dataset: did2 */
if(H5Oare_mdc_flushes_disabled(did2, &corked) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if(!corked) TEST_ERROR
/* Open the datatype twice: tid1, tid2 */
if((tid1 = H5Topen2(fid1, DT, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
if((tid2 = H5Topen2(fid2, DT, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Open the datatype attribute twice: aidt1, aidt2 */
if((aidt1 = H5Aopen(tid1, DT_ATTR, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
if((aidt2 = H5Aopen(tid2, DT_ATTR, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Cork the datatype: tid2 */
if(H5Odisable_mdc_flushes(tid2) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Verify cork status of the datatype: tid2 */
if(H5Oget_info(tid2, &oinfo3) < 0) TEST_ERROR;
if(verify_cork_tag(fid2, oinfo3.addr, TRUE) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Check cork status of the datatype: tid1 */
if(H5Oare_mdc_flushes_disabled(tid1, &corked) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if(!corked) TEST_ERROR
/* Uncork the group: gid1 */
if(H5Oenable_mdc_flushes(gid1) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Verify cork status of the group: gid1 */
if(H5Oget_info(gid1, &oinfo1) < 0) TEST_ERROR;
if(verify_cork_tag(fid1, oinfo1.addr, FALSE) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Check cork status of the group: gid2 */
if(H5Oare_mdc_flushes_disabled(gid2, &corked) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if(corked) TEST_ERROR
/* Close the group: gid2 */
@@ -1465,28 +1473,28 @@ verify_multiple_cork(hbool_t swmr)
/* Check cork status of the group: gid1 */
if(H5Oare_mdc_flushes_disabled(gid1, &corked) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if(corked) TEST_ERROR
/* Verify cork status of the group: gid1 */
if(verify_cork_tag(fid1, oinfo1.addr, FALSE) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Close the group: gid1 */
if(H5Gclose(gid1) < 0) TEST_ERROR
/* Uncork the dataset: gid2 */
if(H5Oenable_mdc_flushes(did2) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Verify cork status of the dataset: did2 */
if(H5Oget_info(did2, &oinfo2) < 0) TEST_ERROR;
if(verify_cork_tag(fid2, oinfo2.addr, FALSE) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Check cork status of the dataset: did1 */
if(H5Oare_mdc_flushes_disabled(did1, &corked) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if(corked) TEST_ERROR
/* Close the dataset: did2 */
@@ -1494,19 +1502,19 @@ verify_multiple_cork(hbool_t swmr)
/* Check cork status of the dataset: did1 */
if(H5Oare_mdc_flushes_disabled(did1, &corked) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if(corked) TEST_ERROR
/* Verify cork status of the dataset: did1 */
if(verify_cork_tag(fid1, oinfo2.addr, FALSE) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Close the dataset: did1 */
if(H5Dclose(did1) < 0) TEST_ERROR
/* Check cork status of the datatype: tid1 */
if(H5Oare_mdc_flushes_disabled(tid1, &corked) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if(!corked) TEST_ERROR
/* Close datatype: tid1 */
@@ -1514,7 +1522,7 @@ verify_multiple_cork(hbool_t swmr)
/* Check cork status of the datatype: tid2 */
if(H5Oare_mdc_flushes_disabled(tid2, &corked) < 0)
- TEST_ERROR;
+ TEST_ERROR;
if(!corked) TEST_ERROR
/* Close datatype: tid2 */
@@ -1522,21 +1530,21 @@ verify_multiple_cork(hbool_t swmr)
/* Should fail to cork the attribute: aidg2; not an object */
H5E_BEGIN_TRY {
- ret = H5Odisable_mdc_flushes(aidg2);
+ ret = H5Odisable_mdc_flushes(aidg2);
} H5E_END_TRY;
if(ret >= 0)
TEST_ERROR
/* Should fail to uncork the attribute: aidd1; not an object */
H5E_BEGIN_TRY {
- ret = H5Odisable_mdc_flushes(aidd1);
+ ret = H5Odisable_mdc_flushes(aidd1);
} H5E_END_TRY;
if(ret >= 0)
TEST_ERROR
/* Should fail to check cork status of the attribute: aidt2; not an object */
H5E_BEGIN_TRY {
- ret = H5Oare_mdc_flushes_disabled(aidt2, &corked);
+ ret = H5Oare_mdc_flushes_disabled(aidt2, &corked);
} H5E_END_TRY;
if(ret >= 0)
TEST_ERROR
@@ -1552,14 +1560,14 @@ verify_multiple_cork(hbool_t swmr)
/* Should fail to cork the file: fid1; not an object */
H5E_BEGIN_TRY {
ret = H5Oare_mdc_flushes_disabled(fid1, &corked);
- ret = H5Odisable_mdc_flushes(fid1);
+ ret = H5Odisable_mdc_flushes(fid1);
} H5E_END_TRY;
if(ret >= 0)
TEST_ERROR
/* Should fail to uncork the file: fid2; not an object */
H5E_BEGIN_TRY {
- ret = H5Oenable_mdc_flushes(fid2);
+ ret = H5Oenable_mdc_flushes(fid2);
} H5E_END_TRY;
if(ret >= 0)
TEST_ERROR
@@ -1574,18 +1582,18 @@ verify_multiple_cork(hbool_t swmr)
error:
H5E_BEGIN_TRY {
- H5Tclose(tid1);
- H5Tclose(tid2);
- H5Gclose(gid1);
- H5Gclose(gid2);
- H5Dclose(did1);
- H5Dclose(did2);
- H5Aclose(aidg1);
- H5Aclose(aidg2);
- H5Aclose(aidd1);
- H5Aclose(aidt1);
- H5Aclose(aidt2);
- H5Aclose(aidd2);
+ H5Tclose(tid1);
+ H5Tclose(tid2);
+ H5Gclose(gid1);
+ H5Gclose(gid2);
+ H5Dclose(did1);
+ H5Dclose(did2);
+ H5Aclose(aidg1);
+ H5Aclose(aidg2);
+ H5Aclose(aidd1);
+ H5Aclose(aidt1);
+ H5Aclose(aidt2);
+ H5Aclose(aidd2);
H5Pclose(fapl);
H5Fclose(fid1);
H5Fclose(fid1);
@@ -1597,7 +1605,7 @@ error:
* Function: test_objs_cork
*
* Purpose: This function verifies H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled public
- * routines are working as specified.
+ * routines are working as specified.
*
* Return: 0 on Success, 1 on Failure
*
@@ -1610,37 +1618,37 @@ test_objs_cork(hbool_t new_format)
{
hid_t fid; /* HDF5 File ID */
hid_t fapl; /* File access property list */
- hid_t gid, did, tid; /* Object IDs */
- hid_t sid; /* Dataspace ID */
- hid_t aid; /* Attribute ID */
- hsize_t dims[RANK]; /* Dataset dimension sizes */
- hbool_t corked; /* Cork status of an object */
+ hid_t gid, did, tid; /* Object IDs */
+ hid_t sid; /* Dataspace ID */
+ hid_t aid; /* Attribute ID */
+ hsize_t dims[RANK]; /* Dataset dimension sizes */
+ hbool_t corked; /* Cork status of an object */
herr_t ret; /* Return value */
/* Testing Macro */
if(new_format) {
- TESTING("H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled (new library format)");
+ TESTING("H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled (new library format)");
} else {
- TESTING("H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled (old library format)");
+ TESTING("H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled (old library format)");
} /* end if */
/* Create fapl */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0 )
- TEST_ERROR;
+ TEST_ERROR;
/* Set to use latest format */
if(new_format) {
- if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 )
- TEST_ERROR;
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 )
+ TEST_ERROR;
} /* end if */
/* Create an HDF5 file */
if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Create group */
if((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Check cork status of the group: not corked */
if(H5Oare_mdc_flushes_disabled(gid, &corked) < 0)
@@ -1649,7 +1657,7 @@ test_objs_cork(hbool_t new_format)
/* Cork the group: an object */
if(H5Odisable_mdc_flushes(gid) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Check cork status of the group: corked */
if(H5Oare_mdc_flushes_disabled(gid, &corked) < 0)
@@ -1658,22 +1666,22 @@ test_objs_cork(hbool_t new_format)
/* Close the group */
if(H5Gclose(gid) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Create a transient copy of a native type */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Should fail to cork the datatype: not an object */
H5E_BEGIN_TRY {
- ret = H5Odisable_mdc_flushes(tid);
+ ret = H5Odisable_mdc_flushes(tid);
} H5E_END_TRY;
if(ret >= 0)
TEST_ERROR
/* Create a named datatype */
if(H5Tcommit2(fid, "group/datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Check cork status of the named datatype: not corked */
if(H5Oare_mdc_flushes_disabled(tid, &corked) < 0)
@@ -1682,7 +1690,7 @@ test_objs_cork(hbool_t new_format)
/* Cork the named datatype: an object */
if(H5Odisable_mdc_flushes(tid) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Check cork status of the named datatype: corked */
if(H5Oare_mdc_flushes_disabled(tid, &corked) < 0)
@@ -1691,17 +1699,17 @@ test_objs_cork(hbool_t new_format)
/* Close the named datatype */
if(H5Tclose(tid) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Create dataspace */
dims[0] = DIM0;
dims[1] = DIM1;
if((sid = H5Screate_simple(RANK, dims, NULL)) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Should fail to uncork the dataspace: not an object */
H5E_BEGIN_TRY {
- ret = H5Oenable_mdc_flushes(sid);
+ ret = H5Oenable_mdc_flushes(sid);
} H5E_END_TRY;
if(ret >= 0)
TEST_ERROR
@@ -1716,7 +1724,7 @@ test_objs_cork(hbool_t new_format)
/* Should fail to check cork status of the attribute: not an object */
H5E_BEGIN_TRY {
- ret = H5Oare_mdc_flushes_disabled(aid, &corked);
+ ret = H5Oare_mdc_flushes_disabled(aid, &corked);
} H5E_END_TRY;
if(ret >= 0)
TEST_ERROR
@@ -1728,7 +1736,7 @@ test_objs_cork(hbool_t new_format)
/* Cork the dataset: an object */
if(H5Odisable_mdc_flushes(did) < 0)
- TEST_ERROR
+ TEST_ERROR
/* Check cork status of the dataset: corked */
if(H5Oare_mdc_flushes_disabled(did, &corked) < 0)
@@ -1775,7 +1783,7 @@ test_objs_cork(hbool_t new_format)
/* Should fail to un-cork the named datatype that is not corked yet */
H5E_BEGIN_TRY {
- ret = H5Oenable_mdc_flushes(tid);
+ ret = H5Oenable_mdc_flushes(tid);
} H5E_END_TRY;
if(ret >= 0)
TEST_ERROR
@@ -1831,7 +1839,7 @@ test_objs_cork(hbool_t new_format)
error:
H5E_BEGIN_TRY {
H5Sclose(sid);
- H5Aclose(aid);
+ H5Aclose(aid);
H5Dclose(did);
H5Gclose(gid);
H5Tclose(tid);
@@ -1847,7 +1855,7 @@ error:
* Function: test_dset_cork
*
* Purpose: This function verifies H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled are
- * working as specified when manipulating datasets.
+ * working as specified when manipulating datasets.
*
* Return: 0 on Success, 1 on Failure
*
@@ -1858,36 +1866,36 @@ error:
static int
test_dset_cork(hbool_t new_format)
{
- hid_t fid; /* File ID */
- hid_t fapl; /* File access property list */
- hid_t gid; /* Groupd ID */
- hid_t did1, did2; /* Dataset IDs */
- hid_t tid1, tid2; /* Datatype IDs */
- hid_t sid; /* Dataspace ID */
- hid_t dcpl; /* Dataset creation property list */
- hsize_t dims[RANK]; /* Dataset dimensions */
- hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dataset dimensions */
- hsize_t cdims[RANK] = {2,2}; /* Chunk dimensions */
- int fillval = 0; /* Fill value */
- int i, j, k = 0; /* Local index variables */
- int data[DIMS0][DIMS1]; /* Data buffer */
- int rbuf[DIMS0][DIMS1]; /* Data buffer */
- hbool_t corked; /* Cork status of an object */
+ hid_t fid; /* File ID */
+ hid_t fapl; /* File access property list */
+ hid_t gid; /* Groupd ID */
+ hid_t did1, did2; /* Dataset IDs */
+ hid_t tid1, tid2; /* Datatype IDs */
+ hid_t sid; /* Dataspace ID */
+ hid_t dcpl; /* Dataset creation property list */
+ hsize_t dims[RANK]; /* Dataset dimensions */
+ hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dataset dimensions */
+ hsize_t cdims[RANK] = {2,2}; /* Chunk dimensions */
+ int fillval = 0; /* Fill value */
+ int i, j, k = 0; /* Local index variables */
+ int data[DIMS0][DIMS1]; /* Data buffer */
+ int rbuf[DIMS0][DIMS1]; /* Data buffer */
+ hbool_t corked; /* Cork status of an object */
/* Testing Macro */
if(new_format) {
- TESTING("H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled on datasets (new library format)");
+ TESTING("H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled on datasets (new library format)");
} else {
- TESTING("H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled on datasets (old library format)");
+ TESTING("H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled on datasets (old library format)");
} /* end if */
/* Create fapl */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- TEST_ERROR;
+ TEST_ERROR;
/* Set to use latest format */
if(new_format) {
- if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 )
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 )
TEST_ERROR;
} /* end if */