diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeLists.txt | 28 | ||||
-rw-r--r-- | test/CMakeTests.cmake | 4 | ||||
-rw-r--r-- | test/cmpd_dset.c | 16 | ||||
-rw-r--r-- | test/dsets.c | 14 | ||||
-rw-r--r-- | test/dt_arith.c | 18 | ||||
-rw-r--r-- | test/fillval.c | 16 | ||||
-rw-r--r-- | test/flush2.c | 4 | ||||
-rw-r--r-- | test/gen_filespace.c | 3 | ||||
-rw-r--r-- | test/gen_plist.c | 4 | ||||
-rw-r--r-- | test/getname.c | 59 | ||||
-rw-r--r-- | test/links.c | 4 | ||||
-rw-r--r-- | test/plugin.c | 17 | ||||
-rw-r--r-- | test/tarray.c | 18 | ||||
-rw-r--r-- | test/tattr.c | 6 | ||||
-rw-r--r-- | test/tgenprop.c | 6 | ||||
-rw-r--r-- | test/th5s.c | 32 | ||||
-rw-r--r-- | test/tmisc.c | 12 | ||||
-rw-r--r-- | test/ttsafe_cancel.c | 7 | ||||
-rw-r--r-- | test/tvltypes.c | 2 |
19 files changed, 181 insertions, 89 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 83f82bd..55b3c44 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -27,7 +27,7 @@ set (TEST_LIB_HEADERS ) add_library (${HDF5_TEST_LIB_TARGET} ${LIB_TYPE} ${TEST_LIB_SRCS} ${TEST_LIB_HEADERS}) -TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} " " " ") +TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} ${LIB_TYPE} " " " ") if (MSVC) target_link_libraries (${HDF5_TEST_LIB_TARGET} "ws2_32.lib") endif (MSVC) @@ -68,7 +68,7 @@ if (BUILD_SHARED_LIBS) INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) - TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} " " " ") + TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} " " " ") target_link_libraries (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS ( ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} @@ -99,7 +99,7 @@ if (BUILD_SHARED_LIBS) INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) - TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} " " " ") + TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} " " " ") target_link_libraries (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS ( ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} @@ -154,14 +154,14 @@ set (testhdf5_SRCS #-- Adding test for testhdf5 add_executable (testhdf5 ${testhdf5_SRCS}) TARGET_NAMING (testhdf5 ${LIB_TYPE}) -TARGET_C_PROPERTIES (testhdf5 " " " ") +TARGET_C_PROPERTIES (testhdf5 ${LIB_TYPE} " " " ") target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (testhdf5 PROPERTIES FOLDER test) MACRO (ADD_H5_EXE file) add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} ${LIB_TYPE}) - TARGET_C_PROPERTIES (${file} " " " ") + TARGET_C_PROPERTIES (${file} ${LIB_TYPE} " " " ") target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (${file} PROPERTIES FOLDER test) ENDMACRO (ADD_H5_EXE file) @@ -237,21 +237,21 @@ endforeach (test ${H5_TESTS}) #-- Adding test for cache add_executable (cache ${HDF5_TEST_SOURCE_DIR}/cache.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache ${LIB_TYPE}) -TARGET_C_PROPERTIES (cache " " " ") +TARGET_C_PROPERTIES (cache ${LIB_TYPE} " " " ") target_link_libraries (cache ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (cache PROPERTIES FOLDER test) #-- Adding test for cache_api add_executable (cache_api ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache_api ${LIB_TYPE}) -TARGET_C_PROPERTIES (cache_api " " " ") +TARGET_C_PROPERTIES (cache_api ${LIB_TYPE} " " " ") target_link_libraries (cache_api ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (cache_api PROPERTIES FOLDER test) #-- Adding test for cache_tagging add_executable (cache_tagging ${HDF5_TEST_SOURCE_DIR}/cache_tagging.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache_tagging ${LIB_TYPE}) -TARGET_C_PROPERTIES (cache_tagging " " " ") +TARGET_C_PROPERTIES (cache_tagging ${LIB_TYPE} " " " ") target_link_libraries (cache_tagging ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (cache_tagging PROPERTIES FOLDER test) @@ -264,7 +264,7 @@ add_executable (ttsafe ${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c ) TARGET_NAMING (ttsafe ${LIB_TYPE}) -TARGET_C_PROPERTIES (ttsafe " " " ") +TARGET_C_PROPERTIES (ttsafe ${LIB_TYPE} " " " ") target_link_libraries (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (ttsafe PROPERTIES FOLDER test) @@ -272,7 +272,7 @@ set_target_properties (ttsafe PROPERTIES FOLDER test) if (HDF5_ENABLE_DEPRECATED_SYMBOLS) add_executable (err_compat ${HDF5_TEST_SOURCE_DIR}/err_compat.c) TARGET_NAMING (err_compat ${LIB_TYPE}) - TARGET_C_PROPERTIES (err_compat " " " ") + TARGET_C_PROPERTIES (err_compat ${LIB_TYPE} " " " ") target_link_libraries (err_compat ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (err_compat PROPERTIES FOLDER test) endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) @@ -280,14 +280,14 @@ endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) #-- Adding test for error_test add_executable (error_test ${HDF5_TEST_SOURCE_DIR}/error_test.c) TARGET_NAMING (error_test ${LIB_TYPE}) -TARGET_C_PROPERTIES (error_test " " " ") +TARGET_C_PROPERTIES (error_test ${LIB_TYPE} " " " ") target_link_libraries (error_test ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (error_test PROPERTIES FOLDER test) #-- Adding test for links_env add_executable (links_env ${HDF5_TEST_SOURCE_DIR}/links_env.c) TARGET_NAMING (links_env ${LIB_TYPE}) -TARGET_C_PROPERTIES (links_env " " " ") +TARGET_C_PROPERTIES (links_env ${LIB_TYPE} " " " ") target_link_libraries (links_env ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (links_env PROPERTIES FOLDER test) @@ -308,8 +308,8 @@ endif (\${TEST_RESULT} STREQUAL \"0\") ############################################################################## if (BUILD_SHARED_LIBS) add_executable (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c) - TARGET_NAMING (plugin ${LIB_TYPE}) - TARGET_C_PROPERTIES (plugin " " " ") + TARGET_NAMING (plugin SHARED) + TARGET_C_PROPERTIES (plugin SHARED " " " ") target_link_libraries (plugin ${HDF5_TEST_PLUGIN_LIB_TARGET}) set_target_properties (plugin PROPERTIES FOLDER test) endif (BUILD_SHARED_LIBS) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index f609b7a..92e4574 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -727,8 +727,8 @@ endif (HDF5_TEST_VFD) if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) MACRO (ADD_H5_GENERATOR genfile) add_executable (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c) - TARGET_NAMING (${genfile} ${LIB_TYPE}) - TARGET_C_PROPERTIES (${genfile} " " " ") + TARGET_NAMING (${genfile} STATIC) + TARGET_C_PROPERTIES (${genfile} STATIC " " " ") target_link_libraries (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (${genfile} PROPERTIES FOLDER generator/test) ENDMACRO (ADD_H5_GENERATOR genfile) diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index a782fb0..d81b7fc 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -1301,17 +1301,17 @@ compare_data(void *src_data, void *dst_data, hbool_t src_subset) printf(" src={a=%d, b=%d, c=[%d,%d,%d,%d,%d,%d,%d,%d], d=%d, e=%d, f=%f, g=%f, h=[%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f], i=%f, j=%f, k=%f, l=%f, m=%f, n=%f}\n", s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], s_ptr->c[3], s_ptr->c[4], s_ptr->c[5], s_ptr->c[6], s_ptr->c[7], - s_ptr->d, s_ptr->e, s_ptr->f, s_ptr->g,s_ptr->h[0],s_ptr->h[1],s_ptr->h[2], - s_ptr->h[3],s_ptr->h[4],s_ptr->h[5],s_ptr->h[6],s_ptr->h[7],s_ptr->h[8], - s_ptr->h[9],s_ptr->h[10],s_ptr->h[11],s_ptr->h[12],s_ptr->h[13],s_ptr->h[14], - s_ptr->h[15], s_ptr->i,s_ptr->j,s_ptr->k,s_ptr->l,s_ptr->m,s_ptr->n); + s_ptr->d, s_ptr->e, (double)s_ptr->f, (double)s_ptr->g,(double)s_ptr->h[0],(double)s_ptr->h[1],(double)s_ptr->h[2], + (double)s_ptr->h[3],(double)s_ptr->h[4],(double)s_ptr->h[5],(double)s_ptr->h[6],(double)s_ptr->h[7],(double)s_ptr->h[8], + (double)s_ptr->h[9],(double)s_ptr->h[10],(double)s_ptr->h[11],(double)s_ptr->h[12],(double)s_ptr->h[13],(double)s_ptr->h[14], + (double)s_ptr->h[15], (double)s_ptr->i,(double)s_ptr->j,s_ptr->k,s_ptr->l,s_ptr->m,s_ptr->n); printf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d,%d,%d,%d,%d], d=%d, e=%d, f=%f, g=%f, h=[%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f], i=%f, j=%f, k=%f, l=%f, m=%f, n=%f}\n", d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], d_ptr->c[3], d_ptr->c[4], d_ptr->c[5], d_ptr->c[6], d_ptr->c[7], - d_ptr->d, d_ptr->e, d_ptr->f, d_ptr->g,d_ptr->h[0],d_ptr->h[1],d_ptr->h[2], - d_ptr->h[3],d_ptr->h[4],d_ptr->h[5],d_ptr->h[6],d_ptr->h[7],d_ptr->h[8], - d_ptr->h[9],d_ptr->h[10],d_ptr->h[11],d_ptr->h[12],d_ptr->h[13], - d_ptr->h[14], d_ptr->h[15], d_ptr->i,d_ptr->j,d_ptr->k,d_ptr->l, + d_ptr->d, d_ptr->e, (double)d_ptr->f, (double)d_ptr->g,(double)d_ptr->h[0],(double)d_ptr->h[1],(double)d_ptr->h[2], + (double)d_ptr->h[3],(double)d_ptr->h[4],(double)d_ptr->h[5],(double)d_ptr->h[6],(double)d_ptr->h[7],(double)d_ptr->h[8], + (double)d_ptr->h[9],(double)d_ptr->h[10],(double)d_ptr->h[11],(double)d_ptr->h[12],(double)d_ptr->h[13], + (double)d_ptr->h[14],(double)d_ptr->h[15],(double)d_ptr->i,(double)d_ptr->j,d_ptr->k,d_ptr->l, d_ptr->m,d_ptr->n); goto error; } diff --git a/test/dsets.c b/test/dsets.c index 3244bd6..e9dd2ce 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -23,19 +23,19 @@ #include <stdlib.h> #include <time.h> +/* + * This file needs to access private information from the H5Z package. + */ +#define H5Z_PACKAGE + + #include "h5test.h" #include "H5srcdir.h" +#include "H5Zpkg.h" #ifdef H5_HAVE_SZLIB_H # include "szlib.h" #endif -/* - * This file needs to access private datatypes from the H5Z package. - */ -#define H5Z_PACKAGE -#include "H5Zpkg.h" - - const char *FILENAME[] = { "dataset", "compact_dataset", diff --git a/test/dt_arith.c b/test/dt_arith.c index 5848864..c5b72d4 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -538,7 +538,7 @@ some_dummy_func(float x) { char s[128]; - HDsnprintf(s, sizeof(s), "%g", x); + HDsnprintf(s, sizeof(s), "%g", (double)x); } @@ -832,7 +832,7 @@ static int test_particular_fp_integer(void) printf(" %02x", saved_buf2[ENDIAN(src_size2, j, endian)]); HDmemcpy(&x, saved_buf2, src_size2); - printf(" %29.20e\n", x); + printf(" %29.20e\n", (double)x); printf(" dst = "); for (j=0; j<dst_size2; j++) @@ -2720,7 +2720,7 @@ my_isnan(dtype_t type, void *val) float x; HDmemcpy(&x, val, sizeof(float)); - HDsnprintf(s, sizeof(s), "%g", x); + HDsnprintf(s, sizeof(s), "%g", (double)x); } else if (FLT_DOUBLE==type) { double x; @@ -3334,7 +3334,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) if (FLT_FLOAT==src_type) { float x; HDmemcpy(&x, &saved[j*src_size], sizeof(float)); - printf(" %29.20e\n", x); + printf(" %29.20e\n", (double)x); } else if (FLT_DOUBLE==src_type) { double x; HDmemcpy(&x, &saved[j*src_size], sizeof(double)); @@ -3354,7 +3354,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) if (FLT_FLOAT==dst_type) { float x; HDmemcpy(&x, &buf[j*dst_size], sizeof(float)); - printf(" %29.20e\n", x); + printf(" %29.20e\n", (double)x); } else if (FLT_DOUBLE==dst_type) { double x; HDmemcpy(&x, &buf[j*dst_size], sizeof(double)); @@ -3372,7 +3372,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) printf(" %02x", hw[ENDIAN(dst_size,k,dendian)]); printf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), ""); if (FLT_FLOAT==dst_type) - printf(" %29.20e\n", hw_f); + printf(" %29.20e\n", (double)hw_f); else if (FLT_DOUBLE==dst_type) printf(" %29.20e\n", hw_d); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE @@ -4450,7 +4450,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) break; case FLT_FLOAT: HDmemcpy(aligned, saved+j*sizeof(float), sizeof(float)); - printf(" %29f\n", *((float*)aligned)); + printf(" %29f\n", (double)*((float*)aligned)); break; case FLT_DOUBLE: HDmemcpy(aligned, saved+j*sizeof(double), sizeof(double)); @@ -4515,7 +4515,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) break; case FLT_FLOAT: HDmemcpy(aligned, buf+j*sizeof(float), sizeof(float)); - printf(" %29f\n", *((float*)aligned)); + printf(" %29f\n", (double)*((float*)aligned)); break; case FLT_DOUBLE: HDmemcpy(aligned, buf+j*sizeof(double), sizeof(double)); @@ -4569,7 +4569,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) printf(" %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long long*)hw)); break; case FLT_FLOAT: - printf(" %29f\n", *((float*)hw)); + printf(" %29f\n", (double)*((float*)hw)); break; case FLT_DOUBLE: printf(" %29f\n", *((double*)hw)); diff --git a/test/fillval.c b/test/fillval.c index e6e8f8e..e7ad521 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -627,7 +627,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) H5_FAILED(); puts(" Got wrong fill value"); printf(" Got rd_c.a=%f, rd_c.y=%f and rd_c.x=%d, rd_c.z=%c\n", - rd_c.a, rd_c.y, rd_c.x, rd_c.z); + (double)rd_c.a, rd_c.y, rd_c.x, rd_c.z); } if(H5Dclose(dset9) < 0) goto error; if(H5Pclose(dcpl) < 0) goto error; @@ -700,7 +700,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) H5_FAILED(); puts(" Got wrong fill value"); printf(" Got rd_c.a=%f, rd_c.y=%f and rd_c.x=%d, rd_c.z=%c\n", - rd_c.a, rd_c.y, rd_c.x, rd_c.z); + (double)rd_c.a, rd_c.y, rd_c.x, rd_c.z); } if(H5Dclose(dset8) < 0) goto error; if(H5Pclose(dcpl) < 0) goto error; @@ -820,8 +820,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, "Fill value: %f, %d, %f, %c\n", hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], - hs_offset[4], rd_c.a, rd_c.x, rd_c.y, rd_c.z, - fill_c.a, fill_c.x, fill_c.y, fill_c.z); + hs_offset[4], (double)rd_c.a, rd_c.x, rd_c.y, rd_c.z, + (double)fill_c.a, fill_c.x, fill_c.y, fill_c.z); goto error; } } @@ -888,8 +888,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], hs_offset[4], - buf_c[u].a, buf_c[u].x, buf_c[u].y, buf_c[u].z, - fill_c.a, fill_c.x, fill_c.y, fill_c.z); + (double)buf_c[u].a, buf_c[u].x, buf_c[u].y, buf_c[u].z, + (double)fill_c.a, fill_c.x, fill_c.y, fill_c.z); goto error; } /* end if */ } /* end for */ @@ -1002,7 +1002,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, (long)hs_offset[0], (long)hs_offset[1], (long)hs_offset[2], (long)hs_offset[3], (long)hs_offset[4], - rd_c.a, rd_c.x, rd_c.y, rd_c.z, should_be_c.a, + (double)rd_c.a, rd_c.x, rd_c.y, rd_c.z, (double)should_be_c.a, should_be_c.x,should_be_c.y,should_be_c.z); goto error; } @@ -1021,7 +1021,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, (long)hs_offset[0], (long)hs_offset[1], (long)hs_offset[2], (long)hs_offset[3], (long)hs_offset[4], - rd_c.a, rd_c.x, rd_c.y, rd_c.z, should_be_c.a, + (double)rd_c.a, rd_c.x, rd_c.y, rd_c.z, (double)should_be_c.a, should_be_c.x,should_be_c.y,should_be_c.z); goto error; } diff --git a/test/flush2.c b/test/flush2.c index 8108bba..28ce41e 100644 --- a/test/flush2.c +++ b/test/flush2.c @@ -186,7 +186,7 @@ main(void) PASSED() else { -#if defined H5_HAVE_WIN32_API && defined _HDF5USEDLL_ +#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 @@ -209,7 +209,7 @@ main(void) PASSED() else { -#if defined H5_HAVE_WIN32_API && defined _HDF5USEDLL_ +#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 diff --git a/test/gen_filespace.c b/test/gen_filespace.c index 7ee2a7a..e0c42e8 100644 --- a/test/gen_filespace.c +++ b/test/gen_filespace.c @@ -42,7 +42,8 @@ static void gen_file(void) hid_t dataset, space; hsize_t dim[1]; int data[NUM_ELMTS]; - unsigned i, j; /* Local index variable */ + size_t j; /* Local index variable */ + int i; /* Local index variable */ H5F_file_space_type_t fs_type; /* File space handling strategy */ for(j = 0, fs_type = H5F_FILE_SPACE_ALL_PERSIST; j < NELMTS(FILENAMES); j++, fs_type = (H5F_file_space_type_t)(fs_type + 1)) { diff --git a/test/gen_plist.c b/test/gen_plist.c index acc5f3e..e77af73 100644 --- a/test/gen_plist.c +++ b/test/gen_plist.c @@ -280,8 +280,8 @@ main(void) assert(ret > 0); /* Create FAPL for the elink FAPL */ - if((fapl1 = ret = H5Pcreate(ret = H5P_FILE_ACCESS)) < 0) - assert(ret > 0); + if((fapl1 = H5Pcreate(H5P_FILE_ACCESS)) < 0) + assert(fapl1 > 0); if((ret = H5Pset_alignment(fapl1, 2, 1024)) < 0) assert(ret > 0); diff --git a/test/getname.c b/test/getname.c index 2d999b9..dc1ddbe 100644 --- a/test/getname.c +++ b/test/getname.c @@ -103,7 +103,11 @@ test_main(hid_t file_id, hid_t fapl) hid_t space_id; hid_t type_id, type2_id; hsize_t dims[1] = { 5 }; - size_t name_len; /* Name length */ + size_t name_len; /* Name length */ + H5O_info_t oinfo; /* Object info structs */ + hid_t dtype; /* Object identifier for testing */ + hid_t dtype_anon; /* Object identifier for testing anonymous */ + ssize_t size; /* Size returned by H5Iget_name */ /* Initialize the file names */ h5_fixname(FILENAME[1], fapl, filename1, sizeof filename1); @@ -2355,7 +2359,58 @@ test_main(hid_t file_id, hid_t fapl) H5Gclose(group_id); H5Gclose(group2_id); H5Fclose(file1_id); - H5Fclose(file2_id); + + PASSED(); + + /*------------------------------------------------------------------------- + * Test H5Iget_name with anonymous datatypes + *------------------------------------------------------------------------- + */ + + TESTING("H5Iget_name with anonymous datatypes"); + + /* Commit the type anonymously and link it in */ + if((dtype = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR + /* Test H5Iget_name with created datatype, should fail because not committed */ + H5E_BEGIN_TRY { + if((size = H5Iget_name(dtype, NULL, 0)) >= 0) TEST_ERROR + } H5E_END_TRY; + + if(H5Tcommit_anon(file2_id, dtype, H5P_DEFAULT, H5P_DEFAULT)) TEST_ERROR + + /* Test H5Iget_name with anonymously created datatype, should pass because committed */ + if((size = H5Iget_name(dtype, NULL, 0)) != 0) TEST_ERROR + + /* Create a link to the object */ + if( H5Olink(dtype, file2_id, "datatype", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + + /* Commit a second datatype with no links to it and commit it */ + if((dtype_anon = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR + if(H5Tcommit_anon(file2_id, dtype_anon, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + + /* Test H5Iget_name with anonymously created datatype, should pass because committed */ + if((size = H5Iget_name(dtype_anon, NULL,0)) != 0) TEST_ERROR + + /* Store the address of the datatype for later use */ + if(H5Oget_info(dtype_anon, &oinfo) < 0) TEST_ERROR + + /* Update the reference count to dtype_anon to preserve the datatype */ + if(H5Oincr_refcount(dtype_anon) < 0) TEST_ERROR + + if(H5Tclose(dtype) < 0) TEST_ERROR + if(H5Tclose(dtype_anon) < 0) TEST_ERROR + if(H5Fclose(file2_id) < 0) TEST_ERROR + + /* Re-open the file and check that the anonymous datatypes persist */ + if( (file2_id = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + + /* Check the H5Iget_name does not return an error for anon committed datatypes */ + if((dtype_anon = H5Oopen_by_addr(file2_id, oinfo.addr)) < 0) TEST_ERROR + + if((size = H5Iget_name(dtype_anon,NULL,0)) != 0) TEST_ERROR + + if(H5Tclose(dtype_anon) < 0) TEST_ERROR + if(H5Fclose(file2_id) < 0) TEST_ERROR PASSED(); diff --git a/test/links.c b/test/links.c index 891b5e4..0846c49 100644 --- a/test/links.c +++ b/test/links.c @@ -4023,10 +4023,6 @@ external_set_elink_acc_flags(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if(ret != FAIL) TEST_ERROR H5E_BEGIN_TRY { - ret = H5Pset_elink_acc_flags(gapl, H5F_ACC_DEBUG); - } H5E_END_TRY; - if(ret != FAIL) TEST_ERROR - H5E_BEGIN_TRY { ret = H5Pset_elink_acc_flags(gapl, H5F_ACC_CREAT); } H5E_END_TRY; if(ret != FAIL) TEST_ERROR diff --git a/test/plugin.c b/test/plugin.c index 02007d5..74a8f4b 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -536,16 +536,17 @@ error: *------------------------------------------------------------------------- */ static herr_t -test_noread_data(hid_t dataset, int *origin_data) +test_noread_data(hid_t dataset) { - int check[DSET_DIM1][DSET_DIM2]; - const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */ - int *data_p = origin_data; - size_t i, j; /* Local index variables */ + int check[DSET_DIM1][DSET_DIM2]; + herr_t ret; /* Read the dataset back */ - if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) >= 0) - TEST_ERROR; + H5E_BEGIN_TRY { + ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check); + } H5E_END_TRY + if(ret >= 0) + TEST_ERROR PASSED(); return 0; @@ -578,7 +579,7 @@ test_noread_with_filters(hid_t file) if((dset = H5Dopen2(file,DSET_DYNLIB1_NAME,H5P_DEFAULT)) < 0) TEST_ERROR - if(test_noread_data(dset, (int *)points_dynlib1) < 0) TEST_ERROR + if(test_noread_data(dset) < 0) TEST_ERROR if(H5Dclose(dset) < 0) TEST_ERROR diff --git a/test/tarray.c b/test/tarray.c index e3d7c37..0923625 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -686,7 +686,7 @@ test_array_compound_atomic(void) continue; } /* end if */ if(!FLT_ABS_EQUAL(wdata[i][j].f, rdata[i][j].f)) { - TestErrPrintf("Array data information doesn't match!, wdata[%d][%d].f=%f, rdata[%d][%d].f=%f\n", (int)i, (int)j, wdata[i][j].f, (int)i, (int)j, rdata[i][j].f); + TestErrPrintf("Array data information doesn't match!, wdata[%d][%d].f=%f, rdata[%d][%d].f=%f\n", (int)i, (int)j, (double)wdata[i][j].f, (int)i, (int)j, (double)rdata[i][j].f); continue; } /* end if */ } /* end for */ @@ -929,7 +929,7 @@ test_array_compound_array(void) } /* end if */ for(k=0; k<ARRAY1_DIM1; k++) if(!FLT_ABS_EQUAL(wdata[i][j].f[k],rdata[i][j].f[k])) { - TestErrPrintf("Array data information doesn't match!, wdata[%d][%d].f[%d]=%f, rdata[%d][%d].f[%d]=%f\n",(int)i,(int)j,(int)k,wdata[i][j].f[k],(int)i,(int)j,(int)k,rdata[i][j].f[k]); + TestErrPrintf("Array data information doesn't match!, wdata[%d][%d].f[%d]=%f, rdata[%d][%d].f[%d]=%f\n",(int)i,(int)j,(int)k,(double)wdata[i][j].f[k],(int)i,(int)j,(int)k,(double)rdata[i][j].f[k]); continue; } /* end if */ } /* end for */ @@ -1619,11 +1619,11 @@ test_array_bkg(void) continue; } if(!FLT_ABS_EQUAL(cf[i].b[j],cfr[i].b[j])) { - TestErrPrintf("Field b data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(float)cf[i].b[j],(int)i,(int)j,(float)cfr[i].b[j]); + TestErrPrintf("Field b data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(double)cf[i].b[j],(int)i,(int)j,(double)cfr[i].b[j]); continue; } if(!DBL_ABS_EQUAL(cf[i].c[j],cfr[i].c[j])) { - TestErrPrintf("Field c data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(float)cf[i].c[j],(int)i,(int)j,(float)cfr[i].c[j]); + TestErrPrintf("Field c data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(double)cf[i].c[j],(int)i,(int)j,(double)cfr[i].c[j]); continue; } } @@ -1686,7 +1686,7 @@ test_array_bkg(void) for (i=0; i< LENGTH; i++) for (j = 0; j < ALEN; j++) if(!FLT_ABS_EQUAL(fld[i].b[j],fldr[i].b[j])) { - TestErrPrintf("Field data doesn't match, fld[%d].b[%d]=%f, fldr[%d].b[%d]=%f\n",(int)i,(int)j,(float)fld[i].b[j],(int)i,(int)j,(float)fldr[i].b[j]); + TestErrPrintf("Field data doesn't match, fld[%d].b[%d]=%f, fldr[%d].b[%d]=%f\n",(int)i,(int)j,(double)fld[i].b[j],(int)i,(int)j,(double)fldr[i].b[j]); continue; } @@ -1712,11 +1712,11 @@ test_array_bkg(void) continue; } if(!FLT_ABS_EQUAL(cf[i].b[j],cfr[i].b[j])) { - TestErrPrintf("Field b data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(float)cf[i].b[j],(int)i,(int)j,(float)cfr[i].b[j]); + TestErrPrintf("Field b data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(double)cf[i].b[j],(int)i,(int)j,(double)cfr[i].b[j]); continue; } if(!DBL_ABS_EQUAL(cf[i].c[j],cfr[i].c[j])) { - TestErrPrintf("Field c data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(float)cf[i].c[j],(int)i,(int)j,(float)cfr[i].c[j]); + TestErrPrintf("Field c data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(double)cf[i].c[j],(int)i,(int)j,(double)cfr[i].c[j]); continue; } } @@ -1761,11 +1761,11 @@ test_array_bkg(void) continue; } if(!FLT_ABS_EQUAL(cf[i].b[j],cfr[i].b[j])) { - TestErrPrintf("Field b data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(float)cf[i].b[j],(int)i,(int)j,(float)cfr[i].b[j]); + TestErrPrintf("Field b data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(double)cf[i].b[j],(int)i,(int)j,(double)cfr[i].b[j]); continue; } if(!DBL_ABS_EQUAL(cf[i].c[j],cfr[i].c[j])) { - TestErrPrintf("Field c data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(float)cf[i].c[j],(int)i,(int)j,(float)cfr[i].c[j]); + TestErrPrintf("Field c data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(double)cf[i].c[j],(int)i,(int)j,(double)cfr[i].c[j]); continue; } } diff --git a/test/tattr.c b/test/tattr.c index 57d19ff..31a3844 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -523,7 +523,7 @@ test_attr_flush(hid_t fapl) CHECK(ret, FAIL, "H5Awrite"); if(!DBL_ABS_EQUAL(rdata,0.0F)) - TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,0.0F); + TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,(double)0.0F); ret=H5Fflush(fil, H5F_SCOPE_GLOBAL); CHECK(ret, FAIL, "H5Fflush"); @@ -532,7 +532,7 @@ test_attr_flush(hid_t fapl) CHECK(ret, FAIL, "H5Awrite"); if(!DBL_ABS_EQUAL(rdata,0.0F)) - TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,0.0F); + TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,(double)0.0F); ret=H5Awrite(att, H5T_NATIVE_DOUBLE, &wdata); CHECK(ret, FAIL, "H5Awrite"); @@ -1016,7 +1016,7 @@ test_attr_scalar_read(hid_t fapl) /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!FLT_ABS_EQUAL(rdata, attr_data5)) printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Aread", attr_data5, rdata, (int)__LINE__, __FILE__); + "H5Aread", (double)attr_data5, (double)rdata, (int)__LINE__, __FILE__); /* Get the attribute's dataspace */ sid = H5Aget_space(attr); diff --git a/test/tgenprop.c b/test/tgenprop.c index d147099..a3f1752 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -683,7 +683,7 @@ test_genprop_basic_list(void) /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", *PROP2_DEF_VALUE, prop2_value, (int)__LINE__, __FILE__); + "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); /* Close list */ @@ -775,7 +775,7 @@ test_genprop_basic_list_prop(void) /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", *PROP2_DEF_VALUE, prop2_value, (int)__LINE__, __FILE__); + "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); /* Check values of temporary properties (set with regular values) */ @@ -1239,7 +1239,7 @@ test_genprop_list_callback(void) /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", *PROP2_DEF_VALUE, prop2_value, (int)__LINE__, __FILE__); + "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); /* Check values of temporary properties (set with regular values) */ ret = H5Pget(lid1, PROP3_NAME,&prop3_value); diff --git a/test/th5s.c b/test/th5s.c index 94268a7..7c1c46e 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -1581,7 +1581,7 @@ test_h5s_compound_scalar_read(void) if(HDmemcmp(&space4_data,&rdata,sizeof(struct space4_struct))) { printf("scalar data different: space4_data.c1=%c, read_data4.c1=%c\n",space4_data.c1,rdata.c1); printf("scalar data different: space4_data.u=%u, read_data4.u=%u\n",space4_data.u,rdata.u); - printf("scalar data different: space4_data.f=%f, read_data4.f=%f\n",space4_data.f,rdata.f); + printf("scalar data different: space4_data.f=%f, read_data4.f=%f\n",(double)space4_data.f,(double)rdata.f); TestErrPrintf("scalar data different: space4_data.c1=%c, read_data4.c1=%c\n",space4_data.c1,rdata.c2); } /* end if */ @@ -1684,7 +1684,7 @@ test_h5s_chunk(void) for(j=0; j<3; j++) { /* Check if the two values are within 0.001% range. */ if(!DBL_REL_EQUAL(chunk_data_dbl[i][j], chunk_data_flt[i][j], 0.00001F)) - TestErrPrintf("%u: chunk_data_dbl[%d][%d]=%e, chunk_data_flt[%d][%d]=%e\n", (unsigned)__LINE__, i, j, chunk_data_dbl[i][j], i, j, chunk_data_flt[i][j]); + TestErrPrintf("%u: chunk_data_dbl[%d][%d]=%e, chunk_data_flt[%d][%d]=%e\n", (unsigned)__LINE__, i, j, chunk_data_dbl[i][j], i, j, (double)chunk_data_flt[i][j]); } /* end for */ } /* end for */ } /* test_h5s_chunk() */ @@ -2224,6 +2224,8 @@ test_h5s_extent_copy(void) hsize_t d3_dims1[3] = {10, 10, 10}, /* 3-D dimensions */ d3_dims2[3] = {20, 20, 20}, d3_dims3[3] = {H5S_UNLIMITED, H5S_UNLIMITED, H5S_UNLIMITED}; + hsize_t npoints[14]; /* Expected number of points in selection for each element in spaces */ + hssize_t npoints_ret; /* Number of points returned by H5Sget_select_npoints() */ htri_t ext_equal; /* Whether two dataspace extents are equal */ const unsigned num_spaces = sizeof(spaces) / sizeof(spaces[0]); unsigned i, j; @@ -2232,36 +2234,50 @@ test_h5s_extent_copy(void) /* Create dataspaces */ spaces[0] = H5Screate(H5S_NULL); CHECK(spaces[0], FAIL, "H5Screate"); + npoints[0] = (hsize_t)0; spaces[1] = H5Screate(H5S_SCALAR); CHECK(spaces[1], FAIL, "H5Screate"); + npoints[1] = (hsize_t)1; spaces[2] = H5Screate_simple(1, d1_dims1, NULL); CHECK(spaces[2], FAIL, "H5Screate"); + npoints[2] = d1_dims1[0]; spaces[3] = H5Screate_simple(1, d1_dims2, NULL); CHECK(spaces[3], FAIL, "H5Screate"); + npoints[3] = d1_dims2[0]; spaces[4] = H5Screate_simple(1, d1_dims1, d1_dims2); CHECK(spaces[4], FAIL, "H5Screate"); + npoints[4] = d1_dims1[0]; spaces[5] = H5Screate_simple(1, d1_dims1, d1_dims3); CHECK(spaces[5], FAIL, "H5Screate"); + npoints[5] = d1_dims1[0]; spaces[6] = H5Screate_simple(2, d2_dims1, NULL); CHECK(spaces[6], FAIL, "H5Screate"); + npoints[6] = d2_dims1[0] * d2_dims1[1]; spaces[7] = H5Screate_simple(2, d2_dims2, NULL); CHECK(spaces[7], FAIL, "H5Screate"); + npoints[7] = d2_dims2[0] * d2_dims2[1]; spaces[8] = H5Screate_simple(2, d2_dims1, d2_dims2); CHECK(spaces[8], FAIL, "H5Screate"); + npoints[8] = d2_dims1[0] * d2_dims1[1]; spaces[9] = H5Screate_simple(2, d2_dims1, d2_dims3); CHECK(spaces[9], FAIL, "H5Screate"); + npoints[9] = d2_dims1[0] * d2_dims1[1]; spaces[10] = H5Screate_simple(3, d3_dims1, NULL); CHECK(spaces[10], FAIL, "H5Screate"); + npoints[10] = d3_dims1[0] * d3_dims1[1] * d3_dims1[2]; spaces[11] = H5Screate_simple(3, d3_dims2, NULL); CHECK(spaces[11], FAIL, "H5Screate"); + npoints[11] = d3_dims2[0] * d3_dims2[1] * d3_dims2[2]; spaces[12] = H5Screate_simple(3, d3_dims1, d3_dims2); CHECK(spaces[12], FAIL, "H5Screate"); + npoints[12] = d3_dims1[0] * d3_dims1[1] * d3_dims1[2]; spaces[13] = H5Screate_simple(3, d3_dims1, d3_dims3); CHECK(spaces[13], FAIL, "H5Screate"); + npoints[13] = d3_dims1[0] * d3_dims1[1] * d3_dims1[2]; tmp_space = H5Screate(H5S_NULL); CHECK(tmp_space, FAIL, "H5Screate"); @@ -2275,14 +2291,26 @@ test_h5s_extent_copy(void) * will test copying from i/j to i/j */ ret = H5Sextent_copy(tmp_space, spaces[j]); CHECK(ret, FAIL, "H5Sextent_copy"); + + /* Verify that the extents are equal */ ext_equal = H5Sextent_equal(tmp_space, spaces[j]); VERIFY(ext_equal, TRUE, "H5Sextent_equal"); + /* Verify that the correct number of elements is selected */ + npoints_ret = H5Sget_select_npoints(tmp_space); + VERIFY((hsize_t)npoints_ret, npoints[j], "H5Sget_select_npoints"); + /* Copy from j to i */ ret = H5Sextent_copy(tmp_space, spaces[i]); CHECK(ret, FAIL, "H5Sextent_copy"); + + /* Verify that the extents are equal */ ext_equal = H5Sextent_equal(tmp_space, spaces[i]); VERIFY(ext_equal, TRUE, "H5Sextent_equal"); + + /* Verify that the correct number of elements is selected */ + npoints_ret = H5Sget_select_npoints(tmp_space); + VERIFY((hsize_t)npoints_ret, npoints[i], "H5Sget_select_npoints"); } /* end for */ /* Close dataspaces */ diff --git a/test/tmisc.c b/test/tmisc.c index 68a30eb..869557c 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -1847,9 +1847,21 @@ test_misc11(void) ret = H5Pset_sizes(fcpl, (size_t)MISC11_SIZEOF_OFF, (size_t)MISC11_SIZEOF_LEN); CHECK(ret, FAIL, "H5Pset_sizes"); + /* This should fail as (32770*2) will exceed ^16 - 2 bytes for storing btree entries */ + H5E_BEGIN_TRY { + ret=H5Pset_sym_k(fcpl, 32770, 0); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Pset_sym_k"); + ret=H5Pset_sym_k(fcpl,MISC11_SYM_IK,MISC11_SYM_LK); CHECK(ret, FAIL, "H5Pset_sym_k"); + /* This should fail as (32770*2) will exceed ^16 - 2 bytes for storing btree entries */ + H5E_BEGIN_TRY { + ret=H5Pset_istore_k(fcpl, 32770); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Pset_istore_k"); + ret=H5Pset_istore_k(fcpl,MISC11_ISTORE_IK); CHECK(ret, FAIL, "H5Pset_istore_k"); diff --git a/test/ttsafe_cancel.c b/test/ttsafe_cancel.c index 56f431e..d8ed462 100644 --- a/test/ttsafe_cancel.c +++ b/test/ttsafe_cancel.c @@ -123,7 +123,7 @@ void tts_cancel(void) void *tts_cancel_thread(void UNUSED *arg) { int datavalue; - int *buffer; + int buffer; hid_t dataspace, datatype, dataset; hsize_t dimsf[1]; /* dataset dimensions */ cancel_cleanup_t *cleanup_structure; @@ -156,10 +156,9 @@ void *tts_cancel_thread(void UNUSED *arg) ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &datavalue); assert(ret>=0); - buffer = HDmalloc(sizeof(int)); - ret=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer); + ret=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buffer); assert(ret>=0); - ret=H5Diterate(buffer, H5T_NATIVE_INT, dataspace, tts_cancel_callback, &dataset); + ret=H5Diterate(&buffer, H5T_NATIVE_INT, dataspace, tts_cancel_callback, &dataset); assert(ret>=0); sleep(3); diff --git a/test/tvltypes.c b/test/tvltypes.c index 2928e57..19e8252 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -1596,7 +1596,7 @@ test_vltypes_compound_vlen_atomic(void) /* Check data read in */ for(i = 0; i < SPACE1_DIM1; i++) if(rdata[i].i != 0 || !FLT_ABS_EQUAL(rdata[i].f, 0.0F) || rdata[i].v.len != 0 || rdata[i].v.p != NULL) - TestErrPrintf("VL doesn't match!, rdata[%d].i=%d, rdata[%d].f=%f, rdata[%d].v.len=%u, rdata[%d].v.p=%p\n",(int)i,rdata[i].i,(int)i,rdata[i].f,(int)i,(unsigned)rdata[i].v.len,(int)i,rdata[i].v.p); + TestErrPrintf("VL doesn't match!, rdata[%d].i=%d, rdata[%d].f=%f, rdata[%d].v.len=%u, rdata[%d].v.p=%p\n",(int)i,rdata[i].i,(int)i,(double)rdata[i].f,(int)i,(unsigned)rdata[i].v.len,(int)i,rdata[i].v.p); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); |