diff options
author | Quincey Koziol <koziol@koziol.gov> | 2019-04-05 15:35:38 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@koziol.gov> | 2019-04-05 15:35:38 (GMT) |
commit | ef7f3ef1773a62b12ca94b1ce9bb9895f849dbd1 (patch) | |
tree | 30f7d1d602d7bb2100397b20c7bcccfa377e8b62 | |
parent | dde0a1c93ab7e183c575b284a9b8f65555818132 (diff) | |
parent | 9e934e75fa9a66bdd95fd3656ca0c19f910123c7 (diff) | |
download | hdf5-ef7f3ef1773a62b12ca94b1ce9bb9895f849dbd1.zip hdf5-ef7f3ef1773a62b12ca94b1ce9bb9895f849dbd1.tar.gz hdf5-ef7f3ef1773a62b12ca94b1ce9bb9895f849dbd1.tar.bz2 |
Merge remote-tracking branch 'origin/develop' into merge_hyperslab_update_01
-rw-r--r-- | java/src/hdf/hdf5lib/HDF5Constants.java | 3 | ||||
-rw-r--r-- | java/src/jni/h5Constants.c | 2 | ||||
-rw-r--r-- | java/test/TestH5P.java | 2 | ||||
-rw-r--r-- | src/H5Aint.c | 1 | ||||
-rw-r--r-- | src/H5CX.c | 119 | ||||
-rw-r--r-- | src/H5CXprivate.h | 4 | ||||
-rw-r--r-- | src/H5Dlayout.c | 1 | ||||
-rw-r--r-- | src/H5Fint.c | 2 | ||||
-rw-r--r-- | src/H5Fpublic.h | 5 | ||||
-rw-r--r-- | src/H5Fsuper.c | 1 | ||||
-rw-r--r-- | src/H5Ofill.c | 1 | ||||
-rw-r--r-- | src/H5Oint.c | 1 | ||||
-rw-r--r-- | src/H5Opline.c | 1 | ||||
-rw-r--r-- | src/H5S.c | 1 | ||||
-rw-r--r-- | src/H5T.c | 1 | ||||
-rw-r--r-- | src/H5trace.c | 6 | ||||
-rw-r--r-- | test/dsets.c | 2 | ||||
-rw-r--r-- | test/h5test.c | 25 | ||||
-rw-r--r-- | test/h5test.h | 1 | ||||
-rw-r--r-- | test/ohdr.c | 51 | ||||
-rw-r--r-- | test/tfile.c | 52 | ||||
-rw-r--r-- | test/trefer.c | 226 |
22 files changed, 338 insertions, 170 deletions
diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index a0c2ed6..9294bad 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -216,6 +216,7 @@ public class HDF5Constants { public static final int H5F_LIBVER_EARLIEST = H5F_LIBVER_EARLIEST(); public static final int H5F_LIBVER_V18 = H5F_LIBVER_V18(); public static final int H5F_LIBVER_V110 = H5F_LIBVER_V110(); + public static final int H5F_LIBVER_V112 = H5F_LIBVER_V112(); public static final int H5F_LIBVER_NBOUNDS = H5F_LIBVER_NBOUNDS(); public static final int H5F_LIBVER_LATEST = H5F_LIBVER_LATEST(); public static final int H5F_OBJ_ALL = H5F_OBJ_ALL(); @@ -1049,6 +1050,8 @@ public class HDF5Constants { private static native final int H5F_LIBVER_V110(); + private static native final int H5F_LIBVER_V112(); + private static native final int H5F_LIBVER_NBOUNDS(); private static native final int H5F_LIBVER_LATEST(); diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index 2ac0892..74eb436 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -401,6 +401,8 @@ Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1V18(JNIEnv *env, jclass cls){return JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1V110(JNIEnv *env, jclass cls){return H5F_LIBVER_V110;} JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1V112(JNIEnv *env, jclass cls){return H5F_LIBVER_V112;} +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1NBOUNDS(JNIEnv *env, jclass cls){return H5F_LIBVER_NBOUNDS;} JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1LATEST(JNIEnv *env, jclass cls){return H5F_LIBVER_LATEST;} diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java index 981f34e..e46ed48 100644 --- a/java/test/TestH5P.java +++ b/java/test/TestH5P.java @@ -214,7 +214,7 @@ public class TestH5P { @Test(expected = HDF5FunctionArgumentException.class) public void testH5Pset_libver_bounds_invalidhigh() throws Throwable { - H5.H5Pset_libver_bounds(fapl_id, HDF5Constants.H5F_LIBVER_V110, HDF5Constants.H5F_LIBVER_V110+1); + H5.H5Pset_libver_bounds(fapl_id, HDF5Constants.H5F_LIBVER_V112, HDF5Constants.H5F_LIBVER_V112+1); } @Test diff --git a/src/H5Aint.c b/src/H5Aint.c index 88a4780..d8ba92a 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -108,6 +108,7 @@ static herr_t H5A__iterate_common(hid_t loc_id, H5_index_t idx_type, const unsigned H5O_attr_ver_bounds[] = { H5O_ATTR_VERSION_1, /* H5F_LIBVER_EARLIEST */ H5O_ATTR_VERSION_3, /* H5F_LIBVER_V18 */ + H5O_ATTR_VERSION_3, /* H5F_LIBVER_V110 */ H5O_ATTR_VERSION_LATEST /* H5F_LIBVER_LATEST */ }; @@ -189,6 +189,10 @@ typedef struct H5CX_t { hid_t dcpl_id; /* DCPL ID for API operation */ H5P_genplist_t *dcpl; /* Dataset Creation Property List */ + /* FAPL */ + hid_t fapl_id; /* FAPL ID for API operation */ + H5P_genplist_t *fapl; /* File Access Property List */ + /* Internal: Object tagging info */ haddr_t tag; /* Current object's tag (ohdr chunk #0 address) */ @@ -278,6 +282,12 @@ typedef struct H5CX_t { hbool_t do_min_dset_ohdr; /* Whether to minimize dataset object header */ hbool_t do_min_dset_ohdr_valid; /* Whether minimize dataset object header flag is valid */ + /* Cached FAPL properties */ + H5F_libver_t low_bound; /* low_bound property for H5Pset_libver_bounds() */ + hbool_t low_bound_valid; /* Whether low_bound property is valid */ + H5F_libver_t high_bound; /* high_bound property for H5Pset_libver_bounds */ + hbool_t high_bound_valid; /* Whether high_bound property is valid */ + /* Cached VOL settings */ H5VL_connector_prop_t vol_connector_prop; /* Property for VOL connector ID & info */ hbool_t vol_connector_prop_valid; /* Whether property for VOL connector ID & info is valid */ @@ -338,6 +348,13 @@ typedef struct H5CX_dcpl_cache_t { hbool_t do_min_dset_ohdr; /* Whether to minimize dataset object header */ } H5CX_dcpl_cache_t; +/* Typedef for cached default file access property list information */ +/* (Same as the cached DXPL struct, above, except for the default DCPL) */ +typedef struct H5CX_fapl_cache_t { + H5F_libver_t low_bound; /* low_bound property for H5Pset_libver_bounds() */ + H5F_libver_t high_bound; /* high_bound property for H5Pset_libver_bounds */ +} H5CX_fapl_cache_t; + /********************/ /* Local Prototypes */ @@ -374,6 +391,9 @@ static H5CX_lapl_cache_t H5CX_def_lapl_cache; /* Define a "default" dataset creation property list cache structure to use for default DCPLs */ static H5CX_dcpl_cache_t H5CX_def_dcpl_cache; +/* Define a "default" file access property list cache structure to use for default FAPLs */ +static H5CX_fapl_cache_t H5CX_def_fapl_cache; + /* Declare a static free list to manage H5CX_node_t structs */ H5FL_DEFINE_STATIC(H5CX_node_t); @@ -398,6 +418,7 @@ H5CX__init_package(void) H5P_genplist_t *dx_plist; /* Data transfer property list */ H5P_genplist_t *la_plist; /* Link access property list */ H5P_genplist_t *dc_plist; /* Dataset creation property list */ + H5P_genplist_t *fa_plist; /* File access property list */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -511,6 +532,23 @@ H5CX__init_package(void) if(H5P_get(dc_plist, H5D_CRT_MIN_DSET_HDR_SIZE_NAME, &H5CX_def_dcpl_cache.do_min_dset_ohdr) < 0) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve dataset minimize flag") + /* Reset the "default FAPL cache" information */ + HDmemset(&H5CX_def_fapl_cache, 0, sizeof(H5CX_fapl_cache_t)); + + /* Get the default FAPL cache information */ + + /* Get the default file access property list */ + if(NULL == (fa_plist = (H5P_genplist_t *)H5I_object(H5P_FILE_ACCESS_DEFAULT))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "not a dataset create property list") + + /* Get low_bound */ + if(H5P_get(fa_plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, &H5CX_def_fapl_cache.low_bound) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve dataset minimize flag") + + if(H5P_get(fa_plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, &H5CX_def_fapl_cache.high_bound) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve dataset minimize flag") + + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5CX__init_package() */ @@ -635,6 +673,7 @@ H5CX__push_common(H5CX_node_t *cnode) /* Set non-zero context info */ cnode->ctx.dxpl_id = H5P_DATASET_XFER_DEFAULT; cnode->ctx.lapl_id = H5P_LINK_ACCESS_DEFAULT; + cnode->ctx.fapl_id = H5P_FILE_ACCESS_DEFAULT; cnode->ctx.tag = H5AC__INVALID_TAG; cnode->ctx.ring = H5AC_RING_USER; @@ -1013,6 +1052,42 @@ H5CX_set_dcpl(hid_t dcpl_id) FUNC_LEAVE_NOAPI_VOID } /* end H5CX_set_dcpl() */ +/*------------------------------------------------------------------------- + * Function: H5CX_set_libver_bounds + * + * Purpose: Sets the low/high bounds according to "f" for the current API call context. + * When "f" is NULL, the low/high bounds are set to latest format. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Vailin Choi + * March 27, 2019 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_set_libver_bounds(H5F_t *f) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(head && *head); + + /* Set the API context value */ + (*head)->ctx.low_bound = (f == NULL) ? H5F_LIBVER_LATEST : H5F_LOW_BOUND(f); + (*head)->ctx.high_bound = (f == NULL) ? H5F_LIBVER_LATEST : H5F_HIGH_BOUND(f); + + /* Mark the values as valid */ + (*head)->ctx.low_bound_valid = TRUE; + (*head)->ctx.high_bound_valid = TRUE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_set_libver_bounds() */ + /*------------------------------------------------------------------------- * Function: H5CX_set_lapl @@ -1083,6 +1158,7 @@ H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass, *acspl_id = *libclass->def_plist_id; else { htri_t is_lapl; /* Whether the access property list is (or is derived from) a link access property list */ + htri_t is_fapl; /* Whether the access property list is (or is derived from) a file access property list */ #ifdef H5CX_DEBUG /* Sanity check the access property list class */ @@ -1096,6 +1172,12 @@ H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass, else if(is_lapl) (*head)->ctx.lapl_id = *acspl_id; + /* Check for file access property and set API context if so */ + if((is_fapl = H5P_class_isa(*libclass->pclass, *H5P_CLS_FACC->pclass)) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "can't check for file access class") + else if(is_fapl) + (*head)->ctx.fapl_id = *acspl_id; + #ifdef H5_HAVE_PARALLEL /* If this routine is not guaranteed to be collective (i.e. it doesn't * modify the structural metadata in a file), check if the application @@ -2286,6 +2368,43 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5CX_get_nlinks() */ +/*------------------------------------------------------------------------- + * Function: H5CX_get_libver_bounds + * + * Purpose: Retrieves the low/high bounds for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Vailin Choi + * March 27, 2019 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_libver_bounds(H5F_libver_t *low_bound, H5F_libver_t *high_bound) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(low_bound); + HDassert(high_bound); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.fapl_id); + + H5CX_RETRIEVE_PROP_VALID(fapl, H5P_FILE_ACCESS_DEFAULT, H5F_ACS_LIBVER_LOW_BOUND_NAME, low_bound) + H5CX_RETRIEVE_PROP_VALID(fapl, H5P_FILE_ACCESS_DEFAULT, H5F_ACS_LIBVER_HIGH_BOUND_NAME, high_bound) + + /* Get the values */ + *low_bound = (*head)->ctx.low_bound; + *high_bound = (*head)->ctx.high_bound; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_libver_bounds() */ + /*------------------------------------------------------------------------- * Function: H5CX_get_dset_min_ohdr_flag diff --git a/src/H5CXprivate.h b/src/H5CXprivate.h index 80f1ac4..4270155 100644 --- a/src/H5CXprivate.h +++ b/src/H5CXprivate.h @@ -79,6 +79,7 @@ H5_DLL herr_t H5CX_free_state(H5CX_state_t *api_state); H5_DLL void H5CX_set_dxpl(hid_t dxpl_id); H5_DLL void H5CX_set_lapl(hid_t lapl_id); H5_DLL void H5CX_set_dcpl(hid_t dcpl_id); +H5_DLL herr_t H5CX_set_libver_bounds(H5F_t *f); H5_DLL herr_t H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass, hid_t loc_id, hbool_t is_collective); H5_DLL herr_t H5CX_set_loc(hid_t loc_id); @@ -127,6 +128,9 @@ H5_DLL herr_t H5CX_get_nlinks(size_t *nlinks); /* "Getter" routines for DCPL properties cached in API context */ H5_DLL herr_t H5CX_get_dset_min_ohdr_flag(hbool_t *dset_min_ohdr_flag); +/* "Getter" routines for FAPL properties cached in API context */ +H5_DLL herr_t H5CX_get_libver_bounds(H5F_libver_t *low_bound, H5F_libver_t *high_bound); + /* "Setter" routines for API context info */ H5_DLL void H5CX_set_tag(haddr_t tag); H5_DLL void H5CX_set_ring(H5AC_ring_t ring); diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index 494d2c8..fb28489 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -50,6 +50,7 @@ const unsigned H5O_layout_ver_bounds[] = { H5O_LAYOUT_VERSION_1, /* H5F_LIBVER_EARLIEST */ H5O_LAYOUT_VERSION_3, /* H5F_LIBVER_V18 */ /* H5O_LAYOUT_VERSION_DEFAULT */ + H5O_LAYOUT_VERSION_4, /* H5F_LIBVER_V110 */ H5O_LAYOUT_VERSION_LATEST /* H5F_LIBVER_LATEST */ }; diff --git a/src/H5Fint.c b/src/H5Fint.c index 03bbbd9..5d03b3b 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -3327,7 +3327,7 @@ H5F__start_swmr_write(H5F_t *f) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "file superblock version - should be at least 3") /* Check for correct file format version */ - if((f->shared->low_bound != H5F_LIBVER_V110) || (f->shared->high_bound != H5F_LIBVER_V110)) + if((f->shared->low_bound < H5F_LIBVER_V110) || (f->shared->high_bound < H5F_LIBVER_V110)) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "file format version does not support SWMR - needs to be 1.10 or greater") /* Should not be marked for SWMR writing mode already */ diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index 9f1ed01..8274654 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -178,11 +178,12 @@ typedef enum H5F_libver_t { H5F_LIBVER_ERROR = -1, H5F_LIBVER_EARLIEST = 0, /* Use the earliest possible format for storing objects */ H5F_LIBVER_V18 = 1, /* Use the latest v18 format for storing objects */ - H5F_LIBVER_V110 = 2, /* Use the latest v10 format for storing objects */ + H5F_LIBVER_V110 = 2, /* Use the latest v110 format for storing objects */ + H5F_LIBVER_V112 = 3, /* Use the latest v112 format for storing objects */ H5F_LIBVER_NBOUNDS } H5F_libver_t; -#define H5F_LIBVER_LATEST H5F_LIBVER_V110 +#define H5F_LIBVER_LATEST H5F_LIBVER_V112 /* File space handling strategy */ typedef enum H5F_fspace_strategy_t { diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 3c225a2..aa5a85d 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -76,6 +76,7 @@ H5FL_DEFINE(H5F_super_t); static const unsigned HDF5_superblock_ver_bounds[] = { HDF5_SUPERBLOCK_VERSION_DEF, /* H5F_LIBVER_EARLIEST */ HDF5_SUPERBLOCK_VERSION_2, /* H5F_LIBVER_V18 */ + HDF5_SUPERBLOCK_VERSION_3, /* H5F_LIBVER_V110 */ HDF5_SUPERBLOCK_VERSION_LATEST /* H5F_LIBVER_LATEST */ }; diff --git a/src/H5Ofill.c b/src/H5Ofill.c index ebd885c..d87dc84 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -157,6 +157,7 @@ const H5O_msg_class_t H5O_MSG_FILL_NEW[1] = {{ const unsigned H5O_fill_ver_bounds[] = { H5O_FILL_VERSION_1, /* H5F_LIBVER_EARLIEST */ H5O_FILL_VERSION_2, /* H5F_LIBVER_V18 */ + H5O_FILL_VERSION_3, /* H5F_LIBVER_V110 */ H5O_FILL_VERSION_LATEST /* H5F_LIBVER_LATEST */ }; diff --git a/src/H5Oint.c b/src/H5Oint.c index 570f94e..60aae45 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -130,6 +130,7 @@ const H5O_msg_class_t *const H5O_msg_class_g[] = { const unsigned H5O_obj_ver_bounds[] = { H5O_VERSION_1, /* H5F_LIBVER_EARLIEST */ H5O_VERSION_2, /* H5F_LIBVER_V18 */ + H5O_VERSION_2, /* H5F_LIBVER_V110 */ H5O_VERSION_LATEST /* H5F_LIBVER_LATEST */ }; diff --git a/src/H5Opline.c b/src/H5Opline.c index 85a95b7..609f2eb 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -93,6 +93,7 @@ const H5O_msg_class_t H5O_MSG_PLINE[1] = {{ const unsigned H5O_pline_ver_bounds[] = { H5O_PLINE_VERSION_1, /* H5F_LIBVER_EARLIEST */ H5O_PLINE_VERSION_2, /* H5F_LIBVER_V18 */ + H5O_PLINE_VERSION_2, /* H5F_LIBVER_V110 */ H5O_PLINE_VERSION_LATEST /* H5F_LIBVER_LATEST */ }; @@ -66,6 +66,7 @@ hbool_t H5_PKG_INIT_VAR = FALSE; const unsigned H5O_sdspace_ver_bounds[] = { H5O_SDSPACE_VERSION_1, /* H5F_LIBVER_EARLIEST */ H5O_SDSPACE_VERSION_2, /* H5F_LIBVER_V18 */ + H5O_SDSPACE_VERSION_2, /* H5F_LIBVER_V110 */ H5O_SDSPACE_VERSION_LATEST /* H5F_LIBVER_LATEST */ }; @@ -513,6 +513,7 @@ H5FL_DEFINE(H5T_shared_t); const unsigned H5O_dtype_ver_bounds[] = { H5O_DTYPE_VERSION_1, /* H5F_LIBVER_EARLIEST */ H5O_DTYPE_VERSION_3, /* H5F_LIBVER_V18 */ + H5O_DTYPE_VERSION_3, /* H5F_LIBVER_V110 */ H5O_DTYPE_VERSION_LATEST /* H5F_LIBVER_LATEST */ }; diff --git a/src/H5trace.c b/src/H5trace.c index 9a13193..23f2f1d 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -1054,7 +1054,11 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case H5F_LIBVER_V110: - HDcompile_assert(H5F_LIBVER_LATEST == H5F_LIBVER_V110); + HDfprintf(out, "H5F_LIBVER_V110"); + break; + + case H5F_LIBVER_V112: + HDcompile_assert(H5F_LIBVER_LATEST == H5F_LIBVER_V112); HDfprintf(out, "H5F_LIBVER_LATEST"); break; diff --git a/test/dsets.c b/test/dsets.c index ef3cf58..a317f14 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -12990,7 +12990,7 @@ test_versionbounds(void) if (vdset > 0) /* dataset created successfully */ { /* Virtual dataset is only available starting in V110 */ - VERIFY(high, H5F_LIBVER_V110, "virtual dataset"); + VERIFY(high >= H5F_LIBVER_V110, TRUE, "virtual dataset"); if(H5Dclose(vdset) < 0) TEST_ERROR vdset = -1; diff --git a/test/h5test.c b/test/h5test.c index bc3f2fa..8634a4d 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -100,6 +100,17 @@ static const char *multi_letters = "msbrglo"; /* The # of seconds to wait for the message file--used by h5_wait_message() */ #define MESSAGE_TIMEOUT 300 /* Timeout in seconds */ +/* The strings that correspond to library version bounds H5F_libver_t in H5Fpublic.h */ +/* This is used by h5_get_version_string() */ +const char *LIBVER_NAMES[] = { + "earliest", /* H5F_LIBVER_EARLIEST = 0 */ + "v18", /* H5F_LIBVER_V18 = 1 */ + "v110", /* H5F_LIBVER_V110 = 2 */ + "latest", /* H5F_LIBVER_V112 = 3 */ + NULL +}; + + /* Previous error reporting function */ static H5E_auto2_t err_func = NULL; @@ -1940,3 +1951,17 @@ error: return NULL; } /* h5_get_dummy_vol_class */ +/*------------------------------------------------------------------------- + * Function: h5_get_version_string + * + * Purpose: Get the string that corresponds to the libvery version bound. + * + * Return: The string + * + *------------------------------------------------------------------------- + */ +char * +h5_get_version_string(H5F_libver_t libver) +{ + return(LIBVER_NAMES[libver]); +} /* end of h5_get_version_string */ diff --git a/test/h5test.h b/test/h5test.h index 8c3ce6b..ada52ad 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -148,6 +148,7 @@ H5TEST_DLL int h5_make_local_copy(const char *origfilename, const char *local_co H5TEST_DLL herr_t h5_verify_cached_stabs(const char *base_name[], hid_t fapl); H5TEST_DLL H5FD_class_t *h5_get_dummy_vfd_class(void); H5TEST_DLL H5VL_class_t *h5_get_dummy_vol_class(void); +H5TEST_DLL char *h5_get_version_string(H5F_libver_t libver); /* Functions that will replace components of a FAPL */ H5TEST_DLL herr_t h5_get_vfd_fapl(hid_t fapl_id); diff --git a/test/ohdr.c b/test/ohdr.c index b8f7112..9fc5791 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -1627,45 +1627,6 @@ error: return FAIL; } /* test_minimized_dset_ohdr_fillvalue_backwards_compatability */ -#define STR_EARLIEST "earliest" -#define STR_V18 "v18" -#define STR_LATEST "latest" -static char * -version_string(H5F_libver_t libver) -{ - char *str = NULL; - - str = (char *) HDmalloc(20); - if (str == NULL) { - HDfprintf(stderr, "Allocation failed\n"); - HDexit(1); - } - - switch(libver) { - case H5F_LIBVER_EARLIEST: - HDstrcpy(str, STR_EARLIEST); - break; - - case H5F_LIBVER_V18: - HDstrcpy(str, STR_V18); - break; - - case H5F_LIBVER_V110: - HDassert(H5F_LIBVER_LATEST == H5F_LIBVER_V110); - HDstrcpy(str, STR_LATEST); - break; - - case H5F_LIBVER_ERROR: - case H5F_LIBVER_NBOUNDS: - default: - HDsprintf(str, "%ld", (long)libver); - break; - } /* end switch */ - - /* Return the formed version bound string */ - return str; -} /* end version_string() */ - /*------------------------------------------------------------------------- * Function: main @@ -1693,7 +1654,6 @@ main(void) H5O_loc_t oh_loc; /* Object header locations */ H5F_libver_t low, high; /* File format bounds */ time_t time_new, ro; - char msg[80]; /* Message for file format version */ int i; /* Local index variable */ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret; /* Generic return value */ @@ -1718,8 +1678,9 @@ main(void) /* Loop through all the combinations of low/high library format bounds */ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) { - char *low_string = NULL; - char *high_string = NULL; + char *low_string = NULL; /* Message for library version low bound */ + char *high_string = NULL; /* Message for library version high bound */ + char msg[80]; /* Message for file format version */ /* Set version bounds before opening the file */ H5E_BEGIN_TRY { @@ -1730,13 +1691,11 @@ main(void) continue; /* Display info about testing */ - low_string = version_string(low); - high_string = version_string(high); + low_string = h5_get_version_string(low); + high_string = h5_get_version_string(high); sprintf(msg, "Using file format version: (%s, %s)", low_string, high_string); HDputs(msg); - HDfree(high_string); - HDfree(low_string); /* test on object continuation block */ if(test_cont(filename, fapl) < 0) diff --git a/test/tfile.c b/test/tfile.c index e3ff372..430bc85 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -5167,7 +5167,7 @@ test_libver_bounds_open(void) /* Get new low bound and verify that it has been upgraded properly */ ret = H5Pget_libver_bounds(new_fapl, &new_low, NULL); CHECK(ret, FAIL, "H5Pget_libver_bounds"); - VERIFY(new_low, H5F_LIBVER_LATEST, "Low bound should be upgraded to H5F_LIBVER_LATEST"); + VERIFY(new_low >= H5F_LIBVER_V110, TRUE, "Low bound should be upgraded to at least H5F_LIBVER_V110"); ret = H5Pclose(new_fapl); CHECK(ret, FAIL, "H5Pclose"); @@ -5445,7 +5445,7 @@ test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr) } H5E_END_TRY; /* Get the internal file pointer if the create succeeds */ - if((ok = fid >= 0)) { + if(fid >= 0) { f = (H5F_t *)H5VL_object(fid); CHECK(f, NULL, "H5VL_object"); } @@ -5456,34 +5456,35 @@ test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr) if(is_swmr) { /* SWMR is enabled */ - if(high == H5F_LIBVER_LATEST) { /* Should succeed */ - VERIFY(ok, TRUE, "H5Fcreate"); + if(high >= H5F_LIBVER_V110) { /* Should succeed */ + VERIFY(fid >= 0, TRUE, "H5Fcreate"); VERIFY(HDF5_SUPERBLOCK_VERSION_3, f->shared->sblock->super_vers, "HDF5_superblock_ver_bounds"); - VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "HDF5_superblock_ver_bounds"); + VERIFY(f->shared->low_bound >= H5F_LIBVER_V110, TRUE, "HDF5_superblock_ver_bounds"); } else /* Should fail */ - VERIFY(ok, FALSE, "H5Fcreate"); + VERIFY(fid >= 0, FALSE, "H5Fcreate"); } else { /* Should succeed */ - VERIFY(ok, TRUE, "H5Fcreate"); + VERIFY(fid >= 0, TRUE, "H5Fcreate"); VERIFY(low, f->shared->low_bound, "HDF5_superblock_ver_bounds"); switch(low) { case H5F_LIBVER_EARLIEST: - ok = (f->shared->sblock->super_vers == 0 || - f->shared->sblock->super_vers == 1 || - f->shared->sblock->super_vers == 2); + ok = (f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_DEF || + f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_1 || + f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_2); VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds"); break; case H5F_LIBVER_V18: - ok = (f->shared->sblock->super_vers == 2); + ok = (f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_2); VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds"); break; case H5F_LIBVER_V110: - ok = (f->shared->sblock->super_vers == 3); + case H5F_LIBVER_V112: + ok = (f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_3); VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds"); break; @@ -5495,7 +5496,7 @@ test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr) } /* end switch */ } - if(ok) { /* Close the file */ + if(fid >= 0) { /* Close the file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); } @@ -5587,7 +5588,6 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr) hid_t new_fapl = -1; /* File access property list */ unsigned super_vers; /* Superblock version */ H5F_libver_t low, high; /* Low and high bounds */ - hbool_t ok; /* The result is ok or not */ herr_t ret; /* Return value */ /* Create the file with the input fcpl and fapl */ @@ -5626,7 +5626,7 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr) } H5E_END_TRY; /* Get the internal file pointer if the open succeeds */ - if((ok = fid >= 0)) { + if(fid >= 0) { f = (H5F_t *)H5VL_object(fid); CHECK(f, NULL, "H5VL_object"); } @@ -5634,26 +5634,24 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr) /* Verify the file open succeeds or fails */ switch(super_vers) { case 3: - if(high == H5F_LIBVER_LATEST) { + if(high >= H5F_LIBVER_V110) { /* Should succeed */ - VERIFY(ok, TRUE, "H5Fopen"); - VERIFY(H5F_LIBVER_V110, f->shared->low_bound, "HDF5_superblock_ver_bounds"); + VERIFY(fid >= 0, TRUE, "H5Fopen"); + VERIFY(f->shared->low_bound >= H5F_LIBVER_V110, TRUE, "HDF5_superblock_ver_bounds"); /* Close the file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); } else /* Should fail */ - VERIFY(ok, FALSE, "H5Fopen"); + VERIFY(fid >= 0, FALSE, "H5Fopen"); break; case 2: if(is_swmr) /* Should fail */ - VERIFY(ok, FALSE, "H5Fopen"); + VERIFY(fid >= 0, FALSE, "H5Fopen"); else { /* Should succeed */ - VERIFY(ok, TRUE, "H5Fopen"); - - ok = f->shared->low_bound >= H5F_LIBVER_V18; - VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds"); + VERIFY(fid >= 0, TRUE, "H5Fopen"); + VERIFY(f->shared->low_bound >= H5F_LIBVER_V18, TRUE, "HDF5_superblock_ver_bounds"); /* Close the file */ ret = H5Fclose(fid); @@ -5664,10 +5662,10 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr) case 1: case 0: if(is_swmr) /* Should fail */ - VERIFY(ok, FALSE, "H5Fopen"); + VERIFY(fid >= 0, FALSE, "H5Fopen"); else { /* Should succeed */ - VERIFY(ok, TRUE, "H5Fopen"); - VERIFY(low, f->shared->low_bound, "HDF5_superblock_ver_bounds"); + VERIFY(fid >= 0, TRUE, "H5Fopen"); + VERIFY(f->shared->low_bound, low, "HDF5_superblock_ver_bounds"); ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); diff --git a/test/trefer.c b/test/trefer.c index 4f76cb3..938f040 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -492,41 +492,42 @@ test_reference_obj(void) ** ****************************************************************/ static void -test_reference_region(void) +test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dset1, /* Dataset ID */ - dset2; /* Dereferenced dataset ID */ - hid_t sid1, /* Dataspace ID #1 */ - sid2; /* Dataspace ID #2 */ - hid_t dapl_id; /* Dataset access property list */ - hsize_t dims1[] = {SPACE1_DIM1}, - dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ - hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ - hsize_t * coords; /* Coordinate buffer */ - hsize_t low[SPACE2_RANK]; /* Selection bounds */ - hsize_t high[SPACE2_RANK]; /* Selection bounds */ - hdset_reg_ref_t *wbuf, /* buffer to write to disk */ - *rbuf; /* buffer read from disk */ - hdset_reg_ref_t nvrbuf[3]={{0},{101},{255}}; /* buffer with non-valid refs */ - uint8_t *dwbuf, /* Buffer for writing numeric data to disk */ - *drbuf; /* Buffer for reading numeric data from disk */ - uint8_t *tu8; /* Temporary pointer to uint8 data */ - H5O_type_t obj_type; /* Type of object */ - int i, j; /* counting variables */ - hssize_t hssize_ret; /* hssize_t return value */ - htri_t tri_ret; /* htri_t return value */ - herr_t ret; /* Generic return value */ - haddr_t addr = HADDR_UNDEF; /* test for undefined reference */ - hid_t dset_NA; /* Dataset id for undefined reference */ - hid_t space_NA; /* Dataspace id for undefined reference */ - hsize_t dims_NA[1] = {1}; /* Dims array for undefined reference */ - hdset_reg_ref_t wdata_NA[1], /* Write buffer */ - rdata_NA[1]; /* Read buffer */ + hid_t fid1; /* HDF5 File IDs */ + hid_t fapl = -1; /* File access property list */ + hid_t dset1, /* Dataset ID */ + dset2; /* Dereferenced dataset ID */ + hid_t sid1, /* Dataspace ID #1 */ + sid2; /* Dataspace ID #2 */ + hid_t dapl_id; /* Dataset access property list */ + hsize_t dims1[] = {SPACE1_DIM1}, + dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ + hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ + hsize_t *coords; /* Coordinate buffer */ + hsize_t low[SPACE2_RANK]; /* Selection bounds */ + hsize_t high[SPACE2_RANK]; /* Selection bounds */ + hdset_reg_ref_t *wbuf, /* buffer to write to disk */ + *rbuf; /* buffer read from disk */ + hdset_reg_ref_t nvrbuf[3]={{0},{101},{255}}; /* buffer with non-valid refs */ + uint8_t *dwbuf, /* Buffer for writing numeric data to disk */ + *drbuf; /* Buffer for reading numeric data from disk */ + uint8_t *tu8; /* Temporary pointer to uint8 data */ + H5O_type_t obj_type; /* Type of object */ + int i, j; /* counting variables */ + hssize_t hssize_ret; /* hssize_t return value */ + htri_t tri_ret; /* htri_t return value */ + herr_t ret; /* Generic return value */ + haddr_t addr = HADDR_UNDEF; /* test for undefined reference */ + hid_t dset_NA; /* Dataset id for undefined reference */ + hid_t space_NA; /* Dataspace id for undefined reference */ + hsize_t dims_NA[1] = {1}; /* Dims array for undefined reference */ + hdset_reg_ref_t wdata_NA[1], /* Write buffer */ + rdata_NA[1]; /* Read buffer */ /* Output message about test being performed */ MESSAGE(5, ("Testing Dataset Region Reference Functions\n")); @@ -537,8 +538,16 @@ test_reference_region(void) dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); - /* Create file */ - fid1 = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + /* Create file access property list */ + fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(fapl, FAIL, "H5Pcreate"); + + /* Set the low/high version bounds in fapl */ + ret = H5Pset_libver_bounds(fapl, libver_low, libver_high); + CHECK(ret, FAIL, "H5Pset_libver_bounds"); + + /* Create file with the fapl */ + fid1 = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); CHECK(fid1, FAIL, "H5Fcreate"); /* Create dataspace for datasets */ @@ -627,6 +636,7 @@ test_reference_region(void) /* Store third dataset region */ ret = H5Rcreate(&wbuf[2], fid1, "/Dataset2", H5R_DATASET_REGION, sid2); CHECK(ret, FAIL, "H5Rcreate"); + ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &wbuf[0], &obj_type); CHECK(ret, FAIL, "H5Rget_obj_type2"); VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2"); @@ -677,7 +687,7 @@ test_reference_region(void) CHECK(ret, FAIL, "H5Fclose"); /* Re-open the file */ - fid1 = H5Fopen(FILE2, H5F_ACC_RDWR, H5P_DEFAULT); + fid1 = H5Fopen(FILE2, H5F_ACC_RDWR, fapl); CHECK(fid1, FAIL, "H5Fopen"); /* @@ -822,30 +832,32 @@ test_reference_region(void) ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - /* Get the unlimited selection */ - sid2 = H5Rget_region(dset1, H5R_DATASET_REGION, &rbuf[2]); - CHECK(sid2, FAIL, "H5Rget_region"); - - /* Verify correct hyperslab selected */ - hssize_ret = H5Sget_select_npoints(sid2); - VERIFY(hssize_ret, (hssize_t)H5S_UNLIMITED, "H5Sget_select_npoints"); - tri_ret = H5Sis_regular_hyperslab(sid2); - CHECK(tri_ret, FAIL, "H5Sis_regular_hyperslab"); - VERIFY(tri_ret, TRUE, "H5Sis_regular_hyperslab Result"); - ret = H5Sget_regular_hyperslab(sid2, start, stride, count, block); - CHECK(ret, FAIL, "H5Sget_regular_hyperslab"); - VERIFY(start[0], (hsize_t)1, "Hyperslab Coordinates"); - VERIFY(start[1], (hsize_t)8, "Hyperslab Coordinates"); - VERIFY(stride[0], (hsize_t)4, "Hyperslab Coordinates"); - VERIFY(stride[1], (hsize_t)1, "Hyperslab Coordinates"); - VERIFY(count[0], H5S_UNLIMITED, "Hyperslab Coordinates"); - VERIFY(count[1], (hsize_t)1, "Hyperslab Coordinates"); - VERIFY(block[0], (hsize_t)2, "Hyperslab Coordinates"); - VERIFY(block[1], (hsize_t)2, "Hyperslab Coordinates"); - - /* Close region space */ - ret = H5Sclose(sid2); - CHECK(ret, FAIL, "H5Sclose"); + if(libver_high >= H5F_LIBVER_V110) { + /* Get the unlimited selection */ + sid2 = H5Rget_region(dset1, H5R_DATASET_REGION, &rbuf[2]); + CHECK(sid2, FAIL, "H5Rget_region"); + + /* Verify correct hyperslab selected */ + hssize_ret = H5Sget_select_npoints(sid2); + VERIFY(hssize_ret, (hssize_t)H5S_UNLIMITED, "H5Sget_select_npoints"); + tri_ret = H5Sis_regular_hyperslab(sid2); + CHECK(tri_ret, FAIL, "H5Sis_regular_hyperslab"); + VERIFY(tri_ret, TRUE, "H5Sis_regular_hyperslab Result"); + ret = H5Sget_regular_hyperslab(sid2, start, stride, count, block); + CHECK(ret, FAIL, "H5Sget_regular_hyperslab"); + VERIFY(start[0], (hsize_t)1, "Hyperslab Coordinates"); + VERIFY(start[1], (hsize_t)8, "Hyperslab Coordinates"); + VERIFY(stride[0], (hsize_t)4, "Hyperslab Coordinates"); + VERIFY(stride[1], (hsize_t)1, "Hyperslab Coordinates"); + VERIFY(count[0], H5S_UNLIMITED, "Hyperslab Coordinates"); + VERIFY(count[1], (hsize_t)1, "Hyperslab Coordinates"); + VERIFY(block[0], (hsize_t)2, "Hyperslab Coordinates"); + VERIFY(block[1], (hsize_t)2, "Hyperslab Coordinates"); + + /* Close region space */ + ret = H5Sclose(sid2); + CHECK(ret, FAIL, "H5Sclose"); + } /* Close first space */ ret = H5Sclose(sid1); @@ -887,34 +899,39 @@ test_reference_region(void) ** test_reference_region_1D(): Test H5R (reference) object reference code. ** Tests 1-D references to various kinds of objects ** +** Note: The libver_low/libver_high parameters are added to create the file +** with the low and high bounds setting in fapl. +** Please see the RFC for "H5Sencode/H5Sdecode Format Change". +** ****************************************************************/ static void -test_reference_region_1D(void) +test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dset1, /* Dataset ID */ - dset3; /* Dereferenced dataset ID */ - hid_t sid1, /* Dataspace ID #1 */ - sid3; /* Dataspace ID #3 */ - hid_t dapl_id; /* Dataset access property list */ - hsize_t dims1[] = {SPACE1_DIM1}, - dims3[] = {SPACE3_DIM1}; - hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */ - hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ - hsize_t * coords; /* Coordinate buffer */ - hsize_t low[SPACE3_RANK]; /* Selection bounds */ - hsize_t high[SPACE3_RANK]; /* Selection bounds */ - hdset_reg_ref_t *wbuf, /* buffer to write to disk */ - *rbuf; /* buffer read from disk */ - uint8_t *dwbuf, /* Buffer for writing numeric data to disk */ - *drbuf; /* Buffer for reading numeric data from disk */ - uint8_t *tu8; /* Temporary pointer to uint8 data */ - H5O_type_t obj_type; /* Object type */ - int i; /* counting variables */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t fapl = -1; /* File access property list */ + hid_t dset1, /* Dataset ID */ + dset3; /* Dereferenced dataset ID */ + hid_t sid1, /* Dataspace ID #1 */ + sid3; /* Dataspace ID #3 */ + hid_t dapl_id; /* Dataset access property list */ + hsize_t dims1[] = {SPACE1_DIM1}, + dims3[] = {SPACE3_DIM1}; + hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */ + hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ + hsize_t *coords; /* Coordinate buffer */ + hsize_t low[SPACE3_RANK]; /* Selection bounds */ + hsize_t high[SPACE3_RANK]; /* Selection bounds */ + hdset_reg_ref_t *wbuf, /* buffer to write to disk */ + *rbuf; /* buffer read from disk */ + uint8_t *dwbuf, /* Buffer for writing numeric data to disk */ + *drbuf; /* Buffer for reading numeric data from disk */ + uint8_t *tu8; /* Temporary pointer to uint8 data */ + H5O_type_t obj_type; /* Object type */ + int i; /* counting variables */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing 1-D Dataset Region Reference Functions\n")); @@ -925,8 +942,16 @@ test_reference_region_1D(void) dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE3_DIM1); drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); - /* Create file */ - fid1 = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + /* Create the file access property list */ + fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(fapl, FAIL, "H5Pcreate"); + + /* Set the low/high version bounds in fapl */ + ret = H5Pset_libver_bounds(fapl, libver_low, libver_high); + CHECK(ret, FAIL, "H5Pset_libver_bounds"); + + /* Create file with the fapl */ + fid1 = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); CHECK(fid1, FAIL, "H5Fcreate"); /* Create dataspace for datasets */ @@ -1022,7 +1047,7 @@ test_reference_region_1D(void) CHECK(ret, FAIL, "H5Fclose"); /* Re-open the file */ - fid1 = H5Fopen(FILE2, H5F_ACC_RDWR, H5P_DEFAULT); + fid1 = H5Fopen(FILE2, H5F_ACC_RDWR, fapl); CHECK(fid1, FAIL, "H5Fopen"); /* Open the dataset */ @@ -1156,6 +1181,10 @@ test_reference_region_1D(void) ret = H5Pclose(dapl_id); CHECK(ret, FAIL, "H5Pclose"); + /* Close file access property list */ + ret = H5Pclose(fapl); + CHECK(ret, FAIL, "H5Pclose"); + /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); @@ -1733,13 +1762,28 @@ test_reference_compat(void) void test_reference(void) { + H5F_libver_t low, high; /* Low and high bounds */ + /* Output message about test being performed */ MESSAGE(5, ("Testing References\n")); test_reference_params(); /* Test for correct parameter checking */ test_reference_obj(); /* Test basic H5R object reference code */ - test_reference_region(); /* Test basic H5R dataset region reference code */ - test_reference_region_1D(); /* Test H5R dataset region reference code for 1-D datasets */ + + /* Loop through all the combinations of low/high version bounds */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + + /* Invalid combinations, just continue */ + if(high == H5F_LIBVER_EARLIEST || high < low) + continue; + + test_reference_region(low, high); /* Test basic H5R dataset region reference code */ + test_reference_region_1D(low, high); /* Test H5R dataset region reference code for 1-D datasets */ + + } /* end high bound */ + } /* end low bound */ + test_reference_obj_deleted(); /* Test H5R object reference code for deleted objects */ test_reference_group(); /* Test operations on dereferenced groups */ #ifndef H5_NO_DEPRECATED_SYMBOLS |