summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2017-05-31 22:07:49 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2017-05-31 22:07:49 (GMT)
commit1e9354bcf551c16f3ad9d6a4ad42a2bce827c95e (patch)
tree20d28f7dd91b67f06880d6ca6566c1caa3dc06ae /test
parent734aebc39538039c6e81db63edd68eb3a2029cd2 (diff)
parent5c5ea7e89fbac1d31880d61e6a35ff6034019078 (diff)
downloadhdf5-1e9354bcf551c16f3ad9d6a4ad42a2bce827c95e.zip
hdf5-1e9354bcf551c16f3ad9d6a4ad42a2bce827c95e.tar.gz
hdf5-1e9354bcf551c16f3ad9d6a4ad42a2bce827c95e.tar.bz2
Merge branch 'develop' into windows_open
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am4
-rw-r--r--test/dsets.c119
-rw-r--r--test/flushrefresh.c1
-rw-r--r--test/mf.c6
-rw-r--r--test/plugin.c8
-rw-r--r--test/swmr.c33
-rw-r--r--test/swmr_remove_reader.c2
-rw-r--r--test/swmr_remove_writer.c2
-rw-r--r--test/tfile.c6
-rw-r--r--test/use_common.c14
-rw-r--r--test/vfd.c156
11 files changed, 327 insertions, 24 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index b274302..20b63f6 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -126,8 +126,8 @@ libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_li
libdynlib4.la: $(libdynlib4_la_OBJECTS) $(libdynlib4_la_DEPENDENCIES) $(EXTRA_libdynlib4_la_DEPENDENCIES)
$(AM_V_CCLD)$(libdynlib4_la_LINK) $(am_libdynlib4_la_rpath) $(libdynlib4_la_OBJECTS) $(libdynlib4_la_LIBADD)
-install-exec-hook:
- $(RM) $(DESTDIR)$(dyndir)/*dynlib*
+#install-exec-hook:
+# $(RM) $(DESTDIR)$(dyndir)/*dynlib*
endif
libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c
diff --git a/test/dsets.c b/test/dsets.c
index c698033..c29d18e 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -17,10 +17,8 @@
*
* Purpose: Tests the dataset interface (H5D)
*/
-
#define H5D_FRIEND /*suppress error about including H5Dpkg */
#define H5D_TESTING
-
#define H5FD_FRIEND /*suppress error about including H5FDpkg */
#define H5FD_TESTING
@@ -12637,7 +12635,123 @@ error:
} /* dls_01_main() */
+/*-------------------------------------------------------------------------
+ * Function: test_compact_open_close_dirty
+ *
+ * Purpose: Verify that the two issues reported in HDFFV-10051 are fixed:
+ * (1) Repeated open/close of a compact dataset fails due to the
+ * increment of ndims in the dataset structure for every open.
+ * (2) layout "dirty" flag for a compact dataset is not reset
+ * properly after flushing the data at dataset close.
+ * The test for issue #1 is based on compactoc.c attached
+ * to the jira issue HDFFV-10051
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Vailin Choi; April 2017
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_compact_open_close_dirty(hid_t fapl)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t did = -1; /* Dataset ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t dcpl = -1; /* Dataset creation property list */
+ hsize_t dims[1] = {10}; /* Dimension */
+ int wbuf[10]; /* Data buffer */
+ char filename[FILENAME_BUF_SIZE]; /* Filename */
+ int i; /* Local index variable */
+ hbool_t dirty; /* The dirty flag */
+
+ TESTING("compact dataset repeated open/close and dirty flag");
+
+ /* Create a file */
+ h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+
+ /* Initialize data */
+ for(i = 0; i < 10; i++)
+ wbuf[i] = i;
+
+ /* Create dataspace */
+ if((sid = H5Screate_simple(1, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Set compact layout */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ TEST_ERROR
+ if(H5Pset_layout(dcpl, H5D_COMPACT) < 0)
+ TEST_ERROR
+ if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0)
+ TEST_ERROR
+
+ /* Create a compact dataset */
+ if((did = H5Dcreate2(fid, DSET_COMPACT_MAX_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Write to the dataset */
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0)
+ TEST_ERROR
+ /* Close the dataset */
+ if(H5Dclose(did) < 0)
+ TEST_ERROR
+
+ /* Verify the repeated open/close of the dataset will not fail */
+ for(i = 0; i < 20;i++) {
+ H5E_BEGIN_TRY {
+ did = H5Dopen2 (fid, DSET_COMPACT_MAX_NAME, H5P_DEFAULT);
+ } H5E_END_TRY;
+ if(did < 0)
+ TEST_ERROR
+ if(H5Dclose(did) < 0)
+ TEST_ERROR
+ }
+
+ /* Open the dataset */
+ if((did = H5Dopen2(fid, DSET_COMPACT_MAX_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Retrieve the "dirty" flag from the compact dataset layout */
+ if(H5D__layout_compact_dirty_test(did, &dirty) < 0)
+ TEST_ERROR
+
+ /* Verify that the "dirty" flag is false */
+ if(dirty)
+ TEST_ERROR
+
+ /* Close the dataset */
+ if(H5Dclose(did) < 0)
+ TEST_ERROR
+
+ /* Close the dataspace */
+ if(H5Sclose(sid) < 0)
+ TEST_ERROR
+
+ /* Close the dataset creation property list */
+ if(H5Pclose(dcpl) < 0)
+ TEST_ERROR
+
+ /* Close the file */
+ if(H5Fclose(fid) < 0)
+ TEST_ERROR
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Sclose(sid);
+ H5Pclose(dcpl);
+ H5Dclose(did);
+ H5Fclose(fid);
+ } H5E_END_TRY;
+ return -1;
+} /* test_compact_open_close_dirty() */
/*-------------------------------------------------------------------------
@@ -12759,6 +12873,7 @@ main(void)
nerrors += (test_simple_io(envval, my_fapl) < 0 ? 1 : 0);
nerrors += (test_compact_io(my_fapl) < 0 ? 1 : 0);
nerrors += (test_max_compact(my_fapl) < 0 ? 1 : 0);
+ nerrors += (test_compact_open_close_dirty(my_fapl) < 0 ? 1 : 0);
nerrors += (test_conv_buffer(file) < 0 ? 1 : 0);
nerrors += (test_tconv(file) < 0 ? 1 : 0);
nerrors += (test_filters(file, my_fapl) < 0 ? 1 : 0);
diff --git a/test/flushrefresh.c b/test/flushrefresh.c
index f35ed5e..0775dee 100644
--- a/test/flushrefresh.c
+++ b/test/flushrefresh.c
@@ -9,6 +9,7 @@
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* Programmer: Mike McGreevy
diff --git a/test/mf.c b/test/mf.c
index 3197989..fea5ee2 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -45,8 +45,10 @@
#define TBLOCK_SIZE4 4
#define TBLOCK_SIZE5 5
#define TBLOCK_SIZE6 6
+#ifdef PB_OUT
#define TBLOCK_SIZE7 7
#define TBLOCK_SIZE8 8
+#endif /* PB_OUT */
#define TBLOCK_SIZE10 10
#define TBLOCK_SIZE11 11
#define TBLOCK_SIZE20 20
@@ -138,8 +140,10 @@ static unsigned test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new
static unsigned test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format);
static unsigned test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format);
static unsigned test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format);
+#ifdef PB_OUT
static unsigned test_mf_fs_persist_split(void);
static unsigned test_mf_fs_persist_multi(void);
+#endif
static unsigned test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl);
static unsigned test_page_small(const char *env_h5_drvr, hid_t fapl);
static unsigned test_page_large(const char *env_h5_drvr, hid_t fapl);
@@ -6091,6 +6095,7 @@ error:
* Verify that the file's free-space manager(s) are persistent for a split-file
*-------------------------------------------------------------------------
*/
+#ifdef PB_OUT
static unsigned
test_mf_fs_persist_split(void)
{
@@ -6716,6 +6721,7 @@ error:
} H5E_END_TRY;
return(1);
} /* test_mf_fs_persist_multi() */
+#endif /* PB_OUT */
/*
*-------------------------------------------------------------------------
diff --git a/test/plugin.c b/test/plugin.c
index 8b4324d..1254e9a 100644
--- a/test/plugin.c
+++ b/test/plugin.c
@@ -574,7 +574,9 @@ test_noread_with_filters(hid_t file)
/* disable filter plugin */
if(H5PLget_loading_state(&plugin_state) < 0) TEST_ERROR
- plugin_state = plugin_state & ~H5PL_FILTER_PLUGIN;
+
+ plugin_state = plugin_state & (unsigned)(~H5PL_FILTER_PLUGIN);
+
if(H5PLset_loading_state(plugin_state) < 0) TEST_ERROR
if((dset = H5Dopen2(file, DSET_DYNLIB1_NAME, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -672,8 +674,8 @@ static herr_t
test_groups_with_filters(hid_t file)
{
herr_t ret_value = -1;
- hid_t gid;
- hid_t group;
+ hid_t gid = -1;
+ hid_t group = -1;
int i;
char gname[256];
diff --git a/test/swmr.c b/test/swmr.c
index 399a9ec..3b1bd09 100644
--- a/test/swmr.c
+++ b/test/swmr.c
@@ -116,16 +116,37 @@ static int test_multiple_same(hid_t in_fapl, hbool_t new_format);
static int
test_metadata_read_attempts(hid_t in_fapl)
{
- hid_t fapl; /* File access property list */
- hid_t file_fapl; /* The file's access property list */
- hid_t fid, fid1, fid2; /* File IDs */
- unsigned attempts; /* The # of read attempts */
- char filename[NAME_BUF_SIZE]; /* File name */
- herr_t ret; /* Generic return value */
+ hid_t fapl = -1; /* File access property list */
+ hid_t file_fapl = -1; /* The file's access property list */
+ hid_t fid = -1, fid1 = -1, fid2 = -1; /* File IDs */
+ hid_t driver_id = -1; /* ID for this VFD */
+ unsigned long driver_flags = 0; /* VFD feature flags */
+ hbool_t compat_w_default_vfd; /* current VFD compat w/ H5P_DEFAULT? */
+ unsigned attempts; /* The # of read attempts */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
TESTING("H5Pget/set_metadata_read_attempts()");
+ /* Check if the driver is compatible with the default VFD.
+ * Most of the tests will attempt to create and open files with both the
+ * VFD specified in the passed-in fapl and the default VFD. Since this
+ * will clearly not work with VFDs that are not compatible with the default
+ * fapl (e.g.: split/multi), we just skip this entire test.
+ */
+ if ((driver_id = H5Pget_driver(in_fapl)) < 0)
+ FAIL_STACK_ERROR
+ if (H5FDdriver_query(driver_id, &driver_flags) < 0)
+ FAIL_STACK_ERROR
+ compat_w_default_vfd = (driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE) ? TRUE : FALSE;
+
+ if (!compat_w_default_vfd) {
+ SKIPPED()
+ HDputs(" The current VFD is not compatible with the default VFD.");
+ return 0;
+ }
+
/* Get a copy of the parameter fapl */
if((fapl = H5Pcopy(in_fapl)) < 0)
FAIL_STACK_ERROR
diff --git a/test/swmr_remove_reader.c b/test/swmr_remove_reader.c
index 11649e3..1fae5e7 100644
--- a/test/swmr_remove_reader.c
+++ b/test/swmr_remove_reader.c
@@ -227,7 +227,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nseconds,
/* Determine the offset of the symbol, within level 0 symbols */
/* (level 0 symbols are the most common symbols) */
- offset = (unsigned)(HDrandom() % symbol_count[0]);
+ offset = (unsigned)HDrandom() % symbol_count[0];
sym_com[v] = &symbol_info[0][offset];
/* Emit informational message */
diff --git a/test/swmr_remove_writer.c b/test/swmr_remove_writer.c
index 82c2f8b..43743d9 100644
--- a/test/swmr_remove_writer.c
+++ b/test/swmr_remove_writer.c
@@ -187,7 +187,7 @@ remove_records(hid_t fid, unsigned verbose, unsigned long nshrinks, unsigned lon
symbol->nrecords = 0;
else
symbol->nrecords -= remove_size;
- dim[1] = symbol->nrecords;
+ dim[1] = symbol->nrecords;
if(H5Dset_extent(symbol->dsid, dim) < 0)
return -1;
diff --git a/test/tfile.c b/test/tfile.c
index 50e3341..533bb24 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -4929,9 +4929,9 @@ test_libver_bounds(void)
static void
test_libver_macros(void)
{
- unsigned major = H5_VERS_MAJOR;
- unsigned minor = H5_VERS_MINOR;
- unsigned release = H5_VERS_RELEASE;
+ int major = H5_VERS_MAJOR;
+ int minor = H5_VERS_MINOR;
+ int release = H5_VERS_RELEASE;
/* Output message about test being performed */
MESSAGE(5, ("Testing macros for library version comparison\n"));
diff --git a/test/use_common.c b/test/use_common.c
index 908cac9..5aa6692 100644
--- a/test/use_common.c
+++ b/test/use_common.c
@@ -48,6 +48,8 @@ parse_option(int argc, char * const argv[])
{
int ret_value=0;
int c;
+ int use_swmr; /* Need an int to detect errors */
+
/* command line options: See function usage for a description */
const char *nagg_options = "f:hi:l:n:s:y:z:";
@@ -96,11 +98,13 @@ parse_option(int argc, char * const argv[])
};
break;
case 's': /* use swmr file open mode */
- if ((UC_opts.use_swmr = HDatoi(optarg)) < 0) {
- fprintf(stderr, "swmr value should be 0(no) or 1(yes)\n");
- usage(progname_g);
- Hgoto_error(-1);
- };
+ use_swmr = HDatoi(optarg);
+ if (use_swmr != 0 && use_swmr != 1) {
+ HDfprintf(stderr, "swmr value should be 0(no) or 1(yes)\n");
+ usage(progname_g);
+ Hgoto_error(-1);
+ }
+ UC_opts.use_swmr = (hbool_t)use_swmr;
break;
case 'y': /* Number of planes per chunk */
if ((UC_opts.chunkplanes = HDstrtoul(optarg, NULL, 0)) <= 0) {
diff --git a/test/vfd.c b/test/vfd.c
index 1932d2c..5d5ebfc 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -86,6 +86,8 @@ test_sec2(void)
hid_t fid = -1; /* file ID */
hid_t fapl_id = -1; /* file access property list ID */
hid_t fapl_id_out = -1; /* from H5Fget_access_plist */
+ hid_t driver_id = -1; /* ID for this VFD */
+ unsigned long driver_flags = 0; /* VFD feature flags */
char filename[1024]; /* filename */
void *os_file_handle = NULL; /* OS file handle */
hsize_t file_size; /* file size */
@@ -99,6 +101,28 @@ test_sec2(void)
TEST_ERROR;
h5_fixname(FILENAME[0], fapl_id, filename, sizeof(filename));
+ /* Check that the VFD feature flags are correct */
+ if ((driver_id = H5Pget_driver(fapl_id)) < 0)
+ TEST_ERROR
+ if (H5FDdriver_query(driver_id, &driver_flags) < 0)
+ TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_POSIX_COMPAT_HANDLE)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_SUPPORTS_SWMR_IO)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) TEST_ERROR
+ /* Check for extra flags not accounted for above */
+ if(driver_flags != (H5FD_FEAT_AGGREGATE_METADATA
+ | H5FD_FEAT_ACCUMULATE_METADATA
+ | H5FD_FEAT_DATA_SIEVE
+ | H5FD_FEAT_AGGREGATE_SMALLDATA
+ | H5FD_FEAT_POSIX_COMPAT_HANDLE
+ | H5FD_FEAT_SUPPORTS_SWMR_IO
+ | H5FD_FEAT_DEFAULT_VFD_COMPATIBLE))
+ TEST_ERROR
+
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
TEST_ERROR;
@@ -174,6 +198,8 @@ test_core(void)
hid_t fid = -1; /* file ID */
hid_t fapl_id = -1; /* file access property list ID */
hid_t fapl_id_out = -1; /* from H5Fget_access_plist */
+ hid_t driver_id = -1; /* ID for this VFD */
+ unsigned long driver_flags = 0; /* VFD feature flags */
hid_t did = -1; /* dataset ID */
hid_t sid = -1; /* dataspace ID */
char filename[1024]; /* filename */
@@ -208,9 +234,34 @@ test_core(void)
if(HDaccess(filename, F_OK) != -1)
if(HDremove(filename) < 0)
FAIL_PUTS_ERROR("unable to remove backing store file");
+
/* Create and close file w/ backing store off */
if(H5Pset_fapl_core(fapl_id, (size_t)CORE_INCREMENT, FALSE) < 0)
TEST_ERROR;
+
+ /* Check that the VFD feature flags are correct.
+ * Note that the H5FDdriver_query() API call does not require a file
+ * so backing-store related flags will not be returned here.
+ */
+ if ((driver_id = H5Pget_driver(fapl_id)) < 0)
+ TEST_ERROR
+ if (H5FDdriver_query(driver_id, &driver_flags) < 0)
+ TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_ALLOW_FILE_IMAGE)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS)) TEST_ERROR
+ /* Check for extra flags not accounted for above */
+ if(driver_flags != (H5FD_FEAT_AGGREGATE_METADATA
+ | H5FD_FEAT_ACCUMULATE_METADATA
+ | H5FD_FEAT_DATA_SIEVE
+ | H5FD_FEAT_AGGREGATE_SMALLDATA
+ | H5FD_FEAT_ALLOW_FILE_IMAGE
+ | H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS))
+ TEST_ERROR
+
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
TEST_ERROR;
if(H5Fclose(fid) < 0)
@@ -219,7 +270,6 @@ test_core(void)
if(HDaccess(filename, F_OK) != -1)
FAIL_PUTS_ERROR("file created when backing store set to FALSE");
-
/************************************************************************
* Check basic core VFD operation and properties. This is done with the
* backing store on so a file will be created for later use.
@@ -795,6 +845,8 @@ test_family(void)
{
hid_t file=-1, fapl=-1, fapl2=-1, space=-1, dset=-1;
hid_t access_fapl = -1;
+ hid_t driver_id = -1; /* ID for this VFD */
+ unsigned long driver_flags = 0; /* VFD feature flags */
char filename[1024];
char dname[]="dataset";
unsigned int i, j;
@@ -812,6 +864,22 @@ test_family(void)
TEST_ERROR;
h5_fixname(FILENAME[2], fapl, filename, sizeof(filename));
+ /* Check that the VFD feature flags are correct */
+ if ((driver_id = H5Pget_driver(fapl)) < 0)
+ TEST_ERROR
+ if (H5FDdriver_query(driver_id, &driver_flags) < 0)
+ TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR
+ /* Check for extra flags not accounted for above */
+ if(driver_flags != (H5FD_FEAT_AGGREGATE_METADATA
+ | H5FD_FEAT_ACCUMULATE_METADATA
+ | H5FD_FEAT_DATA_SIEVE
+ | H5FD_FEAT_AGGREGATE_SMALLDATA))
+ TEST_ERROR
+
if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
@@ -1096,6 +1164,8 @@ test_multi(void)
hid_t file=-1, fapl=-1, fapl2=-1, dset=-1, space=-1;
hid_t root=-1, attr=-1, aspace=-1, atype=-1;
hid_t access_fapl = -1;
+ hid_t driver_id = -1; /* ID for this VFD */
+ unsigned long driver_flags = 0; /* VFD feature flags */
char filename[1024];
int *fhandle2=NULL, *fhandle=NULL;
hsize_t file_size;
@@ -1152,6 +1222,22 @@ test_multi(void)
TEST_ERROR;
h5_fixname(FILENAME[4], fapl, filename, sizeof filename);
+ /* Check that the VFD feature flags are correct */
+ if ((driver_id = H5Pget_driver(fapl)) < 0)
+ TEST_ERROR
+ if (H5FDdriver_query(driver_id, &driver_flags) < 0)
+ TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_USE_ALLOC_SIZE)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_PAGED_AGGR)) TEST_ERROR
+ /* Check for extra flags not accounted for above */
+ if(driver_flags != (H5FD_FEAT_DATA_SIEVE
+ | H5FD_FEAT_AGGREGATE_SMALLDATA
+ | H5FD_FEAT_USE_ALLOC_SIZE
+ | H5FD_FEAT_PAGED_AGGR))
+ TEST_ERROR
+
if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
@@ -1484,6 +1570,8 @@ test_log(void)
hid_t file = -1;
hid_t fapl = -1;
hid_t access_fapl = -1;
+ hid_t driver_id = -1; /* ID for this VFD */
+ unsigned long driver_flags = 0; /* VFD feature flags */
char filename[1024];
int *fhandle = NULL;
hsize_t file_size = 0;
@@ -1499,6 +1587,28 @@ test_log(void)
TEST_ERROR;
h5_fixname(FILENAME[6], fapl, filename, sizeof filename);
+ /* Check that the VFD feature flags are correct */
+ if ((driver_id = H5Pget_driver(fapl)) < 0)
+ TEST_ERROR
+ if (H5FDdriver_query(driver_id, &driver_flags) < 0)
+ TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_POSIX_COMPAT_HANDLE)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_SUPPORTS_SWMR_IO)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) TEST_ERROR
+ /* Check for extra flags not accounted for above */
+ if(driver_flags != (H5FD_FEAT_AGGREGATE_METADATA
+ | H5FD_FEAT_ACCUMULATE_METADATA
+ | H5FD_FEAT_DATA_SIEVE
+ | H5FD_FEAT_AGGREGATE_SMALLDATA
+ | H5FD_FEAT_POSIX_COMPAT_HANDLE
+ | H5FD_FEAT_SUPPORTS_SWMR_IO
+ | H5FD_FEAT_DEFAULT_VFD_COMPATIBLE))
+ TEST_ERROR
+
/* Create the test file */
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
@@ -1571,6 +1681,8 @@ test_stdio(void)
hid_t file = -1;
hid_t fapl = -1;
hid_t access_fapl = -1;
+ hid_t driver_id = -1; /* ID for this VFD */
+ unsigned long driver_flags = 0; /* VFD feature flags */
char filename[1024];
FILE *fhandle = NULL;
hsize_t file_size = 0;
@@ -1584,6 +1696,24 @@ test_stdio(void)
TEST_ERROR;
h5_fixname(FILENAME[7], fapl, filename, sizeof filename);
+ /* Check that the VFD feature flags are correct */
+ if ((driver_id = H5Pget_driver(fapl)) < 0)
+ TEST_ERROR
+ if (H5FDdriver_query(driver_id, &driver_flags) < 0)
+ TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) TEST_ERROR
+ /* Check for extra flags not accounted for above */
+ if(driver_flags != (H5FD_FEAT_AGGREGATE_METADATA
+ | H5FD_FEAT_ACCUMULATE_METADATA
+ | H5FD_FEAT_DATA_SIEVE
+ | H5FD_FEAT_AGGREGATE_SMALLDATA
+ | H5FD_FEAT_DEFAULT_VFD_COMPATIBLE))
+ TEST_ERROR
+
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
@@ -1658,6 +1788,8 @@ test_windows(void)
hid_t file = -1;
hid_t fapl = -1;
hid_t access_fapl = -1;
+ hid_t driver_id = -1; /* ID for this VFD */
+ unsigned long driver_flags = 0; /* VFD feature flags */
char filename[1024];
int *fhandle = NULL;
hsize_t file_size = 0;
@@ -1680,6 +1812,28 @@ test_windows(void)
TEST_ERROR;
h5_fixname(FILENAME[8], fapl, filename, sizeof filename);
+ /* Check that the VFD feature flags are correct */
+ if ((driver_id = H5Pget_driver(fapl)) < 0)
+ TEST_ERROR
+ if (H5FDdriver_query(driver_id, &driver_flags) < 0)
+ TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_POSIX_COMPAT_HANDLE)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_SUPPORTS_SWMR_IO)) TEST_ERROR
+ if(!(driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) TEST_ERROR
+ /* Check for extra flags not accounted for above */
+ if(driver_flags != (H5FD_FEAT_AGGREGATE_METADATA
+ | H5FD_FEAT_ACCUMULATE_METADATA
+ | H5FD_FEAT_DATA_SIEVE
+ | H5FD_FEAT_AGGREGATE_SMALLDATA
+ | H5FD_FEAT_POSIX_COMPAT_HANDLE
+ | H5FD_FEAT_SUPPORTS_SWMR_IO
+ | H5FD_FEAT_DEFAULT_VFD_COMPATIBLE))
+ TEST_ERROR
+
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;