summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-03-06 23:18:28 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-03-06 23:18:28 (GMT)
commit503ab9d88d6fb4b0866cb8bb77ee1df68dd735c1 (patch)
tree635b28e181a5448d4d6ec1a95b22f5efa77b27a5
parent7cbf17a03f4131c65453e8d54bae0cc0737f8929 (diff)
parent16621eeb9174ae69be31a619426ff6ad39600150 (diff)
downloadhdf5-503ab9d88d6fb4b0866cb8bb77ee1df68dd735c1.zip
hdf5-503ab9d88d6fb4b0866cb8bb77ee1df68dd735c1.tar.gz
hdf5-503ab9d88d6fb4b0866cb8bb77ee1df68dd735c1.tar.bz2
Merge pull request #325 in HDFFV/hdf5 from ~BYRN/hdf5_adb:hdf5_1_8 to hdf5_1_8
* commit '16621eeb9174ae69be31a619426ff6ad39600150': HDFFV-10128 fix test scripts with ref files HDFFV-10128 new files added HDFFV-10128 test reference files HDFFV-10128 merge from develop
-rw-r--r--MANIFEST6
-rw-r--r--tools/h5diff/CMakeTests.cmake43
-rw-r--r--tools/h5diff/h5diffgentest.c161
-rw-r--r--tools/h5diff/testfiles/diff_strings1.h5bin0 -> 4464 bytes
-rw-r--r--tools/h5diff/testfiles/diff_strings2.h5bin0 -> 4464 bytes
-rw-r--r--tools/h5diff/testfiles/h5diff_60.txt10
-rw-r--r--tools/h5diff/testfiles/h5diff_61.txt30
-rw-r--r--tools/h5diff/testfiles/h5diff_62.txt37
-rw-r--r--tools/h5diff/testfiles/h5diff_63.txt10
-rw-r--r--tools/h5diff/testh5diff.sh.in21
-rw-r--r--tools/lib/h5diff_array.c10
11 files changed, 310 insertions, 18 deletions
diff --git a/MANIFEST b/MANIFEST
index 7ef11d3..47ed8d1 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1806,6 +1806,10 @@
./tools/h5diff/testfiles/h5diff_57.txt
./tools/h5diff/testfiles/h5diff_58.txt
./tools/h5diff/testfiles/h5diff_59.txt
+./tools/h5diff/testfiles/h5diff_60.txt
+./tools/h5diff/testfiles/h5diff_61.txt
+./tools/h5diff/testfiles/h5diff_62.txt
+./tools/h5diff/testfiles/h5diff_63.txt
./tools/h5diff/testfiles/h5diff_600.txt
./tools/h5diff/testfiles/h5diff_601.txt
./tools/h5diff/testfiles/h5diff_603.txt
@@ -2009,6 +2013,8 @@
./tools/h5diff/testfiles/tudfilter2.h5
./tools/h5diff/testfiles/h5diff_ud.txt
./tools/h5diff/testfiles/h5diff_udfail.txt
+./tools/h5diff/testfiles/diff_strings1.h5
+./tools/h5diff/testfiles/diff_strings2.h5
#test files for h5repack
./tools/h5repack/testfiles/README
diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake
index a9ec683..3e985f7 100644
--- a/tools/h5diff/CMakeTests.cmake
+++ b/tools/h5diff/CMakeTests.cmake
@@ -52,6 +52,8 @@
${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/non_comparables2.h5
${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/tudfilter.h5
${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
)
set (LIST_OTHER_TEST_FILES
@@ -179,6 +181,10 @@
${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_518.txt
${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_530.txt
${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_540.txt
+ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_60.txt
+ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_61.txt
+ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_62.txt
+ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_63.txt
${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_600.txt
${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_601.txt
${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_603.txt
@@ -286,7 +292,7 @@
##############################################################################
##############################################################################
- MACRO (ADD_H5_TEST resultfile resultcode)
+ macro (ADD_H5_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME H5DIFF-${resultfile} COMMAND $<TARGET_FILE:h5diff> ${ARGN})
@@ -314,9 +320,9 @@
if (H5_HAVE_PARALLEL)
ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN})
endif ()
- ENDMACRO ()
+ endmacro ()
- MACRO (ADD_PH5_TEST resultfile resultcode)
+ macro (ADD_PH5_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME PH5DIFF-${resultfile} COMMAND $<TARGET_FILE:ph5diff> ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN})
@@ -348,9 +354,9 @@
endif ()
set (last_test "PH5DIFF-${resultfile}")
endif ()
- ENDMACRO ()
+ endmacro ()
- MACRO (ADD_H5_UD_TEST testname resultcode resultfile)
+ macro (ADD_H5_UD_TEST testname resultcode resultfile)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
# Remove any output file left over from previous test run
add_test (
@@ -393,7 +399,7 @@
endif ()
set_tests_properties (H5DIFF_UD-${testname} PROPERTIES DEPENDS H5DIFF_UD-${testname}-clearall-objects)
endif ()
- ENDMACRO ()
+ endmacro ()
##############################################################################
##############################################################################
@@ -450,6 +456,9 @@
# attrs with verbose option level
set (ATTR_VERBOSE_LEVEL_FILE1 h5diff_attr_v_level1.h5)
set (ATTR_VERBOSE_LEVEL_FILE2 h5diff_attr_v_level2.h5)
+ # strings
+ set (STRINGS1 diff_strings1.h5)
+ set (STRINGS2 diff_strings2.h5)
if (HDF5_ENABLE_USING_MEMCHECKER)
# Remove any output file left over from previous test run
@@ -707,6 +716,14 @@
h5diff_530.out.err
h5diff_540.out
h5diff_540.out.err
+ h5diff_60.out
+ h5diff_60.out.err
+ h5diff_61.out
+ h5diff_61.out.err
+ h5diff_62.out
+ h5diff_62.out.err
+ h5diff_63.out
+ h5diff_63.out.err
h5diff_600.out
h5diff_600.out.err
h5diff_601.out
@@ -927,6 +944,13 @@ ADD_H5_TEST (h5diff_58 1 -v ${FILE7} ${FILE8} refreg)
# ( HDDFV-7942 )
ADD_H5_TEST (h5diff_59 0 -v ${FILE4} ${FILE4} dset11a dset11b)
+# Strings
+# ( HDFFV-10128 )
+ADD_H5_TEST (h5diff_60 1 -v ${STRINGS1} ${STRINGS2} string1 string1)
+ADD_H5_TEST (h5diff_61 1 -v ${STRINGS1} ${STRINGS2} string2 string2)
+ADD_H5_TEST (h5diff_62 1 -v ${STRINGS1} ${STRINGS2} string3 string3)
+ADD_H5_TEST (h5diff_63 1 -v ${STRINGS1} ${STRINGS2} string4 string4)
+
# ##############################################################################
# # Error messages
# ##############################################################################
@@ -1089,8 +1113,7 @@ ADD_H5_TEST (h5diff_103 1 -v --use-system-epsilon ${FILE1} ${FILE1} g1/d1
g1/d2)
# with --use-system-epsilon for float value. expect less differences
-ADD_H5_TEST (h5diff_104 1 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp1
-g1/fp2)
+ADD_H5_TEST (h5diff_104 1 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp1 g1/fp2)
# not comparable -c flag
ADD_H5_TEST (h5diff_200 0 ${FILE2} ${FILE2} g2/dset1 g2/dset2)
@@ -1386,3 +1409,7 @@ ADD_H5_TEST (h5diff_646 1 -v --use-system-epsilon -p 0.05 ${FILE1} ${FILE2} /g1/
##############################################################################
ADD_H5_UD_TEST (h5diff_plugin_test 0 h5diff_ud -v tudfilter.h5 tudfilter2.h5)
ADD_H5_UD_TEST (h5diff_plugin_fail 2 h5diff_udfail -v tudfilter.h5 tudfilter2.h5)
+
+# ##############################################################################
+# # END
+# ##############################################################################
diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c
index cfaffe6..50b32aa 100644
--- a/tools/h5diff/h5diffgentest.c
+++ b/tools/h5diff/h5diffgentest.c
@@ -93,6 +93,9 @@ hsize_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024);
/* non-comparable dataset and attribute */
#define NON_COMPARBLES1 "non_comparables1.h5"
#define NON_COMPARBLES2 "non_comparables2.h5"
+/* string dataset and attribute */
+#define DIFF_STRINGS1 "diff_strings1.h5"
+#define DIFF_STRINGS2 "diff_strings2.h5"
#define UIMAX 4294967295u /*Maximum value for a variable of type unsigned int */
#define STR_SIZE 3
@@ -157,6 +160,7 @@ static void test_comps_array_vlen (const char *fname, const char *dset, const ch
static void test_comps_vlen_arry (const char *fname, const char *dset,const char *attr, int diff, int is_file_new);
static void test_data_nocomparables (const char *fname, int diff);
static void test_objs_nocomparables (const char *fname1, const char *fname2);
+static void test_objs_strings (const char *fname, const char *fname2);
/* called by test_attributes() and test_datasets() */
static void write_attr_in(hid_t loc_id,const char* dset_name,hid_t fid,int make_diffs);
@@ -257,6 +261,9 @@ int main(void)
/* common objects (same name) with different object types. HDFFV-7644 */
test_objs_nocomparables(NON_COMPARBLES1, NON_COMPARBLES2);
+ /* string dataset and attribute. HDFFV-10028 */
+ test_objs_strings(DIFF_STRINGS1, DIFF_STRINGS2);
+
return 0;
}
@@ -5214,6 +5221,160 @@ out:
}
+static hid_t mkstr(int size, H5T_str_t pad) {
+ hid_t type;
+
+ if((type=H5Tcopy(H5T_C_S1)) < 0) return -1;
+ if(H5Tset_size(type, (size_t)size) < 0) return -1;
+ if(H5Tset_strpad(type, pad) < 0) return -1;
+
+ return type;
+}
+
+/*-------------------------------------------------------------------------
+* Function: test_objs_strings
+*
+* Purpose:
+* Create test files with common objects (same name) but different string
+* types.
+* h5diff should show differences output from these common objects.
+*-------------------------------------------------------------------------*/
+static void test_objs_strings(const char *fname1, const char *fname2)
+{
+ herr_t status = SUCCEED;
+ hid_t fid1=0;
+ hid_t fid2=0;
+ hid_t dataset=0;
+ hid_t space=0;
+ hid_t f_type=0;
+ hid_t m_type=0;
+ hsize_t dims1[] = {3, 4};
+ char string1A[12][3] = {"s1","s2","s3","s4","s5","s6","s","s","s9",
+ "s0","s1","s2"};
+ char string1B[12][3] = {"s1","s2","s3","s4","s","s","s7","s8","s9",
+ "s0","s1","s2"};
+
+ hsize_t dims2[]={20};
+ char string2A[20][10] = {"ab cd ef1", "ab cd ef2", "ab cd ef3", "ab cd ef4",
+ "ab cd ef5", "ab cd ef6", "ab cd ef7", "ab cd ef8",
+ "ab cd 9", "ab cd 0", "ab cd 1", "ab cd 2",
+ "ab cd ef3", "ab cd ef4", "ab cd ef5", "ab cd ef6",
+ "ab cd ef7", "ab cd ef8", "ab cd ef9", "ab cd ef0"};
+ char string2B[20][10] = {"ab cd ef1", "ab cd ef2", "ab cd ef3", "ab cd ef4",
+ "ab cd ef5", "ab cd ef6", "ab cd ef7", "ab cd ef8",
+ "ab cd ef9", "ab cd ef0", "ab cd ef1", "ab cd ef2",
+ "ab cd 3", "ab cd 4", "ab cd 5", "ab cd 6",
+ "ab cd ef7", "ab cd ef8", "ab cd ef9", "ab cd ef0"};
+
+ hsize_t dims3[] = {27};
+ char string3A[27][6] = {"abcd0", "abcd1", "abcd2", "abcd3",
+ "abcd4", "abcd5", "abcd6", "abcd7",
+ "abcd8", "abcd9", "abcd0", "abcd1",
+ "abd2", "abc3", "bcd4", "acd5",
+ "abcd6", "abcd7", "abcd8", "abcd9",
+ "abcd0", "abcd1", "abcd2", "abcd3",
+ "abc4", "abc5", "abc6"};
+ char string3B[27][6] = {"abcd0", "abcd1", "abcd2", "abcd3",
+ "abcd4", "abcd5", "abcd6", "abcd7",
+ "abcd8", "abcd9", "abcd0", "abcd1",
+ "abcd2", "abcd3", "abcd4", "abcd5",
+ "abd6", "abc7", "bcd8", "acd9",
+ "abcd0", "abcd1", "abcd2", "abcd3",
+ "abd4", "abd5", "abd6"};
+
+ hsize_t dims4[] = {3};
+ char string4A[3][21] = { "s1234567890123456789", "s1234567890123456789",
+ "s12345678901234567"};
+ char string4B[3][21] = { "s1234567890123456789", "s12345678901234567",
+ "s1234567890123456789"};
+
+ /*-----------------------------------------------------------------------
+ * Create file(s)
+ *------------------------------------------------------------------------*/
+ /* file1 */
+ fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ if (fid1 < 0)
+ {
+ fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ status = FAIL;
+ goto out;
+ }
+
+ /* file2 */
+ fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ if (fid2 < 0)
+ {
+ fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
+ status = FAIL;
+ goto out;
+ }
+
+ /* string 1 : nullterm string */
+ space = H5Screate_simple(2, dims1, NULL);
+ f_type = mkstr(5, H5T_STR_NULLTERM);
+ m_type = mkstr(3, H5T_STR_NULLTERM);
+ dataset = H5Dcreate2(fid1, "/string1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string1A);
+ H5Dclose(dataset);
+ dataset = H5Dcreate2(fid2, "/string1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string1B);
+ H5Tclose(m_type);
+ H5Tclose(f_type);
+ H5Sclose(space);
+ H5Dclose(dataset);
+
+ /* string 2 : space pad string */
+ space = H5Screate_simple(1, dims2, NULL);
+ f_type = mkstr(11, H5T_STR_SPACEPAD);
+ m_type = mkstr(10, H5T_STR_NULLTERM);
+ dataset = H5Dcreate2(fid1, "/string2", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string2A);
+ H5Dclose(dataset);
+ dataset = H5Dcreate2(fid2, "/string2", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string2B);
+ H5Tclose(m_type);
+ H5Tclose(f_type);
+ H5Sclose(space);
+ H5Dclose(dataset);
+
+ /* string 3 : null pad string */
+ space = H5Screate_simple(1, dims3, NULL);
+ f_type = mkstr(8, H5T_STR_NULLPAD);
+ m_type = mkstr(6, H5T_STR_NULLTERM);
+ dataset = H5Dcreate2(fid1, "/string3", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string3A);
+ H5Dclose(dataset);
+ dataset = H5Dcreate2(fid2, "/string3", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string3B);
+ H5Tclose(m_type);
+ H5Tclose(f_type);
+ H5Sclose(space);
+ H5Dclose(dataset);
+
+ /* string 4 : space pad long string */
+ space = H5Screate_simple(1, dims4, NULL);
+ f_type = mkstr(168, H5T_STR_SPACEPAD);
+ m_type = mkstr(21, H5T_STR_NULLTERM);
+ dataset = H5Dcreate2(fid1, "/string4", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string4A);
+ H5Dclose(dataset);
+ dataset = H5Dcreate2(fid2, "/string4", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string4B);
+ H5Tclose(m_type);
+ H5Tclose(f_type);
+ H5Sclose(space);
+ H5Dclose(dataset);
+
+out:
+ /*-----------------------------------------------------------------------
+ * Close IDs
+ *-----------------------------------------------------------------------*/
+ if(fid1)
+ H5Fclose(fid1);
+ if(fid2)
+ H5Fclose(fid2);
+}
+
/*-------------------------------------------------------------------------
* Function: write_attr_in
*
diff --git a/tools/h5diff/testfiles/diff_strings1.h5 b/tools/h5diff/testfiles/diff_strings1.h5
new file mode 100644
index 0000000..8839f5a
--- /dev/null
+++ b/tools/h5diff/testfiles/diff_strings1.h5
Binary files differ
diff --git a/tools/h5diff/testfiles/diff_strings2.h5 b/tools/h5diff/testfiles/diff_strings2.h5
new file mode 100644
index 0000000..810278c
--- /dev/null
+++ b/tools/h5diff/testfiles/diff_strings2.h5
Binary files differ
diff --git a/tools/h5diff/testfiles/h5diff_60.txt b/tools/h5diff/testfiles/h5diff_60.txt
new file mode 100644
index 0000000..938f279
--- /dev/null
+++ b/tools/h5diff/testfiles/h5diff_60.txt
@@ -0,0 +1,10 @@
+dataset: </string1> and </string1>
+size: [3x4] [3x4]
+position string1 string1 difference
+------------------------------------------------------------
+[ 1 0 ] 5 \000
+[ 1 1 ] 6 \000
+[ 1 2 ] \000 7
+[ 1 3 ] \000 8
+4 differences found
+EXIT CODE: 1
diff --git a/tools/h5diff/testfiles/h5diff_61.txt b/tools/h5diff/testfiles/h5diff_61.txt
new file mode 100644
index 0000000..1f238b1
--- /dev/null
+++ b/tools/h5diff/testfiles/h5diff_61.txt
@@ -0,0 +1,30 @@
+dataset: </string2> and </string2>
+size: [20] [20]
+position string2 string2 difference
+------------------------------------------------------------
+[ 8 ] 9 e
+[ 8 ] f
+[ 8 ] 9
+[ 9 ] 0 e
+[ 9 ] f
+[ 9 ] 0
+[ 10 ] 1 e
+[ 10 ] f
+[ 10 ] 1
+[ 11 ] 2 e
+[ 11 ] f
+[ 11 ] 2
+[ 12 ] e 3
+[ 12 ] f
+[ 12 ] 3
+[ 13 ] e 4
+[ 13 ] f
+[ 13 ] 4
+[ 14 ] e 5
+[ 14 ] f
+[ 14 ] 5
+[ 15 ] e 6
+[ 15 ] f
+[ 15 ] 6
+24 differences found
+EXIT CODE: 1
diff --git a/tools/h5diff/testfiles/h5diff_62.txt b/tools/h5diff/testfiles/h5diff_62.txt
new file mode 100644
index 0000000..0cc0947
--- /dev/null
+++ b/tools/h5diff/testfiles/h5diff_62.txt
@@ -0,0 +1,37 @@
+dataset: </string3> and </string3>
+size: [27] [27]
+position string3 string3 difference
+------------------------------------------------------------
+[ 12 ] d c
+[ 12 ] 2 d
+[ 12 ] \000 2
+[ 13 ] 3 d
+[ 13 ] \000 3
+[ 14 ] b a
+[ 14 ] c b
+[ 14 ] d c
+[ 14 ] 4 d
+[ 14 ] \000 4
+[ 15 ] c b
+[ 15 ] d c
+[ 15 ] 5 d
+[ 15 ] \000 5
+[ 16 ] c d
+[ 16 ] d 6
+[ 16 ] 6 \000
+[ 17 ] d 7
+[ 17 ] 7 \000
+[ 18 ] a b
+[ 18 ] b c
+[ 18 ] c d
+[ 18 ] d 8
+[ 18 ] 8 \000
+[ 19 ] b c
+[ 19 ] c d
+[ 19 ] d 9
+[ 19 ] 9 \000
+[ 24 ] c d
+[ 25 ] c d
+[ 26 ] c d
+31 differences found
+EXIT CODE: 1
diff --git a/tools/h5diff/testfiles/h5diff_63.txt b/tools/h5diff/testfiles/h5diff_63.txt
new file mode 100644
index 0000000..043da16
--- /dev/null
+++ b/tools/h5diff/testfiles/h5diff_63.txt
@@ -0,0 +1,10 @@
+dataset: </string4> and </string4>
+size: [3] [3]
+position string4 string4 difference
+------------------------------------------------------------
+[ 1 ] 8
+[ 1 ] 9
+[ 2 ] 8
+[ 2 ] 9
+4 differences found
+EXIT CODE: 1
diff --git a/tools/h5diff/testh5diff.sh.in b/tools/h5diff/testh5diff.sh.in
index 5748128..b2b0b8c 100644
--- a/tools/h5diff/testh5diff.sh.in
+++ b/tools/h5diff/testh5diff.sh.in
@@ -120,6 +120,8 @@ $SRC_H5DIFF_TESTFILES/h5diff_attr_v_level2.h5
$SRC_H5DIFF_TESTFILES/h5diff_enum_invalid_values.h5
$SRC_H5DIFF_TESTFILES/non_comparables1.h5
$SRC_H5DIFF_TESTFILES/non_comparables2.h5
+$SRC_H5DIFF_TESTFILES/diff_strings1.h5
+$SRC_H5DIFF_TESTFILES/diff_strings2.h5
"
LIST_OTHER_TEST_FILES="
@@ -252,6 +254,10 @@ $SRC_H5DIFF_TESTFILES/h5diff_517.txt
$SRC_H5DIFF_TESTFILES/h5diff_518.txt
$SRC_H5DIFF_TESTFILES/h5diff_530.txt
$SRC_H5DIFF_TESTFILES/h5diff_540.txt
+$SRC_H5DIFF_TESTFILES/h5diff_60.txt
+$SRC_H5DIFF_TESTFILES/h5diff_61.txt
+$SRC_H5DIFF_TESTFILES/h5diff_62.txt
+$SRC_H5DIFF_TESTFILES/h5diff_63.txt
$SRC_H5DIFF_TESTFILES/h5diff_600.txt
$SRC_H5DIFF_TESTFILES/h5diff_601.txt
$SRC_H5DIFF_TESTFILES/h5diff_603.txt
@@ -609,8 +615,6 @@ TOOLTEST h5diff_28.txt -v h5diff_types.h5 h5diff_types.h5 l1 l2
TOOLTEST h5diff_30.txt -v h5diff_enum_invalid_values.h5 h5diff_enum_invalid_values.h5 dset1 dset2
-
-
# ##############################################################################
# # Dataset datatypes
# ##############################################################################
@@ -646,6 +650,13 @@ TOOLTEST h5diff_58.txt -v h5diff_dset1.h5 h5diff_dset2.h5 refreg
# ( HDDFV-7942 )
TOOLTEST h5diff_59.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset11a dset11b
+# Strings
+# ( HDFFV-10128 )
+TOOLTEST h5diff_60.txt -v diff_strings1.h5 diff_strings2.h5 string1 string1
+TOOLTEST h5diff_61.txt -v diff_strings1.h5 diff_strings2.h5 string2 string2
+TOOLTEST h5diff_62.txt -v diff_strings1.h5 diff_strings2.h5 string3 string3
+TOOLTEST h5diff_63.txt -v diff_strings1.h5 diff_strings2.h5 string4 string4
+
# ##############################################################################
# # Error messages
# ##############################################################################
@@ -717,8 +728,6 @@ TOOLTEST h5diff_618.txt -p 2 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.19: number smaller than smallest difference
TOOLTEST h5diff_619.txt -p 0.005 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
-
-
# ##############################################################################
# # -n
# ##############################################################################
@@ -771,7 +780,6 @@ TOOLTEST h5diff_tmp2.txt tmpSingleSiteBethe.output.h5 tmpSingleSiteBethe.referen
# ##################################################
# attrs with verbose option level
# ##################################################
-
TOOLTEST h5diff_700.txt -v1 h5diff_attr1.h5 h5diff_attr2.h5
TOOLTEST h5diff_701.txt -v2 h5diff_attr1.h5 h5diff_attr2.h5
TOOLTEST h5diff_702.txt --verbose=1 h5diff_attr1.h5 h5diff_attr2.h5
@@ -822,7 +830,6 @@ TOOLTEST h5diff_103.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h
# with --use-system-epsilon for float value
TOOLTEST h5diff_104.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h5 g1/fp1 g1/fp2
-
# not comparable -c flag
TOOLTEST h5diff_200.txt h5diff_basic2.h5 h5diff_basic2.h5 g2/dset1 g2/dset2
@@ -950,7 +957,6 @@ TOOLTEST h5diff_424.txt --follow-symlinks -v h5diff_ext2softlink_trg.h5 h5diff_e
# extlink_to_softlink_to_dset1 vs extlink_to_softlink_to_dset2"
TOOLTEST h5diff_425.txt --follow-symlinks -v h5diff_ext2softlink_src.h5 h5diff_ext2softlink_src.h5 /ext_link_to_slink1 /ext_link_to_slink2
-
# ##############################################################################
# # Dangling links compare (--follow-symlinks and --no-dangling-links)
# ##############################################################################
@@ -1101,6 +1107,7 @@ TOOLTEST h5diff_540.txt -v compounds_array_vlen1.h5 compounds_array_vlen2.h5
# ##############################################################################
# # Test mutually exclusive options
# ##############################################################################
+#
# Test with -d , -p and --use-system-epsilon.
TOOLTEST h5diff_640.txt -v -d 5 -p 0.05 --use-system-epsilon h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4
TOOLTEST h5diff_641.txt -v -d 5 -p 0.05 h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index e4b166f..fc19bbc 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -544,7 +544,7 @@ hsize_t diff_array( void *_mem1,
* Recursively call this function for each element
* H5T_STRING
* compare byte by byte in a cycle from 0 to type_size. this type_size is the
- * value obtained by the get_size function but it is the string lenght for
+ * value obtained by the get_size function but it is the string length for
* variable sized strings
* H5T_OPAQUE
* compare byte by byte in a cycle from 0 to type_size
@@ -600,7 +600,7 @@ static hsize_t diff_datum(void *_mem1,
/* Fast comparison first for atomic type by memcmp().
* It is OK not to list non-atomic type here because it will not be caught
- * by the confition, but it gives more clarity for code planning
+ * by the condition, but it gives more clarity for code planning
*/
if (type_class != H5T_REFERENCE &&
type_class != H5T_COMPOUND &&
@@ -690,6 +690,10 @@ static hsize_t diff_datum(void *_mem1,
* of length of strings.
* For now mimic the previous way.
*/
+ if(size1 != size2)
+ {
+ nfound++;
+ }
if(size1 < size2)
{
size = size1;
@@ -710,7 +714,7 @@ static hsize_t diff_datum(void *_mem1,
pad = H5Tget_strpad(m_type);
- for (u=0; u<size && (s[u] || pad!=H5T_STR_NULLTERM); u++)
+ for (u=0; u<size; u++)
nfound+=character_compare(
s1 + u,
s2 + u, /* offset */