summaryrefslogtreecommitdiffstats
path: root/test/stab.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2017-03-14 04:30:37 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2017-03-14 04:30:37 (GMT)
commit0313cbb91d974b153dbe8747d193ac3c619eea3b (patch)
treeaf6c4a631d5753685ee0033a6a8415a25fc97672 /test/stab.c
parent847d675f2743ec420ef6c9efdd6e52ae93b4fe44 (diff)
downloadhdf5-0313cbb91d974b153dbe8747d193ac3c619eea3b.zip
hdf5-0313cbb91d974b153dbe8747d193ac3c619eea3b.tar.gz
hdf5-0313cbb91d974b153dbe8747d193ac3c619eea3b.tar.bz2
Final merge of page buffering branch to develop
Diffstat (limited to 'test/stab.c')
-rw-r--r--test/stab.c81
1 files changed, 58 insertions, 23 deletions
diff --git a/test/stab.c b/test/stab.c
index f81bb5f..00aee21 100644
--- a/test/stab.c
+++ b/test/stab.c
@@ -96,7 +96,7 @@ const char *FILENAME[] = {
*-------------------------------------------------------------------------
*/
static int
-test_misc(hid_t fapl, hbool_t new_format)
+test_misc(hid_t fcpl, hid_t fapl, hbool_t new_format)
{
hid_t fid = (-1); /* File ID */
hid_t g1 = (-1), g2 = (-1), g3 = (-1);
@@ -110,7 +110,7 @@ test_misc(hid_t fapl, hbool_t new_format)
/* Create file */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
- if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) TEST_ERROR
/* Create initial groups for testing, then close */
if((g1 = H5Gcreate2(fid, "test_1a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -177,7 +177,7 @@ test_misc(hid_t fapl, hbool_t new_format)
*-------------------------------------------------------------------------
*/
static int
-test_long(hid_t fapl, hbool_t new_format)
+test_long(hid_t fcpl, hid_t fapl, hbool_t new_format)
{
hid_t fid = (-1); /* File ID */
hid_t g1 = (-1), g2 = (-1);
@@ -192,7 +192,7 @@ test_long(hid_t fapl, hbool_t new_format)
/* Create file */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
- if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) TEST_ERROR
/* Group names */
name1 = (char *)HDmalloc((size_t)LONG_NAME_LEN);
@@ -252,7 +252,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-test_large(hid_t fapl, hbool_t new_format)
+test_large(hid_t fcpl, hid_t fapl, hbool_t new_format)
{
hid_t fid = (-1); /* File ID */
hid_t cwg = (-1), dir = (-1); /* Group IDs */
@@ -267,7 +267,7 @@ test_large(hid_t fapl, hbool_t new_format)
/* Create file */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
- if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) TEST_ERROR
/*
* Create a directory that has so many entries that the root
@@ -318,7 +318,7 @@ test_large(hid_t fapl, hbool_t new_format)
*-------------------------------------------------------------------------
*/
static int
-lifecycle(hid_t fapl2)
+lifecycle(hid_t fcpl, hid_t fapl2)
{
hid_t fid = (-1); /* File ID */
hid_t gid = (-1); /* Group ID */
@@ -341,7 +341,7 @@ lifecycle(hid_t fapl2)
/* Create file */
h5_fixname(FILENAME[0], fapl2, filename, sizeof(filename));
- if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl2)) < 0) TEST_ERROR
/* Close file */
if(H5Fclose(fid) < 0) TEST_ERROR
@@ -532,7 +532,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-long_compact(hid_t fapl2)
+long_compact(hid_t fcpl, hid_t fapl2)
{
hid_t fid = (-1); /* File ID */
hid_t gid = (-1); /* Group ID */
@@ -546,7 +546,7 @@ long_compact(hid_t fapl2)
/* Create file */
h5_fixname(FILENAME[0], fapl2, filename, sizeof(filename));
- if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl2)) < 0) TEST_ERROR
/* Close file */
if(H5Fclose(fid) < 0) TEST_ERROR
@@ -755,7 +755,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-no_compact(hid_t fapl2)
+no_compact(hid_t fcpl, hid_t fapl2)
{
hid_t fid = (-1); /* File ID */
hid_t gid = (-1); /* Group ID */
@@ -772,7 +772,7 @@ no_compact(hid_t fapl2)
/* Create file */
h5_fixname(FILENAME[0], fapl2, filename, sizeof(filename));
- if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) TEST_ERROR
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl2)) < 0) TEST_ERROR
/* Close file */
if(H5Fclose(fid) < 0) TEST_ERROR
@@ -1165,9 +1165,20 @@ error:
int
main(void)
{
- hid_t fapl, fapl2; /* File access property list IDs */
- unsigned new_format; /* Whether to use the new format or not */
- int nerrors = 0;
+ hid_t fapl, fapl2; /* File access property list IDs */
+ hid_t fcpl, fcpl2; /* File creation property list ID */
+ unsigned new_format; /* Whether to use the new format or not */
+ const char *env_h5_drvr; /* File Driver value from environment */
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
+ int nerrors = 0;
+
+ /* Get the VFD to use */
+ env_h5_drvr = HDgetenv("HDF5_DRIVER");
+ if(env_h5_drvr == NULL)
+ env_h5_drvr = "nomatch";
+
+ /* VFD that does not support contigous address space */
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
/* Reset library */
h5_reset();
@@ -1179,20 +1190,42 @@ main(void)
/* 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
+ /* Set up file creation property list */
+ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR
+ if((fcpl2 = H5Pcopy(fcpl)) < 0) TEST_ERROR
+
+ /* Set to use paged aggregation strategy and persisting free-space */
+ /* Skip testing for multi/split drivers */
+ if(H5Pset_file_space_strategy(fcpl2, H5F_FSPACE_STRATEGY_PAGE, 1, (hsize_t)1) < 0)
+ TEST_ERROR
+
/* Loop over using new group format */
for(new_format = FALSE; new_format <= TRUE; new_format++) {
+ hid_t my_fapl = fapl;
+ hid_t my_fcpl = fcpl;
+
+ if(!contig_addr_vfd)
+ continue;
+
+ if(new_format) {
+ my_fapl = fapl2;
+ my_fcpl = fcpl2; /* Set to use paged aggregation and persisting free-space */
+ }
+
/* Perform basic tests, with old & new style groups */
- nerrors += test_misc((new_format ? fapl2 : fapl), new_format);
- nerrors += test_long((new_format ? fapl2 : fapl), new_format);
- nerrors += test_large((new_format ? fapl2 : fapl), new_format);
+ nerrors += test_misc(my_fcpl, my_fapl, new_format);
+ nerrors += test_long(my_fcpl, my_fapl, new_format);
+ nerrors += test_large(my_fcpl, my_fapl, new_format);
} /* end for */
/* New format group specific tests (require new format features) */
- nerrors += lifecycle(fapl2);
- nerrors += long_compact(fapl2);
- nerrors += read_old();
- nerrors += no_compact(fapl2);
- nerrors += gcpl_on_root(fapl2);
+ if(contig_addr_vfd) {
+ nerrors += lifecycle(fcpl2, fapl2);
+ nerrors += long_compact(fcpl2, fapl2);
+ nerrors += read_old();
+ nerrors += no_compact(fcpl2, fapl2);
+ nerrors += gcpl_on_root(fapl2);
+ }
/* Old group API specific tests */
nerrors += old_api(fapl);
@@ -1200,6 +1233,8 @@ main(void)
/* Close 2nd FAPL */
H5Pclose(fapl2);
+ H5Pclose(fcpl);
+ H5Pclose(fcpl2);
/* Verify symbol table messages are cached */
nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);