From 06002f8c22b46d69cf4951eba0bbca946955c0d0 Mon Sep 17 00:00:00 2001 From: Songyu Lu Date: Wed, 10 Apr 2019 10:21:38 -0500 Subject: Minor fixes: updating the test vds_env.c according to the set up of vds.c. --- src/H5Fprivate.h | 2 +- test/vds_env.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 48 insertions(+), 8 deletions(-) diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 553e16b..80d7229 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -702,7 +702,7 @@ typedef enum H5F_mem_page_t { /* Type of prefix for opening prefixed files */ typedef enum H5F_prefix_open_t { - H5D_PREFIX_ERROR = -1, /* Error */ + H5F_PREFIX_ERROR = -1, /* Error */ H5F_PREFIX_VDS = 0, /* Virtual dataset prefix */ H5F_PREFIX_ELINK = 1, /* External link prefix */ H5F_PREFIX_EFILE = 2, /* External file prefix */ diff --git a/test/vds_env.c b/test/vds_env.c index d73336d..b42bb00 100644 --- a/test/vds_env.c +++ b/test/vds_env.c @@ -294,22 +294,62 @@ int main(void) { char filename[FILENAME_BUF_SIZE]; - hid_t fapl; + hid_t fapl, my_fapl; int test_api_config; unsigned bit_config; + H5F_libver_t low, high; /* Low and high bounds */ + unsigned latest = FALSE; /* Using the latest library version bound */ int nerrors = 0; /* Testing setup */ h5_reset(); fapl = h5_fileaccess(); - for(bit_config = 0; bit_config < TEST_IO_NTESTS; bit_config++) { - HDprintf("Config: %s%s%s\n", bit_config & TEST_IO_CLOSE_SRC ? "closed source dataset, " : "", bit_config & TEST_IO_DIFFERENT_FILE ? "different source file" : "same source file", bit_config & TEST_IO_REOPEN_VIRT ? ", reopen virtual file" : ""); - nerrors += test_vds_prefix_second(bit_config, fapl); - } + /* Set to use the latest file format */ + if((my_fapl = H5Pcopy(fapl)) < 0) TEST_ERROR + + /* Loop through all the combinations of low/high version bounds */ + for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { + for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { + char msg[80]; /* Message for file version bounds */ + char *low_string; /* The low bound string */ + char *high_string; /* The high bound string */ + + /* Invalid combinations, just continue */ + if(high == H5F_LIBVER_EARLIEST || high < low) + continue; + + /* Test virtual dataset only for V110 and above */ + if(high < H5F_LIBVER_V110) + continue; + + /* Whether to use latest hyperslab/point selection version */ + if(low >= H5F_LIBVER_V112) + latest = TRUE; + + /* Set the low/high version bounds */ + if(H5Pset_libver_bounds(my_fapl, low, high) < 0) + TEST_ERROR - /* Verify symbol table messages are cached */ - nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); + /* Display testing info */ + low_string = h5_get_version_string(low); + high_string = h5_get_version_string(high); + HDsprintf(msg, "Testing virtual dataset with file version bounds: (%s, %s):", low_string, high_string); + HDputs(msg); + + for(bit_config = 0; bit_config < TEST_IO_NTESTS; bit_config++) { + HDprintf("Config: %s%s%s\n", bit_config & TEST_IO_CLOSE_SRC ? "closed source dataset, " : "", bit_config & TEST_IO_DIFFERENT_FILE ? "different source file" : "same source file", bit_config & TEST_IO_REOPEN_VIRT ? ", reopen virtual file" : ""); + nerrors += test_vds_prefix_second(bit_config, fapl); + } + + /* Verify symbol table messages are cached */ + nerrors += (h5_verify_cached_stabs(FILENAME, my_fapl) < 0 ? 1 : 0); + + } /* end for high */ + } /* end for low */ + + if(H5Pclose(my_fapl) < 0) + TEST_ERROR if(nerrors) goto error; -- cgit v0.12