summaryrefslogtreecommitdiffstats
path: root/test/tfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/tfile.c')
-rw-r--r--test/tfile.c141
1 files changed, 83 insertions, 58 deletions
diff --git a/test/tfile.c b/test/tfile.c
index caf9c62..3babae5 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -1647,7 +1647,8 @@ test_file_is_accessible(const char *env_h5_drvr)
unsigned char buf[1024]; /* Buffer of data to write */
htri_t is_hdf5; /* Whether a file is an HDF5 file */
int posix_ret; /* Return value from POSIX calls */
- herr_t ret; /* Return value from HDF5 calls */
+ hbool_t driver_is_default_compatible;
+ herr_t ret; /* Return value from HDF5 calls */
/* Output message about test being performed */
MESSAGE(5, ("Testing Detection of HDF5 Files\n"));
@@ -1656,6 +1657,11 @@ test_file_is_accessible(const char *env_h5_drvr)
fapl_id = h5_fileaccess();
CHECK(fapl_id, H5I_INVALID_HID, "H5Pcreate");
+ if (h5_driver_is_default_vfd_compatible(fapl_id, &driver_is_default_compatible) < 0) {
+ TestErrPrintf("Can't check if VFD is compatible with default VFD");
+ return;
+ }
+
/* Fix up filenames */
h5_fixname(FILE_IS_ACCESSIBLE, fapl_id, filename, sizeof(filename));
h5_fixname(FILE_IS_ACCESSIBLE_NON_HDF5, fapl_id, non_hdf5_filename, sizeof(non_hdf5_filename));
@@ -1733,10 +1739,7 @@ test_file_is_accessible(const char *env_h5_drvr)
VERIFY(is_hdf5, TRUE, "H5Fis_accessible");
} /* end if */
- /* Don't run the below tests for drivers that use multiple
- * logical files, like the splitter driver.
- */
- if (!h5_driver_uses_multiple_files(env_h5_drvr, H5_EXCLUDE_MULTIPART_DRIVERS)) {
+ if (driver_is_default_compatible) {
/***********************/
/* EMPTY non-HDF5 file */
/***********************/
@@ -5536,10 +5539,19 @@ test_libver_bounds_copy(void)
hid_t fapl = -1; /* File access property list ID */
const char *src_fname; /* Source file name */
herr_t ret; /* Generic return value */
+ hbool_t driver_is_default_compatible;
/* Output message about the test being performed */
MESSAGE(5, ("Testing H5Ocopy a dataset in a 1.8 library file to a 1.10 library file\n"));
+ ret = h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible);
+ CHECK_I(ret, "h5_driver_is_default_vfd_compatible");
+
+ if (!driver_is_default_compatible) {
+ HDprintf("-- SKIPPED --\n");
+ return;
+ }
+
/* Get the test file name */
src_fname = H5_get_srcdir_filename(SRC_FILE);
@@ -5598,10 +5610,7 @@ test_libver_bounds(void)
test_libver_bounds_real(H5F_LIBVER_EARLIEST, 1, H5F_LIBVER_LATEST, 2);
test_libver_bounds_real(H5F_LIBVER_LATEST, 2, H5F_LIBVER_EARLIEST, 2);
test_libver_bounds_open();
-
- if (!h5_driver_uses_modified_filename()) {
- test_libver_bounds_copy();
- }
+ test_libver_bounds_copy();
} /* end test_libver_bounds() */
/**************************************************************************************
@@ -6491,30 +6500,35 @@ test_libver_bounds_dataset(hid_t fapl)
dset = (H5D_t *)H5VL_object(did);
CHECK_PTR(dset, "H5VL_object");
- /* Verify the dataset's layout, fill value and filter pipeline message versions */
- /* Also verify the chunk indexing type */
- if (f->shared->low_bound == H5F_LIBVER_EARLIEST) {
- /* For layout message: the earliest version the library will set is 3 */
- /* For fill value message: the earliest version the library will set is 2 */
- VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT, "H5O_layout_ver_bounds");
- VERIFY(dset->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2, "H5O_fill_ver_bounds");
- }
- else {
- VERIFY(dset->shared->layout.version, H5O_layout_ver_bounds[f->shared->low_bound],
- "H5O_layout_ver_bounds");
- VERIFY(dset->shared->dcpl_cache.fill.version, H5O_fill_ver_bounds[f->shared->low_bound],
- "H5O_fill_ver_bounds");
- }
+ if (dset) {
+ /* Verify the dataset's layout, fill value and filter pipeline message versions */
+ /* Also verify the chunk indexing type */
+ if (f->shared->low_bound == H5F_LIBVER_EARLIEST) {
+ /* For layout message: the earliest version the library will set is 3 */
+ /* For fill value message: the earliest version the library will set is 2 */
+ VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT,
+ "H5O_layout_ver_bounds");
+ VERIFY(dset->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2,
+ "H5O_fill_ver_bounds");
+ }
+ else {
+ VERIFY(dset->shared->layout.version, H5O_layout_ver_bounds[f->shared->low_bound],
+ "H5O_layout_ver_bounds");
+ VERIFY(dset->shared->dcpl_cache.fill.version,
+ H5O_fill_ver_bounds[f->shared->low_bound], "H5O_fill_ver_bounds");
+ }
- /* Verify the filter pipeline message version */
- VERIFY(dset->shared->dcpl_cache.pline.version, H5O_pline_ver_bounds[f->shared->low_bound],
- "H5O_pline_ver_bounds");
+ /* Verify the filter pipeline message version */
+ VERIFY(dset->shared->dcpl_cache.pline.version, H5O_pline_ver_bounds[f->shared->low_bound],
+ "H5O_pline_ver_bounds");
- /* Verify the dataset's chunk indexing type */
- if (dset->shared->layout.version == H5O_LAYOUT_VERSION_LATEST)
- VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BT2, "chunk_index_type");
- else
- VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BTREE, "chunk_index_type");
+ /* Verify the dataset's chunk indexing type */
+ if (dset->shared->layout.version == H5O_LAYOUT_VERSION_LATEST)
+ VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BT2, "chunk_index_type");
+ else
+ VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BTREE,
+ "chunk_index_type");
+ }
/* Close the dataset */
ret = H5Dclose(did);
@@ -6739,13 +6753,19 @@ test_libver_bounds_dataspace(hid_t fapl)
tmp_space_contig = (H5S_t *)H5I_object(tmp_sid_contig);
CHECK_PTR(tmp_space_contig, "H5I_object");
- /* Verify versions for the three dataspaces */
- VERIFY(tmp_space->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound],
- "H5O_sdspace_ver_bounds");
- VERIFY(tmp_space_compact->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound],
- "H5O_sdspace_ver_bounds");
- VERIFY(tmp_space_contig->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound],
- "H5O_sdspace_ver_bounds");
+ if (tmp_space) {
+ /* Verify versions for the three dataspaces */
+ VERIFY(tmp_space->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound],
+ "H5O_sdspace_ver_bounds");
+ }
+ if (tmp_space_compact) {
+ VERIFY(tmp_space_compact->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound],
+ "H5O_sdspace_ver_bounds");
+ }
+ if (tmp_space_contig) {
+ VERIFY(tmp_space_contig->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound],
+ "H5O_sdspace_ver_bounds");
+ }
/* Close the three datasets */
ret = H5Dclose(did);
@@ -7063,24 +7083,26 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid)
dtype = (H5T_t *)H5I_object(dtid);
CHECK_PTR(dtype, "H5I_object");
- /* Verify the dataset's datatype message version */
- /* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY:
- * --the library will set version according to low_bound
- * --H5T_ARRAY: the earliest version the library will set is 2
- * H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_REFERENCE:
- * --the library will only use basic version
- */
- if (dtype->shared->type == H5T_COMPOUND || dtype->shared->type == H5T_ENUM ||
- dtype->shared->type == H5T_ARRAY) {
- if (dtype->shared->type == H5T_ARRAY && f->shared->low_bound == H5F_LIBVER_EARLIEST)
- VERIFY(dtype->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds");
+ if (dtype) {
+ /* Verify the dataset's datatype message version */
+ /* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY:
+ * --the library will set version according to low_bound
+ * --H5T_ARRAY: the earliest version the library will set is 2
+ * H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_REFERENCE:
+ * --the library will only use basic version
+ */
+ if (dtype->shared->type == H5T_COMPOUND || dtype->shared->type == H5T_ENUM ||
+ dtype->shared->type == H5T_ARRAY) {
+ if (dtype->shared->type == H5T_ARRAY && f->shared->low_bound == H5F_LIBVER_EARLIEST)
+ VERIFY(dtype->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds");
+ else
+ VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[f->shared->low_bound],
+ "H5O_dtype_ver_bounds");
+ }
else
- VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[f->shared->low_bound],
+ VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST],
"H5O_dtype_ver_bounds");
}
- else
- VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST],
- "H5O_dtype_ver_bounds");
/* Close the dataset */
ret = H5Dclose(did);
@@ -8017,9 +8039,9 @@ test_deprec(const char *env_h5_drvr)
void
test_file(void)
{
- const char *env_h5_drvr; /* File Driver value from environment */
- hid_t fapl_id = H5I_INVALID_HID; /* VFD-dependent fapl ID */
- hbool_t driver_uses_modified_filename = h5_driver_uses_modified_filename();
+ const char *env_h5_drvr; /* File Driver value from environment */
+ hid_t fapl_id = H5I_INVALID_HID; /* VFD-dependent fapl ID */
+ hbool_t driver_is_default_compatible;
herr_t ret;
/* Output message about test being performed */
@@ -8034,6 +8056,9 @@ test_file(void)
fapl_id = h5_fileaccess();
CHECK(fapl_id, H5I_INVALID_HID, "h5_fileaccess");
+ ret = h5_driver_is_default_vfd_compatible(fapl_id, &driver_is_default_compatible);
+ CHECK(ret, FAIL, "h5_driver_is_default_vfd_compatible");
+
test_file_create(); /* Test file creation(also creation templates)*/
test_file_open(env_h5_drvr); /* Test file opening */
test_file_reopen(); /* Test file reopening */
@@ -8057,7 +8082,7 @@ test_file(void)
env_h5_drvr); /* Tests that files created with a userblock have the correct size */
test_cached_stab_info(); /* Tests that files are created with cached stab info in the superblock */
- if (!driver_uses_modified_filename) {
+ if (driver_is_default_compatible) {
test_rw_noupdate(); /* Test to ensure that RW permissions don't write the file unless dirtied */
}
@@ -8078,7 +8103,7 @@ test_file(void)
test_sects_freespace(env_h5_drvr, FALSE); /* Test file public routine H5Fget_free_sections() */
/* Skipped testing for multi/split drivers */
- if (!driver_uses_modified_filename) {
+ if (driver_is_default_compatible) {
test_filespace_compatible(); /* Test compatibility for file space management */
test_filespace_round_compatible(); /* Testing file space compatibility for files from trunk to 1_8 to