summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2017-05-26 22:22:07 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2017-05-26 22:22:07 (GMT)
commit13d3d4bd0e0b799aa9c3a9b45e445d1f52294d47 (patch)
tree6e002d8f2366917b876c1f20feebbb07d0245874 /test
parent343b53d64f4e8ecd2fbab5c356099918e55d8238 (diff)
downloadhdf5-13d3d4bd0e0b799aa9c3a9b45e445d1f52294d47.zip
hdf5-13d3d4bd0e0b799aa9c3a9b45e445d1f52294d47.tar.gz
hdf5-13d3d4bd0e0b799aa9c3a9b45e445d1f52294d47.tar.bz2
Added feature flag checks for a few other VFDs in test/vfd.c.
Diffstat (limited to 'test')
-rw-r--r--test/vfd.c126
1 files changed, 116 insertions, 10 deletions
diff --git a/test/vfd.c b/test/vfd.c
index 213cd9c..f8e5761 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -101,9 +101,6 @@ test_sec2(void)
TEST_ERROR;
h5_fixname(FILENAME[0], fapl_id, filename, sizeof(filename));
- if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
- TEST_ERROR;
-
/* Check that the VFD feature flags are correct */
if ((driver_id = H5Pget_driver(fapl_id)) < 0)
TEST_ERROR
@@ -126,6 +123,9 @@ test_sec2(void)
| H5FD_FEAT_DEFAULT_VFD_COMPATIBLE))
TEST_ERROR
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ TEST_ERROR;
+
/* Retrieve the access property list... */
if((fapl_id_out = H5Fget_access_plist(fid)) < 0)
TEST_ERROR;
@@ -234,16 +234,10 @@ 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;
- if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
- TEST_ERROR;
- if(H5Fclose(fid) < 0)
- TEST_ERROR;
- /* Check for the backing store file */
- if(HDaccess(filename, F_OK) != -1)
- FAIL_PUTS_ERROR("file created when backing store set to FALSE");
/* Check that the VFD feature flags are correct.
* Note that the H5FDdriver_query() API call does not require a file
@@ -268,6 +262,14 @@ test_core(void)
| 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)
+ TEST_ERROR;
+ /* Check for the backing store file */
+ 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.
@@ -843,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;
@@ -860,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;
@@ -1144,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;
@@ -1200,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;
@@ -1532,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;
@@ -1547,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;
@@ -1619,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;
@@ -1632,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;
@@ -1706,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;
@@ -1728,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_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((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;