2
0
mirror of https://github.com/HDFGroup/hdf5.git synced 2025-04-24 17:51:25 +08:00

Minor fixes: updating the test vds_env.c according to the set up of vds.c.

This commit is contained in:
Songyu Lu 2019-04-10 10:21:38 -05:00
parent c0b13e078e
commit 06002f8c22
2 changed files with 48 additions and 8 deletions

@ -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 */

@ -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
/* Verify symbol table messages are cached */
nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
/* 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
/* 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;