summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2017-08-01 20:20:58 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2017-08-01 20:20:58 (GMT)
commit8e5c993d9c55b99df36ab8a0c9b66a0de390c181 (patch)
treed353e33df4c6bffcdfcb2caba32c8a35ef7729d7 /test
parent0f396554d86dc26048d5c105ceb748e452fd9229 (diff)
parent464926f2a3adf3ef1c1e3ae60105544f08ff1e51 (diff)
downloadhdf5-8e5c993d9c55b99df36ab8a0c9b66a0de390c181.zip
hdf5-8e5c993d9c55b99df36ab8a0c9b66a0de390c181.tar.gz
hdf5-8e5c993d9c55b99df36ab8a0c9b66a0de390c181.tar.bz2
Merge branch 'develop' into vol_integration
Diffstat (limited to 'test')
-rw-r--r--test/fheap.c16
-rw-r--r--test/plugin.c65
-rw-r--r--test/tfile.c17
3 files changed, 77 insertions, 21 deletions
diff --git a/test/fheap.c b/test/fheap.c
index 4be6cb9..6c3a8ac 100644
--- a/test/fheap.c
+++ b/test/fheap.c
@@ -16377,6 +16377,16 @@ main(void)
unsigned nerrors = 0; /* Cumulative error count */
unsigned num_pb_fs = 1; /* The number of settings to test for page buffering and file space handling */
int ExpressMode; /* Express testing level */
+ const char *envval; /* Environment variable */
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
+
+ /* Don't run this test using certain file drivers */
+ envval = HDgetenv("HDF5_DRIVER");
+ if(envval == NULL)
+ envval = "nomatch";
+
+ /* Current VFD that does not support contigous address space */
+ contig_addr_vfd = (hbool_t)(HDstrcmp(envval, "split") && HDstrcmp(envval, "multi"));
/* Reset library */
h5_reset();
@@ -16428,6 +16438,12 @@ main(void)
shared_wobj_g[u] = (unsigned char)u;
for(v = 0; v < num_pb_fs; v++) {
+ /* Skip test when:
+ a) multi/split drivers and
+ b) persisting free-space or using paged aggregation strategy
+ because the library will fail file creation (temporary) for the above conditions */
+ if(!contig_addr_vfd && v)
+ break;
if((fcpl = H5Pcopy(def_fcpl)) < 0)
TEST_ERROR
diff --git a/test/plugin.c b/test/plugin.c
index f536a9e..ea199f6 100644
--- a/test/plugin.c
+++ b/test/plugin.c
@@ -723,7 +723,6 @@ test_path_api_calls(void)
ssize_t path_len = -1;
char path[256];
char temp_name[256];
- herr_t ret_value = -1;
HDputs("Testing access to the filter path table");
@@ -737,6 +736,15 @@ test_path_api_calls(void)
*/
n_starting_paths = 42;
+ /* Check that initialization is correct */
+ TESTING(" initialize");
+
+ if(H5PLsize(&n_paths) < 0)
+ TEST_ERROR
+ if(n_paths != 2)
+ TEST_ERROR
+
+ PASSED();
/****************/
/* H5PLremove() */
@@ -1097,37 +1105,44 @@ main(void)
/* Testing setup */
h5_reset();
- fapl = h5_fileaccess();
+
+ if ((fapl = h5_fileaccess()) < 0)
+ TEST_ERROR
/* Turn off the chunk cache, so all the chunks are immediately written to disk */
- if(H5Pget_cache(fapl, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0) < 0) TEST_ERROR
+ if (H5Pget_cache(fapl, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0) < 0)
+ TEST_ERROR
rdcc_nbytes = 0;
- if(H5Pset_cache(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0) TEST_ERROR
+ if (H5Pset_cache(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0)
+ TEST_ERROR
/* Copy the file access property list */
- if((fapl2 = H5Pcopy(fapl)) < 0) TEST_ERROR
+ if ((fapl2 = H5Pcopy(fapl)) < 0)
+ TEST_ERROR
/* Set the "use the latest version of the format" bounds for creating objects in the file */
- if(H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) TEST_ERROR
+ if (H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR
- h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
+ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
/* Test with old & new format groups */
- for(new_format = FALSE; new_format <= TRUE; new_format++) {
+ for (new_format = FALSE; new_format <= TRUE; new_format++) {
hid_t my_fapl;
/* Set the FAPL for the type of format */
- if(new_format) {
+ if (new_format) {
HDputs("\nTesting with new file format:");
my_fapl = fapl2;
- } /* end if */
+ }
else {
HDputs("Testing with old file format:");
my_fapl = fapl;
- } /* end else */
+ }
/* Create the file for this test */
- if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR
+ if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
+ TEST_ERROR
/* Test dynamically loaded filters for chunked dataset */
nerrors += (test_filters_for_datasets(file) < 0 ? 1 : 0);
@@ -1135,12 +1150,15 @@ main(void)
/* Test dynamically loaded filters for groups */
nerrors += (test_filters_for_groups(file) < 0 ? 1 : 0);
- if(H5Fclose(file) < 0) TEST_ERROR
+ if (H5Fclose(file) < 0)
+ TEST_ERROR
} /* end for */
/* Close FAPL */
- if(H5Pclose(fapl2) < 0) TEST_ERROR
- if(H5Pclose(fapl) < 0) TEST_ERROR
+ if (H5Pclose(fapl2) < 0)
+ TEST_ERROR
+ if (H5Pclose(fapl) < 0)
+ TEST_ERROR
/* Restore the default error handler (set in h5_reset()) */
h5_restore_err();
@@ -1149,10 +1167,12 @@ main(void)
/* Close the library so that all loaded plugin libraries are unloaded */
h5_reset();
- fapl = h5_fileaccess();
+ if ((fapl = h5_fileaccess()) < 0)
+ TEST_ERROR
/* Reopen the file for testing data reading */
- if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
+ if ((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0)
+ TEST_ERROR
/* Read the data with filters */
nerrors += (test_read_with_filters(file) < 0 ? 1 : 0);
@@ -1165,20 +1185,23 @@ main(void)
/* Close the library so that all loaded plugin libraries are unloaded */
h5_reset();
- fapl = h5_fileaccess();
+ if ((fapl = h5_fileaccess()) < 0)
+ TEST_ERROR
/* Reopen the file for testing data reading */
- if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
+ if ((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0)
+ TEST_ERROR
/* Read the data with disabled filters */
nerrors += (test_noread_with_filters(file) < 0 ? 1 : 0);
- if(H5Fclose(file) < 0) TEST_ERROR
+ if (H5Fclose(file) < 0)
+ TEST_ERROR
/* Test the APIs for access to the filter plugin path table */
nerrors += (test_path_api_calls() < 0 ? 1 : 0);
- if(nerrors)
+ if (nerrors)
TEST_ERROR
HDprintf("All plugin tests passed.\n");
diff --git a/test/tfile.c b/test/tfile.c
index eb4dff8..a5e98f8 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -109,6 +109,7 @@
#define TEST_THRESHOLD10 10 /* Free space section threshold */
#define FSP_SIZE_DEF 4096 /* File space page size default */
#define FSP_SIZE512 512 /* File space page size */
+#define FSP_SIZE1G 1024*1024*1024 /* File space page size */
/* Declaration for test_libver_macros2() */
#define FILE6 "tfile6.h5" /* Test file */
@@ -3582,6 +3583,9 @@ test_filespace_info(const char *env_h5_drvr)
* Setting value less than 512 will return an error;
* --setting file space page size to 0
* --setting file space page size to 511
+ *
+ * File space page size has a maximum size of 1 gigabyte.
+ * Setting value greater than 1 gigabyte will return an error.
*/
/* Create file creation property list template */
fcpl = H5Pcreate(H5P_FILE_CREATE);
@@ -3599,6 +3603,12 @@ test_filespace_info(const char *env_h5_drvr)
} H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_file_space_page_size");
+ /* Setting to 1GB+1: should fail */
+ H5E_BEGIN_TRY {
+ ret = H5Pset_file_space_page_size(fcpl, FSP_SIZE1G+1);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Pset_file_space_page_size");
+
/* Setting to 512: should succeed */
ret = H5Pset_file_space_page_size(fcpl, FSP_SIZE512);
CHECK(ret, FAIL, "H5Pset_file_space_page_size");
@@ -3606,6 +3616,13 @@ test_filespace_info(const char *env_h5_drvr)
CHECK(ret, FAIL, "H5Pget_file_space_page_size");
VERIFY(fsp_size, FSP_SIZE512, "H5Pget_file_space_page_size");
+ /* Setting to 1GB: should succeed */
+ ret = H5Pset_file_space_page_size(fcpl, FSP_SIZE1G);
+ CHECK(ret, FAIL, "H5Pset_file_space_page_size");
+ ret = H5Pget_file_space_page_size(fcpl, &fsp_size);
+ CHECK(ret, FAIL, "H5Pget_file_space_page_size");
+ VERIFY(fsp_size, FSP_SIZE1G, "H5Pget_file_space_page_size");
+
/* Close property list */
H5Pclose(fcpl);