diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeLists.txt | 40 | ||||
-rw-r--r-- | test/CMakeTests.cmake | 14 | ||||
-rw-r--r-- | test/H5srcdir.h | 16 | ||||
-rw-r--r-- | test/dsets.c | 2 | ||||
-rw-r--r-- | test/dt_arith.c | 118 | ||||
-rw-r--r-- | test/dtypes.c | 4 | ||||
-rw-r--r-- | test/earray.c | 4 | ||||
-rw-r--r-- | test/farray.c | 8 | ||||
-rw-r--r-- | test/fheap.c | 14 | ||||
-rw-r--r-- | test/fillval.c | 2 | ||||
-rw-r--r-- | test/flush2.c | 4 | ||||
-rw-r--r-- | test/gen_cross.c | 4 | ||||
-rw-r--r-- | test/gen_udlinks.c | 4 | ||||
-rw-r--r-- | test/getname.c | 2 | ||||
-rw-r--r-- | test/lheap.c | 4 | ||||
-rw-r--r-- | test/links.c | 29 | ||||
-rw-r--r-- | test/links_env.c | 4 | ||||
-rw-r--r-- | test/objcopy.c | 2 | ||||
-rw-r--r-- | test/stab.c | 2 | ||||
-rw-r--r-- | test/tattr.c | 12 | ||||
-rw-r--r-- | test/tconfig.c | 9 | ||||
-rw-r--r-- | test/tfile.c | 124 | ||||
-rw-r--r-- | test/tgenprop.c | 82 | ||||
-rw-r--r-- | test/th5o.c | 2 | ||||
-rw-r--r-- | test/th5s.c | 45 | ||||
-rw-r--r-- | test/tmisc.c | 42 | ||||
-rw-r--r-- | test/tsohm.c | 3 | ||||
-rw-r--r-- | test/ttsafe.c | 43 | ||||
-rw-r--r-- | test/ttsafe.h | 10 | ||||
-rw-r--r-- | test/ttsafe_error.c | 1 | ||||
-rw-r--r-- | test/ttst.c | 6 | ||||
-rw-r--r-- | test/tvltypes.c | 52 |
32 files changed, 312 insertions, 396 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c94b880..f33c2df 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -58,6 +58,12 @@ if (BUILD_SHARED_LIBS) INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) + if (HDF5_ENABLE_THREADSAFE) + set_property (TARGET ${HDF5_TEST_LIBSH_TARGET} + APPEND PROPERTY COMPILE_DEFINITIONS + "H5_HAVE_THREADSAFE" + ) + endif (HDF5_ENABLE_THREADSAFE) endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- @@ -103,7 +109,7 @@ endif (BUILD_SHARED_LIBS) TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different + ARGS -E copy_if_different "$<TARGET_FILE:${HDF5_TEST_PLUGIN_LIB_TARGET}>" "${CMAKE_BINARY_DIR}/testdir1/$<TARGET_FILE_NAME:${HDF5_TEST_PLUGIN_LIB_TARGET}>" ) @@ -134,7 +140,7 @@ endif (BUILD_SHARED_LIBS) TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different + ARGS -E copy_if_different "$<TARGET_FILE:${HDF5_TEST_PLUGIN_LIB_TARGET}>" "${CMAKE_BINARY_DIR}/testdir2/$<TARGET_FILE_NAME:${HDF5_TEST_PLUGIN_LIB_TARGET}>" ) @@ -207,7 +213,7 @@ set (H5_TESTS #cache_api #cache_tagging pool - hyperslab + #hyperslab istore bittests dt_arith @@ -307,6 +313,26 @@ if (BUILD_SHARED_LIBS) set_target_properties (cache_tagging-shared PROPERTIES FOLDER test) endif (BUILD_SHARED_LIBS) +#-- Adding test for hyperslab +add_executable (hyperslab ${HDF5_TEST_SOURCE_DIR}/hyperslab.c) +TARGET_NAMING (hyperslab STATIC) +TARGET_C_PROPERTIES (hyperslab STATIC " " " ") +target_link_libraries (hyperslab ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (hyperslab PROPERTIES FOLDER test) +if (BUILD_SHARED_LIBS) + add_executable (hyperslab-shared ${HDF5_TEST_SOURCE_DIR}/hyperslab.c) + TARGET_NAMING (hyperslab-shared SHARED) + TARGET_C_PROPERTIES (hyperslab-shared SHARED " " " ") + target_link_libraries (hyperslab-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (hyperslab-shared PROPERTIES FOLDER test) + if (HDF5_ENABLE_THREADSAFE) + set_property (TARGET hyperslab-shared + APPEND PROPERTY COMPILE_DEFINITIONS + "H5_HAVE_THREADSAFE" + ) + endif (HDF5_ENABLE_THREADSAFE) +endif (BUILD_SHARED_LIBS) + #-- Adding test for ttsafe add_executable (ttsafe ${HDF5_TEST_SOURCE_DIR}/ttsafe.c @@ -331,6 +357,12 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (ttsafe-shared SHARED " " " ") target_link_libraries (ttsafe-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (ttsafe-shared PROPERTIES FOLDER test) + if (HDF5_ENABLE_THREADSAFE) + set_property (TARGET ttsafe-shared + APPEND PROPERTY COMPILE_DEFINITIONS + "H5_HAVE_THREADSAFE" + ) + endif (HDF5_ENABLE_THREADSAFE) endif (BUILD_SHARED_LIBS) #-- Adding test for err_compat @@ -379,7 +411,7 @@ endif (BUILD_SHARED_LIBS) #-- Adding test for libinfo set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) -file (WRITE ${GREP_RUNNER} +file (WRITE ${GREP_RUNNER} "file (STRINGS \${TEST_PROGRAM} TEST_RESULT REGEX \"SUMMARY OF THE HDF5 CONFIGURATION\") if (\${TEST_RESULT} STREQUAL \"0\") message (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\") diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 5fe51ed..0efa2ae 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -562,9 +562,10 @@ if (NOT CYGWIN) add_test (NAME H5TEST-cache COMMAND $<TARGET_FILE:cache>) set_tests_properties (H5TEST-cache PROPERTIES DEPENDS H5TEST-clear-cache-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=2" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) + set_tests_properties (H5TEST-cache PROPERTIES TIMEOUT 2400) endif (NOT CYGWIN) #-- Adding test for cache_api @@ -725,9 +726,10 @@ if (BUILD_SHARED_LIBS) add_test (NAME H5TEST-shared-cache COMMAND $<TARGET_FILE:cache-shared>) set_tests_properties (H5TEST-shared-cache PROPERTIES DEPENDS H5TEST-shared-clear-cache-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5TestExpress=2" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) + set_tests_properties (H5TEST-cache PROPERTIES TIMEOUT 2400) endif (NOT CYGWIN) #-- Adding test for cache_api @@ -1052,7 +1054,7 @@ if (HDF5_TEST_VFD) -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=2" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) if (BUILD_SHARED_LIBS) @@ -1068,7 +1070,7 @@ if (HDF5_TEST_VFD) -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=2" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) endif (BUILD_SHARED_LIBS) @@ -1136,7 +1138,7 @@ if (HDF5_TEST_VFD) ) set_tests_properties (VFD-${vfdname}-fheap PROPERTIES TIMEOUT 1800 - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=2" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) if (BUILD_SHARED_LIBS) @@ -1153,7 +1155,7 @@ if (HDF5_TEST_VFD) ) set_tests_properties (VFD-${vfdname}-fheap-shared PROPERTIES TIMEOUT 1800 - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=2" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) endif (BUILD_SHARED_LIBS) diff --git a/test/H5srcdir.h b/test/H5srcdir.h index 4f0f439..81624d8 100644 --- a/test/H5srcdir.h +++ b/test/H5srcdir.h @@ -32,11 +32,7 @@ static char srcdir_path[1024] = ""; static char srcdir_testpath[1024] = ""; /* Append the test file name to the srcdir path and return the whole string */ -#ifdef H5_VMS -static const char *H5_get_srcdir_filename(char *filename) -#else static const char *H5_get_srcdir_filename(const char *filename) -#endif { const char *srcdir = HDgetenv("srcdir"); @@ -46,19 +42,7 @@ static const char *H5_get_srcdir_filename(const char *filename) /* Build path to test file */ if((HDstrlen(srcdir) + HDstrlen(filename) + 2) < sizeof(srcdir_testpath)) { -#ifdef H5_VMS - HDstrcpy(srcdir_testpath, srcdir); - if(filename[0] == '[') { - char *tmp = filename; - - srcdir_testpath[HDstrlen(srcdir) - 1] = '\0'; - HDstrcat(srcdir_testpath, ++tmp); - } /* end if */ - else - HDstrcat(srcdir_testpath, filename); -#else HDsnprintf(srcdir_testpath, sizeof(srcdir_testpath), "%s/%s", srcdir, filename); -#endif return(srcdir_testpath); } /* end if */ else diff --git a/test/dsets.c b/test/dsets.c index e6b2ee4..136fec2 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -7567,7 +7567,7 @@ test_chunk_expand(hid_t fapl) if(TRUE != H5Zfilter_avail(H5Z_FILTER_EXPAND)) FAIL_STACK_ERROR /* Loop over storage allocation time */ - for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; alloc_time++) { + for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; H5_INC_ENUM(H5D_alloc_time_t, alloc_time)) { /* Create file */ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR diff --git a/test/dt_arith.c b/test/dt_arith.c index b3f5cad..eb201d0 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -58,10 +58,9 @@ const char *FILENAME[] = { }; /* - * Count up or down depending on whether the machine is big endian, little - * endian, or VAX (OpenVMS). If local variable `endian' is H5T_ORDER_BE then - * the result will be I, otherwise the result will be Z-(I+1). VAX is printed - * as little endian. + * Count up or down depending on whether the machine is big endian or little + * endian. If local variable `endian' is H5T_ORDER_BE then the result will + * be I, otherwise the result will be Z-(I+1). */ #define ENDIAN(Z,I,E) (H5T_ORDER_BE==E?(I):(Z)-((I)+1)) @@ -88,11 +87,6 @@ static int skip_overflow_tests_g = 0; #define HANDLE_SIGFPE #endif -/* OpenVMS doesn't have this feature. Make sure to disable it*/ -#ifdef H5_VMS -#undef HANDLE_SIGFPE -#endif - /* * Decide what values of floating-point number we want to test. They are * 1 - normalized; 2 - denormalized; 3 - special. @@ -2740,24 +2734,6 @@ my_isnan(dtype_t type, void *val) retval = 1; } -#ifdef H5_VMS - /* For "float" and "double" on OpenVMS/Alpha, NaN is - * actually a valid value of maximal value.*/ - if(!retval) { - if (FLT_FLOAT==type) { - float x; - HDmemcpy(&x, val, sizeof(float)); - retval = (x==FLT_MAX || x==-FLT_MAX); - } else if (FLT_DOUBLE==type) { - double x; - HDmemcpy(&x, val, sizeof(double)); - retval = (x==DBL_MAX || x==-DBL_MAX); - } else { - return 0; - } - } -#endif /*H5_VMS*/ - return retval; } @@ -2786,23 +2762,8 @@ my_isinf(int endian, unsigned char *val, size_t size, bits = (unsigned char*)HDcalloc((size_t)1, size); -#ifdef H5_VMS - if(H5T_ORDER_VAX==endian) { - for (i = 0; i < size; i += 4) { - bits[i] = val[(size-2)-i]; - bits[i+1] = val[(size-1)-i]; - - bits[(size-2)-i] = val[i]; - bits[(size-1)-i] = val[i+1]; - } - } else { - for (i=0; i<size; i++) - bits[size-(i+1)] = *(val + ENDIAN(size,i,endian)); - } -#else /*H5_VMS*/ for (i=0; i<size; i++) bits[size-(i+1)] = *(val + ENDIAN(size, i, endian)); -#endif /*H5_VMS*/ if(H5T__bit_find(bits, mpos, msize, H5T_BIT_LSB, 1) < 0 && H5T__bit_find(bits, epos, esize, H5T_BIT_LSB, 0) < 0) @@ -2860,9 +2821,6 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) unsigned char *hw=NULL; /*ptr to hardware-conv'd*/ int underflow; /*underflow occurred */ int overflow; /*overflow occurred */ -#ifdef H5_VMS - int maximal; /*maximal value occurred, for VMS only. */ -#endif /* H5_VMS */ int uflow=0; /*underflow debug counters*/ size_t j, k; /*counters */ int sendian; /* source type endianess */ @@ -2913,9 +2871,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) * The remainder of this function is executed only by the child if * HANDLE_SIGFPE is defined. */ -#ifndef H5_VMS HDsignal(SIGFPE,fpe_handler); -#endif /* What are the names of the source and destination types */ if (H5Tequal(src, H5T_NATIVE_FLOAT)) { @@ -3013,47 +2969,19 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) switch (run_test) { case TEST_NOOP: case TEST_NORMAL: -#ifdef H5_VMS if(src_type == FLT_FLOAT) { INIT_FP_NORM(float, FLT_MAX, FLT_MIN, FLT_MAX_10_EXP, FLT_MIN_10_EXP, src_size, dst_size, buf, saved, nelmts); - } else if(src_type == FLT_DOUBLE && dst_type == FLT_FLOAT) { - /*Temporary solution for VMS. Cap double values between maximal and minimal - *destination values because VMS return exception when overflows or underflows. - *Same below.*/ - INIT_FP_NORM(double, FLT_MAX, FLT_MIN, FLT_MAX_10_EXP, FLT_MIN_10_EXP, - src_size, dst_size, buf, saved, nelmts); } else if(src_type == FLT_DOUBLE) { INIT_FP_NORM(double, DBL_MAX, DBL_MIN, DBL_MAX_10_EXP, DBL_MIN_10_EXP, src_size, dst_size, buf, saved, nelmts); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 - } else if(src_type == FLT_LDOUBLE && dst_type == FLT_FLOAT) { - INIT_FP_NORM(long double, FLT_MAX, FLT_MIN, FLT_MAX_10_EXP, FLT_MIN_10_EXP, - src_size, dst_size, buf, saved, nelmts); - } else if(src_type == FLT_LDOUBLE && dst_type == FLT_DOUBLE) { - INIT_FP_NORM(long double, DBL_MAX, DBL_MIN, DBL_MAX_10_EXP, DBL_MIN_10_EXP, - src_size, dst_size, buf, saved, nelmts); } else if(src_type == FLT_LDOUBLE) { INIT_FP_NORM(long double, LDBL_MAX, LDBL_MIN, LDBL_MAX_10_EXP, LDBL_MIN_10_EXP, src_size, dst_size, buf, saved, nelmts); #endif } else goto error; -#else /*H5_VMS*/ - if(src_type == FLT_FLOAT) { - INIT_FP_NORM(float, FLT_MAX, FLT_MIN, FLT_MAX_10_EXP, FLT_MIN_10_EXP, - src_size, dst_size, buf, saved, nelmts); - } else if(src_type == FLT_DOUBLE) { - INIT_FP_NORM(double, DBL_MAX, DBL_MIN, DBL_MAX_10_EXP, DBL_MIN_10_EXP, - src_size, dst_size, buf, saved, nelmts); -#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 - } else if(src_type == FLT_LDOUBLE) { - INIT_FP_NORM(long double, LDBL_MAX, LDBL_MIN, LDBL_MAX_10_EXP, LDBL_MIN_10_EXP, - src_size, dst_size, buf, saved, nelmts); -#endif - } else - goto error; -#endif /*H5_VMS*/ break; case TEST_DENORM: @@ -3129,9 +3057,6 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) hw = (unsigned char*)&hw_f; underflow = HDfabs(*((double*)aligned)) < FLT_MIN; overflow = HDfabs(*((double*)aligned)) > FLT_MAX; -#ifdef H5_VMS - maximal = HDfabs(*((double*)aligned)) == FLT_MAX; -#endif } else if (FLT_DOUBLE==dst_type) { hw_d = *((double*)aligned); hw = (unsigned char*)&hw_d; @@ -3149,17 +3074,11 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) hw = (unsigned char*)&hw_f; underflow = HDfabsl(*((long double*)aligned)) < FLT_MIN; overflow = HDfabsl(*((long double*)aligned)) > FLT_MAX; -#ifdef H5_VMS - maximal = HDfabs(*((long double*)aligned)) == FLT_MAX; -#endif } else if (FLT_DOUBLE==dst_type) { hw_d = *((long double*)aligned); hw = (unsigned char*)&hw_d; underflow = HDfabsl(*((long double*)aligned)) < DBL_MIN; overflow = HDfabsl(*((long double*)aligned)) > DBL_MAX; -#ifdef H5_VMS - maximal = HDfabs(*((long double*)aligned)) == DBL_MAX; -#endif } else { hw_ld = *((long double*)aligned); hw = (unsigned char*)&hw_ld; @@ -3194,17 +3113,6 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) if (k==dst_size) continue; /*no error*/ -#ifdef H5_VMS - /* For "float" and "double" on OpenVMS/Alpha, NaN is - * a valid value of maximal value.*/ - if (FLT_FLOAT==src_type && - my_isnan(src_type, saved+j*sizeof(float))) { - continue; - } else if (FLT_DOUBLE==src_type && - my_isnan(src_type, saved+j*sizeof(double))) { - continue; - } -#endif /*H5_VMS*/ /* * Assume same if both results are NaN. There are many NaN bit @@ -3262,11 +3170,6 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) if (overflow && my_isinf(dendian, buf+j*sizeof(float), dst_size, dst_mpos, dst_msize, dst_epos, dst_esize)) continue; /* all overflowed, no error */ -#ifdef H5_VMS - if (maximal && my_isinf(dendian, buf+j*sizeof(float), - dst_size, dst_mpos, dst_msize, dst_epos, dst_esize)) - continue; /* maximal value, no error */ -#endif /*H5_VMS*/ check_mant[0] = HDfrexpf(x, check_expo+0); check_mant[1] = HDfrexpf(hw_f, check_expo+1); } else if (FLT_DOUBLE==dst_type) { @@ -3278,11 +3181,6 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) if (overflow && my_isinf(dendian, buf+j*sizeof(double), dst_size, dst_mpos, dst_msize, dst_epos, dst_esize)) continue; /* all overflowed, no error */ -#ifdef H5_VMS - if (maximal && my_isinf(dendian, buf+j*sizeof(double), - dst_size, dst_mpos, dst_msize, dst_epos, dst_esize)) - continue; /* maximal value, no error */ -#endif /*H5_VMS*/ check_mant[0] = HDfrexp(x, check_expo+0); check_mant[1] = HDfrexp(hw_d, check_expo+1); #if H5_SIZEOF_LONG_DOUBLE !=0 && (H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE) @@ -4924,7 +4822,6 @@ run_fp_tests(const char *name) nerrors += test_conv_flt_1(name, TEST_NORMAL, H5T_NATIVE_LDOUBLE, H5T_NATIVE_DOUBLE); #endif -#ifndef H5_VMS /*Test denormalized values. TEST_DENORM indicates denormalized values.*/ nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_FLOAT, H5T_NATIVE_DOUBLE); nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_DOUBLE, H5T_NATIVE_FLOAT); @@ -4944,7 +4841,6 @@ run_fp_tests(const char *name) nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_LDOUBLE, H5T_NATIVE_FLOAT); nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_LDOUBLE, H5T_NATIVE_DOUBLE); #endif -#endif /*H5_VMS*/ done: return nerrors; @@ -5085,11 +4981,7 @@ run_fp_int_conv(const char *name) int nerrors = 0; int test_values; -#ifdef H5_VMS - test_values = TEST_NORMAL; -#else for(test_values = TEST_NORMAL; test_values <= TEST_SPECIAL; test_values++) { -#endif /*H5_VMS*/ nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_SCHAR); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_SCHAR); @@ -5194,9 +5086,7 @@ run_fp_int_conv(const char *name) #endif /*H5_LDOUBLE_TO_LLONG_ACCURATE*/ #endif #endif -#ifndef H5_VMS } /* end for */ -#endif /* H5_VMS */ return nerrors; } @@ -5248,10 +5138,8 @@ main(void) * for user-defined integer types */ nerrors += test_derived_integer(); -#ifndef H5_VMS /* Does floating point overflow generate a SIGFPE? */ generates_sigfpe(); -#endif /* Test degenerate cases */ nerrors += run_fp_tests("noop"); diff --git a/test/dtypes.c b/test/dtypes.c index 59cf000..88bbce0 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -3233,11 +3233,7 @@ test_compound_18(void) /* Open Generated File */ /* (generated with gen_bad_compound.c) */ -#ifdef H5_VMS - if((file = H5Fopen(TESTFILE, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR -#else if((file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR -#endif /* Try to open the datatype */ H5E_BEGIN_TRY { diff --git a/test/earray.c b/test/earray.c index feaa15e..b510992 100644 --- a/test/earray.c +++ b/test/earray.c @@ -2894,7 +2894,7 @@ main(void) init_cparam(&cparam); /* Iterate over the testing parameters */ - for(curr_test = EARRAY_TEST_NORMAL; curr_test < EARRAY_TEST_NTESTS; curr_test++) { + for(curr_test = EARRAY_TEST_NORMAL; curr_test < EARRAY_TEST_NTESTS; H5_INC_ENUM(earray_test_type_t, curr_test)) { /* Initialize the testing parameters */ init_tparam(&tparam, &cparam); @@ -2926,7 +2926,7 @@ main(void) nerrors += test_flush_depend(fapl, &cparam, &tparam); /* Iterate over the type of capacity tests */ - for(curr_iter = EARRAY_ITER_FW; curr_iter < EARRAY_ITER_NITERS; curr_iter++) { + for(curr_iter = EARRAY_ITER_FW; curr_iter < EARRAY_ITER_NITERS; H5_INC_ENUM(earray_iter_type_t, curr_iter)) { hsize_t sblk; /* Super block index */ hsize_t dblk; /* Data block index */ hsize_t nelmts; /* # of elements to test */ diff --git a/test/farray.c b/test/farray.c index 4c18916..43b63c6 100644 --- a/test/farray.c +++ b/test/farray.c @@ -1554,11 +1554,11 @@ main(void) } /* Iterate over the testing parameters */ - for(curr_test = FARRAY_TEST_NORMAL; curr_test < FARRAY_TEST_NTESTS; curr_test++) { + for(curr_test = FARRAY_TEST_NORMAL; curr_test < FARRAY_TEST_NTESTS; H5_INC_ENUM(farray_test_type_t, curr_test)) { /* Initialize the testing parameters */ - HDmemset(&tparam, 0, sizeof(tparam)); - tparam.nelmts = TEST_NELMTS; + HDmemset(&tparam, 0, sizeof(tparam)); + tparam.nelmts = TEST_NELMTS; /* Set appropriate testing parameters for each test */ switch(curr_test) { @@ -1589,7 +1589,7 @@ main(void) nerrors += test_delete_open(fapl, &cparam, &tparam); /* Iterate over the type of capacity tests */ - for(curr_iter = FARRAY_ITER_FW; curr_iter < FARRAY_ITER_NITERS; curr_iter++) { + for(curr_iter = FARRAY_ITER_FW; curr_iter < FARRAY_ITER_NITERS; H5_INC_ENUM(farray_iter_type_t, curr_iter)) { /* Set appropriate parameters for each type of iteration */ switch(curr_iter) { diff --git a/test/fheap.c b/test/fheap.c index fee6fdf..bb30e05 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -16380,7 +16380,7 @@ main(void) /* Iterate over the testing parameters */ #ifndef QAK - for(curr_test = FHEAP_TEST_NORMAL; curr_test < FHEAP_TEST_NTESTS; curr_test++) { + for(curr_test = FHEAP_TEST_NORMAL; curr_test < FHEAP_TEST_NTESTS; H5_INC_ENUM(fheap_test_type_t, curr_test)) { #else /* QAK */ HDfprintf(stderr, "Uncomment test loop!\n"); curr_test = FHEAP_TEST_NORMAL; @@ -16418,9 +16418,7 @@ curr_test = FHEAP_TEST_NORMAL; nerrors += test_id_limits(fapl, &small_cparam); nerrors += test_filtered_create(fapl, &small_cparam); nerrors += test_size(fapl, &small_cparam); -#ifndef H5_CANNOT_OPEN_TWICE nerrors += test_reopen_hdr(fapl, &small_cparam); -#endif /*H5_CANNOT_OPEN_TWICE*/ #else /* QAK */ HDfprintf(stderr, "Uncomment tests!\n"); #endif /* QAK */ @@ -16432,7 +16430,7 @@ HDfprintf(stderr, "Uncomment tests!\n"); #ifndef QAK2 /* Filling with different sized objects */ - for(fill = FHEAP_TEST_FILL_LARGE; fill < FHEAP_TEST_FILL_N; fill++) { + for(fill = FHEAP_TEST_FILL_LARGE; fill < FHEAP_TEST_FILL_N; H5_INC_ENUM(fheap_test_fill_t, fill)) { #else /* QAK2 */ HDfprintf(stderr, "Uncomment test loop!\n"); fill = FHEAP_TEST_FILL_LARGE; @@ -16544,9 +16542,9 @@ HDfprintf(stderr, "Uncomment tests!\n"); fheap_test_del_drain_t drain_half; /* Deletion draining */ /* More complex removal patterns */ - for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; del_dir++) { + for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; H5_INC_ENUM(fheap_test_del_dir_t, del_dir)) { tparam.del_dir = del_dir; - for(drain_half = FHEAP_DEL_DRAIN_ALL; drain_half < FHEAP_DEL_DRAIN_N; drain_half++) { + for(drain_half = FHEAP_DEL_DRAIN_ALL; drain_half < FHEAP_DEL_DRAIN_N; H5_INC_ENUM(fheap_test_del_drain_t, drain_half)) { tparam.drain_half = drain_half; #else /* QAK2 */ HDfprintf(stderr, "Uncomment test loops!\n"); @@ -16685,7 +16683,7 @@ HDfprintf(stderr, "Uncomment tests!\n"); } /* end switch */ /* Try several different methods of deleting objects */ - for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; del_dir++) { + for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; H5_INC_ENUM(fheap_test_del_dir_t, del_dir)) { tparam.del_dir = del_dir; /* Test 'huge' object insert & delete */ @@ -16728,7 +16726,7 @@ HDfprintf(stderr, "Uncomment tests!\n"); { fheap_test_del_dir_t del_dir; /* Deletion direction */ - for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; del_dir++) { + for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; H5_INC_ENUM(fheap_test_del_dir_t, del_dir)) { tparam.del_dir = del_dir; /* Controlled tests */ diff --git a/test/fillval.c b/test/fillval.c index c791504..b7b2ff5 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -845,7 +845,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, if(datatype==H5T_INTEGER) { /*check for overflow*/ HDassert((nelmts * sizeof(int)) == (hsize_t)((size_t)(nelmts * sizeof(int)))); - buf = HDmalloc((size_t)(nelmts * sizeof(int))); + buf = (int *)HDmalloc((size_t)(nelmts * sizeof(int))); if(H5Dread(dset1, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, buf) < 0) goto error; diff --git a/test/flush2.c b/test/flush2.c index 28ce41e..0ee299e 100644 --- a/test/flush2.c +++ b/test/flush2.c @@ -189,8 +189,6 @@ main(void) #if defined H5_HAVE_WIN32_API && !defined (hdf5_EXPORTS) SKIPPED(); puts(" DLL will flush the file even when calling _exit, skip this test temporarily"); -#elif defined H5_VMS - SKIPPED(); #else H5_FAILED() goto error; @@ -212,8 +210,6 @@ main(void) #if defined H5_HAVE_WIN32_API && !defined (hdf5_EXPORTS) SKIPPED(); puts(" DLL will flush the file even when calling _exit, skip this test temporarily"); -#elif defined H5_VMS - SKIPPED(); #else H5_FAILED() goto error; diff --git a/test/gen_cross.c b/test/gen_cross.c index 1c73016..2d4b788 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -22,6 +22,10 @@ * Run it on an OpenVMS, a little-endian, and a big-endian machine. Change the * output file names to vms_data.h5, le_data.h5, and be_data.h5, and put them * under hdf5/test/ directory. + * + * Note that we no longer support OpenVMS. The OpenVMS file will eventually + * have to go away since we won't be able to re-create it but it's probably + * worth keeping around for now. */ #include <stdio.h> diff --git a/test/gen_udlinks.c b/test/gen_udlinks.c index a1312d2..fc044da 100644 --- a/test/gen_udlinks.c +++ b/test/gen_udlinks.c @@ -57,6 +57,10 @@ main (void) strcpy(filename1, NAME_BE_1); strcpy(filename2, NAME_BE_2); break; + case H5T_ORDER_ERROR: + case H5T_ORDER_VAX: + case H5T_ORDER_MIXED: + case H5T_ORDER_NONE: default: goto error; } diff --git a/test/getname.c b/test/getname.c index dc1ddbe..e1bbc6b 100644 --- a/test/getname.c +++ b/test/getname.c @@ -2995,9 +2995,7 @@ main(void) nerrors += test_main(file_id, fapl); nerrors += test_obj_ref(fapl); nerrors += test_reg_ref(fapl); -#ifndef H5_CANNOT_OPEN_TWICE nerrors += test_elinks(fapl); -#endif /*H5_CANNOT_OPEN_TWICE*/ /* Close file */ H5Fclose(file_id); diff --git a/test/lheap.c b/test/lheap.c index bdb6360..492316e 100644 --- a/test/lheap.c +++ b/test/lheap.c @@ -179,11 +179,7 @@ main(void) { const char *testfile = H5_get_srcdir_filename(TESTFILE); /* Corrected test file name */ hid_t dset = -1; -#ifdef H5_VMS - file = H5Fopen(TESTFILE, H5F_ACC_RDONLY, H5P_DEFAULT); -#else file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT); -#endif if(file >= 0){ if((dset = H5Dopen2(file, "/Dataset1", H5P_DEFAULT)) < 0) TEST_ERROR diff --git a/test/links.c b/test/links.c index cfbc4a1..ef71be7 100644 --- a/test/links.c +++ b/test/links.c @@ -36,13 +36,8 @@ /* File for external link test. Created with gen_udlinks.c */ #define LINKED_FILE "be_extlink2.h5" -#ifdef H5_VMS -#define TMPDIR "[.tmp]" -#define TMPDIR2 "[.tmp2]" -#else /* H5_VMS */ #define TMPDIR "tmp/" #define TMPDIR2 "tmp2/" -#endif /* H5_VMS */ /* Symlinks for external link symlink test */ #define SYMLINK1 TMPDIR "sym1.h5" @@ -320,7 +315,7 @@ typedef struct { * Function: fix_ext_filename * * Purpose: Internal function to append path to file name. It handles - * path name of Unix, Windows, and OpenVMS. + * path name of Unix and Windows. * * Return: void * @@ -333,17 +328,8 @@ fix_ext_filename(char *path_name, char *cwd, const char *file_name) { HDstrcpy(path_name, cwd); -#ifdef H5_VMS - if(file_name[0] == '[') { - char *tmp = file_name; - path_name[strlen(cwd)-1] = '\0'; - HDstrcat(path_name, ++tmp); - } else - HDstrcat(path_name, file_name); -#else HDstrcat(path_name, "/"); HDstrcat(path_name, file_name); -#endif } @@ -2877,7 +2863,6 @@ external_link_abs_mainpath(hid_t fapl, hbool_t new_format) * set up name for main file: * Linux: "/CWD/tmp/extlinks0" * Window: "<cur drive>:/CWD/tmp/extlinks0" - * OpenVMS: "<cur disk>$<partition>:[CWD.tmp]extlinks0" */ fix_ext_filename(tmpname, cwdpath, FILENAME[13]); h5_fixname(tmpname, fapl, filename1, sizeof filename1); @@ -6943,7 +6928,6 @@ external_file_cache(hid_t fapl, hbool_t new_format) /* Verify that all files are now closed */ H5F_sfile_assert_num(0); -#ifndef H5_CANNOT_OPEN_TWICE /* * Test 5: 3 file cycle */ @@ -7045,7 +7029,6 @@ external_file_cache(hid_t fapl, hbool_t new_format) /* Verify that all files are now closed */ H5F_sfile_assert_num(0); -#endif /* H5_CANNOT_OPEN_TWICE */ /* Close fapl */ H5Pclose(my_fapl); @@ -14580,15 +14563,11 @@ main(void) printf("\n---Testing without external file cache---\n"); } /* end else */ -#ifndef H5_CANNOT_OPEN_TWICE nerrors += external_link_root(my_fapl, new_format) < 0 ? 1 : 0; -#endif /* H5_CANNOT_OPEN_TWICE */ nerrors += external_link_path(my_fapl, new_format) < 0 ? 1 : 0; -#ifndef H5_CANNOT_OPEN_TWICE nerrors += external_link_self(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_pingpong(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_toomany(my_fapl, new_format) < 0 ? 1 : 0; -#endif /* H5_CANNOT_OPEN_TWICE */ nerrors += external_link_dangling(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_recursive(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_query(my_fapl, new_format) < 0 ? 1 : 0; @@ -14596,9 +14575,7 @@ main(void) nerrors += external_link_unlink_dense(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_move(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_ride(my_fapl, new_format) < 0 ? 1 : 0; -#ifndef H5_CANNOT_OPEN_TWICE nerrors += external_link_closing(my_fapl, new_format) < 0 ? 1 : 0; -#endif /* H5_CANNOT_OPEN_TWICE */ nerrors += external_link_endian(new_format) < 0 ? 1 : 0; nerrors += external_link_strong(my_fapl, new_format) < 0 ? 1 : 0; @@ -14628,9 +14605,7 @@ main(void) nerrors += external_symlink(env_h5_drvr, my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_copy_invalid_object(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_dont_fail_to_source(my_fapl, new_format) < 0 ? 1 : 0; -#ifndef H5_CANNOT_OPEN_TWICE nerrors += external_open_twice(my_fapl, new_format) < 0 ? 1 : 0; -#endif /* H5_CANNOT_OPEN_TWICE */ } /* end for */ /* These tests assume that external links are a form of UD links, @@ -14654,9 +14629,7 @@ main(void) nerrors += obj_visit_by_name(my_fapl, new_format) < 0 ? 1 : 0; nerrors += obj_visit_stop(my_fapl, new_format) < 0 ? 1 : 0; nerrors += link_filters(my_fapl, new_format) < 0 ? 1 : 0; -#ifndef H5_CANNOT_OPEN_TWICE nerrors += obj_exists(my_fapl, new_format) < 0 ? 1 : 0; -#endif /* H5_CANNOT_OPEN_TWICE */ /* Keep this test last, it's testing files that are used above */ /* do not do this for files used by external link tests */ diff --git a/test/links_env.c b/test/links_env.c index 308d562..6e47667 100644 --- a/test/links_env.c +++ b/test/links_env.c @@ -25,11 +25,7 @@ #include "H5Iprivate.h" /* IDs */ #include "H5Lprivate.h" /* Links */ -#ifdef H5_VMS -#define TMPDIR "[.tmp]" -#else /* H5_VMS */ #define TMPDIR "tmp/" -#endif /* H5_VMS */ #define NAME_BUF_SIZE 1024 const char *FILENAME[] = { diff --git a/test/objcopy.c b/test/objcopy.c index e84e70c..a73beb3 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -12276,9 +12276,7 @@ main(void) nerrors += test_copy_group_wide_loop(fcpl_src, fcpl_dst, src_fapl, dst_fapl); nerrors += test_copy_group_links(fcpl_src, fcpl_dst, src_fapl, dst_fapl); nerrors += test_copy_soft_link(fcpl_src, fcpl_dst, src_fapl, dst_fapl); -#ifndef H5_CANNOT_OPEN_TWICE nerrors += test_copy_ext_link(fcpl_src, fcpl_dst, src_fapl, dst_fapl); -#endif /* H5_CANNOT_OPEN_TWICE */ nerrors += test_copy_exist(fcpl_src, fcpl_dst, src_fapl, dst_fapl); nerrors += test_copy_path(fcpl_src, fcpl_dst, src_fapl, dst_fapl); diff --git a/test/stab.c b/test/stab.c index 48b58b1..95e9722 100644 --- a/test/stab.c +++ b/test/stab.c @@ -57,8 +57,6 @@ const char *FILENAME[] = { /* The group_old.h5 is generated from gen_old_fill.c in HDF5 'test' directory * for version 1.6. To get this data file, simply compile gen_old_group.c with * the HDF5 library in that branch and run it. */ -/* I changed the name "group_old.h5.copy" to "group_old_copy.h5" because OpenVMS - * doesn't like any file name with more than one ".". SLU 2010/12/13 */ #define FILE_OLD_GROUPS "group_old.h5" #define FILE_OLD_GROUPS_COPY "group_old_copy.h5" diff --git a/test/tattr.c b/test/tattr.c index 137c7c9..6642cf1 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -5919,9 +5919,9 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Pget_attr_phase_change"); /* Loop over operating on different indices on link fields */ - for(idx_type = H5_INDEX_NAME; idx_type <=H5_INDEX_CRT_ORDER; idx_type++) { + for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; H5_INC_ENUM(H5_index_t, idx_type)) { /* Loop over operating in different orders */ - for(order = H5_ITER_INC; order <=H5_ITER_DEC; order++) { + for(order = H5_ITER_INC; order <= H5_ITER_DEC; H5_INC_ENUM(H5_iter_order_t, order)) { /* Loop over using index for creation order value */ for(use_index = FALSE; use_index <= TRUE; use_index++) { /* Print appropriate test message */ @@ -6868,9 +6868,9 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) iter_info.visited = visited; /* Loop over operating on different indices on link fields */ - for(idx_type = H5_INDEX_NAME; idx_type <=H5_INDEX_CRT_ORDER; idx_type++) { + for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; H5_INC_ENUM(H5_index_t, idx_type)) { /* Loop over operating in different orders */ - for(order = H5_ITER_INC; order <=H5_ITER_DEC; order++) { + for(order = H5_ITER_INC; order <= H5_ITER_DEC; H5_INC_ENUM(H5_iter_order_t, order)) { /* Loop over using index for creation order value */ for(use_index = FALSE; use_index <= TRUE; use_index++) { /* Print appropriate test message */ @@ -7223,9 +7223,9 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Pget_attr_phase_change"); /* Loop over operating on different indices on link fields */ - for(idx_type = H5_INDEX_NAME; idx_type <=H5_INDEX_CRT_ORDER; idx_type++) { + for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; H5_INC_ENUM(H5_index_t, idx_type)) { /* Loop over operating in different orders */ - for(order = H5_ITER_INC; order <=H5_ITER_DEC; order++) { + for(order = H5_ITER_INC; order <= H5_ITER_DEC; H5_INC_ENUM(H5_iter_order_t, order)) { /* Loop over using index for creation order value */ for(use_index = FALSE; use_index <= TRUE; use_index++) { /* Print appropriate test message */ diff --git a/test/tconfig.c b/test/tconfig.c index f3ac242..14c863e 100644 --- a/test/tconfig.c +++ b/test/tconfig.c @@ -60,13 +60,6 @@ void test_exit_definitions(void); * Programmer: Albert Cheng * September 25, 2001 * - * Modifications: - * Raymond Lu - * 16 Dec 2009 - * On Boeing's OpenVMS, the value of EXIT_FAILURE is 268435458. - * (The test is in test_exit_definitions.) Their document says - * it's supposed to be 2. I commented it out for OpenVMS for - * further consideration. *------------------------------------------------------------------------- */ void @@ -75,9 +68,7 @@ test_configure(void) /* Output message about test being performed */ MESSAGE(5, ("Testing configure definitions\n")); test_config_ctypes(); -#ifndef H5_VMS test_exit_definitions(); -#endif } diff --git a/test/tfile.c b/test/tfile.c index 52c8fd9..33c947f 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -181,19 +181,15 @@ test_file_create(void) * try to create the same file with H5F_ACC_TRUNC. This should fail * because fid1 is the same file and is currently open. */ -#ifndef H5_HAVE_FILE_VERSIONS fid2 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); VERIFY(fid2, FAIL, "H5Fcreate"); -#endif /*H5_DONT_HAVE_FILE_VERSIONS*/ /* Close all files */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); -#ifndef H5_HAVE_FILE_VERSIONS ret = H5Fclose(fid2); VERIFY(ret, FAIL, "H5Fclose"); /*file should not have been open */ -#endif /*H5_HAVE_FILE_VERSIONS*/ /* * Try again with H5F_ACC_EXCL. This should fail because the file already @@ -206,7 +202,6 @@ test_file_create(void) fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(fid1, FAIL, "H5Fcreate"); -#ifndef H5_HAVE_FILE_VERSIONS /* * Try to truncate first file again. This should fail because fid1 is the * same file and is currently open. @@ -220,7 +215,6 @@ test_file_create(void) */ fid2 = H5Fcreate(FILE1, H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT); VERIFY(fid2, FAIL, "H5Fcreate"); -#endif /*H5_HAVE_FILE_VERSIONS*/ /* Get the file-creation template */ tmpl1 = H5Fget_create_plist(fid1); @@ -833,7 +827,9 @@ test_file_close(void) ret = H5Gclose(group_id3); CHECK(ret, FAIL, "H5Gclose"); break; - default: + + case H5F_CLOSE_DEFAULT: + default: CHECK(fc_degree, H5F_CLOSE_DEFAULT, "H5Pget_fclose_degree"); break; } @@ -1320,6 +1316,19 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, VERIFY(oid_list[i], did, "H5Fget_obj_ids"); break; + case H5I_UNINIT: + case H5I_BADID: + case H5I_DATATYPE: + case H5I_DATASPACE: + case H5I_ATTR: + case H5I_REFERENCE: + case H5I_VFL: + case H5I_GENPROP_CLS: + case H5I_GENPROP_LST: + case H5I_ERROR_CLASS: + case H5I_ERROR_MSG: + case H5I_ERROR_STACK: + case H5I_NTYPES: default: ERROR("H5Fget_obj_ids"); } /* end switch */ @@ -1370,7 +1379,6 @@ test_file_perm(void) ret = H5Dclose(dset); CHECK(ret, FAIL, "H5Dclose"); -#ifndef H5_CANNOT_OPEN_TWICE /* Open the file (with read-only permission) */ filero = H5Fopen(FILE2, H5F_ACC_RDONLY, H5P_DEFAULT); CHECK(filero, FAIL, "H5Fopen"); @@ -1387,7 +1395,6 @@ test_file_perm(void) ret = H5Fclose(filero); CHECK(ret, FAIL, "H5Fclose"); -#endif /*H5_CANNOT_OPEN_TWICE*/ ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); @@ -2364,7 +2371,7 @@ test_rw_noupdate(void) /* Check That Timestamps Are Equal */ if(diff > 0.0F) { /* Output message about test being performed */ - MESSAGE(1, ("Testing to verify that nothing is written if nothing is changed: This test is skipped on this system because the modification time from stat is the same as the last access time (We know OpenVMS behaves in this way).\n")); + MESSAGE(1, ("Testing to verify that nothing is written if nothing is changed: This test is skipped on this system because the modification time from stat is the same as the last access time.\n")); } /* end if */ else { hid_t file_id; /* HDF5 File ID */ @@ -3087,67 +3094,68 @@ test_filespace_info(void) my_fapl = fapl; } /* end else */ - /* Test with different sized free space section threshold */ - for(fs_size = 0; fs_size <= TEST_THRESHOLD10; fs_size++) { + /* Test with different sized free space section threshold */ + for(fs_size = 0; fs_size <= TEST_THRESHOLD10; fs_size++) { - /* Test with different file space handling strategies */ - for(fs_type = 0; fs_type < H5F_FILE_SPACE_NTYPES; H5_INC_ENUM(H5F_file_space_type_t, fs_type)) { + /* Test with different file space handling strategies */ + for(fs_type = H5F_FILE_SPACE_DEFAULT; fs_type < H5F_FILE_SPACE_NTYPES; H5_INC_ENUM(H5F_file_space_type_t, fs_type)) { - /* Get a copy of the default file creation property */ - fcpl1 = H5Pcopy(fcpl); - CHECK(fcpl1, FAIL, "H5Pcopy"); + /* Get a copy of the default file creation property */ + fcpl1 = H5Pcopy(fcpl); + CHECK(fcpl1, FAIL, "H5Pcopy"); - /* Set file space strategy and free space section threshold */ - ret = H5Pset_file_space(fcpl1, fs_type, fs_size); - CHECK(ret, FAIL, "H5Pget_file_space"); + /* Set file space strategy and free space section threshold */ + ret = H5Pset_file_space(fcpl1, fs_type, fs_size); + CHECK(ret, FAIL, "H5Pget_file_space"); - /* Get the file space info from the creation property */ - ret = H5Pget_file_space(fcpl1, &strategy, &threshold); - CHECK(ret, FAIL, "H5Pget_file_space"); + /* Get the file space info from the creation property */ + ret = H5Pget_file_space(fcpl1, &strategy, &threshold); + CHECK(ret, FAIL, "H5Pget_file_space"); - /* A 0 value for strategy retains existing strategy in use */ - VERIFY(strategy, (H5F_file_space_type_t)(fs_type ? fs_type : def_type), "H5Pget_file_space"); - /* A 0 value for threshold retains existing threshold in use */ - VERIFY(threshold, (hsize_t)(fs_size ? fs_size : def_size), "H5Pget_file_space"); + /* A 0 value for strategy retains existing strategy in use */ + VERIFY(strategy, (H5F_file_space_type_t)(fs_type ? fs_type : def_type), "H5Pget_file_space"); + /* A 0 value for threshold retains existing threshold in use */ + VERIFY(threshold, (hsize_t)(fs_size ? fs_size : def_size), "H5Pget_file_space"); - /* Create the file with the specified file space info */ - fid1 = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl1, my_fapl); - CHECK(ret, FAIL, "H5Fcreate"); + /* Create the file with the specified file space info */ + fid1 = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl1, my_fapl); + CHECK(ret, FAIL, "H5Fcreate"); - /* Close the file */ - ret = H5Fclose(fid1); - CHECK(ret, FAIL, "H5Fclose"); + /* Close the file */ + ret = H5Fclose(fid1); + CHECK(ret, FAIL, "H5Fclose"); - /* Re-open the file */ - fid2 = H5Fopen(filename, H5F_ACC_RDWR, my_fapl); - CHECK(ret, FAIL, "H5Fopen"); + /* Re-open the file */ + fid2 = H5Fopen(filename, H5F_ACC_RDWR, my_fapl); + CHECK(ret, FAIL, "H5Fopen"); - /* Get the file's creation property */ - fcpl2 = H5Fget_create_plist(fid2); - CHECK(fcpl2, FAIL, "H5Fget_create_plist"); + /* Get the file's creation property */ + fcpl2 = H5Fget_create_plist(fid2); + CHECK(fcpl2, FAIL, "H5Fget_create_plist"); - strategy = threshold = 0; + strategy = H5F_FILE_SPACE_DEFAULT; + threshold = 0; - /* Get the file space info from the creation property list */ - ret = H5Pget_file_space(fcpl2, &strategy, &threshold); - CHECK(ret, FAIL, "H5Pget_file_space"); + /* Get the file space info from the creation property list */ + ret = H5Pget_file_space(fcpl2, &strategy, &threshold); + CHECK(ret, FAIL, "H5Pget_file_space"); - VERIFY(strategy, (H5F_file_space_type_t)(fs_type ? fs_type : def_type), "H5Pget_file_space"); - VERIFY(threshold, (hsize_t)(fs_size ? fs_size : def_size), "H5Pget_file_space"); + VERIFY(strategy, (H5F_file_space_type_t)(fs_type ? fs_type : def_type), "H5Pget_file_space"); + VERIFY(threshold, (hsize_t)(fs_size ? fs_size : def_size), "H5Pget_file_space"); - /* Close the file */ - ret = H5Fclose(fid2); - CHECK(ret, FAIL, "H5Fclose"); + /* Close the file */ + ret = H5Fclose(fid2); + CHECK(ret, FAIL, "H5Fclose"); - /* Release file-creation template */ - ret = H5Pclose(fcpl1); - CHECK(ret, FAIL, "H5Pclose"); - ret = H5Pclose(fcpl2); - CHECK(ret, FAIL, "H5Pclose"); - } /* end for file space strategy type */ - } /* end for free space threshold */ + /* Release file-creation template */ + ret = H5Pclose(fcpl1); + CHECK(ret, FAIL, "H5Pclose"); + ret = H5Pclose(fcpl2); + CHECK(ret, FAIL, "H5Pclose"); + } /* end for file space strategy type */ + } /* end for free space threshold */ - h5_cleanup(FILESPACE_NAME, my_fapl); + h5_cleanup(FILESPACE_NAME, my_fapl); } /* end for new/old format */ @@ -3660,16 +3668,12 @@ test_file(void) test_file_freespace(); /* Test file free space information */ test_file_ishdf5(); /* Test detecting HDF5 files correctly */ test_file_open_dot(); /* Test opening objects with "." for a name */ -#ifndef H5_CANNOT_OPEN_TWICE test_file_open_overlap(); /* Test opening files in an overlapping manner */ -#endif /*H5_CANNOT_OPEN_TWICE*/ test_file_getname(); /* Test basic H5Fget_name() functionality */ -#ifndef H5_CANNOT_OPEN_TWICE test_file_double_root_open(); /* Test opening root group from two files works properly */ test_file_double_group_open(); /* Test opening same group from two files works properly */ test_file_double_dataset_open(); /* Test opening same dataset from two files works properly */ test_file_double_datatype_open(); /* Test opening same named datatype from two files works properly */ -#endif /*H5_CANNOT_OPEN_TWICE*/ test_userblock_file_size(); /* Tests that files created with a userblock have the correct size */ test_cached_stab_info(); /* Tests that files are created with cached stab info in the superblock */ test_rw_noupdate(); /* Test to ensure that RW permissions don't write the file unless dirtied */ diff --git a/test/tgenprop.c b/test/tgenprop.c index 10cae6d..fda4161 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -61,6 +61,18 @@ double prop4_def=1.41F; /* Property 4 default value */ #define PROP4_SIZE sizeof(prop4_def) #define PROP4_DEF_VALUE (&prop4_def) +/* Structs used during iteration */ +typedef struct iter_data_t { + int iter_count; + char **names; +} iter_data_t; + +typedef struct count_data_t { + int count; + hid_t id; +} count_data_t; + + /**************************************************************** ** ** test_genprop_basic_class(): Test basic generic property list code. @@ -284,17 +296,12 @@ test_genprop_basic_class_prop(void) ** ****************************************************************/ static int -test_genprop_iter1(hid_t id, const char *name, void *iter_data) +test_genprop_iter1(hid_t H5_ATTR_UNUSED id, const char *name, + void *iter_data) { - struct { /* Struct for iterations */ - int iter_count; - const char **names; - } *iter_struct = iter_data; - - /* Shut compiler up */ - id = id; + iter_data_t *idata = (iter_data_t *)iter_data; - return(HDstrcmp(name,iter_struct->names[iter_struct->iter_count++])); + return HDstrcmp(name,idata->names[idata->iter_count++]); } /**************************************************************** @@ -373,43 +380,34 @@ test_genprop_class_iter(void) static herr_t test_genprop_cls_crt_cb1(hid_t list_id, void *create_data) { - struct { /* Struct for iterations */ - int count; - hid_t id; - } *count_struct=create_data; + count_data_t *cdata = (count_data_t *)create_data; - count_struct->count++; - count_struct->id=list_id; + cdata->count++; + cdata->id = list_id; - return(SUCCEED); + return SUCCEED; } static herr_t test_genprop_cls_cpy_cb1(hid_t new_list_id, hid_t H5_ATTR_UNUSED old_list_id, void *copy_data) { - struct { /* Struct for iterations */ - int count; - hid_t id; - } *count_struct=copy_data; + count_data_t *cdata = (count_data_t *)copy_data; - count_struct->count++; - count_struct->id=new_list_id; + cdata->count++; + cdata->id = new_list_id; - return(SUCCEED); + return SUCCEED; } static herr_t test_genprop_cls_cls_cb1(hid_t list_id, void *create_data) { - struct { /* Struct for iterations */ - int count; - hid_t id; - } *count_struct=create_data; + count_data_t *cdata = (count_data_t *)create_data; - count_struct->count++; - count_struct->id=list_id; + cdata->count++; + cdata->id = list_id; - return(SUCCEED); + return SUCCEED; } /**************************************************************** @@ -843,17 +841,12 @@ test_genprop_basic_list_prop(void) ** ****************************************************************/ static int -test_genprop_iter2(hid_t id, const char *name, void *iter_data) +test_genprop_iter2(hid_t H5_ATTR_UNUSED id, const char *name, + void *iter_data) { - struct { /* Struct for iterations */ - int iter_count; - const char **names; - } *iter_struct=iter_data; - - /* Shut compiler up */ - id=id; + iter_data_t *idata = (iter_data_t *)iter_data; - return(HDstrcmp(name,iter_struct->names[iter_struct->iter_count++])); + return HDstrcmp(name,idata->names[idata->iter_count++]); } /**************************************************************** @@ -995,15 +988,12 @@ prop_cb_info prop3_cb_info; /* Callback statistics for property #3 */ static herr_t test_genprop_cls_cpy_cb2(hid_t new_list_id, hid_t H5_ATTR_UNUSED old_list_id, void *create_data) { - struct { /* Struct for iterations */ - int count; - hid_t id; - } *count_struct=create_data; + count_data_t *cdata = (count_data_t *)create_data; - count_struct->count++; - count_struct->id=new_list_id; + cdata->count++; + cdata->id = new_list_id; - return(SUCCEED); + return SUCCEED; } /**************************************************************** diff --git a/test/th5o.c b/test/th5o.c index be3b4ab..40844fa 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -1355,9 +1355,7 @@ test_h5o(void) test_h5o_link(); /* Test object link routine */ test_h5o_comment(); /* Test routines for comment */ test_h5o_comment_by_name(); /* Test routines for comment by name */ -#ifndef H5_CANNOT_OPEN_TWICE /* OpenVMS can't open a file twice */ test_h5o_getinfo_same_file(); /* Test info for objects in the same file */ -#endif /* H5_CANNOT_OPEN_TWICE */ } /* test_h5o() */ diff --git a/test/th5s.c b/test/th5s.c index 1560ef4..a478803 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -565,7 +565,7 @@ test_h5s_zero_dim(void) wdata_real[i][j][k] = i + j + k; /* Test with different space allocation times */ - for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; alloc_time++) { + for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; H5_INC_ENUM(H5D_alloc_time_t, alloc_time)) { /* Make sure we can create the space with the dimension size 0 (starting from v1.8.7). * The dimension doesn't need to be unlimited. */ @@ -2326,6 +2326,48 @@ test_h5s_extent_copy(void) /**************************************************************** ** +** test_h5s_bug1(): Test Creating dataspace with H5Screate then +* setting extent with H5Sextent_copy. +** +****************************************************************/ +static void +test_h5s_bug1(void) +{ + hid_t space1; /* Dataspace to copy extent to */ + hid_t space2; /* Scalar dataspace */ + hsize_t dims[2] = {10, 10}; /* Dimensions */ + hsize_t start[2] = {0, 0}; /* Hyperslab start */ + htri_t select_valid; /* Whether the dataspace selection is valid */ + herr_t ret; /* Generic error return */ + + /* Create dataspaces */ + space1 = H5Screate(H5S_SIMPLE); + CHECK(space1, FAIL, "H5Screate"); + space2 = H5Screate_simple(2, dims, NULL); + CHECK(space2, FAIL, "H5Screate"); + + /* Copy extent to space1 */ + ret = H5Sextent_copy(space1, space2); + CHECK(ret, FAIL, "H5Sextent_copy"); + + /* Select hyperslab in space1 containing entire extent */ + ret = H5Sselect_hyperslab(space1, H5S_SELECT_SET, start, NULL, dims, NULL); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Check that space1's selection is valid */ + select_valid = H5Sselect_valid(space1); + CHECK(select_valid, FAIL, "H5Sselect_valid"); + VERIFY(select_valid, TRUE, "H5Sselect_valid result"); + + /* Close dataspaces */ + ret = H5Sclose(space1); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(space2); + CHECK(ret, FAIL, "H5Sclose"); +} /* test_h5s_bug1() */ + +/**************************************************************** +** ** test_h5s(): Main H5S (dataspace) testing routine. ** ****************************************************************/ @@ -2350,6 +2392,7 @@ test_h5s(void) test_h5s_extent_equal(); /* Test extent comparison code */ test_h5s_extent_copy(); /* Test extent copy code */ + test_h5s_bug1(); /* Test bug in offset initialization */ } /* test_h5s() */ diff --git a/test/tmisc.c b/test/tmisc.c index 11c6de7..6a68857 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -713,7 +713,7 @@ create_struct3(void) misc5_struct3_hndl *str3hndl; /* New 'struct3' created */ herr_t ret; /* For error checking */ - str3hndl = HDmalloc(sizeof(misc5_struct3_hndl)); + str3hndl = (misc5_struct3_hndl *)HDmalloc(sizeof(misc5_struct3_hndl)); CHECK(str3hndl,NULL,"malloc"); str3hndl->st3h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct3)); @@ -722,10 +722,10 @@ create_struct3(void) ret = H5Tinsert(str3hndl->st3h_base, "st3_el1", HOFFSET( misc5_struct3, st3_el1), H5T_NATIVE_INT); CHECK(ret,FAIL,"H5Tinsert"); - str3hndl->st3h_id=H5Tvlen_create(str3hndl->st3h_base); + str3hndl->st3h_id = H5Tvlen_create(str3hndl->st3h_base); CHECK(str3hndl->st3h_id,FAIL,"H5Tvlen_create"); - return(str3hndl); + return str3hndl; } static void @@ -733,10 +733,10 @@ delete_struct3(misc5_struct3_hndl *str3hndl) { herr_t ret; /* For error checking */ - ret=H5Tclose(str3hndl->st3h_id); + ret = H5Tclose(str3hndl->st3h_id); CHECK(ret,FAIL,"H5Tclose"); - ret=H5Tclose(str3hndl->st3h_base); + ret = H5Tclose(str3hndl->st3h_base); CHECK(ret,FAIL,"H5Tclose"); HDfree(str3hndl); @@ -756,7 +756,7 @@ create_struct2(void) misc5_struct2_hndl *str2hndl; /* New 'struct2' created */ herr_t ret; /* For error checking */ - str2hndl = HDmalloc(sizeof(misc5_struct2_hndl)); + str2hndl = (misc5_struct2_hndl *)HDmalloc(sizeof(misc5_struct2_hndl)); CHECK(str2hndl, NULL, "malloc"); str2hndl->st2h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct2)); @@ -765,16 +765,16 @@ create_struct2(void) ret = H5Tinsert(str2hndl->st2h_base, "st2_el1", HOFFSET(misc5_struct2, st2_el1), H5T_NATIVE_INT); CHECK(ret, FAIL, "H5Tinsert"); - str2hndl->st2h_st3hndl=create_struct3(); + str2hndl->st2h_st3hndl = create_struct3(); CHECK(str2hndl->st2h_st3hndl,NULL,"create_struct3"); - ret=H5Tinsert(str2hndl->st2h_base, "st2_el2", HOFFSET(misc5_struct2, st2_el2), str2hndl->st2h_st3hndl->st3h_id); + ret = H5Tinsert(str2hndl->st2h_base, "st2_el2", HOFFSET(misc5_struct2, st2_el2), str2hndl->st2h_st3hndl->st3h_id); CHECK(ret,FAIL,"H5Tinsert"); - str2hndl->st2h_id= H5Tvlen_create(str2hndl->st2h_base); + str2hndl->st2h_id = H5Tvlen_create(str2hndl->st2h_base); CHECK(str2hndl->st2h_id,FAIL,"H5Tvlen_create"); - return(str2hndl); + return str2hndl; } static void @@ -798,10 +798,10 @@ set_struct2(misc5_struct2 *buf) { unsigned i; /* Local index variable */ - buf->st2_el1=MISC5_DBGELVAL2; - buf->st2_el2.len=MISC5_DBGNELM3; + buf->st2_el1 = MISC5_DBGELVAL2; + buf->st2_el2.len = MISC5_DBGNELM3; - buf->st2_el2.p=HDmalloc((buf->st2_el2.len)*sizeof(misc5_struct3)); + buf->st2_el2.p = HDmalloc((buf->st2_el2.len)*sizeof(misc5_struct3)); CHECK(buf->st2_el2.p,NULL,"malloc"); for(i=0; i<(buf->st2_el2.len); i++) @@ -822,7 +822,7 @@ create_struct1(void) misc5_struct1_hndl *str1hndl; /* New 'struct1' created */ herr_t ret; /* For error checking */ - str1hndl = HDmalloc(sizeof(misc5_struct1_hndl)); + str1hndl = (misc5_struct1_hndl *)HDmalloc(sizeof(misc5_struct1_hndl)); CHECK(str1hndl, NULL, "malloc"); str1hndl->st1h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct1)); @@ -834,13 +834,13 @@ create_struct1(void) str1hndl->st1h_st2hndl=create_struct2(); CHECK(str1hndl->st1h_st2hndl,NULL,"create_struct2"); - ret=H5Tinsert(str1hndl->st1h_base, "st1_el2", HOFFSET(misc5_struct1, st1_el2), str1hndl->st1h_st2hndl->st2h_id); + ret = H5Tinsert(str1hndl->st1h_base, "st1_el2", HOFFSET(misc5_struct1, st1_el2), str1hndl->st1h_st2hndl->st2h_id); CHECK(ret,FAIL,"H5Tinsert"); - str1hndl->st1h_id=H5Tvlen_create(str1hndl->st1h_base); + str1hndl->st1h_id = H5Tvlen_create(str1hndl->st1h_base); CHECK(str1hndl->st1h_id,FAIL,"H5Tvlen_create"); - return(str1hndl); + return str1hndl; } static void @@ -848,12 +848,12 @@ delete_struct1(misc5_struct1_hndl *str1hndl) { herr_t ret; /* For error checking */ - ret=H5Tclose(str1hndl->st1h_id); + ret = H5Tclose(str1hndl->st1h_id); CHECK(ret,FAIL,"H5Tclose"); delete_struct2(str1hndl->st1h_st2hndl); - ret=H5Tclose(str1hndl->st1h_base); + ret = H5Tclose(str1hndl->st1h_base); CHECK(ret,FAIL,"H5Tclose"); HDfree(str1hndl); @@ -1243,10 +1243,10 @@ test_misc8(void) MESSAGE(5, ("Testing dataset storage sizes\n")); /* Allocate space for the data to write & read */ - wdata=HDmalloc(sizeof(int)*MISC8_DIM0*MISC8_DIM1); + wdata = (int *)HDmalloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); CHECK(wdata,NULL,"malloc"); #ifdef VERIFY_DATA - rdata=HDmalloc(sizeof(int)*MISC8_DIM0*MISC8_DIM1); + rdata = (int *)HDmalloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); CHECK(rdata,NULL,"malloc"); #endif /* VERIFY_DATA */ diff --git a/test/tsohm.c b/test/tsohm.c index 9da655e..e22940f 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -3988,10 +3988,7 @@ test_sohm(void) test_sohm_delete(); /* Test deleting shared messages */ test_sohm_delete_revert(); /* Test that a file with SOHMs becomes an * empty file again when they are deleted. */ -#ifndef H5_CANNOT_OPEN_TWICE /* On VMS this test fails since it tries to - open target file the second time */ test_sohm_extlink(); /* Test SOHMs when external links are used */ -#endif /* H5_CANNOT_OPEN_TWICE */ test_sohm_extend_dset(); /* Test extending shared datasets */ test_sohm_external_dtype(); /* Test using datatype in another file */ diff --git a/test/ttsafe.c b/test/ttsafe.c index d0ab81a..d3c5cfb 100644 --- a/test/ttsafe.c +++ b/test/ttsafe.c @@ -40,13 +40,6 @@ /* ANY new test needs to have a prototype in ttsafe.h */ #include "ttsafe.h" -#ifndef H5_HAVE_THREADSAFE -int main(void) -{ - printf("Test skipped because THREADSAFE not enabled\n"); - return 0; -} -#else #define MAX_NUM_NAME 1000 #define NAME_OFFSET 6 /* offset for "name<num>" */ @@ -66,6 +59,30 @@ num_digits(int num) return u; } +/* Test the H5is_library_threadsafe() function */ +void +tts_is_threadsafe(void) +{ + hbool_t is_ts; + hbool_t should_be; + +#ifdef H5_HAVE_THREADSAFE + is_ts = FALSE; + should_be = TRUE; +#else /* H5_HAVE_THREADSAFE */ + is_ts = TRUE; + should_be = FALSE; +#endif /* H5_HAVE_THREADSAFE */ + + if(H5is_library_threadsafe(&is_ts) != SUCCEED) + TestErrPrintf("H5_is_library_threadsafe() call failed - test failed\n"); + + if(is_ts != should_be) + TestErrPrintf("Thread-safety value incorrect - test failed\n"); + + return; +} + /* Routine to generate attribute names for numeric values */ char *gen_name(int value) { @@ -88,10 +105,13 @@ char *gen_name(int value) int main(int argc, char *argv[]) { + /* Initialize testing framework */ TestInit(argv[0], NULL, NULL); /* Tests are generally arranged from least to most complexity... */ + AddTest("is_threadsafe", tts_is_threadsafe, NULL, "library threadsafe status", NULL); +#ifdef H5_HAVE_THREADSAFE AddTest("dcreate", tts_dcreate, cleanup_dcreate, "multi-dataset creation", NULL); AddTest("error", tts_error, cleanup_error, "per-thread error stacks", NULL); #ifdef H5_HAVE_PTHREAD_H @@ -100,6 +120,12 @@ int main(int argc, char *argv[]) #endif /* H5_HAVE_PTHREAD_H */ AddTest("acreate", tts_acreate, cleanup_acreate, "multi-attribute creation", NULL); +#else /* H5_HAVE_THREADSAFE */ + + printf("Most thread-safety tests skipped because THREADSAFE not enabled\n"); + +#endif /* H5_HAVE_THREADSAFE */ + /* Display testing information */ TestInfo(argv[0]); @@ -118,5 +144,6 @@ int main(int argc, char *argv[]) TestCleanup(); return GetTestNumErrs(); + } /* end main() */ -#endif /*H5_HAVE_THREADSAFE*/ + diff --git a/test/ttsafe.h b/test/ttsafe.h index b4826fc..f2e9e86 100644 --- a/test/ttsafe.h +++ b/test/ttsafe.h @@ -20,8 +20,6 @@ #ifndef TTSAFE_H #define TTSAFE_H -#include <string.h> - /* * Include required headers. This file tests internal library functions, * so we include the private headers here. @@ -31,16 +29,13 @@ #include "H5Eprivate.h" #include "testhdf5.h" -#ifdef H5_HAVE_THREADSAFE -/* Include pthread library for threadsafe tests */ -#ifdef H5_HAVE_PTHREAD_H -#include <pthread.h> -#endif /* H5_HAVE_PTHREAD_H */ /* Prototypes for the support routines */ extern char* gen_name(int); /* Prototypes for the test routines */ +void tts_is_threadsafe(void); +#ifdef H5_HAVE_THREADSAFE void tts_dcreate(void); void tts_error(void); void tts_cancel(void); @@ -54,3 +49,4 @@ void cleanup_acreate(void); #endif /* H5_HAVE_THREADSAFE */ #endif /* TTSAFE_H */ + diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c index e143263..a2f25db 100644 --- a/test/ttsafe_error.c +++ b/test/ttsafe_error.c @@ -231,3 +231,4 @@ void cleanup_error(void) } #endif /*H5_HAVE_THREADSAFE*/ + diff --git a/test/ttst.c b/test/ttst.c index 4ffe4cd..b869b63 100644 --- a/test/ttst.c +++ b/test/ttst.c @@ -95,13 +95,13 @@ test_tst_init(void) } /* end for */ /* Allocate space for the array of unique words */ - uniq_words=HDmalloc(sizeof(char *)*num_uniq_words); + uniq_words = (char **)HDmalloc(sizeof(char *)*num_uniq_words); /* Allocate space for the array of randomized order unique words also */ - rand_uniq_words=HDmalloc(sizeof(char *)*num_uniq_words); + rand_uniq_words = (char **)HDmalloc(sizeof(char *)*num_uniq_words); /* Allocate space for the array of sorted order unique words also */ - sort_uniq_words=HDmalloc(sizeof(char *)*num_uniq_words); + sort_uniq_words = (char **)HDmalloc(sizeof(char *)*num_uniq_words); /* Insert unique words from test set into unique word set */ w=0; diff --git a/test/tvltypes.c b/test/tvltypes.c index d1a4235..b7bbaee 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -1021,7 +1021,7 @@ test_vltypes_compound_vlen_vlen(void) wdata[i].f=(float)((i*20)/3.0F); wdata[i].v.p=HDmalloc((i+L1_INCM)*sizeof(hvl_t)); wdata[i].v.len=i+L1_INCM; - for(t1=(wdata[i].v).p,j=0; j<(i+L1_INCM); j++, t1++) { + for(t1=(hvl_t *)((wdata[i].v).p),j=0; j<(i+L1_INCM); j++, t1++) { t1->p=HDmalloc((j+L2_INCM)*sizeof(unsigned int)); t1->len=j+L2_INCM; for(k=0; k<j+L2_INCM; k++) @@ -1102,7 +1102,7 @@ test_vltypes_compound_vlen_vlen(void) continue; } /* end if */ - for(t1=wdata[i].v.p, t2=rdata[i].v.p, j=0; j<rdata[i].v.len; j++, t1++, t2++) { + for(t1=(hvl_t *)(wdata[i].v.p), t2=(hvl_t *)(rdata[i].v.p), j=0; j<rdata[i].v.len; j++, t1++, t2++) { if(t1->len != t2->len) { TestErrPrintf("%d: VL data length don't match!, i=%d, j=%d, t1->len=%d, t2->len=%d\n",__LINE__,(int)i,(int)j,(int)t1->len,(int)t2->len); continue; @@ -1161,13 +1161,13 @@ static void test_vltypes_compound_vlstr(void) { typedef enum { - red, - blue, - green + red, + blue, + green } e1; typedef struct { char *string; - e1 color; + e1 color; } s2; typedef struct { /* Struct that the compound type are composed of */ hvl_t v; @@ -1199,12 +1199,12 @@ test_vltypes_compound_vlstr(void) for(i=0; i<SPACE1_DIM1; i++) { wdata[i].v.p=(s2*)HDmalloc((i+L3_INCM)*sizeof(s2)); wdata[i].v.len=i+L3_INCM; - for(t1=(wdata[i].v).p, j=0; j<(i+L3_INCM); j++, t1++) { - strcat(str, "m"); - t1->string = (char*)HDmalloc(strlen(str)*sizeof(char)+1); + for(t1=(s2 *)((wdata[i].v).p), j=0; j<(i+L3_INCM); j++, t1++) { + strcat(str, "m"); + t1->string = (char*)HDmalloc(strlen(str)*sizeof(char)+1); strcpy(t1->string, str); - /*t1->color = red;*/ - t1->color = blue; + /*t1->color = red;*/ + t1->color = blue; } } /* end for */ @@ -1342,7 +1342,7 @@ test_vltypes_compound_vlstr(void) continue; } /* end if */ - for(t1=wdata[i].v.p, t2=rdata[i].v.p, j=0; j<rdata[i].v.len; j++, t1++, t2++) { + for(t1=(s2 *)(wdata[i].v.p), t2=(s2 *)(rdata[i].v.p), j=0; j<rdata[i].v.len; j++, t1++, t2++) { if( strcmp(t1->string, t2->string) ) { TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n",t1->string, t2->string); continue; @@ -1400,7 +1400,7 @@ test_vltypes_compound_vlstr(void) continue; } /* end if */ - for(t1=wdata2[i].v.p, t2=rdata2[i].v.p, j=0; j<rdata2[i].v.len; j++, t1++, t2++) { + for(t1=(s2 *)(wdata2[i].v.p), t2=(s2 *)(rdata2[i].v.p), j=0; j<rdata2[i].v.len; j++, t1++, t2++) { if( strcmp(t1->string, t2->string) ) { TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n",t1->string, t2->string); continue; @@ -1871,7 +1871,7 @@ test_vltypes_vlen_vlen_atomic(void) return; } /* end if */ wdata[i].len=i+1; - for(t1=wdata[i].p,j=0; j<(i+1); j++, t1++) { + for(t1=(hvl_t *)(wdata[i].p),j=0; j<(i+1); j++, t1++) { t1->p=HDmalloc((j+1)*sizeof(unsigned int)); if(t1->p==NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n",i,j); @@ -1977,7 +1977,7 @@ test_vltypes_vlen_vlen_atomic(void) TestErrPrintf("%d: VL data length don't match!, wdata[%d].len=%d, rdata[%d].len=%d\n",__LINE__,(int)i,(int)wdata[i].len,(int)i,(int)rdata[i].len); continue; } /* end if */ - for(t1=wdata[i].p, t2=rdata[i].p, j=0; j<rdata[i].len; j++, t1++, t2++) { + for(t1=(hvl_t *)wdata[i].p, t2=(hvl_t *)(rdata[i].p), j=0; j<rdata[i].len; j++, t1++, t2++) { if(t1->len!=t2->len) { TestErrPrintf("%d: VL data length don't match!, i=%d, j=%d, t1->len=%d, t2->len=%d\n",__LINE__,(int)i,(int)j,(int)t1->len,(int)t2->len); continue; @@ -2062,7 +2062,7 @@ rewrite_longer_vltypes_vlen_vlen_atomic(void) return; } /* end if */ wdata[i].len = i + increment; - for(t1 = wdata[i].p, j = 0; j < (i + increment); j++, t1++) { + for(t1 = (hvl_t *)(wdata[i].p), j = 0; j < (i + increment); j++, t1++) { t1->p = HDmalloc((j + 1) * sizeof(unsigned int)); if(t1->p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n", i, j); @@ -2157,7 +2157,7 @@ rewrite_longer_vltypes_vlen_vlen_atomic(void) TestErrPrintf("%d: VL data length don't match!, wdata[%d].len=%d, rdata[%d].len=%d\n",__LINE__,(int)i,(int)wdata[i].len,(int)i,(int)rdata[i].len); continue; } /* end if */ - for(t1=wdata[i].p, t2=rdata[i].p, j=0; j<rdata[i].len; j++, t1++, t2++) { + for(t1=(hvl_t *)(wdata[i].p), t2=(hvl_t *)(rdata[i].p), j=0; j<rdata[i].len; j++, t1++, t2++) { if(t1->len!=t2->len) { TestErrPrintf("%d: VL data length don't match!, i=%d, j=%d, t1->len=%d, t2->len=%d\n",__LINE__,(int)i,(int)j,(int)t1->len,(int)t2->len); continue; @@ -2238,7 +2238,7 @@ rewrite_shorter_vltypes_vlen_vlen_atomic(void) return; } /* end if */ wdata[i].len=i+increment; - for(t1=wdata[i].p,j=0; j<(i+increment); j++, t1++) { + for(t1=(hvl_t *)(wdata[i].p),j=0; j<(i+increment); j++, t1++) { t1->p=HDmalloc((j+1)*sizeof(unsigned int)); if(t1->p==NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n",i,j); @@ -2333,7 +2333,7 @@ rewrite_shorter_vltypes_vlen_vlen_atomic(void) TestErrPrintf("%d: VL data length don't match!, wdata[%d].len=%d, rdata[%d].len=%d\n",__LINE__,(int)i,(int)wdata[i].len,(int)i,(int)rdata[i].len); continue; } /* end if */ - for(t1=wdata[i].p, t2=rdata[i].p, j=0; j<rdata[i].len; j++, t1++, t2++) { + for(t1=(hvl_t *)(wdata[i].p), t2=(hvl_t *)(rdata[i].p), j=0; j<rdata[i].len; j++, t1++, t2++) { if(t1->len!=t2->len) { TestErrPrintf("%d: VL data length don't match!, i=%d, j=%d, t1->len=%d, t2->len=%d\n",__LINE__,(int)i,(int)j,(int)t1->len,(int)t2->len); continue; @@ -2496,7 +2496,7 @@ test_vltypes_fill_value(void) /* Allocate space for the buffer to read data */ - rbuf = HDmalloc(SPACE4_DIM_LARGE * sizeof(dtype1_struct)); + rbuf = (dtype1_struct *)HDmalloc(SPACE4_DIM_LARGE * sizeof(dtype1_struct)); CHECK(rbuf, NULL, "HDmalloc"); @@ -2538,7 +2538,7 @@ test_vltypes_fill_value(void) CHECK(file_id, FAIL, "H5Fcreate"); /* Create datasets with different storage layouts */ - for(layout = H5D_COMPACT; layout <= H5D_CHUNKED; layout++) { + for(layout = H5D_COMPACT; layout <= H5D_CHUNKED; H5_INC_ENUM(H5D_layout_t, layout)) { unsigned compress_loop; /* # of times to run loop, for testing compressed chunked dataset */ unsigned test_loop; /* Loop over datasets */ @@ -2597,6 +2597,8 @@ test_vltypes_fill_value(void) } break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: assert(0 && "Unknown layout type!"); break; @@ -2648,7 +2650,7 @@ test_vltypes_fill_value(void) CHECK(file_id, FAIL, "H5Fopen"); /* Read empty datasets with different storage layouts */ - for(layout = H5D_COMPACT; layout <= H5D_CHUNKED; layout++) { + for(layout = H5D_COMPACT; layout <= H5D_CHUNKED; H5_INC_ENUM(H5D_layout_t, layout)) { unsigned compress_loop; /* # of times to run loop, for testing compressed chunked dataset */ unsigned test_loop; /* Loop over datasets */ @@ -2698,6 +2700,8 @@ test_vltypes_fill_value(void) dset_elmts = SPACE4_DIM_LARGE; break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: assert(0 && "Unknown layout type!"); break; @@ -2843,7 +2847,7 @@ test_vltypes_fill_value(void) CHECK(file_id, FAIL, "H5Fopen"); /* Write one element & fill values to datasets with different storage layouts */ - for(layout = H5D_COMPACT; layout <= H5D_CHUNKED; layout++) { + for(layout = H5D_COMPACT; layout <= H5D_CHUNKED; H5_INC_ENUM(H5D_layout_t, layout)) { unsigned compress_loop; /* # of times to run loop, for testing compressed chunked dataset */ unsigned test_loop; /* Loop over datasets */ @@ -2893,6 +2897,8 @@ test_vltypes_fill_value(void) dset_elmts = SPACE4_DIM_LARGE; break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: assert(0 && "Unknown layout type!"); break; |