diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeLists.txt | 1 | ||||
-rw-r--r-- | test/enc_dec_plist.c | 4 | ||||
-rw-r--r-- | test/external.c | 3 | ||||
-rw-r--r-- | test/external_common.h | 12 | ||||
-rw-r--r-- | test/external_env.c | 1 | ||||
-rw-r--r-- | test/external_fname.h | 37 | ||||
-rw-r--r-- | test/fheap.c | 41 | ||||
-rw-r--r-- | test/h5test.c | 2 | ||||
-rw-r--r-- | test/h5test.h | 2 | ||||
-rw-r--r-- | test/ohdr.c | 4 | ||||
-rw-r--r-- | test/tid.c | 2 | ||||
-rw-r--r-- | test/ttsafe_error.c | 2 | ||||
-rw-r--r-- | test/vds.c | 4 | ||||
-rw-r--r-- | test/vds_env.c | 4 | ||||
-rw-r--r-- | test/vds_swmr.h | 48 | ||||
-rw-r--r-- | test/vds_swmr_gen.c | 46 | ||||
-rw-r--r-- | test/vds_swmr_reader.c | 2 |
17 files changed, 125 insertions, 90 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 15d10a7..9173531 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -22,6 +22,7 @@ set (TEST_LIB_HEADERS ${HDF5_TEST_SOURCE_DIR}/h5test.h ${HDF5_TEST_SOURCE_DIR}/cache_common.h ${HDF5_TEST_SOURCE_DIR}/external_common.h + ${HDF5_TEST_SOURCE_DIR}/external_fname.h ${HDF5_TEST_SOURCE_DIR}/swmr_common.h ) diff --git a/test/enc_dec_plist.c b/test/enc_dec_plist.c index 23bec6e..826957f 100644 --- a/test/enc_dec_plist.c +++ b/test/enc_dec_plist.c @@ -190,8 +190,8 @@ main(void) for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) { char msg[80]; /* Message for file version bounds */ - char* low_string; /* The low bound string */ - char* high_string; /* The high bound string */ + const char *low_string; /* The low bound string */ + const char *high_string; /* The high bound string */ /* Invalid combinations, just continue */ if(high == H5F_LIBVER_EARLIEST || high < low) diff --git a/test/external.c b/test/external.c index 6aa9d1b..597878f 100644 --- a/test/external.c +++ b/test/external.c @@ -18,6 +18,7 @@ * Purpose: Tests datasets stored in external raw files. */ #include "external_common.h" +#include "external_fname.h" /*------------------------------------------------------------------------- @@ -864,7 +865,7 @@ test_path_absolute(hid_t fapl) hid_t dset = -1; /* dataset */ size_t i; /* miscellaneous counter */ char cwdpath[1024]; /* working directory */ - char filename[1024]; /* file name */ + char filename[1536]; /* file name */ int part[PART_SIZE]; /* raw data buffer (partial) */ int whole[TOTAL_SIZE]; /* raw data buffer (total) */ hsize_t cur_size; /* current data space size */ diff --git a/test/external_common.h b/test/external_common.h index 1e4fe7a..a2cb03e 100644 --- a/test/external_common.h +++ b/test/external_common.h @@ -23,16 +23,6 @@ /* Include test header files */ #include "h5test.h" -static const char *EXT_FNAME[] = { - "extern_1", - "extern_2", - "extern_3", - "extern_4", - "extern_dir/file_1", - "extern_5", - NULL -}; - /* A similar collection of files is used for the tests that * perform file I/O. */ @@ -42,4 +32,6 @@ static const char *EXT_FNAME[] = { #define GARBAGE_PER_FILE 10 H5TEST_DLL herr_t reset_raw_data_files(int); + #endif /* _EXTERNAL_COMMON_H */ + diff --git a/test/external_env.c b/test/external_env.c index 1bf0cf0..8ecebf6 100644 --- a/test/external_env.c +++ b/test/external_env.c @@ -15,6 +15,7 @@ * Purpose: Tests datasets stored in external raw files. */ #include "external_common.h" +#include "external_fname.h" static const char *EXT_ENV_FNAME[] = { "extern_env_dir/env_file_1", diff --git a/test/external_fname.h b/test/external_fname.h new file mode 100644 index 0000000..c5111b6 --- /dev/null +++ b/test/external_fname.h @@ -0,0 +1,37 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol <koziol@lbl.gov> + * July, 2019 + * + * Purpose: Private declaration for external.c and external_env.c + */ +#ifndef _EXTERNAL_FNAME_H +#define _EXTERNAL_FNAME_H + +/* Include test header files */ +#include "h5test.h" + +static const char *EXT_FNAME[] = { + "extern_1", + "extern_2", + "extern_3", + "extern_4", + "extern_dir/file_1", + "extern_5", + NULL +}; + +#endif /* _EXTERNAL_FNAME_H */ + diff --git a/test/fheap.c b/test/fheap.c index 91a1df5..1ad5c11 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -6650,7 +6650,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Close the fractal heap */ - if((H5HF_close(fh)) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR fh = NULL; @@ -6842,7 +6842,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Close the fractal heap */ - if((H5HF_close(fh)) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR fh = NULL; @@ -7012,6 +7012,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t /* Close the fractal heap */ if(H5HF_close(fh) < 0) FAIL_STACK_ERROR + fh = NULL; /* Close the file */ if(H5Fclose(file) < 0) @@ -13694,28 +13695,30 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ - H5HF_create_t tmp_cparam; /* Local heap creation parameters */ - fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ - size_t id_len; /* Size of fractal heap IDs */ - h5_stat_size_t empty_size; /* Size of a file with an empty heap */ - h5_stat_size_t file_size; /* Size of file currently */ - unsigned char *heap_id = NULL; /* Heap ID for object */ - size_t obj_size; /* Size of object */ - size_t robj_size; /* Size of object read */ - unsigned char obj_type; /* Type of storage for object */ - fheap_heap_state_t state; /* State of fractal heap */ - unsigned deflate_level; /* Deflation level */ - size_t old_actual_id_len =0 ; /* Old actual ID length */ - hbool_t huge_ids_direct; /* Are 'huge' objects directly acccessed? */ - const char *base_desc = "insert 'huge' object into heap with I/O filters, then remove %s"; /* Test description */ + H5HF_create_t tmp_cparam; /* Local heap creation parameters */ + fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ + size_t id_len; /* Size of fractal heap IDs */ + h5_stat_size_t empty_size; /* Size of a file with an empty heap */ + h5_stat_size_t file_size; /* Size of file currently */ + unsigned char *heap_id = NULL; /* Heap ID for object */ + size_t obj_size; /* Size of object */ + size_t robj_size; /* Size of object read */ + unsigned char obj_type; /* Type of storage for object */ + fheap_heap_state_t state; /* State of fractal heap */ + unsigned deflate_level; /* Deflation level */ + size_t old_actual_id_len = 0; /* Old actual ID length */ + hbool_t huge_ids_direct; /* Are 'huge' objects directly acccessed? */ + hbool_t pline_init = FALSE; /* Whether the I/O pipeline has been initialized */ + const char *base_desc = "insert 'huge' object into heap with I/O filters, then remove %s"; /* Test description */ - /* Copy heap creation properties */ - HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t)); + /* Copy heap creation properties */ + HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t)); /* Set an I/O filter for heap data */ deflate_level = 6; if(H5Z_append(&tmp_cparam.pline, H5Z_FILTER_DEFLATE, H5Z_FLAG_OPTIONAL, (size_t)1, &deflate_level) < 0) FAIL_STACK_ERROR + pline_init = TRUE; /* Adjust actual ID length, if asking for IDs that can directly access 'huge' objects */ if(cparam->id_len == 1) { @@ -13878,7 +13881,7 @@ error: H5MM_xfree(heap_id); if(fh) H5HF_close(fh); - if(&tmp_cparam.pline) + if(pline_init) H5O_msg_reset(H5O_PLINE_ID, &tmp_cparam.pline); /* Release the I/O pipeline filter information */ H5Fclose(file); } H5E_END_TRY; diff --git a/test/h5test.c b/test/h5test.c index 59ccfe4..99b2010 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -2016,7 +2016,7 @@ error: * *------------------------------------------------------------------------- */ -char * +const char * h5_get_version_string(H5F_libver_t libver) { return(LIBVER_NAMES[libver]); diff --git a/test/h5test.h b/test/h5test.h index 448813e..a0c8974 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -149,7 +149,7 @@ H5TEST_DLL int h5_make_local_copy(const char *origfilename, const char *local_co H5TEST_DLL herr_t h5_verify_cached_stabs(const char *base_name[], hid_t fapl); H5TEST_DLL H5FD_class_t *h5_get_dummy_vfd_class(void); H5TEST_DLL H5VL_class_t *h5_get_dummy_vol_class(void); -H5TEST_DLL char *h5_get_version_string(H5F_libver_t libver); +H5TEST_DLL const char *h5_get_version_string(H5F_libver_t libver); /* Functions that will replace components of a FAPL */ H5TEST_DLL herr_t h5_get_vfd_fapl(hid_t fapl_id); diff --git a/test/ohdr.c b/test/ohdr.c index facedd5..c5d5ac4 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -1626,8 +1626,8 @@ main(void) /* Loop through all the combinations of low/high library format bounds */ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) { - char *low_string = NULL; /* Message for library version low bound */ - char *high_string = NULL; /* Message for library version high bound */ + const char *low_string; /* Message for library version low bound */ + const char *high_string; /* Message for library version high bound */ char msg[80]; /* Message for file format version */ /* Set version bounds before opening the file */ @@ -498,7 +498,7 @@ static int test_id_type_list(void) goto out; /* Sanity check */ - if(startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES) + if((int)startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES) { /* Error condition, throw an error */ CHECK(1, 1, "H5Iregister_type"); diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c index 5e26888..9eeaa24 100644 --- a/test/ttsafe_error.c +++ b/test/ttsafe_error.c @@ -38,7 +38,7 @@ /* Having a common dataset name is an error */ #define DATASETNAME "commonname" -#define EXPECTED_ERROR_DEPTH 9 +#define EXPECTED_ERROR_DEPTH 10 #define WRITE_NUMBER 37 /* Typedefs */ @@ -12168,8 +12168,8 @@ main(void) for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) { char msg[80]; /* Message for file version bounds */ - char *low_string; /* The low bound string */ - char *high_string; /* The high bound string */ + const char *low_string; /* The low bound string */ + const char *high_string; /* The high bound string */ /* Invalid combinations, just continue */ if(high == H5F_LIBVER_EARLIEST || high < low) diff --git a/test/vds_env.c b/test/vds_env.c index 9c7b698..b2ca9d0 100644 --- a/test/vds_env.c +++ b/test/vds_env.c @@ -315,8 +315,8 @@ main(void) for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) { char msg[80]; /* Message for file version bounds */ - char *low_string; /* The low bound string */ - char *high_string; /* The high bound string */ + const char *low_string; /* The low bound string */ + const char *high_string; /* The high bound string */ /* Invalid combinations, just continue */ if(high == H5F_LIBVER_EARLIEST || high < low) diff --git a/test/vds_swmr.h b/test/vds_swmr.h index a8e4d50..eb2dcf4 100644 --- a/test/vds_swmr.h +++ b/test/vds_swmr.h @@ -77,48 +77,12 @@ /* Dataset dimensions */ #define SM_HEIGHT 2 /* K */ #define LG_HEIGHT 4 /* N */ -#define SM_LG_HEIGHT 6 /* SM_HEIGHT + LG_HEIGHT */ #define FULL_HEIGHT 18 /* (3 * K) + (3 * N) */ -#define HALF_HEIGHT 9 #define WIDTH 8 /* M */ -#define HALF_WIDTH 4 - -/* Max number of planes in the dataset */ -#define N_MAX_PLANES H5S_UNLIMITED /* Number of planes each writer will write */ #define N_PLANES_TO_WRITE 25 -/* Dataset datatypes */ -#define SOURCE_DATATYPE H5T_STD_I32LE -#define VDS_DATATYPE H5T_STD_I32LE - -/* Starting size of datasets, both source and VDS */ -static hsize_t DIMS[N_SOURCES][RANK] = { - {0, SM_HEIGHT, WIDTH}, - {0, LG_HEIGHT, WIDTH}, - {0, SM_HEIGHT, WIDTH}, - {0, LG_HEIGHT, WIDTH}, - {0, SM_HEIGHT, WIDTH}, - {0, LG_HEIGHT, WIDTH} -}; -static hsize_t VDS_DIMS[RANK] = {0, FULL_HEIGHT, WIDTH}; - -/* Maximum size of datasets, both source and VDS. - * NOTE: Theoretical (i.e.: H5S_UNLIMITED), not the actual max - * number of planes written out by the writers before they stop. - * That number is specified separately. - */ -static hsize_t MAX_DIMS[N_SOURCES][RANK] = { - {N_MAX_PLANES, SM_HEIGHT, WIDTH}, - {N_MAX_PLANES, LG_HEIGHT, WIDTH}, - {N_MAX_PLANES, SM_HEIGHT, WIDTH}, - {N_MAX_PLANES, LG_HEIGHT, WIDTH}, - {N_MAX_PLANES, SM_HEIGHT, WIDTH}, - {N_MAX_PLANES, LG_HEIGHT, WIDTH} -}; -static hsize_t VDS_MAX_DIMS[RANK] = {N_MAX_PLANES, FULL_HEIGHT, WIDTH}; - /* Planes */ static hsize_t PLANES[N_SOURCES][RANK] = { {1, SM_HEIGHT, WIDTH}, @@ -128,7 +92,6 @@ static hsize_t PLANES[N_SOURCES][RANK] = { {1, SM_HEIGHT, WIDTH}, {1, LG_HEIGHT, WIDTH} }; -static hsize_t VDS_PLANE[RANK] = {1, FULL_HEIGHT, WIDTH}; /* File names for source datasets */ static char FILE_NAMES[N_SOURCES][NAME_LEN] = { @@ -144,20 +107,9 @@ static char FILE_NAMES[N_SOURCES][NAME_LEN] = { static char VDS_FILE_NAME[NAME_LEN] = "vds_swmr.h5"; /* Dataset names */ -static char SOURCE_DSET_NAME[NAME_LEN] = "source_dset"; static char SOURCE_DSET_PATH[NAME_LEN] = "/source_dset"; static char VDS_DSET_NAME[NAME_LEN] = "vds_dset"; /* Fill values */ -static int32_t FILL_VALUES[N_SOURCES] = { - -1, - -2, - -3, - -4, - -5, - -6 -}; -static int32_t VDS_FILL_VALUE = -9; - #endif /* VDS_SWMR_H */ diff --git a/test/vds_swmr_gen.c b/test/vds_swmr_gen.c index 1cb9744..2589653 100644 --- a/test/vds_swmr_gen.c +++ b/test/vds_swmr_gen.c @@ -14,6 +14,52 @@ #include "h5test.h" #include "vds_swmr.h" +/* Max number of planes in the dataset */ +#define N_MAX_PLANES H5S_UNLIMITED + +/* Dataset datatypes */ +#define SOURCE_DATATYPE H5T_STD_I32LE +#define VDS_DATATYPE H5T_STD_I32LE + +/* Starting size of datasets, both source and VDS */ +static hsize_t DIMS[N_SOURCES][RANK] = { + {0, SM_HEIGHT, WIDTH}, + {0, LG_HEIGHT, WIDTH}, + {0, SM_HEIGHT, WIDTH}, + {0, LG_HEIGHT, WIDTH}, + {0, SM_HEIGHT, WIDTH}, + {0, LG_HEIGHT, WIDTH} +}; +static hsize_t VDS_DIMS[RANK] = {0, FULL_HEIGHT, WIDTH}; + +/* Maximum size of datasets, both source and VDS. + * NOTE: Theoretical (i.e.: H5S_UNLIMITED), not the actual max + * number of planes written out by the writers before they stop. + * That number is specified separately. + */ +static hsize_t MAX_DIMS[N_SOURCES][RANK] = { + {N_MAX_PLANES, SM_HEIGHT, WIDTH}, + {N_MAX_PLANES, LG_HEIGHT, WIDTH}, + {N_MAX_PLANES, SM_HEIGHT, WIDTH}, + {N_MAX_PLANES, LG_HEIGHT, WIDTH}, + {N_MAX_PLANES, SM_HEIGHT, WIDTH}, + {N_MAX_PLANES, LG_HEIGHT, WIDTH} +}; +static hsize_t VDS_MAX_DIMS[RANK] = {N_MAX_PLANES, FULL_HEIGHT, WIDTH}; + +static char SOURCE_DSET_NAME[NAME_LEN] = "source_dset"; + +static int32_t FILL_VALUES[N_SOURCES] = { + -1, + -2, + -3, + -4, + -5, + -6 +}; + +static int32_t VDS_FILL_VALUE = -9; + int main(void) { diff --git a/test/vds_swmr_reader.c b/test/vds_swmr_reader.c index d0ec77b..eb9a82b 100644 --- a/test/vds_swmr_reader.c +++ b/test/vds_swmr_reader.c @@ -14,6 +14,8 @@ #include "h5test.h" #include "vds_swmr.h" +static hsize_t VDS_PLANE[RANK] = {1, FULL_HEIGHT, WIDTH}; + int main(void) { |