diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2017-07-27 20:27:41 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2017-07-27 20:27:41 (GMT) |
commit | 2dd0c39c96586993403421d59264c38ba6a1d4d7 (patch) | |
tree | 5b2daf5d17f857cb8f7b06de95815cbda2085acc | |
parent | 749d0d83415ace804dc686157c6e4242c716808d (diff) | |
parent | 61cbf3b334905c14c2031dac96a54587954142e1 (diff) | |
download | hdf5-2dd0c39c96586993403421d59264c38ba6a1d4d7.zip hdf5-2dd0c39c96586993403421d59264c38ba6a1d4d7.tar.gz hdf5-2dd0c39c96586993403421d59264c38ba6a1d4d7.tar.bz2 |
Merge pull request #615 in HDFFV/hdf5 from ~BYRN/hdf5_adb:hdf5_1_8 to hdf5_1_8
* commit '61cbf3b334905c14c2031dac96a54587954142e1':
Parallel needs copy of file in PAR folder
Add comparison file to list
Add comparison file to list
Insure program execution order
Add test for plugin initialize check
HDFFV-10246 Fix vl string compare
-rw-r--r-- | MANIFEST | 1 | ||||
-rw-r--r-- | release_docs/RELEASE.txt | 11 | ||||
-rw-r--r-- | test/plugin.c | 3 | ||||
-rw-r--r-- | tools/h5diff/CMakeTests.cmake | 11 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_vlstr.txt | 16 | ||||
-rw-r--r-- | tools/h5diff/testh5diff.sh.in | 5 | ||||
-rw-r--r-- | tools/lib/h5diff_array.c | 20 | ||||
-rw-r--r-- | tools/perform/CMakeTests.cmake | 1 |
8 files changed, 62 insertions, 6 deletions
@@ -2021,6 +2021,7 @@ ./tools/h5diff/testfiles/h5diff_udfail.txt ./tools/h5diff/testfiles/diff_strings1.h5 ./tools/h5diff/testfiles/diff_strings2.h5 +./tools/h5diff/testfiles/h5diff_vlstr.txt #test files for h5repack ./tools/h5repack/testfiles/README diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 792e5b2..cd9a1f5 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -92,7 +92,7 @@ New Features Support for New Platforms, Languages, and Compilers =================================================== - + Bug Fixes since HDF5-1.8.19 @@ -120,7 +120,14 @@ Bug Fixes since HDF5-1.8.19 Tools ----- - - None + - h5diff + + h5diff segfaulted on compare of a NULL variable length string. + + Improved h5diff compare of strings by adding a check for + NULL strings and setting the lengths to zero. + + (ADB - 2017/07/25, HDFFV-10246) Fortran API diff --git a/test/plugin.c b/test/plugin.c index b662476..0de8839 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -731,7 +731,10 @@ test_filter_path_apis(void) if(H5Zfilter_avail(H5Z_FILTER_DYNLIB1) != TRUE) TEST_ERROR + TESTING(" initialize"); H5PLsize(&ndx); + if(ndx!=2) TEST_ERROR + PASSED(); TESTING(" remove"); /* Remove all existing paths*/ diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index 7f6f8c3..aa620ef 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -66,6 +66,8 @@ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/tudfilter2.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/diff_strings1.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/diff_strings2.h5 + # tools/testfiles + ${HDF5_TOOLS_DIR}/testfiles/tvlstr.h5 ) set (LIST_OTHER_TEST_FILES @@ -251,6 +253,7 @@ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_90.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_ud.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_udfail.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_vlstr.txt ) set (LIST_WIN_TEST_FILES @@ -276,6 +279,11 @@ HDFTEST_COPY_FILE("${h5_tstfiles}" "${PROJECT_BINARY_DIR}/PAR/testfiles/${fname}" "h5diff_files") endif () endforeach () + # copy second version of tvlstr.h5 + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tvlstr.h5" "${PROJECT_BINARY_DIR}/testfiles/tvlstr2.h5" "h5diff_files") + if (H5_HAVE_PARALLEL) + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tvlstr.h5" "${PROJECT_BINARY_DIR}/PAR/testfiles/tvlstr2.h5" "h5diff_files") + endif () # @@ -839,6 +847,8 @@ h5diff_801.out.err h5diff_90.out h5diff_90.out.err + h5diff_vlstr.out + h5diff_vlstr.out.err ) set_tests_properties (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT "${last_test}" STREQUAL "") @@ -1403,6 +1413,7 @@ ADD_H5_TEST (h5diff_487 1 -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 # # diff various multiple vlen and fixed strings in a compound type dataset # ############################################################################## ADD_H5_TEST (h5diff_530 0 -v ${COMP_VL_STRS_FILE} ${COMP_VL_STRS_FILE} /group /group_copy) +ADD_H5_TEST (h5diff_vlstr 0 -v tvlstr.h5 tvlstr2.h5) # ############################################################################## # # Test container types (array,vlen) with multiple nested compound types diff --git a/tools/h5diff/testfiles/h5diff_vlstr.txt b/tools/h5diff/testfiles/h5diff_vlstr.txt new file mode 100644 index 0000000..67141f1 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_vlstr.txt @@ -0,0 +1,16 @@ + +file1 file2 +--------------------------------------- + x x / + x x /Dataset1 + x x /vl_string_type + +group : </> and </> +0 differences found +attribute: <test_scalar of </>> and <test_scalar of </>> +0 differences found +dataset: </Dataset1> and </Dataset1> +0 differences found +datatype: </vl_string_type> and </vl_string_type> +0 differences found +EXIT CODE: 0 diff --git a/tools/h5diff/testh5diff.sh.in b/tools/h5diff/testh5diff.sh.in index 45a7a45..ff370a9 100644 --- a/tools/h5diff/testh5diff.sh.in +++ b/tools/h5diff/testh5diff.sh.in @@ -120,6 +120,7 @@ $SRC_H5DIFF_TESTFILES/non_comparables1.h5 $SRC_H5DIFF_TESTFILES/non_comparables2.h5 $SRC_H5DIFF_TESTFILES/diff_strings1.h5 $SRC_H5DIFF_TESTFILES/diff_strings2.h5 +$SRC_TOOLS_TESTFILES/tvlstr.h5 " LIST_OTHER_TEST_FILES=" @@ -308,6 +309,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_80.txt $SRC_H5DIFF_TESTFILES/h5diff_90.txt $SRC_H5DIFF_TESTFILES/h5diff_tmp1.txt $SRC_H5DIFF_TESTFILES/h5diff_tmp2.txt +$SRC_H5DIFF_TESTFILES/h5diff_vlstr.txt $SRC_H5DIFF_TESTFILES/tmptest.he5 $SRC_H5DIFF_TESTFILES/tmptest2.he5 $SRC_H5DIFF_TESTFILES/tmpSingleSiteBethe.reference.h5 @@ -522,6 +524,8 @@ SKIP() { ############################################################################## # prepare for test COPY_TESTFILES_TO_TESTDIR +# second copy of tvlstr.h5 +$CP -f $SRC_TOOLS_TESTFILES/tvlstr.h5 $TESTDIR/tvlstr2.h5 # ############################################################################ # # Common usage @@ -1097,6 +1101,7 @@ TOOLTEST h5diff_487.txt -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 h5 # # diff various multiple vlen and fixed strings in a compound type dataset # ############################################################################## TOOLTEST h5diff_530.txt -v h5diff_comp_vl_strs.h5 h5diff_comp_vl_strs.h5 /group /group_copy +TOOLTEST h5diff_vlstr.txt -v tvlstr.h5 tvlstr2.h5 # ############################################################################## # # Test container types (array,vlen) with multiple nested compound types diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 1b17382..6480cf6 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -674,21 +674,33 @@ static hsize_t diff_datum(void *_mem1, h5difftrace("diff_datum H5T_STRING variable\n"); /* Get pointer to first string */ s1 = *(char**) mem1; - size1 = HDstrlen(s1); + if(s1) + size1 = HDstrlen(s1); + else + size1 = 0; /* Get pointer to second string */ s2 = *(char**) mem2; - size2 = HDstrlen(s2); + if(s2) + size2 = HDstrlen(s2); + else + size2 = 0; } else if (H5T_STR_NULLTERM == pad) { h5difftrace("diff_datum H5T_STRING null term\n"); /* Get pointer to first string */ s1 = (char*) mem1; - size1 = HDstrlen(s1); + if(s1) + size1 = HDstrlen(s1); + else + size1 = 0; if (size1 > size_mtype) size1 = size_mtype; /* Get pointer to second string */ s2 = (char*) mem2; - size2 = HDstrlen(s2); + if(s2) + size2 = HDstrlen(s2); + else + size2 = 0; if (size2 > size_mtype) size2 = size_mtype; } diff --git a/tools/perform/CMakeTests.cmake b/tools/perform/CMakeTests.cmake index 5c4b54f..5468b0d 100644 --- a/tools/perform/CMakeTests.cmake +++ b/tools/perform/CMakeTests.cmake @@ -55,6 +55,7 @@ add_test (NAME PERFORM_perf_meta COMMAND $<TARGET_FILE:perf_meta>) add_test (NAME PERFORM_zip_perf_help COMMAND $<TARGET_FILE:zip_perf> "-h") add_test (NAME PERFORM_zip_perf COMMAND $<TARGET_FILE:zip_perf> tfilters.h5) +set_tests_properties (PERFORM_zip_perf PROPERTIES DEPENDS PERFORM_zip_perf_help) if (H5_HAVE_PARALLEL) add_test (NAME PERFORM_h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:h5perf>) |