summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2014-06-23 20:24:08 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2014-06-23 20:24:08 (GMT)
commit9158e8aa03227a294739aed5549ab14c1d04fb5c (patch)
treeb201f1d5616b04576de70d5043d196fbe199b06d /tools
parent67ba5eb6e8a71a110d47fd3079edcc1fe09fb95f (diff)
downloadhdf5-9158e8aa03227a294739aed5549ab14c1d04fb5c.zip
hdf5-9158e8aa03227a294739aed5549ab14c1d04fb5c.tar.gz
hdf5-9158e8aa03227a294739aed5549ab14c1d04fb5c.tar.bz2
[svn-r25342] Bring revisions #25120 - #25266 from trunk to revise_chunks.
Tested on jam, koala, ostrich, platypus.
Diffstat (limited to 'tools')
-rw-r--r--tools/CMakeLists.txt2
-rw-r--r--tools/h5copy/CMakeTests.cmake2
-rw-r--r--tools/h5diff/CMakeTests.cmake4
-rw-r--r--tools/h5dump/CMakeTests.cmake24
-rw-r--r--tools/h5dump/CMakeTestsPBITS.cmake2
-rw-r--r--tools/h5dump/CMakeTestsXML.cmake2
-rw-r--r--tools/h5import/CMakeTests.cmake14
-rw-r--r--tools/h5import/h5import.c9
-rw-r--r--tools/h5jam/CMakeTests.cmake18
-rw-r--r--tools/h5ls/CMakeTests.cmake2
-rw-r--r--tools/h5ls/h5ls.c9
-rw-r--r--tools/h5repack/CMakeLists.txt2
-rw-r--r--tools/h5repack/CMakeTests.cmake16
-rw-r--r--tools/h5stat/CMakeTests.cmake2
-rw-r--r--tools/lib/CMakeLists.txt17
-rw-r--r--tools/lib/h5diff.c293
-rw-r--r--tools/lib/h5diff_dset.c6
-rw-r--r--tools/misc/CMakeTests.cmake4
18 files changed, 219 insertions, 209 deletions
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 27820ae..a9a8c49 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -4,7 +4,7 @@ PROJECT (HDF5_TOOLS)
#-----------------------------------------------------------------------------
# Apply Definitions to compiler in this directory and below
#-----------------------------------------------------------------------------
-add_definitions (${HDF5_EXTRA_C_FLAGS})
+add_definitions (${HDF_EXTRA_C_FLAGS})
#-----------------------------------------------------------------------------
# Setup include Directories
diff --git a/tools/h5copy/CMakeTests.cmake b/tools/h5copy/CMakeTests.cmake
index 77399a8..9002e5a 100644
--- a/tools/h5copy/CMakeTests.cmake
+++ b/tools/h5copy/CMakeTests.cmake
@@ -230,7 +230,7 @@
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=./testfiles/${testname}.out"
-D "TEST_MASK=true"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects)
endif (HDF5_ENABLE_USING_MEMCHECKER)
diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake
index 0986d89..686803b 100644
--- a/tools/h5diff/CMakeTests.cmake
+++ b/tools/h5diff/CMakeTests.cmake
@@ -317,7 +317,7 @@
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${resultfile}.txt"
-D "TEST_APPEND=EXIT CODE:"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS "H5DIFF-${resultfile}-clear-objects")
endif (HDF5_ENABLE_USING_MEMCHECKER)
@@ -355,7 +355,7 @@
# -D "TEST_APPEND=EXIT CODE: [0-9]"
# -D "TEST_REF_FILTER=EXIT CODE: 0"
-D "TEST_SKIP_COMPARE=TRUE"
- -P "${HDF5_RESOURCES_DIR}/prunTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/prunTest.cmake"
)
set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS "PH5DIFF-${resultfile}-clear-objects")
endif (HDF5_ENABLE_USING_MEMCHECKER)
diff --git a/tools/h5dump/CMakeTests.cmake b/tools/h5dump/CMakeTests.cmake
index fb7022c..f9ebc32 100644
--- a/tools/h5dump/CMakeTests.cmake
+++ b/tools/h5dump/CMakeTests.cmake
@@ -313,7 +313,7 @@
# copy test files from source dir to test dir
#
foreach (tst_h5_file ${HDF5_REFERENCE_TEST_FILES})
- GET_FILENAME_COMPONENT(fname "${tst_h5_file}" NAME)
+ get_filename_component (fname "${tst_h5_file}" NAME)
set (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}")
#message (STATUS " Copying ${tst_h5_file}")
add_custom_command (
@@ -339,7 +339,7 @@
endforeach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES})
foreach (tst_other_file ${HDF5_REFERENCE_FILES})
- GET_FILENAME_COMPONENT(fname "${tst_other_file}" NAME)
+ get_filename_component (fname "${tst_other_file}" NAME)
set (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}")
#message (STATUS " Copying ${tst_other_file}")
add_custom_command (
@@ -351,7 +351,7 @@
endforeach (tst_other_file ${HDF5_REFERENCE_FILES})
foreach (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES})
- GET_FILENAME_COMPONENT(fname "${tst_error_file}" NAME)
+ get_filename_component (fname "${tst_error_file}" NAME)
set (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}")
#message (STATUS " Copying ${tst_error_file}")
add_custom_command (
@@ -415,7 +415,7 @@
-D "TEST_OUTPUT=h5dump-${testname}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=h5dump-${testname}.txt"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5DUMP-h5dump-${testname} PROPERTIES DEPENDS "H5DUMP-h5dump-${testname}-clear-objects")
endif (HDF5_ENABLE_USING_MEMCHECKER)
@@ -461,7 +461,7 @@
-D "TEST_OUTPUT=${resultfile}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${resultfile}.ddl"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
endif (HDF5_ENABLE_USING_MEMCHECKER)
@@ -494,7 +494,7 @@
-D "TEST_OUTPUT=${resultfile}-N.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${resultfile}.ddl"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES DEPENDS "H5DUMP-N-${resultfile}-clear-objects")
endif (HDF5_ENABLE_USING_MEMCHECKER)
@@ -527,7 +527,7 @@
-D "TEST_OUTPUT=${resultfile}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${resultfile}.ddl"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
add_test (
@@ -567,7 +567,7 @@
-D "TEST_OUTPUT=${resultfile}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${resultfile}.ddl"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
add_test (
@@ -629,7 +629,7 @@
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${resultfile}.ddl"
-D "TEST_MASK_ERROR=true"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
endif (NOT HDF5_ENABLE_USING_MEMCHECKER)
@@ -654,7 +654,7 @@
-D "TEST_REFERENCE=${resultfile}.ddl"
-D "TEST_ERRREF=${resultfile}.err"
-D "TEST_MASK_ERROR=true"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
endif (NOT HDF5_ENABLE_USING_MEMCHECKER)
@@ -681,7 +681,7 @@
-D "TEST_MASK_ERROR=true"
-D "TEST_ENV_VAR:STRING=${envvar}"
-D "TEST_ENV_VALUE:STRING=${envval}"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
endif (NOT HDF5_ENABLE_USING_MEMCHECKER)
@@ -705,7 +705,7 @@
-D "TEST_OUTPUT=${conffile}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${conffile}.ddl"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5DUMP-IMPORT-${resultfile} PROPERTIES DEPENDS "H5DUMP-IMPORT-${resultfile}-clear-objects")
add_test (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND h5import ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5)
diff --git a/tools/h5dump/CMakeTestsPBITS.cmake b/tools/h5dump/CMakeTestsPBITS.cmake
index a920198..421e020 100644
--- a/tools/h5dump/CMakeTestsPBITS.cmake
+++ b/tools/h5dump/CMakeTestsPBITS.cmake
@@ -155,7 +155,7 @@
-D "TEST_OUTPUT=${resultfile}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${resultfile}.ddl"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
endif (HDF5_ENABLE_USING_MEMCHECKER)
diff --git a/tools/h5dump/CMakeTestsXML.cmake b/tools/h5dump/CMakeTestsXML.cmake
index ffc1cae..0d4e0f4 100644
--- a/tools/h5dump/CMakeTestsXML.cmake
+++ b/tools/h5dump/CMakeTestsXML.cmake
@@ -196,7 +196,7 @@
-D "TEST_OUTPUT=${resultfile}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${resultfile}.xml"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS "H5DUMP-XML-${resultfile}-clear-objects")
endif (HDF5_ENABLE_USING_MEMCHECKER)
diff --git a/tools/h5import/CMakeTests.cmake b/tools/h5import/CMakeTests.cmake
index 5c5b4de..6986aee 100644
--- a/tools/h5import/CMakeTests.cmake
+++ b/tools/h5import/CMakeTests.cmake
@@ -133,7 +133,7 @@
-D "TEST_EXPECT=0"
-D "TEST_FILTER=(^(HDF5)[^\n]*)"
-D "TEST_SKIP_COMPARE=TRUE"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5IMPORT-${testname}-H5DMP PROPERTIES DEPENDS H5IMPORT-${testname})
add_test (
@@ -146,7 +146,7 @@
-D "TEST_EXPECT=0"
-D "TEST_FILTER=(^(HDF5)[^\n]*)"
-D "TEST_REFERENCE=${testfile}.new"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP)
endif (HDF5_ENABLE_USING_MEMCHECKER)
@@ -180,7 +180,7 @@
-D "TEST_OUTPUT=d${testfile}.dmp"
-D "TEST_EXPECT=0"
-D "TEST_SKIP_COMPARE=TRUE"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
else ("${ARGN}" STREQUAL "BINARY")
add_test (
@@ -192,7 +192,7 @@
-D "TEST_OUTPUT=d${testfile}.dmp"
-D "TEST_EXPECT=0"
-D "TEST_SKIP_COMPARE=TRUE"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ("${ARGN}" STREQUAL "BINARY")
set_tests_properties (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects")
@@ -206,7 +206,7 @@
-D "TEST_OUTPUT=d${testfile}.imp"
-D "TEST_EXPECT=0"
-D "TEST_SKIP_COMPARE=TRUE"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5IMPORT-DUMP-${testname} PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-H5DMP")
@@ -214,13 +214,13 @@
NAME H5IMPORT-DUMP-${testname}-H5DFF
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff>"
- -D "TEST_ARGS:STRING=-v;d${testfile};testfiles/${testfile};${datasetname};${datasetname}"
+ -D "TEST_ARGS:STRING=-r;d${testfile};testfiles/${testfile};${datasetname};${datasetname}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=d${testfile}.dff"
-D "TEST_EXPECT=0"
-D "TEST_FILTER=(^(Warning)[^\n]*)"
-D "TEST_REFERENCE=testfiles/d${testfile}.txt"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}")
endif (NOT HDF5_ENABLE_USING_MEMCHECKER)
diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c
index 74c67b9..96fb6f9 100644
--- a/tools/h5import/h5import.c
+++ b/tools/h5import/h5import.c
@@ -874,12 +874,9 @@ static int processStrData(FILE *strm, struct Input *in, hid_t file_id)
*-------------------------------------------------------------------------
*/
- while (!HDfeof(strm)) {
- c = HDfgetc(strm);
-
+ while(EOF != (c = HDfgetc(strm)))
if (c == 10) /* eol */
nlines++;
- }
if (!nlines)
return 0;
@@ -940,9 +937,7 @@ static int processStrData(FILE *strm, struct Input *in, hid_t file_id)
line = 0;
- while (!HDfeof(strm)) {
- c = HDfgetc(strm);
-
+ while(EOF != (c = HDfgetc(strm))) {
str[i] = (char)c;
i++;
diff --git a/tools/h5jam/CMakeTests.cmake b/tools/h5jam/CMakeTests.cmake
index fb64313..b5dc256 100644
--- a/tools/h5jam/CMakeTests.cmake
+++ b/tools/h5jam/CMakeTests.cmake
@@ -77,7 +77,7 @@
-D "TEST_OUTPUT=${expectfile}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=testfiles/${expectfile}.txt"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5JAM-${expectfile} PROPERTIES DEPENDS H5JAM-${expectfile}-clear-objects)
endif (HDF5_ENABLE_USING_MEMCHECKER)
@@ -111,7 +111,7 @@
-D "TEST_OUTPUT=${expectfile}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=testfiles/${expectfile}.txt"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES DEPENDS H5JAM-UNJAM-${expectfile}-clear-objects)
endif (HDF5_ENABLE_USING_MEMCHECKER)
@@ -140,7 +140,7 @@
-D "TEST_EXPECT=0"
-D "TEST_FILTER=(^(HDF5)[^\n]*)"
-D "TEST_SKIP_COMPARE=TRUE"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-clear-objects)
add_test (
@@ -153,7 +153,7 @@
-D "TEST_EXPECT=0"
-D "TEST_FILTER=(^(HDF5)[^\n]*)"
-D "TEST_REFERENCE=${actual}.new"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP_CMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-H5DMP)
endif (NOT HDF5_ENABLE_USING_MEMCHECKER)
@@ -200,7 +200,7 @@
-D "TEST_OUTPUT=${outfile}.ufile.txt"
-D "TEST_EXPECT=0"
-D "TEST_SKIP_COMPARE=TRUE"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects)
set (compare_test "${outfile}.ufile.txt")
@@ -231,7 +231,7 @@
-D "TEST_UFILE=${compare_test}"
-D "TEST_EXPECT=0"
-D "TEST_OFILE="
- -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake"
+ -P "${HDF_RESOURCES_DIR}/userblockTest.cmake"
)
set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects)
endif (NOT "${compare_test}" STREQUAL "")
@@ -247,7 +247,7 @@
-D "TEST_EXPECT=0"
-D "TEST_UFILE=NULL"
-D "TEST_OFILE=NULL"
- -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake"
+ -P "${HDF_RESOURCES_DIR}/userblockTest.cmake"
)
if (NOT "${compare_test}" STREQUAL "")
set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1)
@@ -295,7 +295,7 @@
-D "TEST_UFILE=testfiles/${jamfile}"
-D "TEST_EXPECT=0"
-D "TEST_OFILE=${compare_orig}"
- -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake"
+ -P "${HDF_RESOURCES_DIR}/userblockTest.cmake"
)
set_tests_properties (H5JAM-${testname}-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-CHECK_UB_1-clear-objects)
CHECKFILE (${testname} "H5JAM-${testname}-CHECK_UB_1" ${chkfile} ${outfile})
@@ -350,7 +350,7 @@
-D "TEST_UFILE=testfiles/${jamfile}"
-D "TEST_EXPECT=0"
-D "TEST_OFILE=${compare_orig}"
- -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake"
+ -P "${HDF_RESOURCES_DIR}/userblockTest.cmake"
)
set_tests_properties (H5JAM-${testname}_NONE-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects)
CHECKFILE (${testname} "H5JAM-${testname}_NONE-CHECK_UB_1" ${infile} ${chkfile})
diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake
index b739130..a42fa17 100644
--- a/tools/h5ls/CMakeTests.cmake
+++ b/tools/h5ls/CMakeTests.cmake
@@ -140,7 +140,7 @@
-D "TEST_OUTPUT=${resultfile}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${resultfile}.ls"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS "H5LS-${resultfile}-clear-objects")
endif (HDF5_ENABLE_USING_MEMCHECKER)
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c
index 3c5ba06..42fb69f 100644
--- a/tools/h5ls/h5ls.c
+++ b/tools/h5ls/h5ls.c
@@ -817,8 +817,6 @@ print_float_type(h5tools_str_t *buffer, hid_t type, int ind)
* Programmer: Robb Matzke
* Thursday, November 5, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static hbool_t
@@ -833,8 +831,7 @@ print_cmpd_type(h5tools_str_t *buffer, hid_t type, int ind)
if(H5T_COMPOUND != H5Tget_class(type))
return FALSE;
- nmembs = H5Tget_nmembers(type);
- if(nmembs <= 0)
+ if((nmembs = H5Tget_nmembers(type)) < 0)
return FALSE;
h5tools_str_append(buffer, "struct {");
@@ -856,6 +853,7 @@ print_cmpd_type(h5tools_str_t *buffer, hid_t type, int ind)
size = H5Tget_size(type);
h5tools_str_append(buffer, "\n%*s} %lu byte%s",
ind, "", (unsigned long)size, 1==size?"":"s");
+
return TRUE;
}
@@ -884,8 +882,7 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind)
if(H5T_ENUM != H5Tget_class(type))
return FALSE;
- nmembs = H5Tget_nmembers(type);
- if(nmembs < 0)
+ if((nmembs = H5Tget_nmembers(type)) < 0)
return FALSE;
super = H5Tget_super(type);
diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt
index 4275e56..cb8720e 100644
--- a/tools/h5repack/CMakeLists.txt
+++ b/tools/h5repack/CMakeLists.txt
@@ -51,7 +51,7 @@ if (BUILD_TESTING)
set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibadd")
set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}")
set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME})
- add_definitions (${HDF5_EXTRA_C_FLAGS})
+ add_definitions (${HDF_EXTRA_C_FLAGS})
INCLUDE_DIRECTORIES (${HDF5_SRC_DIR})
add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${LIB_TYPE} dynlib_rpk.c)
diff --git a/tools/h5repack/CMakeTests.cmake b/tools/h5repack/CMakeTests.cmake
index 430defc..220c871 100644
--- a/tools/h5repack/CMakeTests.cmake
+++ b/tools/h5repack/CMakeTests.cmake
@@ -29,7 +29,7 @@
-D "TEST_EXPECT=${resultcode}"
-D "TEST_OUTPUT=h5repacktest"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake"
+ -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
)
if (NOT "${last_test}" STREQUAL "")
set_tests_properties (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test})
@@ -136,7 +136,7 @@
-D "TEST_OUTPUT=h5repack-${testname}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=h5repack-${testname}.txt"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS "H5REPACK-h5repack-${testname}-clear-objects")
endif (HDF5_ENABLE_USING_MEMCHECKER)
@@ -215,7 +215,7 @@
-D "TEST_EXPECT=${resultcode}"
-D "TEST_FILTER:STRING=${testfilter}"
-D "TEST_REFERENCE=${resultfile}.tst"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif (HDF5_ENABLE_USING_MEMCHECKER)
if (NOT "${last_test}" STREQUAL "")
@@ -250,7 +250,7 @@
-D "TEST_OUTPUT=${resultfile}-${testname}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${testname}.${resultfile}.ddl"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5REPACK_DMP-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_DMP-${testname}")
endif (NOT HDF5_ENABLE_USING_MEMCHECKER)
@@ -290,7 +290,7 @@
-D "TEST_EXPECT=${resultcode}"
-D "TEST_FILTER:STRING=${testfilter}"
-D "TEST_REFERENCE=${testfilter}"
- -P "${HDF5_RESOURCES_DIR}/grepTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
)
set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF)
else (${resultcode} STREQUAL "0")
@@ -313,7 +313,7 @@
-D "TEST_EXPECT=${resultcode}"
-D "TEST_FILTER:STRING=${nottestfilter}"
-D "TEST_REFERENCE=${testfilter}"
- -P "${HDF5_RESOURCES_DIR}/grepTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
)
set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF)
endif (${resultcode} STREQUAL "0")
@@ -365,7 +365,7 @@
-D "TEST_REFERENCE=${testname}.${resultfile}.tst"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5REPACK_UD-${testname} PROPERTIES DEPENDS H5REPACK_UD-${testname}-clearall-objects)
add_test (
@@ -379,7 +379,7 @@
-D "TEST_REFERENCE=${resultfile}-${testname}.ddl"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5REPACK_UD-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_UD-${testname}")
endif (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER)
diff --git a/tools/h5stat/CMakeTests.cmake b/tools/h5stat/CMakeTests.cmake
index b803dff..4175eb2 100644
--- a/tools/h5stat/CMakeTests.cmake
+++ b/tools/h5stat/CMakeTests.cmake
@@ -101,7 +101,7 @@
-D "TEST_OUTPUT=${resultfile}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${resultfile}.ddl"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS "H5STAT-${resultfile}-clear-objects")
endif (HDF5_ENABLE_USING_MEMCHECKER)
diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt
index c3b8294..e65673a 100644
--- a/tools/lib/CMakeLists.txt
+++ b/tools/lib/CMakeLists.txt
@@ -4,7 +4,7 @@ PROJECT (HDF5_TOOLS_LIB)
#-----------------------------------------------------------------------------
# Apply Definitions to compiler in this directory and below
#-----------------------------------------------------------------------------
-add_definitions (${HDF5_EXTRA_C_FLAGS})
+add_definitions (${HDF_EXTRA_C_FLAGS})
#-----------------------------------------------------------------------------
# Define Sources
@@ -71,21 +71,6 @@ install (
)
#-----------------------------------------------------------------------------
-# Because tools are installed into bin/tools we need to make sure the hdf5tools
-# library will be installed into the proper location.
-#-----------------------------------------------------------------------------
-if (APPLE)
- option (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF)
- if (HDF5_BUILD_WITH_INSTALL_NAME)
- SET_TARGET_PROPERTIES(${HDF5_TOOLS_LIB_TARGET} PROPERTIES
- LINK_FLAGS "-current_version ${HDF5_PACKAGE_VERSION} -compatibility_version ${HDF5_PACKAGE_VERSION}"
- INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
- BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME}
- )
- endif (HDF5_BUILD_WITH_INSTALL_NAME)
-endif (APPLE)
-
-#-----------------------------------------------------------------------------
# Add Target(s) to CMake Install for import into other projects
#-----------------------------------------------------------------------------
if (HDF5_EXPORTED_TARGETS)
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 884a85d..13cea23 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -470,75 +470,81 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo,
switch(linfo->type)
{
- case H5L_TYPE_SOFT:
- ret = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links);
- /* error */
- if (ret < 0)
- goto done;
- /* no dangling link option given and detect dangling link */
- else if (ret == 0)
- {
- tinfo->symlink_visited.dangle_link = TRUE;
- trav_info_visit_lnk(path, linfo, tinfo);
- if (opts->no_dangle_links)
- opts->err_stat = 1; /* make dgangling link is error */
- goto done;
- }
+ case H5L_TYPE_SOFT:
+ ret = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links);
+ /* error */
+ if (ret < 0)
+ goto done;
+ /* no dangling link option given and detect dangling link */
+ else if (ret == 0)
+ {
+ tinfo->symlink_visited.dangle_link = TRUE;
+ trav_info_visit_lnk(path, linfo, tinfo);
+ if (opts->no_dangle_links)
+ opts->err_stat = 1; /* make dgangling link is error */
+ goto done;
+ }
- /* check if already visit the target object */
- if(symlink_is_visited( &(tinfo->symlink_visited), linfo->type, NULL, lnk_info.trg_path))
- goto done;
+ /* check if already visit the target object */
+ if(symlink_is_visited( &(tinfo->symlink_visited), linfo->type, NULL, lnk_info.trg_path))
+ goto done;
- /* add this link as visited link */
- if(symlink_visit_add( &(tinfo->symlink_visited), linfo->type, NULL, lnk_info.trg_path) < 0)
- goto done;
-
- if(h5trav_visit(tinfo->fid, path, TRUE, TRUE,
- trav_grp_objs,trav_grp_symlinks, tinfo) < 0)
- {
- parallel_print("Error: Could not get file contents\n");
- opts->err_stat = 1;
- goto done;
- }
- break;
-
- case H5L_TYPE_EXTERNAL:
- ret = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links);
- /* error */
- if (ret < 0)
- goto done;
- /* no dangling link option given and detect dangling link */
- else if (ret == 0)
- {
- tinfo->symlink_visited.dangle_link = TRUE;
- trav_info_visit_lnk(path, linfo, tinfo);
- if (opts->no_dangle_links)
- opts->err_stat = 1; /* make dgangling link is error */
- goto done;
- }
+ /* add this link as visited link */
+ if(symlink_visit_add( &(tinfo->symlink_visited), linfo->type, NULL, lnk_info.trg_path) < 0)
+ goto done;
+
+ if(h5trav_visit(tinfo->fid, path, TRUE, TRUE,
+ trav_grp_objs,trav_grp_symlinks, tinfo) < 0)
+ {
+ parallel_print("Error: Could not get file contents\n");
+ opts->err_stat = 1;
+ goto done;
+ }
+ break;
+
+ case H5L_TYPE_EXTERNAL:
+ ret = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links);
+ /* error */
+ if (ret < 0)
+ goto done;
+ /* no dangling link option given and detect dangling link */
+ else if (ret == 0)
+ {
+ tinfo->symlink_visited.dangle_link = TRUE;
+ trav_info_visit_lnk(path, linfo, tinfo);
+ if (opts->no_dangle_links)
+ opts->err_stat = 1; /* make dgangling link is error */
+ goto done;
+ }
- if(H5Lunpack_elink_val(lnk_info.trg_path, linfo->u.val_size, NULL, &ext_fname, &ext_path) < 0)
- goto done;
+ if(H5Lunpack_elink_val(lnk_info.trg_path, linfo->u.val_size, NULL, &ext_fname, &ext_path) < 0)
+ goto done;
- /* check if already visit the target object */
- if(symlink_is_visited( &(tinfo->symlink_visited), linfo->type, ext_fname, ext_path))
- goto done;
+ /* check if already visit the target object */
+ if(symlink_is_visited( &(tinfo->symlink_visited), linfo->type, ext_fname, ext_path))
+ goto done;
- /* add this link as visited link */
- if(symlink_visit_add( &(tinfo->symlink_visited), linfo->type, ext_fname, ext_path) < 0)
- goto done;
-
- if(h5trav_visit(tinfo->fid, path, TRUE, TRUE,
- trav_grp_objs,trav_grp_symlinks, tinfo) < 0)
- {
- parallel_print("Error: Could not get file contents\n");
+ /* add this link as visited link */
+ if(symlink_visit_add( &(tinfo->symlink_visited), linfo->type, ext_fname, ext_path) < 0)
+ goto done;
+
+ if(h5trav_visit(tinfo->fid, path, TRUE, TRUE,
+ trav_grp_objs,trav_grp_symlinks, tinfo) < 0)
+ {
+ parallel_print("Error: Could not get file contents\n");
+ opts->err_stat = 1;
+ goto done;
+ }
+ break;
+
+ case H5L_TYPE_HARD:
+ case H5L_TYPE_MAX:
+ case H5L_TYPE_ERROR:
+ default:
+ parallel_print("Error: Invalid link type\n");
opts->err_stat = 1;
goto done;
- }
- break;
- default:
- ;
- break;
+ break;
} /* end of switch */
done:
@@ -572,7 +578,6 @@ hsize_t h5diff(const char *fname1,
hid_t file2_id = (-1);
char filenames[2][MAX_FILENAME];
hsize_t nfound = 0;
- int i;
int l_ret1 = -1;
int l_ret2 = -1;
char * obj1fullname = NULL;
@@ -653,27 +658,37 @@ hsize_t h5diff(const char *fname1,
/* if any object is specified */
if (objname1)
{
- /* malloc 2 more for "/" and end-of-line */
- obj1fullname = (char*)HDcalloc(HDstrlen(objname1) + 2, sizeof(char));
- obj2fullname = (char*)HDcalloc(HDstrlen(objname2) + 2, sizeof(char));
-
/* make the given object1 fullpath, start with "/" */
if (HDstrncmp(objname1, "/", 1))
{
+#ifdef H5_HAVE_ASPRINTF
+ /* Use the asprintf() routine, since it does what we're trying to do below */
+ HDasprintf(&obj1fullname, "/%s", objname1);
+#else /* H5_HAVE_ASPRINTF */
+ /* (malloc 2 more for "/" and end-of-line) */
+ obj1fullname = (char*)HDmalloc(HDstrlen(objname1) + 2);
HDstrcpy(obj1fullname, "/");
HDstrcat(obj1fullname, objname1);
+#endif /* H5_HAVE_ASPRINTF */
}
else
- HDstrcpy(obj1fullname, objname1);
+ obj1fullname = HDstrdup(objname1);
/* make the given object2 fullpath, start with "/" */
if (HDstrncmp(objname2, "/", 1))
{
+#ifdef H5_HAVE_ASPRINTF
+ /* Use the asprintf() routine, since it does what we're trying to do below */
+ HDasprintf(&obj2fullname, "/%s", objname2);
+#else /* H5_HAVE_ASPRINTF */
+ /* (malloc 2 more for "/" and end-of-line) */
+ obj2fullname = (char*)HDmalloc(HDstrlen(objname2) + 2);
HDstrcpy(obj2fullname, "/");
HDstrcat(obj2fullname, objname2);
+#endif /* H5_HAVE_ASPRINTF */
}
else
- HDstrcpy(obj2fullname, objname2);
+ obj2fullname = HDstrdup(objname2);
/*----------------------------------------------------------
* check if obj1 is root, group, single object or symlink
@@ -706,7 +721,8 @@ hsize_t h5diff(const char *fname1,
*/
if(src_linfo1.type == H5L_TYPE_HARD)
{
- int idx = 0;
+ size_t idx;
+
/* optional data pass */
info1_obj->opts = (diff_opt_t*)options;
@@ -716,7 +732,7 @@ hsize_t h5diff(const char *fname1,
options->err_stat = 1;
goto out;
}
- obj1type = oinfo1.type;
+ obj1type = (h5trav_type_t)oinfo1.type;
trav_info_add(info1_obj, obj1fullname, obj1type);
idx = info1_obj->nused - 1;
info1_obj->paths[idx].objno = oinfo1.addr;
@@ -765,7 +781,8 @@ hsize_t h5diff(const char *fname1,
*/
if(src_linfo2.type == H5L_TYPE_HARD)
{
- int idx = 0;
+ size_t idx;
+
/* optional data pass */
info2_obj->opts = (diff_opt_t*)options;
@@ -775,7 +792,7 @@ hsize_t h5diff(const char *fname1,
options->err_stat = 1;
goto out;
}
- obj2type = oinfo2.type;
+ obj2type = (h5trav_type_t)oinfo2.type;
trav_info_add(info2_obj, obj2fullname, obj2type);
idx = info2_obj->nused - 1;
info2_obj->paths[idx].objno = oinfo2.addr;
@@ -798,11 +815,9 @@ hsize_t h5diff(const char *fname1,
{
h5difftrace("h5diff no object specified\n");
/* set root group */
- obj1fullname = (char*)HDcalloc((size_t)2, sizeof(char));
- HDstrcat(obj1fullname, "/");
+ obj1fullname = (char*)HDstrdup("/");
obj1type = H5TRAV_TYPE_GROUP;
- obj2fullname = (char*)HDcalloc((size_t)2, sizeof(char));
- HDstrcat(obj2fullname, "/");
+ obj2fullname = (char*)HDstrdup("/");
obj2type = H5TRAV_TYPE_GROUP;
}
@@ -856,12 +871,13 @@ hsize_t h5diff(const char *fname1,
}
else if(l_ret1 != 2) /* symbolic link */
{
- obj1type = trg_linfo1.trg_type;
+ obj1type = (h5trav_type_t)trg_linfo1.trg_type;
h5difftrace("h5diff ... ... trg_linfo1.trg_type == H5L_TYPE_HARD\n");
if (info1_lp != NULL) {
- int idx = info1_lp->nused - 1;
+ size_t idx = info1_lp->nused - 1;
+
h5difftrace("h5diff ... ... ... info1_obj not null\n");
- info1_lp->paths[idx].type = trg_linfo1.trg_type;
+ info1_lp->paths[idx].type = (h5trav_type_t)trg_linfo1.trg_type;
info1_lp->paths[idx].objno = trg_linfo1.objno;
info1_lp->paths[idx].fileno = trg_linfo1.fileno;
}
@@ -904,11 +920,12 @@ hsize_t h5diff(const char *fname1,
}
else if(l_ret2 != 2) /* symbolic link */
{
- obj2type = trg_linfo2.trg_type;
+ obj2type = (h5trav_type_t)trg_linfo2.trg_type;
if (info2_lp != NULL) {
- int idx = info2_lp->nused - 1;
+ size_t idx = info2_lp->nused - 1;
+
h5difftrace("h5diff ... ... ... info2_obj not null\n");
- info2_lp->paths[idx].type = trg_linfo2.trg_type;
+ info2_lp->paths[idx].type = (h5trav_type_t)trg_linfo2.trg_type;
info2_lp->paths[idx].objno = trg_linfo2.objno;
info2_lp->paths[idx].fileno = trg_linfo2.fileno;
}
@@ -972,6 +989,8 @@ hsize_t h5diff(const char *fname1,
#ifdef H5_HAVE_PARALLEL
if(g_Parallel)
{
+ int i;
+
if((HDstrlen(fname1) > MAX_FILENAME) || (HDstrlen(fname2) > MAX_FILENAME))
{
HDfprintf(stderr, "The parallel diff only supports path names up to %d characters\n", MAX_FILENAME);
@@ -997,6 +1016,8 @@ hsize_t h5diff(const char *fname1,
*/
if(options->m_verbose)
{
+ unsigned u;
+
parallel_print("\n");
/* if given objects is group under root */
if (HDstrcmp (obj1fullname,"/") || HDstrcmp (obj2fullname,"/"))
@@ -1004,12 +1025,12 @@ hsize_t h5diff(const char *fname1,
else
parallel_print("file1 file2\n");
parallel_print("---------------------------------------\n");
- for(i = 0; i < match_list->nobjs; i++)
+ for(u = 0; u < match_list->nobjs; u++)
{
char c1, c2;
- c1 = (match_list->objs[i].flags[0]) ? 'x' : ' ';
- c2 = (match_list->objs[i].flags[1]) ? 'x' : ' ';
- parallel_print("%5c %6c %-15s\n", c1, c2, match_list->objs[i].name);
+ c1 = (match_list->objs[u].flags[0]) ? 'x' : ' ';
+ c2 = (match_list->objs[u].flags[1]) ? 'x' : ' ';
+ parallel_print("%5c %6c %-15s\n", c1, c2, match_list->objs[u].name);
} /* end for */
parallel_print ("\n");
} /* end if */
@@ -1092,8 +1113,8 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
hsize_t nfound = 0;
unsigned i;
- char * grp1_path = "";
- char * grp2_path = "";
+ const char * grp1_path = "";
+ const char * grp2_path = "";
char * obj1_fullpath = NULL;
char * obj2_fullpath = NULL;
diff_args_t argdata;
@@ -1106,10 +1127,10 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
* if not root, prepare object name to be pre-appended to group path to
* make full path
*/
- if (HDstrcmp (grp1, "/"))
- grp1_path = (char *)grp1;
- if (HDstrcmp (grp2, "/"))
- grp2_path = (char *)grp2;
+ if(HDstrcmp(grp1, "/"))
+ grp1_path = grp1;
+ if(HDstrcmp(grp2, "/"))
+ grp2_path = grp2;
/*-------------------------------------------------------------------------
* regarding the return value of h5diff (0, no difference in files, 1 difference )
@@ -1163,22 +1184,32 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
if( table->objs[i].flags[0] && table->objs[i].flags[1])
{
/* make full path for obj1 */
- obj1_fullpath = (char*)HDcalloc (HDstrlen(grp1_path) + strlen (table->objs[i].name) + 1, sizeof (char));
+#ifdef H5_HAVE_ASPRINTF
+ /* Use the asprintf() routine, since it does what we're trying to do below */
+ HDasprintf(&obj1_fullpath, "%s%s", grp1_path, table->objs[i].name);
+#else /* H5_HAVE_ASPRINTF */
+ obj1_fullpath = (char*)HDmalloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1);
HDstrcpy(obj1_fullpath, grp1_path);
HDstrcat(obj1_fullpath, table->objs[i].name);
+#endif /* H5_HAVE_ASPRINTF */
/* make full path for obj2 */
- obj2_fullpath = (char*)HDcalloc (HDstrlen(grp2_path) + strlen (table->objs[i].name) + 1, sizeof (char));
+#ifdef H5_HAVE_ASPRINTF
+ /* Use the asprintf() routine, since it does what we're trying to do below */
+ HDasprintf(&obj2_fullpath, "%s%s", grp2_path, table->objs[i].name);
+#else /* H5_HAVE_ASPRINTF */
+ obj2_fullpath = (char*)HDmalloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1);
HDstrcpy(obj2_fullpath, grp2_path);
HDstrcat(obj2_fullpath, table->objs[i].name);
+#endif /* H5_HAVE_ASPRINTF */
/* get index to figure out type of the object in file1 */
- while ( info1->paths[idx1].path &&
- (HDstrcmp (obj1_fullpath, info1->paths[idx1].path) != 0) )
+ while(info1->paths[idx1].path &&
+ (HDstrcmp(obj1_fullpath, info1->paths[idx1].path) != 0))
idx1++;
/* get index to figure out type of the object in file2 */
- while ( info2->paths[idx2].path &&
- (HDstrcmp (obj2_fullpath, info2->paths[idx2].path) != 0) )
+ while(info2->paths[idx2].path &&
+ (HDstrcmp(obj2_fullpath, info2->paths[idx2].path) != 0))
idx2++;
/* Set argdata to pass other args into diff() */
@@ -1363,10 +1394,10 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
} /* end if */
} /* end else */
#endif /* H5_HAVE_PARALLEL */
- if (obj1_fullpath)
- HDfree (obj1_fullpath);
- if (obj2_fullpath)
- HDfree (obj2_fullpath);
+ if(obj1_fullpath)
+ HDfree(obj1_fullpath);
+ if(obj2_fullpath)
+ HDfree(obj2_fullpath);
} /* end if */
} /* end for */
h5difftrace("done with for loop\n");
@@ -1586,12 +1617,12 @@ hsize_t diff(hid_t file1_id,
if (options->follow_links)
{
if (linkinfo1.linfo.type == H5L_TYPE_SOFT ||
- linkinfo1.linfo.type == H5L_TYPE_EXTERNAL)
- argdata->type[0] = linkinfo1.trg_type;
+ linkinfo1.linfo.type == H5L_TYPE_EXTERNAL)
+ argdata->type[0] = (h5trav_type_t)linkinfo1.trg_type;
if (linkinfo2.linfo.type == H5L_TYPE_SOFT ||
- linkinfo2.linfo.type == H5L_TYPE_EXTERNAL)
- argdata->type[1] = linkinfo2.trg_type;
+ linkinfo2.linfo.type == H5L_TYPE_EXTERNAL)
+ argdata->type[1] = (h5trav_type_t)linkinfo2.trg_type;
}
}
/* if objects are not the same type */
@@ -1633,29 +1664,30 @@ hsize_t diff(hid_t file1_id,
{
switch(object_type)
{
- case H5TRAV_TYPE_DATASET:
- do_print_objname("dataset", path1, path2, options);
- break;
- case H5TRAV_TYPE_NAMED_DATATYPE:
- do_print_objname("datatype", path1, path2, options);
- break;
- case H5TRAV_TYPE_GROUP:
- do_print_objname("group", path1, path2, options);
- break;
- case H5TRAV_TYPE_LINK:
- do_print_objname("link", path1, path2, options);
- break;
- case H5TRAV_TYPE_UDLINK:
- if(linkinfo1.linfo.type == H5L_TYPE_EXTERNAL && linkinfo2.linfo.type == H5L_TYPE_EXTERNAL)
- do_print_objname("external link", path1, path2, options);
- else
- do_print_objname ("user defined link", path1, path2, options);
- break;
- default:
- parallel_print("Comparison not supported: <%s> and <%s> are of type %s\n",
- path1, path2, get_type(object_type) );
- options->not_cmp = 1;
- break;
+ case H5TRAV_TYPE_DATASET:
+ do_print_objname("dataset", path1, path2, options);
+ break;
+ case H5TRAV_TYPE_NAMED_DATATYPE:
+ do_print_objname("datatype", path1, path2, options);
+ break;
+ case H5TRAV_TYPE_GROUP:
+ do_print_objname("group", path1, path2, options);
+ break;
+ case H5TRAV_TYPE_LINK:
+ do_print_objname("link", path1, path2, options);
+ break;
+ case H5TRAV_TYPE_UDLINK:
+ if(linkinfo1.linfo.type == H5L_TYPE_EXTERNAL && linkinfo2.linfo.type == H5L_TYPE_EXTERNAL)
+ do_print_objname("external link", path1, path2, options);
+ else
+ do_print_objname ("user defined link", path1, path2, options);
+ break;
+ case H5TRAV_TYPE_UNKNOWN:
+ default:
+ parallel_print("Comparison not supported: <%s> and <%s> are of type %s\n",
+ path1, path2, get_type(object_type) );
+ options->not_cmp = 1;
+ break;
} /* switch(type)*/
print_found(nfound);
@@ -1862,6 +1894,7 @@ hsize_t diff(hid_t file1_id,
}
break;
+ case H5TRAV_TYPE_UNKNOWN:
default:
if(options->m_verbose)
parallel_print("Comparison not supported: <%s> and <%s> are of type %s\n",
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index f6e6329..d7c5639 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -441,13 +441,13 @@ hsize_t diff_datasetid( hid_t did1,
HDassert(sm_nbytes > 0);
} /* end for */
- /* malloc return code should be verified.
+ /* malloc return code should be verified.
* If fail, need to handle the error.
* This else branch should be recoded as a separate function.
* Note that there are many "goto error" within this branch
* that fails to address freeing other objects created here.
- * E.g., sm_space.
- */
+ * E.g., sm_space.
+ */
sm_buf1 = HDmalloc((size_t)sm_nbytes);
HDassert(sm_buf1);
sm_buf2 = HDmalloc((size_t)sm_nbytes);
diff --git a/tools/misc/CMakeTests.cmake b/tools/misc/CMakeTests.cmake
index 0887fb6..d28b744 100644
--- a/tools/misc/CMakeTests.cmake
+++ b/tools/misc/CMakeTests.cmake
@@ -119,7 +119,7 @@
-D "TEST_EXPECT=${resultcode}"
-D "TEST_MASK_MOD=true"
-D "TEST_REFERENCE=${resultfile}.ls"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5MKGRP-${resultfile}-h5ls PROPERTIES DEPENDS H5MKGRP-${resultfile})
endif (HDF5_ENABLE_USING_MEMCHECKER)
@@ -147,7 +147,7 @@
-D "TEST_OUTPUT=${resultfile}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${resultfile}.txt"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects)
endif (HDF5_ENABLE_USING_MEMCHECKER)