summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-05-16 14:28:49 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-05-16 14:28:49 (GMT)
commit4f0b92bdd5d35395b3ee0d90a84133032b85e8ff (patch)
tree20c448e7d3eddc6ddc303d24c23a4872a4905d35 /tools
parent3e1a06e6494c9dd9a6f4b39e702949159e803283 (diff)
downloadhdf5-4f0b92bdd5d35395b3ee0d90a84133032b85e8ff.zip
hdf5-4f0b92bdd5d35395b3ee0d90a84133032b85e8ff.tar.gz
hdf5-4f0b92bdd5d35395b3ee0d90a84133032b85e8ff.tar.bz2
HDFFV-10128 Fixed string length with no null fixed
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/h5diff_array.c9
-rw-r--r--tools/test/h5diff/CMakeTests.cmake2
-rw-r--r--tools/test/h5diff/testfiles/h5diff_tmp1.txt14
3 files changed, 9 insertions, 16 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 0a9d18a..499d5eb 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -665,6 +665,7 @@ static hsize_t diff_datum(void *_mem1,
size_t size1;
size_t size2;
size_t sizex;
+ size_t size_mtype = H5Tget_size(m_type);
H5T_str_t pad = H5Tget_strpad(m_type);
/* if variable length string */
@@ -682,17 +683,21 @@ static hsize_t diff_datum(void *_mem1,
/* Get pointer to first string */
s1 = (char*) mem1;
size1 = HDstrlen(s1);
+ if (size1 > size_mtype)
+ size1 = size_mtype;
/* Get pointer to second string */
s2 = (char*) mem2;
size2 = HDstrlen(s2);
+ if (size2 > size_mtype)
+ size2 = size_mtype;
}
else {
/* Get pointer to first string */
s1 = (char *)mem1;
- size1 = H5Tget_size(m_type);
+ size1 = size_mtype;
/* Get pointer to second string */
s2 = (char *)mem2;
- size2 = H5Tget_size(m_type);
+ size2 = size_mtype;
}
/*
diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake
index 5759c2b..f6cd2dd 100644
--- a/tools/test/h5diff/CMakeTests.cmake
+++ b/tools/test/h5diff/CMakeTests.cmake
@@ -1130,7 +1130,7 @@ ADD_H5_TEST (h5diff_631 0 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp18 g1/f
# ##############################################################################
ADD_H5_TEST (h5diff_70 1 -v ${FILE5} ${FILE6})
# temporary test to verify HDF5-8625
-ADD_H5_TEST (h5diff_tmp1 1 tmptest2.he5 tmptest.he5)
+ADD_H5_TEST (h5diff_tmp1 0 tmptest2.he5 tmptest.he5)
# temporary test to verify HDF5-8639
ADD_H5_TEST (h5diff_tmp2 1 tmpSingleSiteBethe.output.h5 tmpSingleSiteBethe.reference.h5)
diff --git a/tools/test/h5diff/testfiles/h5diff_tmp1.txt b/tools/test/h5diff/testfiles/h5diff_tmp1.txt
index e2bb247..40e3fb6 100644
--- a/tools/test/h5diff/testfiles/h5diff_tmp1.txt
+++ b/tools/test/h5diff/testfiles/h5diff_tmp1.txt
@@ -1,17 +1,5 @@
-attribute: <EndDate of </HDFEOS/ADDITIONAL/FILE_ATTRIBUTES>> and <EndDate of </HDFEOS/ADDITIONAL/FILE_ATTRIBUTES>>
-3 differences found
-attribute: <Set2eqSet1 of </HDFEOS/ADDITIONAL/FILE_ATTRIBUTES>> and <Set2eqSet1 of </HDFEOS/ADDITIONAL/FILE_ATTRIBUTES>>
-1 differences found
-attribute: <VersionID of </HDFEOS/ADDITIONAL/FILE_ATTRIBUTES>> and <VersionID of </HDFEOS/ADDITIONAL/FILE_ATTRIBUTES>>
-1 differences found
-attribute: <LongName of </HDFEOS/GRIDS/SET1/Data Fields/STv>> and <LongName of </HDFEOS/GRIDS/SET1/Data Fields/STv>>
-1 differences found
-attribute: <LongName of </HDFEOS/GRIDS/SET1/Data Fields/Tot_Precip_Water>> and <LongName of </HDFEOS/GRIDS/SET1/Data Fields/Tot_Precip_Water>>
-1 differences found
-attribute: <LongName of </HDFEOS/GRIDS/SET2/Data Fields/STv>> and <LongName of </HDFEOS/GRIDS/SET2/Data Fields/STv>>
-1 differences found
--------------------------------
Some objects are not comparable
--------------------------------
Use -c for a list of objects.
-EXIT CODE: 1
+EXIT CODE: 0