diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 032250f5..fb6f053a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,7 +33,7 @@ jobs: matrix: os: [ubuntu-latest] python-version: ["3.10"] - hdf5-branch: ["hdf5_1_14", "develop"] + hdf5-branch: ["hdf5_1_14"] runs-on: ${{matrix.os}} steps: diff --git a/CMakeLists.txt b/CMakeLists.txt index edaca480..a31fd37e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -311,7 +311,6 @@ macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) endif () endmacro () - #----------------------------------------------------------------------------- # Setup output Directories #----------------------------------------------------------------------------- @@ -582,7 +581,6 @@ if (BUILD_STATIC_LIBS) ${HDF5_C_HL_LIBRARIES}) endif() - #----------------------------------------------------------------------------- # Build the REST VOL #----------------------------------------------------------------------------- diff --git a/configure.ac b/configure.ac index 4fd4f614..c6adb59d 100644 --- a/configure.ac +++ b/configure.ac @@ -1161,6 +1161,9 @@ else enable_static=no fi +# Autotools build isn't supported by HDF5 >= 2.0.0, so assume HDF5 version is < 2.0.0 +AC_DEFINE([HDF5_2], [0], [Whether HDF5 version is at least 2.0.0]) + ## Expose things for *.in markup AC_SUBST([STATIC_SHARED]) AC_SUBST([enable_shared]) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index cea92b9d..88df5f75 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -43,6 +43,7 @@ MACRO (ADD_HDF5_VOL_REST_EXE file) target_link_libraries (${file} PUBLIC ${HDF5_VOL_REST_LIB_TARGET}) set_target_properties (${file} PROPERTIES FOLDER test) add_dependencies(${file} ${HDF5_VOL_REST_LIB_TARGET}) + target_compile_definitions(${file} PRIVATE HDF5_2=$,1,0>) endif () if (BUILD_SHARED_LIBS) add_executable (${file}-shared ${HDF5_VOL_REST_TEST_SOURCE_DIR}/${file}.c) @@ -50,6 +51,7 @@ MACRO (ADD_HDF5_VOL_REST_EXE file) target_link_libraries (${file}-shared PUBLIC ${HDF5_VOL_REST_LIBSH_TARGET}) set_target_properties (${file}-shared PROPERTIES FOLDER test) add_dependencies(${file}-shared ${HDF5_VOL_REST_LIBSH_TARGET}) + target_compile_definitions(${file}-shared PRIVATE HDF5_2=$,1,0>) endif (BUILD_SHARED_LIBS) ENDMACRO (ADD_HDF5_VOL_REST_EXE file) diff --git a/test/test_rest_vol.c b/test/test_rest_vol.c index 44825a2d..d7c98933 100644 --- a/test/test_rest_vol.c +++ b/test/test_rest_vol.c @@ -18281,6 +18281,10 @@ generate_random_datatype(H5T_class_t parent_class) goto case_vlen; case H5T_ARRAY: goto case_array; +#if HDF5_2 + case H5T_COMPLEX: + goto case_complex; +#endif default: H5_FAILED(); printf(" invalid value for goto\n"); @@ -18365,6 +18369,10 @@ generate_random_datatype(H5T_class_t parent_class) goto case_vlen; case H5T_ARRAY: goto case_array; +#if HDF5_2 + case H5T_COMPLEX: + goto case_complex; +#endif default: H5_FAILED(); printf(" invalid value for goto\n"); @@ -18400,6 +18408,10 @@ generate_random_datatype(H5T_class_t parent_class) goto case_vlen; case H5T_ARRAY: goto case_array; +#if HDF5_2 + case H5T_COMPLEX: + goto case_complex; +#endif default: H5_FAILED(); printf(" invalid value for goto\n"); @@ -18443,6 +18455,10 @@ generate_random_datatype(H5T_class_t parent_class) goto case_vlen; case H5T_ARRAY: goto case_array; +#if HDF5_2 + case H5T_COMPLEX: + goto case_complex; +#endif default: H5_FAILED(); printf(" invalid value for goto\n"); @@ -18527,6 +18543,10 @@ generate_random_datatype(H5T_class_t parent_class) goto case_vlen; case H5T_ARRAY: goto case_array; +#if HDF5_2 + case H5T_COMPLEX: + goto case_complex; +#endif default: H5_FAILED(); printf(" invalid value for goto\n"); @@ -18566,6 +18586,10 @@ generate_random_datatype(H5T_class_t parent_class) goto case_vlen; case H5T_ARRAY: goto case_array; +#if HDF5_2 + case H5T_COMPLEX: + goto case_complex; +#endif default: H5_FAILED(); printf(" invalid value for goto\n"); @@ -18614,6 +18638,10 @@ generate_random_datatype(H5T_class_t parent_class) goto case_vlen; case H5T_ARRAY: goto case_array; +#if HDF5_2 + case H5T_COMPLEX: + goto case_complex; +#endif default: H5_FAILED(); printf(" invalid value for goto\n"); @@ -18669,6 +18697,10 @@ generate_random_datatype(H5T_class_t parent_class) goto case_vlen; case H5T_ARRAY: goto case_array; +#if HDF5_2 + case H5T_COMPLEX: + goto case_complex; +#endif default: H5_FAILED(); printf(" invalid value for goto\n"); @@ -18710,6 +18742,10 @@ generate_random_datatype(H5T_class_t parent_class) goto case_vlen; case H5T_ARRAY: goto case_array; +#if HDF5_2 + case H5T_COMPLEX: + goto case_complex; +#endif default: H5_FAILED(); printf(" invalid value for goto\n"); @@ -18739,6 +18775,44 @@ generate_random_datatype(H5T_class_t parent_class) break; } +#if HDF5_2 +case_complex: + case H5T_COMPLEX: { + /* Complex datatypes are unsupported, try again */ + switch (rand() % H5T_NCLASSES) { + case H5T_INTEGER: + goto case_integer; + case H5T_FLOAT: + goto case_float; + case H5T_TIME: + goto case_time; + case H5T_STRING: + goto case_string; + case H5T_BITFIELD: + goto case_bitfield; + case H5T_OPAQUE: + goto case_opaque; + case H5T_COMPOUND: + goto case_compound; + case H5T_REFERENCE: + goto case_reference; + case H5T_ENUM: + goto case_enum; + case H5T_VLEN: + goto case_vlen; + case H5T_ARRAY: + goto case_array; + case H5T_COMPLEX: + goto case_complex; + default: + H5_FAILED(); + printf(" invalid value for goto\n"); + break; + } + + break; + } +#endif default: H5_FAILED();