summaryrefslogtreecommitdiffstats
path: root/tools/test
diff options
context:
space:
mode:
Diffstat (limited to 'tools/test')
-rw-r--r--tools/test/h5copy/CMakeLists.txt4
-rw-r--r--tools/test/h5copy/CMakeTests.cmake30
-rw-r--r--tools/test/h5copy/h5copygentest.c30
-rw-r--r--tools/test/h5diff/CMakeLists.txt4
-rw-r--r--tools/test/h5diff/CMakeTests.cmake92
-rw-r--r--tools/test/h5diff/dynlib_diff.c4
-rw-r--r--tools/test/h5diff/h5diffgentest.c432
-rw-r--r--tools/test/h5diff/testfiles/h5diff_58.txt4
-rw-r--r--tools/test/h5diff/testfiles/h5diff_58_ref.txt37
-rw-r--r--tools/test/h5diff/testfiles/h5diff_reg.txt15
-rw-r--r--tools/test/h5diff/testh5diff.sh.in22
-rw-r--r--tools/test/h5dump/CMakeLists.txt10
-rw-r--r--tools/test/h5dump/CMakeTests.cmake83
-rw-r--r--tools/test/h5dump/CMakeTestsPBITS.cmake10
-rw-r--r--tools/test/h5dump/CMakeTestsVDS.cmake18
-rw-r--r--tools/test/h5dump/CMakeTestsXML.cmake10
-rw-r--r--tools/test/h5dump/CMakeVFDTests.cmake8
-rw-r--r--tools/test/h5dump/dynlib_dump.c4
-rw-r--r--tools/test/h5dump/errfiles/tarray1_big.err57
-rw-r--r--tools/test/h5dump/errfiles/tattrregR.err38
-rw-r--r--tools/test/h5dump/errfiles/tdataregR.err38
-rw-r--r--tools/test/h5dump/errfiles/tdset-2.err2
-rw-r--r--tools/test/h5dump/errfiles/tperror.err2
-rw-r--r--tools/test/h5dump/errfiles/tqmarkfile.err2
-rw-r--r--tools/test/h5dump/h5dumpgentest.c517
-rw-r--r--tools/test/h5dump/testh5dump.sh.in62
-rw-r--r--tools/test/h5format_convert/CMakeLists.txt4
-rw-r--r--tools/test/h5format_convert/CMakeTests.cmake22
-rw-r--r--tools/test/h5format_convert/h5fc_chk_idx.c4
-rw-r--r--tools/test/h5format_convert/h5fc_gentest.c52
-rw-r--r--tools/test/h5import/CMakeLists.txt4
-rw-r--r--tools/test/h5import/CMakeTests.cmake28
-rw-r--r--tools/test/h5jam/CMakeLists.txt4
-rw-r--r--tools/test/h5jam/CMakeTests.cmake28
-rw-r--r--tools/test/h5jam/getub.c2
-rw-r--r--tools/test/h5jam/testh5jam.sh.in4
-rw-r--r--tools/test/h5ls/CMakeLists.txt6
-rw-r--r--tools/test/h5ls/CMakeTests.cmake16
-rw-r--r--tools/test/h5ls/CMakeTestsVDS.cmake14
-rw-r--r--tools/test/h5ls/dynlib_ls.c4
-rw-r--r--tools/test/h5repack/CMakeLists.txt4
-rw-r--r--tools/test/h5repack/CMakeTests.cmake246
-rw-r--r--tools/test/h5repack/h5repackgentest.c304
-rw-r--r--tools/test/h5repack/h5repacktst.c234
-rw-r--r--tools/test/h5repack/testfiles/attrregion.tattrreg.h5.ddl46
-rw-r--r--tools/test/h5repack/testfiles/dataregion.tdatareg.h5.ddl42
-rw-r--r--tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst2
-rw-r--r--tools/test/h5stat/CMakeLists.txt4
-rw-r--r--tools/test/h5stat/CMakeTests.cmake14
-rw-r--r--tools/test/h5stat/h5stat_gentest.c56
-rw-r--r--tools/test/misc/CMakeLists.txt8
-rw-r--r--tools/test/misc/CMakeTestsClear.cmake34
-rw-r--r--tools/test/misc/CMakeTestsMkgrp.cmake49
-rw-r--r--tools/test/misc/CMakeTestsRepart.cmake14
-rw-r--r--tools/test/misc/h5clear_gentest.c26
-rw-r--r--tools/test/misc/h5repart_gentest.c71
-rw-r--r--tools/test/misc/repart_test.c6
-rw-r--r--tools/test/misc/talign.c10
-rw-r--r--tools/test/misc/vds/UC_1_one_dim_gen.c16
-rw-r--r--tools/test/misc/vds/UC_2_two_dims_gen.c16
-rw-r--r--tools/test/misc/vds/UC_3_gaps_gen.c20
-rw-r--r--tools/test/misc/vds/UC_4_printf_gen.c16
-rw-r--r--tools/test/misc/vds/UC_5_stride_gen.c16
-rw-r--r--tools/test/perform/CMakeLists.txt22
-rw-r--r--tools/test/perform/CMakeTests.cmake305
-rw-r--r--tools/test/perform/chunk.c2
-rw-r--r--tools/test/perform/chunk_cache.c11
-rw-r--r--tools/test/perform/iopipe.c38
-rw-r--r--tools/test/perform/perf.c34
-rw-r--r--tools/test/perform/pio_engine.c392
-rw-r--r--tools/test/perform/pio_perf.c56
-rw-r--r--tools/test/perform/pio_perf.h3
-rw-r--r--tools/test/perform/pio_standalone.c135
-rw-r--r--tools/test/perform/pio_standalone.h4
-rw-r--r--tools/test/perform/sio_engine.c37
-rw-r--r--tools/test/perform/sio_perf.h3
-rw-r--r--tools/test/perform/sio_standalone.h17
77 files changed, 2163 insertions, 1877 deletions
diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt
index 1130ea7..028935f 100644
--- a/tools/test/h5copy/CMakeLists.txt
+++ b/tools/test/h5copy/CMakeLists.txt
@@ -43,4 +43,6 @@ if (BUILD_SHARED_LIBS)
)
endif ()
-include (CMakeTests.cmake)
+if (HDF5_TEST_TOOLS AND HDF5_TEST_SERIAL)
+ include (CMakeTests.cmake)
+endif ()
diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake
index b0d1615..4ce0318 100644
--- a/tools/test/h5copy/CMakeTests.cmake
+++ b/tools/test/h5copy/CMakeTests.cmake
@@ -45,12 +45,6 @@
endforeach ()
add_custom_target(h5copy_files ALL COMMENT "Copying files needed by h5copy tests" DEPENDS ${h5copy_files_list})
- if (NOT BUILD_SHARED_LIBS)
- set (tgt_ext "")
- else ()
- set (tgt_ext "-shared")
- endif ()
-
##############################################################################
##############################################################################
### T H E T E S T S M A C R O S ###
@@ -71,7 +65,7 @@
add_test (
NAME H5COPY_F-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
)
if (HDF5_ENABLE_USING_MEMCHECKER)
if (last_test)
@@ -85,7 +79,7 @@
if (NOT ${resultcode} EQUAL 2)
add_test (
NAME H5COPY_F-${testname}-DIFF
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname})
if (${resultcode} EQUAL 1)
@@ -105,7 +99,7 @@
add_test (
NAME H5COPY-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
)
if (HDF5_ENABLE_USING_MEMCHECKER)
if (last_test)
@@ -119,7 +113,7 @@
if (NOT ${resultcode} EQUAL 2)
add_test (
NAME H5COPY-${testname}-DIFF
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname})
if (${resultcode} EQUAL 1)
@@ -149,7 +143,7 @@
add_test (
NAME H5COPY-${testname}-prefill
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam}
)
if (HDF5_ENABLE_USING_MEMCHECKER)
if (last_test)
@@ -161,14 +155,14 @@
add_test (
NAME H5COPY-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
)
set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill)
# resultcode=2 will cause the test to skip the diff test
if (NOT ${resultcode} EQUAL 2)
add_test (
NAME H5COPY-${testname}-DIFF
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname})
if (${resultcode} EQUAL 1)
@@ -188,7 +182,7 @@
add_test (
NAME H5COPY_SAME-${testname}-prefill
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam}
)
if (HDF5_ENABLE_USING_MEMCHECKER)
if (last_test)
@@ -200,14 +194,14 @@
add_test (
NAME H5COPY_SAME-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${testname}.out.h5 -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${testname}.out.h5 -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
)
set_tests_properties (H5COPY_SAME-${testname} PROPERTIES DEPENDS H5COPY_SAME-${testname}-prefill)
# resultcode=2 will cause the test to skip the diff test
if (NOT ${resultcode} EQUAL 2)
add_test (
NAME H5COPY_SAME-${testname}-DIFF
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> -v ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname})
if (${resultcode} EQUAL 1)
@@ -223,7 +217,7 @@
macro (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5COPY-CMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN})
+ add_test (NAME H5COPY-CMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN})
if (${resultcode} EQUAL 1)
set_tests_properties (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true")
endif ()
@@ -240,7 +234,7 @@
NAME H5COPY-CMP-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5copy${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5copy${tgt_file_ext}>"
-D "TEST_ARGS=-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${vparam};${sparam};${srcname};${dparam};${dstname}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=./testfiles/${testname}.out.out"
diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c
index f6aa72f..2a8a575 100644
--- a/tools/test/h5copy/h5copygentest.c
+++ b/tools/test/h5copy/h5copygentest.c
@@ -261,7 +261,7 @@ static void gent_named_vl(hid_t loc_id)
H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
/* close */
- H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf);
+ H5Treclaim(tid,sid,H5P_DEFAULT,buf);
H5Sclose(sid);
H5Dclose(did);
H5Tclose(tid);
@@ -314,7 +314,7 @@ static void gent_nested_vl(hid_t loc_id)
H5Dwrite(did, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
/* close */
- H5Dvlen_reclaim(tid2,sid,H5P_DEFAULT,buf);
+ H5Treclaim(tid2,sid,H5P_DEFAULT,buf);
H5Sclose(sid);
H5Dclose(did);
H5Tclose(tid1);
@@ -338,14 +338,14 @@ static void gent_att_compound_vlstr(hid_t loc_id)
const char *v;
} s1;
hsize_t dim[1] = {1}; /* Dimension size */
- hid_t sid = -1; /* Dataspace ID */
- hid_t tid = -1; /* Datatype ID */
- hid_t aid = -1; /* Attribute ID */
- hid_t did = -1; /* Dataset ID */
- hid_t gid = -1; /* Group ID */
- hid_t vl_str_tid = -1; /* Variable length datatype ID */
- hid_t cmpd_tid = -1; /* Compound datatype ID */
- hid_t null_sid = -1; /* Null dataspace ID */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t tid = H5I_INVALID_HID; /* Datatype ID */
+ hid_t aid = H5I_INVALID_HID; /* Attribute ID */
+ hid_t did = H5I_INVALID_HID; /* Dataset ID */
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
+ hid_t vl_str_tid = H5I_INVALID_HID; /* Variable length datatype ID */
+ hid_t cmpd_tid = H5I_INVALID_HID; /* Compound datatype ID */
+ hid_t null_sid = H5I_INVALID_HID; /* Null dataspace ID */
s1 buf; /* Buffer */
buf.i = 9;
@@ -725,7 +725,7 @@ out:
*------------------------------------------------------------------------*/
static void Test_Obj_Copy(void)
{
- hid_t fid = -1; /* File id */
+ hid_t fid = H5I_INVALID_HID; /* File id */
hid_t fapl_new = (-1); /* File access property id */
unsigned new_format; /* New format or old format */
@@ -744,9 +744,9 @@ static void Test_Obj_Copy(void)
/* Set the FAPL for the type of format */
/* Create source file */
if(new_format)
- fid = H5Fcreate(HDF_FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_new);
- else
- fid = H5Fcreate(HDF_FILE1_NEW, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ fid = H5Fcreate(HDF_FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_new);
+ else
+ fid = H5Fcreate(HDF_FILE1_NEW, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if(fid < 0) {
HDfprintf(stderr, "Error: H5Fcreate failed.\n");
goto out;
@@ -756,7 +756,7 @@ static void Test_Obj_Copy(void)
gent_empty_group(fid);
gent_nested_datasets(fid);
gent_nested_group(fid);
- gent_att_compound_vlstr(fid);
+ gent_att_compound_vlstr(fid);
H5Fclose(fid);
fid = (-1);
diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt
index cb4397f..82e09c6 100644
--- a/tools/test/h5diff/CMakeLists.txt
+++ b/tools/test/h5diff/CMakeLists.txt
@@ -43,4 +43,6 @@ if (BUILD_SHARED_LIBS)
)
endif ()
-include (CMakeTests.cmake)
+if (HDF5_TEST_TOOLS)
+ include (CMakeTests.cmake)
+endif ()
diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake
index 93dfd72..3d9c6f5 100644
--- a/tools/test/h5diff/CMakeTests.cmake
+++ b/tools/test/h5diff/CMakeTests.cmake
@@ -94,6 +94,17 @@
${HDF5_TOOLS_DIR}/testfiles/vds/5_vds.h5
# tools/testfiles
${HDF5_TOOLS_DIR}/testfiles/tvlstr.h5
+ #STD_REF_OBJ files
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_attr.h5
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_compat.h5
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_ext1.h5
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_ext2.h5
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_grp.h5
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_obj_del.h5
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_obj.h5
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_param.h5
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_reg_1d.h5
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_reg.h5
)
set (LIST_OTHER_TEST_FILES
@@ -201,6 +212,7 @@
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_56.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_57.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_58.txt
+ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_58_ref.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_59.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_500.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_501.txt
@@ -282,6 +294,7 @@
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_90.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_8625.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_8639.txt
+ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_reg.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_ud.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_udfail.err
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_udfail.txt
@@ -350,12 +363,6 @@
endif ()
add_custom_target(h5diff_files ALL COMMENT "Copying files needed by h5diff tests" DEPENDS ${h5diff_files_list})
- if (NOT BUILD_SHARED_LIBS)
- set (tgt_ext "")
- else ()
- set (tgt_ext "-shared")
- endif ()
-
##############################################################################
##############################################################################
### T H E T E S T S M A C R O S ###
@@ -363,35 +370,37 @@
##############################################################################
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 ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> ${ARGN})
- set_tests_properties (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (${resultcode})
- set_tests_properties (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true")
- endif ()
- if (last_test)
- set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
- endif ()
- else ()
- add_test (
- NAME H5DIFF-${resultfile}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5diff${tgt_ext}>"
- -D "TEST_ARGS:STRING=${ARGN}"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
- -D "TEST_OUTPUT=${resultfile}.out"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_REFERENCE=${resultfile}.txt"
- -D "TEST_APPEND=EXIT CODE:"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- if (last_test)
- set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
+ if (HDF5_TEST_SERIAL)
+ # If using memchecker add tests without using scripts
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME H5DIFF-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> ${ARGN})
+ set_tests_properties (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
+ if (${resultcode})
+ set_tests_properties (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true")
+ endif ()
+ if (last_test)
+ set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
+ endif ()
+ else ()
+ add_test (
+ NAME H5DIFF-${resultfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5diff${tgt_file_ext}>"
+ -D "TEST_ARGS:STRING=${ARGN}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_OUTPUT=${resultfile}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}.txt"
+ -D "TEST_APPEND=EXIT CODE:"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ if (last_test)
+ set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
+ endif ()
endif ()
endif ()
- if (H5_HAVE_PARALLEL)
+ if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL)
ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN})
endif ()
endmacro ()
@@ -399,7 +408,7 @@
macro (ADD_PH5_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME MPI_TEST_H5DIFF-${resultfile} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ph5diff> ${MPIEXEC_POSTFLAGS} ${ARGN})
+ add_test (NAME MPI_TEST_H5DIFF-${resultfile} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ph5diff${tgt_file_ext}> ${MPIEXEC_POSTFLAGS} ${ARGN})
set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/PAR/testfiles")
if (${resultcode})
set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true")
@@ -411,7 +420,7 @@
add_test (
NAME MPI_TEST_H5DIFF-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:ph5diff>;${MPIEXEC_POSTFLAGS}"
+ -D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:ph5diff${tgt_file_ext}>;${MPIEXEC_POSTFLAGS}"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/PAR/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -426,7 +435,7 @@
if (last_test)
set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
endif ()
- set (last_test "PH5DIFF-${resultfile}")
+ set (last_test "MPI_TEST_H5DIFF-${resultfile}")
endif ()
endmacro ()
@@ -1044,7 +1053,10 @@ ADD_H5_TEST (h5diff_56 1 -v ${FILE4} ${FILE4} dset6a dset6b)
ADD_H5_TEST (h5diff_57 0 -v ${FILE4} ${FILE4} dset7a dset7b)
# 5.8 (region reference)
-ADD_H5_TEST (h5diff_58 1 -v ${FILE7} ${FILE8} refreg)
+ADD_H5_TEST (h5diff_58 1 -v2 ${FILE7} ${FILE8} refreg)
+ADD_H5_TEST (h5diff_58_ref 1 -v2 ${FILE7} ${FILE8} /g1/reference2D)
+# STD_REF_OBJ
+ADD_H5_TEST (h5diff_reg 0 -v2 trefer_attr.h5 trefer_ext2.h5 Dataset3 Dataset3)
# test for both dset and attr with same type but with different size
# ( HDDFV-7942 )
@@ -1484,8 +1496,6 @@ ADD_H5_TEST (h5diff_485 0 -v --exclude-path "/group1" h5diff_exclude3-1.h5 h5dif
ADD_H5_TEST (h5diff_486 0 -v --exclude-path "/group1" h5diff_exclude3-2.h5 h5diff_exclude3-1.h5)
ADD_H5_TEST (h5diff_487 1 -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 h5diff_exclude3-2.h5)
-
-
# ##############################################################################
# # diff various multiple vlen and fixed strings in a compound type dataset
# ##############################################################################
@@ -1524,7 +1534,7 @@ ADD_H5_TEST (h5diff_800 1 -v ${FILE7} ${FILE8} /g1/array /g1/array)
ADD_H5_TEST (h5diff_801 1 -v ${FILE7} ${FILE8A} /g1/array /g1/array)
# ##############################################################################
-# VDS tests
+# # VDS tests
# ##############################################################################
ADD_H5_TEST (h5diff_v1 0 -v ${FILEV1} ${FILEV2})
ADD_H5_TEST (h5diff_v2 0 -r ${FILEV1} ${FILEV2})
@@ -1533,7 +1543,7 @@ ADD_H5_TEST (h5diff_v3 0 -c ${FILEV1} ${FILEV2})
##############################################################################
### P L U G I N T E S T S
##############################################################################
-if (BUILD_SHARED_LIBS)
+if (BUILD_SHARED_LIBS AND HDF5_TEST_SERIAL)
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)
endif ()
diff --git a/tools/test/h5diff/dynlib_diff.c b/tools/test/h5diff/dynlib_diff.c
index 571452e..661a6dc 100644
--- a/tools/test/h5diff/dynlib_diff.c
+++ b/tools/test/h5diff/dynlib_diff.c
@@ -69,7 +69,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts,
/* Subtract the original value with MULTIPLIER */
while(buf_left > 0) {
char temp = *int_ptr;
- *int_ptr = temp - MULTIPLIER;
+ *int_ptr = (int8_t)(temp - MULTIPLIER);
int_ptr++;
buf_left -= sizeof(*int_ptr);
} /* end while */
@@ -78,7 +78,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts,
/* Add the original value with MULTIPLIER */
while(buf_left > 0) {
char temp = *int_ptr;
- *int_ptr = temp + MULTIPLIER;
+ *int_ptr = (int8_t)(temp + MULTIPLIER);
int_ptr++;
buf_left -= sizeof(*int_ptr);
} /* end while */
diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c
index d60e393..1d5354f 100644
--- a/tools/test/h5diff/h5diffgentest.c
+++ b/tools/test/h5diff/h5diffgentest.c
@@ -303,8 +303,8 @@ int main(void)
static
int test_basic(const char *fname1, const char *fname2, const char *fname3)
{
- hid_t fid1 = -1, fid2 = -1;
- hid_t gid1 = -1, gid2 = -1, gid3 = -1;
+ hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID;
+ hid_t gid1 = H5I_INVALID_HID, gid2 = H5I_INVALID_HID, gid3 = H5I_INVALID_HID;
hsize_t dims1[1] = { 6 };
hsize_t dims2[2] = { 3, 2 };
@@ -432,14 +432,12 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3)
/* epsilon = 0.0000000000000001 = 1e-16
* system epsilon for double : DBL_EPSILON = 2.22045E-16
*/
- double data13[3][2] = { { H5_DOUBLE(0.0000000000000000), H5_DOUBLE(
- 0.0000000000000001) }, { H5_DOUBLE(0.0000000000000001),
- H5_DOUBLE(0.0000000000000000) }, { H5_DOUBLE(
- 0.00000000000000033), H5_DOUBLE(0.0000000000000001) } };
- double data14[3][2] = { { H5_DOUBLE(0.0000000000000000), H5_DOUBLE(
- 0.0000000000000004) }, { H5_DOUBLE(0.0000000000000002),
- H5_DOUBLE(0.0000000000000001) }, { H5_DOUBLE(
- 0.0000000000000001), H5_DOUBLE(0.00000000000000000) } };
+ double data13[3][2] = { { 0.0000000000000000, 0.0000000000000001 },
+ { 0.0000000000000001, 0.0000000000000000 },
+ { 0.00000000000000033, 0.0000000000000001 } };
+ double data14[3][2] = { { 0.0000000000000000, 0.0000000000000004 },
+ { 0.0000000000000002, 0.0000000000000001 },
+ { 0.0000000000000001, 0.00000000000000000 } };
write_dset(gid1, 2, dims2, "fp1", H5T_NATIVE_FLOAT, data11);
write_dset(gid1, 2, dims2, "fp2", H5T_NATIVE_FLOAT, data12);
@@ -662,11 +660,11 @@ out:
static
int test_types(const char *fname)
{
- hid_t fid1 = -1;
- hid_t gid1 = -1;
- hid_t gid2 = -1;
- hid_t tid1 = -1;
- hid_t tid2 = -1;
+ hid_t fid1 = H5I_INVALID_HID;
+ hid_t gid1 = H5I_INVALID_HID;
+ hid_t gid2 = H5I_INVALID_HID;
+ hid_t tid1 = H5I_INVALID_HID;
+ hid_t tid2 = H5I_INVALID_HID;
herr_t status;
hsize_t dims[1] = { 1 };
typedef struct s1_t {
@@ -787,8 +785,8 @@ int test_types(const char *fname)
static
int test_datatypes(const char *fname)
{
- hid_t fid1 = -1;
- hid_t dset = -1;
+ hid_t fid1 = H5I_INVALID_HID;
+ hid_t dset = H5I_INVALID_HID;
hsize_t dims[2] = { 3, 2 };
herr_t status;
char buf1a[3][2] = { { 1, 1 }, { 1, 1 }, { 1, 1 } };
@@ -977,11 +975,11 @@ int test_datatypes(const char *fname)
static
int test_attributes(const char *file, int make_diffs /* flag to modify data buffers */)
{
- hid_t fid = -1;
- hid_t did = -1;
- hid_t gid = -1;
- hid_t root_id = -1;
- hid_t sid = -1;
+ hid_t fid = H5I_INVALID_HID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID;
+ hid_t root_id = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
hsize_t dims[1] = { 2 };
herr_t status;
@@ -1039,14 +1037,14 @@ int test_attributes(const char *file, int make_diffs /* flag to modify data buff
static int test_attributes_verbose_level(const char *fname1, const char *fname2)
{
herr_t status = SUCCEED;
- hid_t fid1 = -1, fid2 = -1;
- hid_t f1_gid = -1, f2_gid = -1;
- hid_t f1_gid2 = -1, f2_gid2 = -1;
- hid_t f1_gid3 = -1, f2_gid3 = -1;
- hid_t f1_gid4 = -1, f2_gid4 = -1;
- hid_t f1_did = -1, f2_did = -1;
- hid_t f1_sid = -1, f2_sid = -1;
- hid_t f1_tid = -1, f2_tid = -1;
+ hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID;
+ hid_t f1_gid = H5I_INVALID_HID, f2_gid = H5I_INVALID_HID;
+ hid_t f1_gid2 = H5I_INVALID_HID, f2_gid2 = H5I_INVALID_HID;
+ hid_t f1_gid3 = H5I_INVALID_HID, f2_gid3 = H5I_INVALID_HID;
+ hid_t f1_gid4 = H5I_INVALID_HID, f2_gid4 = H5I_INVALID_HID;
+ hid_t f1_did = H5I_INVALID_HID, f2_did = H5I_INVALID_HID;
+ hid_t f1_sid = H5I_INVALID_HID, f2_sid = H5I_INVALID_HID;
+ hid_t f1_tid = H5I_INVALID_HID, f2_tid = H5I_INVALID_HID;
/* dset */
hsize_t dset_dims[1] = { 3 };
int dset_data[3] = { 0, 1, 2 };
@@ -1304,10 +1302,10 @@ out:
static
int test_datasets(const char *file, int make_diffs /* flag to modify data buffers */)
{
- hid_t fid = -1;
- hid_t did = -1;
- hid_t gid = -1;
- hid_t sid = -1;
+ hid_t fid = H5I_INVALID_HID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
hsize_t dims[1] = { 2 };
herr_t status;
int buf[2] = { 1, 2 };
@@ -1357,10 +1355,10 @@ int test_datasets(const char *file, int make_diffs /* flag to modify data buffer
static
int test_special_datasets(const char *file, int make_diffs /* flag to modify data buffers */)
{
- hid_t fid = -1;
- hid_t did = -1;
- hid_t sid0 = -1;
- hid_t sid = -1;
+ hid_t fid = H5I_INVALID_HID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t sid0 = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
hsize_t dims0[SPACE1_RANK] = { SPACE1_DIM1, SPACE1_DIM2 };
hsize_t dims[SPACE1_RANK] = { SPACE1_DIM1, SPACE1_DIM2 };
herr_t status;
@@ -1413,9 +1411,9 @@ int test_special_datasets(const char *file, int make_diffs /* flag to modify dat
*-------------------------------------------------------------------------*/
static int test_link_name(const char *fname1)
{
- hid_t fid1 = -1;
- hid_t gid1 = -1;
- hid_t gid2 = -1;
+ hid_t fid1 = H5I_INVALID_HID;
+ hid_t gid1 = H5I_INVALID_HID;
+ hid_t gid2 = H5I_INVALID_HID;
herr_t status = SUCCEED;
/*-----------------------------------------------------------------------
@@ -1486,8 +1484,8 @@ out:
*-------------------------------------------------------------------------*/
static int test_soft_links(const char *fname1)
{
- hid_t fid1 = -1;
- hid_t gid1 = -1;
+ hid_t fid1 = H5I_INVALID_HID;
+ hid_t gid1 = H5I_INVALID_HID;
hsize_t dims2[2] = { 2, 4 };
int data1[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } };
int data2[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } };
@@ -1605,10 +1603,10 @@ out:
*-------------------------------------------------------------------------*/
static int test_linked_softlinks(const char *fname1)
{
- hid_t fid1 = -1;
- hid_t gid1 = -1;
- hid_t gid2 = -1;
- hid_t gid3 = -1;
+ hid_t fid1 = H5I_INVALID_HID;
+ hid_t gid1 = H5I_INVALID_HID;
+ hid_t gid2 = H5I_INVALID_HID;
+ hid_t gid3 = H5I_INVALID_HID;
hsize_t dims2[2] = { 2, 4 };
int data1[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } };
int data2[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } };
@@ -1786,10 +1784,10 @@ out:
*-------------------------------------------------------------------------*/
static int test_external_links(const char *fname1, const char *fname2)
{
- hid_t fid1 = -1;
- hid_t fid2 = -1;
- hid_t gid1 = -1;
- hid_t gid2 = -1;
+ hid_t fid1 = H5I_INVALID_HID;
+ hid_t fid2 = H5I_INVALID_HID;
+ hid_t gid1 = H5I_INVALID_HID;
+ hid_t gid2 = H5I_INVALID_HID;
hsize_t dims2[2] = { 2, 4 };
int data1[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } };
int data2[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } };
@@ -1931,9 +1929,9 @@ out:
*-------------------------------------------------------------------------*/
static int test_ext2soft_links(const char *fname1, const char *fname2)
{
- hid_t fid1 = -1;
- hid_t fid2 = -1;
- hid_t gid2 = -1;
+ hid_t fid1 = H5I_INVALID_HID;
+ hid_t fid2 = H5I_INVALID_HID;
+ hid_t gid2 = H5I_INVALID_HID;
hsize_t dims2[2] = { 2, 4 };
int data1[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } };
int data2[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } };
@@ -2060,12 +2058,12 @@ out:
static
int gen_dataset_idx(const char *file, int format)
{
- hid_t fid = -1; /* file id */
- hid_t did = -1;
- hid_t did2 = -1; /* dataset id */
- hid_t sid = -1; /* space id */
- hid_t fapl = -1; /* file access property id */
- hid_t dcpl = -1; /* dataset creation property id */
+ hid_t fid = H5I_INVALID_HID; /* file id */
+ hid_t did = H5I_INVALID_HID;
+ hid_t did2 = H5I_INVALID_HID; /* dataset id */
+ hid_t sid = H5I_INVALID_HID; /* space id */
+ hid_t fapl = H5I_INVALID_HID; /* file access property id */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation property id */
hsize_t dims[1] = { 10 }; /* dataset dimension */
hsize_t c_dims[1] = { 2 }; /* chunk dimension */
herr_t status; /* return status */
@@ -2146,8 +2144,8 @@ int gen_dataset_idx(const char *file, int format)
*-------------------------------------------------------------------------*/
static int test_dangle_links(const char *fname1, const char *fname2)
{
- hid_t fid1 = -1;
- hid_t fid2 = -1;
+ hid_t fid1 = H5I_INVALID_HID;
+ hid_t fid2 = H5I_INVALID_HID;
hsize_t dims2[2] = { 2, 4 };
int data1[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } };
int data2[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } };
@@ -2346,10 +2344,10 @@ out:
*-------------------------------------------------------------------------*/
static int test_group_recurse(const char *fname1, const char *fname2)
{
- hid_t fid1 = -1;
- hid_t fid2 = -1;
- hid_t gid1_f1 = -1, gid2_f1 = -1, gid3_f1 = -1, gid10_f1 = -1;
- hid_t gid1_f2 = -1, gid2_f2 = -1, gid3_f2 = -1, gid11_f2 = -1;
+ hid_t fid1 = H5I_INVALID_HID;
+ hid_t fid2 = H5I_INVALID_HID;
+ hid_t gid1_f1 = H5I_INVALID_HID, gid2_f1 = H5I_INVALID_HID, gid3_f1 = H5I_INVALID_HID, gid10_f1 = H5I_INVALID_HID;
+ hid_t gid1_f2 = H5I_INVALID_HID, gid2_f2 = H5I_INVALID_HID, gid3_f2 = H5I_INVALID_HID, gid11_f2 = H5I_INVALID_HID;
hsize_t dims2[2] = { 2, 4 };
int data1[4][2] = { { 0, 1 }, { 0, 1 }, { 1, 0 }, { 1, 0 } };
int data2[4][2] = { { 0, 2 }, { 0, 2 }, { 2, 0 }, { 2, 0 } };
@@ -2758,18 +2756,18 @@ out:
#define GRP_R_DSETNAME2 "dset2"
static int test_group_recurse2(void)
{
- hid_t fileid1 = -1;
- hid_t grp1 = -1;
- hid_t grp2 = -1;
- hid_t grp3 = -1;
- hid_t grp4 = -1;
- hid_t dset1 = -1;
- hid_t dset2 = -1;
- hid_t datatype = -1;
- hid_t dataspace = -1;
- hid_t fileid2 = -1;
- hid_t fileid3 = -1;
- hid_t fileid4 = -1;
+ hid_t fileid1 = H5I_INVALID_HID;
+ hid_t grp1 = H5I_INVALID_HID;
+ hid_t grp2 = H5I_INVALID_HID;
+ hid_t grp3 = H5I_INVALID_HID;
+ hid_t grp4 = H5I_INVALID_HID;
+ hid_t dset1 = H5I_INVALID_HID;
+ hid_t dset2 = H5I_INVALID_HID;
+ hid_t datatype = H5I_INVALID_HID;
+ hid_t dataspace = H5I_INVALID_HID;
+ hid_t fileid2 = H5I_INVALID_HID;
+ hid_t fileid3 = H5I_INVALID_HID;
+ hid_t fileid4 = H5I_INVALID_HID;
hsize_t dimsf[2]; /* dataset dimensions */
herr_t status = 0;
int data1[4][2] = { { 0, 0 }, { 1, 1 }, { 2, 2 }, { 3, 3 } };
@@ -3069,10 +3067,10 @@ out:
*-------------------------------------------------------------------------*/
static int test_exclude_obj1(const char *fname1, const char *fname2)
{
- hid_t fid1 = -1;
- hid_t fid2 = -1;
- hid_t gid1 = -1;
- hid_t gid2 = -1;
+ hid_t fid1 = H5I_INVALID_HID;
+ hid_t fid2 = H5I_INVALID_HID;
+ hid_t gid1 = H5I_INVALID_HID;
+ hid_t gid2 = H5I_INVALID_HID;
hsize_t dims2[2] = { 2, 4 };
int data1[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } };
int data2[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } };
@@ -3189,11 +3187,11 @@ out:
*-------------------------------------------------------------------------*/
static int test_exclude_obj2(const char *fname1, const char *fname2)
{
- hid_t fid1 = -1;
- hid_t fid2 = -1;
- hid_t gid1 = -1;
- hid_t gid2 = -1;
- hid_t gid3 = -1;
+ hid_t fid1 = H5I_INVALID_HID;
+ hid_t fid2 = H5I_INVALID_HID;
+ hid_t gid1 = H5I_INVALID_HID;
+ hid_t gid2 = H5I_INVALID_HID;
+ hid_t gid3 = H5I_INVALID_HID;
hsize_t dims2[2] = { 2, 4 };
int data1[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } };
int data2[4][2] = { { 0, 1 }, { 2, 3 }, { 1, 2 }, { 3, 4 } };
@@ -3320,9 +3318,9 @@ out:
*-------------------------------------------------------------------------*/
static int test_exclude_obj3(const char *fname1, const char *fname2)
{
- hid_t fid1 = -1;
- hid_t fid2 = -1;
- hid_t gid1 = -1;
+ hid_t fid1 = H5I_INVALID_HID;
+ hid_t fid2 = H5I_INVALID_HID;
+ hid_t gid1 = H5I_INVALID_HID;
hsize_t dims2[2] = { 2, 4 };
int data1[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } };
herr_t status = SUCCEED;
@@ -3416,8 +3414,8 @@ out:
static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new)
{
int i;
- hid_t fid1 = -1; /* file id */
- hid_t gid = -1;
+ hid_t fid1 = H5I_INVALID_HID; /* file id */
+ hid_t gid = H5I_INVALID_HID;
/* compound1 datatype */
typedef struct comp1_t {
@@ -3534,21 +3532,21 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
} comp9_t;
/* vlen string */
- hid_t sid_vlen_str = -1; /* dataspace ID */
- hid_t tid_vlen_str = -1; /* datatype ID */
+ hid_t sid_vlen_str = H5I_INVALID_HID; /* dataspace ID */
+ hid_t tid_vlen_str = H5I_INVALID_HID; /* datatype ID */
char vlen_str_buf[] = { "Variable length string" };
hsize_t dims_vlen_str[] = { VLEN_STR_DIM };
/* fixlen string */
- hid_t sid_fixlen_str = -1; /* dataspace ID */
- hid_t tid_fixlen_str = -1; /* datatype ID */
+ hid_t sid_fixlen_str = H5I_INVALID_HID; /* dataspace ID */
+ hid_t tid_fixlen_str = H5I_INVALID_HID; /* datatype ID */
const char fixlen_str_buf[FIXLEN_STR_SIZE] = { "Fixed length string" };
hsize_t dims_fixlen_str[] = { FIXLEN_STR_DIM };
/* vlen string array */
- hid_t sid_vlen_str_array = -1; /* dataspace ID */
- hid_t tid_vlen_str_array_pre = -1; /* datatype ID */
- hid_t tid_vlen_str_array = -1; /* datatype ID */
+ hid_t sid_vlen_str_array = H5I_INVALID_HID; /* dataspace ID */
+ hid_t tid_vlen_str_array_pre = H5I_INVALID_HID; /* datatype ID */
+ hid_t tid_vlen_str_array = H5I_INVALID_HID; /* datatype ID */
const char *vlen_str_array_buf[VLEN_STR_ARRY_DIM] =
{ "1 - Variable length string Array",
"2 - Testing variable length string array in compound type",
@@ -3556,9 +3554,9 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
hsize_t dims_vlen_str_array[] = { VLEN_STR_ARRY_DIM };
/* fixlen string array */
- hid_t sid_fixlen_str_array = -1; /* dataspace ID */
- hid_t tid_fixlen_str_array_pre = -1; /* datatype ID */
- hid_t tid_fixlen_str_array = -1; /* datatype ID */
+ hid_t sid_fixlen_str_array = H5I_INVALID_HID; /* dataspace ID */
+ hid_t tid_fixlen_str_array_pre = H5I_INVALID_HID; /* datatype ID */
+ hid_t tid_fixlen_str_array = H5I_INVALID_HID; /* datatype ID */
const char *fixlen_str_array_buf[FIXLEN_STR_ARRY_DIM] = {
"1 - Fixed length string Array", "2 - Fixed length string Array",
"3 - Fixed length string Array" };
@@ -3567,17 +3565,17 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
/*------------------------------------------
* compound dataset
*------------------------------------------*/
- hid_t sid_comp = -1; /* dataspace ID */
- hid_t tid1_comp = -1; /* datatype ID */
- hid_t tid2_comp = -1; /* datatype ID */
- hid_t tid3_comp = -1; /* datatype ID */
- hid_t tid4_comp = -1; /* datatype ID */
- hid_t tid5_comp = -1; /* datatype ID */
- hid_t tid6_comp = -1; /* datatype ID */
- hid_t tid7_comp = -1; /* datatype ID */
- hid_t tid8_comp = -1; /* datatype ID */
- hid_t tid9_comp = -1; /* datatype ID */
- hid_t did_comp = -1; /* dataset ID */
+ hid_t sid_comp = H5I_INVALID_HID; /* dataspace ID */
+ hid_t tid1_comp = H5I_INVALID_HID; /* datatype ID */
+ hid_t tid2_comp = H5I_INVALID_HID; /* datatype ID */
+ hid_t tid3_comp = H5I_INVALID_HID; /* datatype ID */
+ hid_t tid4_comp = H5I_INVALID_HID; /* datatype ID */
+ hid_t tid5_comp = H5I_INVALID_HID; /* datatype ID */
+ hid_t tid6_comp = H5I_INVALID_HID; /* datatype ID */
+ hid_t tid7_comp = H5I_INVALID_HID; /* datatype ID */
+ hid_t tid8_comp = H5I_INVALID_HID; /* datatype ID */
+ hid_t tid9_comp = H5I_INVALID_HID; /* datatype ID */
+ hid_t did_comp = H5I_INVALID_HID; /* dataset ID */
hsize_t dims_comp[] = { COMP_DIM };
herr_t status = SUCCEED;
@@ -4020,7 +4018,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
}
H5Dclose(did_comp);
- did_comp = -1;
+ did_comp = H5I_INVALID_HID;
out:
/*-----------------------------------------------------------------------
@@ -4091,9 +4089,9 @@ out:
static int test_enums(const char *fname)
{
- hid_t fid = -1;
+ hid_t fid = H5I_INVALID_HID;
- hid_t tid = -1;
+ hid_t tid = H5I_INVALID_HID;
int enum_val = -1;
/* The data in the two arrays cover the following cases:
@@ -4217,17 +4215,17 @@ static void test_comps_array(const char *fname, const char *dset, const char *at
cmpd1_t wdata[SDIM_DSET]; /* dataset with compound1 */
- hid_t fid = -1; /* HDF5 File IDs */
- hid_t did_dset = -1; /* Dataset ID */
- hid_t sid_dset = -1; /* Dataset space ID */
- hid_t tid_cmpd1 = -1; /* Compound1 type ID */
- hid_t tid_arry1 = -1; /* Array type ID in compound1 */
- hid_t tid_cmpd2 = -1; /* Compound2 type ID */
- hid_t tid_attr = -1;
+ hid_t fid = H5I_INVALID_HID; /* HDF5 File IDs */
+ hid_t did_dset = H5I_INVALID_HID; /* Dataset ID */
+ hid_t sid_dset = H5I_INVALID_HID; /* Dataset space ID */
+ hid_t tid_cmpd1 = H5I_INVALID_HID; /* Compound1 type ID */
+ hid_t tid_arry1 = H5I_INVALID_HID; /* Array type ID in compound1 */
+ hid_t tid_cmpd2 = H5I_INVALID_HID; /* Compound2 type ID */
+ hid_t tid_attr = H5I_INVALID_HID;
hsize_t sdims_dset[] = { SDIM_DSET };
hsize_t sdims_cmpd_arry[] = { SDIM_CMPD_ARRAY };
int i, j;
- herr_t ret; /* Generic return value */
+ herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */
/* Initialize array data to write */
for (i = 0; i < SDIM_DSET; i++) {
@@ -4326,17 +4324,17 @@ static void test_comps_vlen(const char * fname, const char *dset, const char *at
cmpd1_t wdata[SDIM_DSET]; /* Dataset for compound1 */
- hid_t fid = -1; /* HDF5 File ID */
- hid_t did_dset = -1; /* dataset ID */
- hid_t sid_dset = -1; /* dataset space ID */
- hid_t tid_attr = -1;
- hid_t tid_cmpd2 = -1; /* compound2 type ID */
- hid_t tid_cmpd1 = -1; /* compound1 type ID */
- hid_t tid_cmpd1_vlen = -1;
+ hid_t fid = H5I_INVALID_HID; /* HDF5 File ID */
+ hid_t did_dset = H5I_INVALID_HID; /* dataset ID */
+ hid_t sid_dset = H5I_INVALID_HID; /* dataset space ID */
+ hid_t tid_attr = H5I_INVALID_HID;
+ hid_t tid_cmpd2 = H5I_INVALID_HID; /* compound2 type ID */
+ hid_t tid_cmpd1 = H5I_INVALID_HID; /* compound1 type ID */
+ hid_t tid_cmpd1_vlen = H5I_INVALID_HID;
hsize_t sdims_dset[] = { SDIM_DSET };
unsigned i, j; /* counting variables */
- herr_t ret; /* Generic return value */
+ herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */
/* Allocate and initialize VL data to write */
for (i = 0; i < SDIM_DSET; i++) {
@@ -4403,7 +4401,7 @@ static void test_comps_vlen(const char * fname, const char *dset, const char *at
assert(ret >= 0);
/* Reclaim the write VL data */
- ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
assert(ret >= 0);
/* ----------------
@@ -4442,19 +4440,19 @@ static void test_comps_array_vlen(const char * fname, const char *dset, const ch
} cmpd1_t;
cmpd1_t wdata[SDIM_DSET]; /* Information to write */
- hid_t fid = -1; /* HDF5 File IDs */
- hid_t did_dset = -1; /* Dataset ID */
- hid_t sid_dset = -1; /* Dataspace ID */
- hid_t tid_attr = -1;
- hid_t tid_cmpd1 = -1; /* Compound1 Datatype ID */
- hid_t tid_arry1 = -1; /* Array Datatype ID */
- hid_t tid_cmpd2 = -1; /* Compound2 Datatype ID */
- hid_t tid_cmpd2_vlen = -1;
- hid_t tid_cmpd3 = -1; /* Compound3 Datatype ID */
+ hid_t fid = H5I_INVALID_HID; /* HDF5 File IDs */
+ hid_t did_dset = H5I_INVALID_HID; /* Dataset ID */
+ hid_t sid_dset = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t tid_attr = H5I_INVALID_HID;
+ hid_t tid_cmpd1 = H5I_INVALID_HID; /* Compound1 Datatype ID */
+ hid_t tid_arry1 = H5I_INVALID_HID; /* Array Datatype ID */
+ hid_t tid_cmpd2 = H5I_INVALID_HID; /* Compound2 Datatype ID */
+ hid_t tid_cmpd2_vlen = H5I_INVALID_HID;
+ hid_t tid_cmpd3 = H5I_INVALID_HID; /* Compound3 Datatype ID */
hsize_t sdims_dset[] = { SDIM_DSET };
hsize_t sdims_arry[] = { SDIM_CMPD_ARRAY };
unsigned i, j, k; /* counting variables */
- herr_t ret; /* Generic return value */
+ herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */
/* Initialize array data to write in compound1 */
for (i = 0; i < SDIM_DSET; i++) {
@@ -4537,7 +4535,7 @@ static void test_comps_array_vlen(const char * fname, const char *dset, const ch
assert(ret >= 0);
/* Reclaim the write VL data */
- ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
assert(ret >= 0);
/*-------------------
@@ -4584,20 +4582,20 @@ static void test_comps_vlen_arry(const char * fname, const char *dset, const cha
cmpd1_t wdata[SDIM_DSET]; /* Dataset for compound1 */
- hid_t fid = -1; /* HDF5 File ID */
- hid_t did_dset = -1; /* dataset ID */
- hid_t sid_dset = -1; /* dataset space ID */
- hid_t tid_attr = -1;
- hid_t tid_cmpd3 = -1; /* compound3 type ID */
- hid_t tid_cmpd2 = -1; /* compound2 type ID */
- hid_t tid_cmpd2_arry = -1;
- hid_t tid_cmpd1 = -1; /* compound1 type ID */
- hid_t tid_cmpd1_vlen = -1;
+ hid_t fid = H5I_INVALID_HID; /* HDF5 File ID */
+ hid_t did_dset = H5I_INVALID_HID; /* dataset ID */
+ hid_t sid_dset = H5I_INVALID_HID; /* dataset space ID */
+ hid_t tid_attr = H5I_INVALID_HID;
+ hid_t tid_cmpd3 = H5I_INVALID_HID; /* compound3 type ID */
+ hid_t tid_cmpd2 = H5I_INVALID_HID; /* compound2 type ID */
+ hid_t tid_cmpd2_arry = H5I_INVALID_HID;
+ hid_t tid_cmpd1 = H5I_INVALID_HID; /* compound1 type ID */
+ hid_t tid_cmpd1_vlen = H5I_INVALID_HID;
hsize_t sdims_dset[] = { SDIM_DSET };
hsize_t sdims_cmpd_arry[] = { SDIM_CMPD_ARRAY };
unsigned i, j, k; /* counting variables */
- herr_t ret; /* Generic return value */
+ herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */
/* Allocate and initialize VL data to write */
for (i = 0; i < SDIM_DSET; i++) {
@@ -4680,7 +4678,7 @@ static void test_comps_vlen_arry(const char * fname, const char *dset, const cha
assert(ret >= 0);
/* Reclaim the write VL data */
- ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
assert(ret >= 0);
/* ----------------
@@ -4717,14 +4715,14 @@ static void test_comps_vlen_arry(const char * fname, const char *dset, const cha
#define DIM_ARRY 3
static void test_data_nocomparables(const char * fname, int make_diffs)
{
- hid_t fid = -1;
- hid_t gid1 = -1;
- hid_t gid2 = -1;
- hid_t did1 = -1;
- hid_t did2 = -1;
- hid_t sid1 = -1;
- hid_t tid_dset1 = -1;
- hid_t tid_attr1 = -1;
+ hid_t fid = H5I_INVALID_HID;
+ hid_t gid1 = H5I_INVALID_HID;
+ hid_t gid2 = H5I_INVALID_HID;
+ hid_t did1 = H5I_INVALID_HID;
+ hid_t did2 = H5I_INVALID_HID;
+ hid_t sid1 = H5I_INVALID_HID;
+ hid_t tid_dset1 = H5I_INVALID_HID;
+ hid_t tid_attr1 = H5I_INVALID_HID;
hsize_t dims1_1[1] = { DIM_ARRY };
hsize_t dims1_2[1] = { DIM_ARRY + 1 };
hsize_t dims2[2] = { DIM_ARRY, 1 };
@@ -4913,14 +4911,14 @@ out:
static void
test_objs_nocomparables(const char *fname1, const char *fname2)
{
- hid_t fid1 = -1;
- hid_t fid2 = -1;
- hid_t topgid1 = -1;
- hid_t topgid2 = -1;
- hid_t gid1 = -1;
- hid_t tid1 = -1;
- hid_t gid2 = -1;
- hid_t tid2 = -1;
+ hid_t fid1 = H5I_INVALID_HID;
+ hid_t fid2 = H5I_INVALID_HID;
+ hid_t topgid1 = H5I_INVALID_HID;
+ hid_t topgid2 = H5I_INVALID_HID;
+ hid_t gid1 = H5I_INVALID_HID;
+ hid_t tid1 = H5I_INVALID_HID;
+ hid_t gid2 = H5I_INVALID_HID;
+ hid_t tid2 = H5I_INVALID_HID;
hsize_t dims[1] = { DIM_ARRY };
int data1[DIM_ARRY] = { 1, 1, 1 };
int data2[DIM_ARRY] = { 2, 2, 2 };
@@ -5039,12 +5037,12 @@ static hid_t mkstr(int size, H5T_str_t pad)
*-------------------------------------------------------------------------*/
static void test_objs_strings(const char *fname1, const char *fname2)
{
- hid_t fid1 = -1;
- hid_t fid2 = -1;
- hid_t dataset = -1;
- hid_t space = -1;
- hid_t f_type = -1;
- hid_t m_type = -1;
+ hid_t fid1 = H5I_INVALID_HID;
+ hid_t fid2 = H5I_INVALID_HID;
+ hid_t dataset = H5I_INVALID_HID;
+ hid_t space = H5I_INVALID_HID;
+ hid_t f_type = H5I_INVALID_HID;
+ hid_t m_type = H5I_INVALID_HID;
hsize_t dims1[] = { 3, 4 };
char string1A[12][3] = { "s1", "s2", "s3", "s4", "s5", "s6", "s", "s", "s9",
"s0", "s1", "s2" };
@@ -5211,10 +5209,10 @@ void write_attr_strings(hid_t loc_id, const char* dset_name, hid_t fid, int make
RED, GREEN
} e_t;
- hid_t aid = -1;
- hid_t sid = -1;
- hid_t tid = -1;
- herr_t status;
+ hid_t aid = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
+ herr_t H5_ATTR_NDEBUG_UNUSED status;
int val, i, j, k, l, n;
float f;
@@ -5446,7 +5444,7 @@ void write_attr_strings(hid_t loc_id, const char* dset_name, hid_t fid, int make
aid = H5Acreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(aid, tid, buf5);
assert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf5);
assert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
@@ -5712,7 +5710,7 @@ void write_attr_strings(hid_t loc_id, const char* dset_name, hid_t fid, int make
aid = H5Acreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(aid, tid, buf52);
assert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf52);
assert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
@@ -6108,7 +6106,7 @@ void write_attr_strings(hid_t loc_id, const char* dset_name, hid_t fid, int make
aid = H5Acreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(aid, tid, buf53);
assert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf53);
assert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
@@ -6202,10 +6200,10 @@ void write_attr_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diff
RED, GREEN
} e_t;
- hid_t aid = -1;
- hid_t sid = -1;
- hid_t tid = -1;
- herr_t status;
+ hid_t aid = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
+ herr_t H5_ATTR_NDEBUG_UNUSED status;
int val, i, j, k, l, n;
float f;
@@ -6434,7 +6432,7 @@ void write_attr_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diff
aid = H5Acreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(aid, tid, buf5);
assert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf5);
assert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
@@ -6702,7 +6700,7 @@ void write_attr_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diff
aid = H5Acreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(aid, tid, buf52);
assert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf52);
assert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
@@ -7100,7 +7098,7 @@ void write_attr_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diff
aid = H5Acreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(aid, tid, buf53);
assert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf53);
assert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
@@ -7193,11 +7191,11 @@ void write_dset_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diff
RED, GREEN
} e_t;
- hid_t did = -1;
- hid_t sid = -1;
- hid_t tid = -1;
- hid_t dcpl = -1;
- herr_t status;
+ hid_t did = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
+ hid_t dcpl = H5I_INVALID_HID;
+ herr_t H5_ATTR_NDEBUG_UNUSED status;
int val, i, j, k, l, n;
float f;
int fillvalue = 2;
@@ -7395,7 +7393,7 @@ void write_dset_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diff
H5P_DEFAULT);
status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5);
HDassert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf5);
HDassert(status >= 0);
status = H5Dclose(did);
status = H5Tclose(tid);
@@ -7417,9 +7415,9 @@ void write_dset_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diff
{
double *dbuf; /* information to write */
- hid_t ldid = -1; /* dataset ID */
- hid_t lsid = -1; /* dataspace ID */
- hid_t ltid = -1; /* datatype ID */
+ hid_t ldid = H5I_INVALID_HID; /* dataset ID */
+ hid_t lsid = H5I_INVALID_HID; /* dataspace ID */
+ hid_t ltid = H5I_INVALID_HID; /* datatype ID */
size_t size;
hsize_t sdims[] = { 1 };
hsize_t tdims[] = { H5TOOLS_MALLOCSIZE / sizeof(double) + 1 };
@@ -7580,7 +7578,7 @@ void write_dset_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diff
did = H5Dcreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf52);
assert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf52);
assert(status >= 0);
status = H5Dclose(did);
status = H5Tclose(tid);
@@ -7759,7 +7757,7 @@ void write_dset_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diff
did = H5Dcreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf53);
assert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf53);
assert(status >= 0);
status = H5Dclose(did);
status = H5Tclose(tid);
@@ -7820,19 +7818,19 @@ static
void gen_datareg(hid_t fid, int make_diffs /* flag to modify data buffers */)
{
/* data dataset */
- hid_t did1 = -1; /* dataset ID */
- hid_t sid1 = -1; /* dataspace ID */
+ hid_t did1 = H5I_INVALID_HID; /* dataset ID */
+ hid_t sid1 = H5I_INVALID_HID; /* dataspace ID */
hsize_t dims1[2] = { 10, 10 };/* dimensions */
int *buf; /* dataset buffer */
/* reference dataset */
- hid_t did2 = -1; /* dataset ID */
- hid_t sid2 = -1; /* dataspace ID */
+ hid_t did2 = H5I_INVALID_HID; /* dataset ID */
+ hid_t sid2 = H5I_INVALID_HID; /* dataspace ID */
hsize_t dims2[] = { 2 }; /* 2 references */
hdset_reg_ref_t *rbuf; /* buffer for write the references */
hsize_t start[10]; /* starting location of hyperslab */
hsize_t count[10]; /* element count of hyperslab */
hsize_t coord[5][2]; /* coordinates for point selection */
- herr_t status;
+ herr_t H5_ATTR_NDEBUG_UNUSED status;
int i;
/* allocate the buffer for write the references */
@@ -7931,12 +7929,12 @@ void gen_datareg(hid_t fid, int make_diffs /* flag to modify data buffers */)
static
int test_hyperslab(const char *fname, int make_diffs /* flag to modify data buffers */)
{
- hid_t did = -1;
- hid_t fid = -1;
- hid_t f_sid = -1;
- hid_t m_sid = -1;
- hid_t tid = -1;
- hid_t dcpl = -1;
+ hid_t did = H5I_INVALID_HID;
+ hid_t fid = H5I_INVALID_HID;
+ hid_t f_sid = H5I_INVALID_HID;
+ hid_t m_sid = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
+ hid_t dcpl = H5I_INVALID_HID;
hsize_t dims[1] = { GBLL }; /* dataset dimensions */
hsize_t hs_size[1] = { GBLL / (1024 * 1024) }; /* hyperslab dimensions */
hsize_t chunk_dims[1] = { GBLL / 1024 }; /* chunk dimensions */
@@ -8030,8 +8028,8 @@ out:
static
int write_attr(hid_t loc_id, int rank, hsize_t *dims, const char *name, hid_t tid, void *buf)
{
- hid_t aid = -1;
- hid_t sid = -1;
+ hid_t aid = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
/* create a space */
if ((sid = H5Screate_simple(rank, dims, NULL)) < 0)
@@ -8070,8 +8068,8 @@ out:
static herr_t
write_dset(hid_t loc_id, int rank, hsize_t *dims, const char *name, hid_t tid, void *buf)
{
- hid_t did = -1;
- hid_t sid = -1;
+ hid_t did = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
/* create a space */
if((sid = H5Screate_simple(rank, dims, NULL)) < 0)
diff --git a/tools/test/h5diff/testfiles/h5diff_58.txt b/tools/test/h5diff/testfiles/h5diff_58.txt
index d27a0c9..da147bc 100644
--- a/tools/test/h5diff/testfiles/h5diff_58.txt
+++ b/tools/test/h5diff/testfiles/h5diff_58.txt
@@ -1,3 +1,4 @@
+
dataset: </refreg> and </refreg>
Referenced dataset 10784 10784
------------------------------------------------------------
@@ -8,4 +9,7 @@ point #1 (2,2) (3,3)
point #3 (1,6) (2,5)
point #4 (2,8) (1,7)
4 differences found
+ obj1 obj2
+ --------------------------------------
+Attributes status: 0 common, 0 only in obj1, 0 only in obj2
EXIT CODE: 1
diff --git a/tools/test/h5diff/testfiles/h5diff_58_ref.txt b/tools/test/h5diff/testfiles/h5diff_58_ref.txt
new file mode 100644
index 0000000..6fa2299
--- /dev/null
+++ b/tools/test/h5diff/testfiles/h5diff_58_ref.txt
@@ -0,0 +1,37 @@
+
+dataset: </g1/reference2D> and </g1/reference2D>
+size: [2] [2]
+position difference
+------------------------------------------------------------
+[ 0 ] 1 0 1
+[ 1 ] 2 0 2
+size: [2] [2]
+position difference
+------------------------------------------------------------
+[ 0 ] 1 0 1
+[ 1 ] 2 0 2
+size: [2] [2]
+position difference
+------------------------------------------------------------
+[ 0 ] 1 0 1
+[ 1 ] 2 0 2
+size: [2] [2]
+position difference
+------------------------------------------------------------
+[ 0 ] 1 0 1
+[ 1 ] 2 0 2
+size: [2] [2]
+position difference
+------------------------------------------------------------
+[ 0 ] 1 0 1
+[ 1 ] 2 0 2
+size: [2] [2]
+position difference
+------------------------------------------------------------
+[ 0 ] 1 0 1
+[ 1 ] 2 0 2
+12 differences found
+ obj1 obj2
+ --------------------------------------
+Attributes status: 0 common, 0 only in obj1, 0 only in obj2
+EXIT CODE: 1
diff --git a/tools/test/h5diff/testfiles/h5diff_reg.txt b/tools/test/h5diff/testfiles/h5diff_reg.txt
new file mode 100644
index 0000000..d4f5415
--- /dev/null
+++ b/tools/test/h5diff/testfiles/h5diff_reg.txt
@@ -0,0 +1,15 @@
+
+dataset: </Dataset3> and </Dataset3>
+attribute: <Attr1 of <(null)>> and <Attr1 of <(null)>>
+0 differences found
+Warning: Cannot open referenced attribute: attribute 1
+Warning: Cannot open referenced attribute: attribute 2
+attribute: <Attr2 of <(null)>> and <Attr2 of <(null)>>
+0 differences found
+attribute: <Attr3 of <(null)>> and <Attr3 of <(null)>>
+0 differences found
+0 differences found
+ obj1 obj2
+ --------------------------------------
+Attributes status: 0 common, 0 only in obj1, 0 only in obj2
+EXIT CODE: 0
diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in
index 557d2ff..2d490a8 100644
--- a/tools/test/h5diff/testh5diff.sh.in
+++ b/tools/test/h5diff/testh5diff.sh.in
@@ -150,6 +150,19 @@ $SRC_TOOLS_TESTFILES/vds/5_c.h5
$SRC_TOOLS_TESTFILES/vds/5_vds.h5
"
+LIST_HDF5_STD_REF_OBJ_TEST_FILES="
+$SRC_TOOLS_TESTFILES/trefer_attr.h5
+$SRC_TOOLS_TESTFILES/trefer_compat.h5
+$SRC_TOOLS_TESTFILES/trefer_ext1.h5
+$SRC_TOOLS_TESTFILES/trefer_ext2.h5
+$SRC_TOOLS_TESTFILES/trefer_grp.h5
+$SRC_TOOLS_TESTFILES/trefer_obj_del.h5
+$SRC_TOOLS_TESTFILES/trefer_obj.h5
+$SRC_TOOLS_TESTFILES/trefer_param.h5
+$SRC_TOOLS_TESTFILES/trefer_reg_1d.h5
+$SRC_TOOLS_TESTFILES/trefer_reg.h5
+"
+
LIST_OTHER_TEST_FILES="
$SRC_H5DIFF_TESTFILES/h5diff_10.txt
$SRC_H5DIFF_TESTFILES/h5diff_100.txt
@@ -259,6 +272,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_55.txt
$SRC_H5DIFF_TESTFILES/h5diff_56.txt
$SRC_H5DIFF_TESTFILES/h5diff_57.txt
$SRC_H5DIFF_TESTFILES/h5diff_58.txt
+$SRC_H5DIFF_TESTFILES/h5diff_58_ref.txt
$SRC_H5DIFF_TESTFILES/h5diff_59.txt
$SRC_H5DIFF_TESTFILES/h5diff_500.txt
$SRC_H5DIFF_TESTFILES/h5diff_501.txt
@@ -338,6 +352,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_80.txt
$SRC_H5DIFF_TESTFILES/h5diff_90.txt
$SRC_H5DIFF_TESTFILES/h5diff_8625.txt
$SRC_H5DIFF_TESTFILES/h5diff_8639.txt
+$SRC_H5DIFF_TESTFILES/h5diff_reg.txt
$SRC_H5DIFF_TESTFILES/h5diff_v1.txt
$SRC_H5DIFF_TESTFILES/h5diff_v2.txt
$SRC_H5DIFF_TESTFILES/h5diff_v3.txt
@@ -347,7 +362,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_vlstr.txt
#
# copy test files and expected output files from source dirs to test dir
#
-COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_HDF5_VDS_TEST_FILES $LIST_OTHER_TEST_FILES $LIST_HDF5_TEST_FILES_XML $LIST_OTHER_TEST_FILES_XML"
+COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_HDF5_VDS_TEST_FILES $LIST_HDF5_STD_REF_OBJ_TEST_FILES $LIST_OTHER_TEST_FILES $LIST_HDF5_TEST_FILES_XML $LIST_OTHER_TEST_FILES_XML"
COPY_TESTFILES_TO_TESTDIR()
{
@@ -691,7 +706,10 @@ TOOLTEST h5diff_56.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset6a dset6b
TOOLTEST h5diff_57.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset7a dset7b
# 5.8 (region reference)
-TOOLTEST h5diff_58.txt -v h5diff_dset1.h5 h5diff_dset2.h5 refreg
+TOOLTEST h5diff_58.txt -v2 h5diff_dset1.h5 h5diff_dset2.h5 refreg
+TOOLTEST h5diff_58_ref.txt -v2 h5diff_dset1.h5 h5diff_dset2.h5 /g1/reference2D
+# STD_REF_OBJ
+TOOLTEST h5diff_reg.txt -v2 trefer_attr.h5 trefer_ext2.h5 Dataset3 Dataset3
# test for both dset and attr with same type but with different size
# ( HDDFV-7942 )
diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt
index 38f4118..b9e4ef5 100644
--- a/tools/test/h5dump/CMakeLists.txt
+++ b/tools/test/h5dump/CMakeLists.txt
@@ -43,10 +43,12 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
#add_test (NAME h5dumpgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dumpgentest>)
endif ()
-include (CMakeTests.cmake)
+if (HDF5_TEST_TOOLS AND HDF5_TEST_SERIAL)
+ include (CMakeTests.cmake)
-include (CMakeTestsPBITS.cmake)
+ include (CMakeTestsPBITS.cmake)
-include (CMakeTestsVDS.cmake)
+ include (CMakeTestsVDS.cmake)
-include (CMakeTestsXML.cmake)
+ include (CMakeTestsXML.cmake)
+endif ()
diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake
index 6299821..187328e 100644
--- a/tools/test/h5dump/CMakeTests.cmake
+++ b/tools/test/h5dump/CMakeTests.cmake
@@ -198,6 +198,16 @@
${HDF5_TOOLS_DIR}/testfiles/h5dump-help.txt
${HDF5_TOOLS_DIR}/testfiles/out3.h5import
${HDF5_TOOLS_DIR}/testfiles/zerodim.ddl
+ #STD_REF_OBJ files
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_attrR.ddl
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_compatR.ddl
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_extR.ddl
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_grpR.ddl
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_obj_delR.ddl
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_objR.ddl
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_paramR.ddl
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_reg_1dR.ddl
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_regR.ddl
)
set (HDF5_N_REFERENCE_FILES
tall-3
@@ -322,6 +332,18 @@
${HDF5_TOOLS_DIR}/testfiles/tvms.h5
${HDF5_TOOLS_DIR}/testfiles/t128bit_float.h5
${HDF5_TOOLS_DIR}/testfiles/zerodim.h5
+ #STD_REF_OBJ files
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_attr.h5
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_compat.h5
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_ext1.h5
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_ext2.h5
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_grp.h5
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_obj_del.h5
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_obj.h5
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_param.h5
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_reg_1d.h5
+ ${HDF5_TOOLS_DIR}/testfiles/trefer_reg.h5
+
)
set (HDF5_ERROR_REFERENCE_TEST_FILES
${PROJECT_SOURCE_DIR}/errfiles/filter_fail.err
@@ -398,16 +420,10 @@
##############################################################################
##############################################################################
- if (NOT BUILD_SHARED_LIBS)
- set (tgt_ext "")
- else ()
- set (tgt_ext "-shared")
- endif ()
-
macro (ADD_HELP_TEST testname resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
+ add_test (NAME H5DUMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN})
set_tests_properties (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
if (last_test)
set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test})
@@ -418,7 +434,7 @@
NAME H5DUMP-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=h5dump-${testname}.out"
@@ -449,7 +465,7 @@
macro (ADD_H5_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
@@ -467,7 +483,7 @@
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -482,7 +498,7 @@
macro (ADD_H5_TEST_N resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-N-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
+ add_test (NAME H5DUMP-N-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN})
set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
if (${resultcode})
set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true")
@@ -500,7 +516,7 @@
NAME H5DUMP-N-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}-N.out"
@@ -515,7 +531,7 @@
macro (ADD_H5_TEST_EXPORT resultfile targetfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN} ${resultfile}.txt ${targetfile})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN} ${resultfile}.txt ${targetfile})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
@@ -533,7 +549,7 @@
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN};${resultfile}.txt;${targetfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -556,7 +572,7 @@
macro (ADD_H5_TEST_EXPORT_DDL resultfile targetfile resultcode ddlfile)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
@@ -576,7 +592,7 @@
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=--ddl=${ddlfile}.txt;${ARGN};${resultfile}.txt;${targetfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -611,7 +627,7 @@
set_tests_properties (H5DUMP-output-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
NAME H5DUMP-output-${resultfile}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN} ${resultfile}.txt ${targetfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN} ${resultfile}.txt ${targetfile}
)
set_tests_properties (H5DUMP-output-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
set_tests_properties (H5DUMP-output-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}-clear-objects)
@@ -632,7 +648,7 @@
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -650,7 +666,7 @@
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -667,7 +683,7 @@
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -685,7 +701,7 @@
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -713,7 +729,7 @@
NAME H5DUMP-IMPORT-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN};-o;${resultfile}.bin;${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${conffile}.out"
@@ -722,10 +738,10 @@
-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 ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import> ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5)
+ add_test (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_file_ext}> ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5)
set_tests_properties (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
set_tests_properties (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-${resultfile})
- add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff> ${testfile} ${resultfile}.h5 /integer /integer)
+ add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> ${testfile} ${resultfile}.h5 /integer /integer)
set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-h5import-${resultfile})
endif ()
@@ -737,7 +753,7 @@
NAME H5DUMP_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -892,7 +908,7 @@
# test for files with array data
ADD_H5_TEST (tarray1 0 --enable-error-stack tarray1.h5)
# # added for bug# 2092 - tarray1_big.h5
- ADD_H5ERR_MASK_TEST (tarray1_big 0 "Undefined reference pointer" --enable-error-stack -R tarray1_big.h5)
+ ADD_H5ERR_MASK_TEST (tarray1_big 0 "NULL token size" --enable-error-stack -R tarray1_big.h5)
ADD_H5_TEST (tarray2 0 --enable-error-stack tarray2.h5)
ADD_H5_TEST (tarray3 0 --enable-error-stack tarray3.h5)
ADD_H5_TEST (tarray4 0 --enable-error-stack tarray4.h5)
@@ -1103,11 +1119,22 @@
# test for dataset region references
ADD_H5_TEST (tdatareg 0 --enable-error-stack tdatareg.h5)
- ADD_H5ERR_MASK_TEST (tdataregR 0 "Undefined reference pointer" --enable-error-stack -R tdatareg.h5)
+ ADD_H5ERR_MASK_TEST (tdataregR 0 "NULL token size" --enable-error-stack -R tdatareg.h5)
ADD_H5_TEST (tattrreg 0 --enable-error-stack tattrreg.h5)
- ADD_H5ERR_MASK_TEST (tattrregR 0 "Undefined reference pointer" -R --enable-error-stack tattrreg.h5)
+ ADD_H5ERR_MASK_TEST (tattrregR 0 "NULL token size" -R --enable-error-stack tattrreg.h5)
ADD_H5_EXPORT_TEST (tbinregR tdatareg.h5 0 --enable-error-stack -d /Dataset1 -s 0 -R -y -o)
+ # test for 1.12 region references
+ ADD_H5_TEST (trefer_attrR 0 --enable-error-stack -R trefer_attr.h5)
+ ADD_H5_TEST (trefer_compatR 0 --enable-error-stack -R trefer_compat.h5)
+ ADD_H5_TEST (trefer_extR 0 --enable-error-stack -R trefer_ext2.h5)
+ ADD_H5_TEST (trefer_grpR 0 --enable-error-stack -R trefer_grp.h5)
+ ADD_H5_TEST (trefer_obj_delR 0 --enable-error-stack -R trefer_obj_del.h5)
+ ADD_H5_TEST (trefer_objR 0 --enable-error-stack -R trefer_obj.h5)
+ ADD_H5_TEST (trefer_paramR 0 --enable-error-stack -R trefer_param.h5)
+ ADD_H5_TEST (trefer_regR 0 --enable-error-stack -R trefer_reg.h5)
+ ADD_H5_TEST (trefer_reg_1dR 0 --enable-error-stack -R trefer_reg_1d.h5)
+
# tests for group creation order
# "1" tracked, "2" name, root tracked
ADD_H5_TEST (tordergr1 0 --enable-error-stack --group=1 --sort_by=creation_order --sort_order=ascending tordergr.h5)
diff --git a/tools/test/h5dump/CMakeTestsPBITS.cmake b/tools/test/h5dump/CMakeTestsPBITS.cmake
index a6be9ae..1e16875 100644
--- a/tools/test/h5dump/CMakeTestsPBITS.cmake
+++ b/tools/test/h5dump/CMakeTestsPBITS.cmake
@@ -119,16 +119,10 @@
##############################################################################
##############################################################################
- if (NOT BUILD_SHARED_LIBS)
- set (tgt_ext "")
- else ()
- set (tgt_ext "-shared")
- endif ()
-
macro (ADD_H5_PBITS_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits")
if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
@@ -141,7 +135,7 @@
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/pbits"
-D "TEST_OUTPUT=${resultfile}.out"
diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake
index 036609c..ae7193c 100644
--- a/tools/test/h5dump/CMakeTestsVDS.cmake
+++ b/tools/test/h5dump/CMakeTestsVDS.cmake
@@ -115,16 +115,10 @@
##############################################################################
##############################################################################
- if (NOT BUILD_SHARED_LIBS)
- set (tgt_ext "")
- else ()
- set (tgt_ext "-shared")
- endif ()
-
macro (ADD_H5_VDS_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
@@ -137,7 +131,7 @@
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -151,7 +145,7 @@
macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
+ add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> ${ARGN})
set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES
ENVIRONMENT "HDF5_VDS_PREFIX=${PROJECT_BINARY_DIR}/testfiles/vds/"
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix"
@@ -167,7 +161,7 @@
NAME H5DUMP_PREFIX-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds/prefix"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -183,7 +177,7 @@
macro (ADD_H5_VDS_LAYOUT resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> -p ${ARGN})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> -p ${ARGN})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
@@ -196,7 +190,7 @@
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=-p;${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds"
-D "TEST_OUTPUT=${resultfile}.out"
diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake
index 6d73cb1..985d940 100644
--- a/tools/test/h5dump/CMakeTestsXML.cmake
+++ b/tools/test/h5dump/CMakeTestsXML.cmake
@@ -160,12 +160,6 @@
##############################################################################
##############################################################################
- if (NOT BUILD_SHARED_LIBS)
- set (tgt_ext "")
- else ()
- set (tgt_ext "-shared")
- endif ()
-
macro (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype)
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
@@ -182,7 +176,7 @@
macro (ADD_XML_H5_TEST resultfile resultcode)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP_XML-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> --xml ${ARGN})
+ add_test (NAME H5DUMP_XML-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_ext}> --xml ${ARGN})
set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml")
if (${resultcode})
set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES WILL_FAIL "true")
@@ -195,7 +189,7 @@
NAME H5DUMP_XML-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=--xml;${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/xml"
-D "TEST_OUTPUT=${resultfile}.out"
diff --git a/tools/test/h5dump/CMakeVFDTests.cmake b/tools/test/h5dump/CMakeVFDTests.cmake
index 0a345ef..337cfe2 100644
--- a/tools/test/h5dump/CMakeVFDTests.cmake
+++ b/tools/test/h5dump/CMakeVFDTests.cmake
@@ -53,19 +53,13 @@ add_custom_target(HDF5_VFD_H5DUMP_files ALL COMMENT "Copying files needed by HDF
##############################################################################
##############################################################################
-if (NOT BUILD_SHARED_LIBS)
- set (tgt_ext "")
-else ()
- set (tgt_ext "-shared")
-endif ()
-
macro (ADD_VFD_H5DUMP_TEST vfdname resultfile resultcode)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5DUMP_VFD-${vfdname}-${resultfile}-h5dump
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_VFD:STRING=${vfdname}"
-D "TEST_EXPECT=${resultcode}"
diff --git a/tools/test/h5dump/dynlib_dump.c b/tools/test/h5dump/dynlib_dump.c
index 571452e..661a6dc 100644
--- a/tools/test/h5dump/dynlib_dump.c
+++ b/tools/test/h5dump/dynlib_dump.c
@@ -69,7 +69,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts,
/* Subtract the original value with MULTIPLIER */
while(buf_left > 0) {
char temp = *int_ptr;
- *int_ptr = temp - MULTIPLIER;
+ *int_ptr = (int8_t)(temp - MULTIPLIER);
int_ptr++;
buf_left -= sizeof(*int_ptr);
} /* end while */
@@ -78,7 +78,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts,
/* Add the original value with MULTIPLIER */
while(buf_left > 0) {
char temp = *int_ptr;
- *int_ptr = temp + MULTIPLIER;
+ *int_ptr = (int8_t)(temp + MULTIPLIER);
int_ptr++;
buf_left -= sizeof(*int_ptr);
} /* end while */
diff --git a/tools/test/h5dump/errfiles/tarray1_big.err b/tools/test/h5dump/errfiles/tarray1_big.err
index ff22495..a20b0b7 100644
--- a/tools/test/h5dump/errfiles/tarray1_big.err
+++ b/tools/test/h5dump/errfiles/tarray1_big.err
@@ -1,58 +1,31 @@
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #000: (file name) line (number) in H5Rdereference2(): unable to dereference object
+ #000: (file name) line (number) in H5Rget_obj_type3(): unable to get object token
major: References
- minor: Can't open object
- #001: (file name) line (number) in H5VL_object_open(): object open failed
- major: Virtual Object Layer
- minor: Can't open object
- #002: (file name) line (number) in H5VL__object_open(): object open failed
- major: Virtual Object Layer
- minor: Can't open object
- #003: (file name) line (number) in H5VL__native_object_open(): unable to dereference object
+ minor: Can't get value
+ #001: (file name) line (number) in H5R__get_obj_token(): NULL token size
major: References
- minor: Can't open object
- #004: (file name) line (number) in H5R__dereference(): Undefined reference pointer
- major: Invalid arguments to routine
- minor: Bad value
+ minor: Unable to copy object
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #000: (file name) line (number) in H5Rdereference2(): unable to dereference object
+ #000: (file name) line (number) in H5Rget_obj_type3(): unable to get object token
major: References
- minor: Can't open object
- #001: (file name) line (number) in H5VL_object_open(): object open failed
- major: Virtual Object Layer
- minor: Can't open object
- #002: (file name) line (number) in H5VL__object_open(): object open failed
- major: Virtual Object Layer
- minor: Can't open object
- #003: (file name) line (number) in H5VL__native_object_open(): unable to dereference object
+ minor: Can't get value
+ #001: (file name) line (number) in H5R__get_obj_token(): NULL token size
major: References
- minor: Can't open object
- #004: (file name) line (number) in H5R__dereference(): Undefined reference pointer
- major: Invalid arguments to routine
- minor: Bad value
+ minor: Unable to copy object
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #000: (file name) line (number) in H5Rdereference2(): unable to dereference object
+ #000: (file name) line (number) in H5Rget_obj_type3(): unable to get object token
major: References
- minor: Can't open object
- #001: (file name) line (number) in H5VL_object_open(): object open failed
- major: Virtual Object Layer
- minor: Can't open object
- #002: (file name) line (number) in H5VL__object_open(): object open failed
- major: Virtual Object Layer
- minor: Can't open object
- #003: (file name) line (number) in H5VL__native_object_open(): unable to dereference object
+ minor: Can't get value
+ #001: (file name) line (number) in H5R__get_obj_token(): NULL token size
major: References
- minor: Can't open object
- #004: (file name) line (number) in H5R__dereference(): Undefined reference pointer
- major: Invalid arguments to routine
- minor: Bad value
+ minor: Unable to copy object
H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5tools_dump_simple_data(): H5Rdereference failed
+ #000: (file name) line (number) in h5tools_dump_data(): H5Rget_obj_type3 H5R_OBJECT1 failed
major: Failure in tools library
minor: error in function
- #001: (file name) line (number) in h5tools_dump_simple_data(): H5Rdereference failed
+ #001: (file name) line (number) in h5tools_dump_data(): H5Rget_obj_type3 H5R_OBJECT1 failed
major: Failure in tools library
minor: error in function
- #002: (file name) line (number) in h5tools_dump_simple_data(): H5Rdereference failed
+ #002: (file name) line (number) in h5tools_dump_data(): H5Rget_obj_type3 H5R_OBJECT1 failed
major: Failure in tools library
minor: error in function
diff --git a/tools/test/h5dump/errfiles/tattrregR.err b/tools/test/h5dump/errfiles/tattrregR.err
index 8a1539c..fa2014a 100644
--- a/tools/test/h5dump/errfiles/tattrregR.err
+++ b/tools/test/h5dump/errfiles/tattrregR.err
@@ -1,39 +1,21 @@
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #000: (file name) line (number) in H5Rdereference2(): unable to dereference object
+ #000: (file name) line (number) in H5Rget_obj_type3(): unable to get object token
major: References
- minor: Can't open object
- #001: (file name) line (number) in H5VL_object_open(): object open failed
- major: Virtual Object Layer
- minor: Can't open object
- #002: (file name) line (number) in H5VL__object_open(): object open failed
- major: Virtual Object Layer
- minor: Can't open object
- #003: (file name) line (number) in H5VL__native_object_open(): unable to dereference object
+ minor: Can't get value
+ #001: (file name) line (number) in H5R__get_obj_token(): NULL token size
major: References
- minor: Can't open object
- #004: (file name) line (number) in H5R__dereference(): Undefined reference pointer
- major: Invalid arguments to routine
- minor: Bad value
+ minor: Unable to copy object
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #000: (file name) line (number) in H5Rdereference2(): unable to dereference object
+ #000: (file name) line (number) in H5Rget_obj_type3(): unable to get object token
major: References
- minor: Can't open object
- #001: (file name) line (number) in H5VL_object_open(): object open failed
- major: Virtual Object Layer
- minor: Can't open object
- #002: (file name) line (number) in H5VL__object_open(): object open failed
- major: Virtual Object Layer
- minor: Can't open object
- #003: (file name) line (number) in H5VL__native_object_open(): unable to dereference object
+ minor: Can't get value
+ #001: (file name) line (number) in H5R__get_obj_token(): NULL token size
major: References
- minor: Can't open object
- #004: (file name) line (number) in H5R__dereference(): Undefined reference pointer
- major: Invalid arguments to routine
- minor: Bad value
+ minor: Unable to copy object
H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5tools_dump_simple_data(): H5Rdereference failed
+ #000: (file name) line (number) in h5tools_dump_data(): H5Rget_obj_type3 H5R_OBJECT1 failed
major: Failure in tools library
minor: error in function
- #001: (file name) line (number) in h5tools_dump_simple_data(): H5Rdereference failed
+ #001: (file name) line (number) in h5tools_dump_data(): H5Rget_obj_type3 H5R_OBJECT1 failed
major: Failure in tools library
minor: error in function
diff --git a/tools/test/h5dump/errfiles/tdataregR.err b/tools/test/h5dump/errfiles/tdataregR.err
index 8a1539c..fa2014a 100644
--- a/tools/test/h5dump/errfiles/tdataregR.err
+++ b/tools/test/h5dump/errfiles/tdataregR.err
@@ -1,39 +1,21 @@
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #000: (file name) line (number) in H5Rdereference2(): unable to dereference object
+ #000: (file name) line (number) in H5Rget_obj_type3(): unable to get object token
major: References
- minor: Can't open object
- #001: (file name) line (number) in H5VL_object_open(): object open failed
- major: Virtual Object Layer
- minor: Can't open object
- #002: (file name) line (number) in H5VL__object_open(): object open failed
- major: Virtual Object Layer
- minor: Can't open object
- #003: (file name) line (number) in H5VL__native_object_open(): unable to dereference object
+ minor: Can't get value
+ #001: (file name) line (number) in H5R__get_obj_token(): NULL token size
major: References
- minor: Can't open object
- #004: (file name) line (number) in H5R__dereference(): Undefined reference pointer
- major: Invalid arguments to routine
- minor: Bad value
+ minor: Unable to copy object
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #000: (file name) line (number) in H5Rdereference2(): unable to dereference object
+ #000: (file name) line (number) in H5Rget_obj_type3(): unable to get object token
major: References
- minor: Can't open object
- #001: (file name) line (number) in H5VL_object_open(): object open failed
- major: Virtual Object Layer
- minor: Can't open object
- #002: (file name) line (number) in H5VL__object_open(): object open failed
- major: Virtual Object Layer
- minor: Can't open object
- #003: (file name) line (number) in H5VL__native_object_open(): unable to dereference object
+ minor: Can't get value
+ #001: (file name) line (number) in H5R__get_obj_token(): NULL token size
major: References
- minor: Can't open object
- #004: (file name) line (number) in H5R__dereference(): Undefined reference pointer
- major: Invalid arguments to routine
- minor: Bad value
+ minor: Unable to copy object
H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5tools_dump_simple_data(): H5Rdereference failed
+ #000: (file name) line (number) in h5tools_dump_data(): H5Rget_obj_type3 H5R_OBJECT1 failed
major: Failure in tools library
minor: error in function
- #001: (file name) line (number) in h5tools_dump_simple_data(): H5Rdereference failed
+ #001: (file name) line (number) in h5tools_dump_data(): H5Rget_obj_type3 H5R_OBJECT1 failed
major: Failure in tools library
minor: error in function
diff --git a/tools/test/h5dump/errfiles/tdset-2.err b/tools/test/h5dump/errfiles/tdset-2.err
index 2d70b35..39bbb0e 100644
--- a/tools/test/h5dump/errfiles/tdset-2.err
+++ b/tools/test/h5dump/errfiles/tdset-2.err
@@ -27,7 +27,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
major: Symbol table
minor: Object not found
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #000: (file name) line (number) in H5Lget_info(): unable to get link info
+ #000: (file name) line (number) in H5Lget_info2(): unable to get link info
major: Links
minor: Can't get value
#001: (file name) line (number) in H5VL_link_get(): link get failed
diff --git a/tools/test/h5dump/errfiles/tperror.err b/tools/test/h5dump/errfiles/tperror.err
index b0b908b..e2f24c1 100644
--- a/tools/test/h5dump/errfiles/tperror.err
+++ b/tools/test/h5dump/errfiles/tperror.err
@@ -27,7 +27,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
major: Symbol table
minor: Object not found
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #000: (file name) line (number) in H5Lget_info(): unable to get link info
+ #000: (file name) line (number) in H5Lget_info2(): unable to get link info
major: Links
minor: Can't get value
#001: (file name) line (number) in H5VL_link_get(): link get failed
diff --git a/tools/test/h5dump/errfiles/tqmarkfile.err b/tools/test/h5dump/errfiles/tqmarkfile.err
index 2c4f1ff..4c3b2ef 100644
--- a/tools/test/h5dump/errfiles/tqmarkfile.err
+++ b/tools/test/h5dump/errfiles/tqmarkfile.err
@@ -15,7 +15,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
major: Symbol table
minor: Object not found
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #000: (file name) line (number) in H5Lget_info(): unable to get link info
+ #000: (file name) line (number) in H5Lget_info2(): unable to get link info
major: Symbol table
minor: Object not found
#001: (file name) line (number) in H5L_get_info(): name doesn't exist
diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c
index 35c3e3c..d72664e 100644
--- a/tools/test/h5dump/h5dumpgentest.c
+++ b/tools/test/h5dump/h5dumpgentest.c
@@ -463,10 +463,23 @@ gent_dataset(void)
{
hid_t fid, dataset, space;
hsize_t dims[2];
- int dset1[10][20];
- double dset2[30][20];
+ int **dset1 = NULL;
+ int *dset1_data = NULL;
+ double **dset2 = NULL;
+ double *dset2_data = NULL;
int i, j;
+ /* Set up data arrays */
+ dset1_data = (int *)HDcalloc(10 * 20, sizeof(int));
+ dset1 = (int **)HDcalloc(10, sizeof(dset1_data));
+ for (i = 0; i < 10; i++)
+ dset1[i] = dset1_data + (i * 20);
+
+ dset2_data = (double *)HDcalloc(30 * 20, sizeof(double));
+ dset2 = (double **)HDcalloc(30, sizeof(dset2_data));
+ for (i = 0; i < 30; i++)
+ dset2[i] = dset2_data + (i * 20);
+
fid = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/* dset1 */
@@ -478,7 +491,7 @@ gent_dataset(void)
for(j = 0; j < 20; j++)
dset1[i][j] = j + i;
- H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1);
+ H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1_data);
H5Sclose(space);
H5Dclose(dataset);
@@ -491,11 +504,16 @@ gent_dataset(void)
for(j = 0; j < 20; j++)
dset2[i][j] = 0.0001F * (float)j + (float)i;
- H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2);
+ H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_data);
H5Sclose(space);
H5Dclose(dataset);
H5Fclose(fid);
+
+ HDfree(dset1);
+ HDfree(dset1_data);
+ HDfree(dset2);
+ HDfree(dset2_data);
}
static void
@@ -638,11 +656,11 @@ static void gent_softlink(void)
#define NY 2
static int gent_softlink2(void)
{
- hid_t fileid1 = -1;
- hid_t gid1 = -1, gid2 = -1;
- hid_t datatype = -1;
- hid_t dset1 = -1, dset2 = -1;
- hid_t dataspace = -1;
+ hid_t fileid1 = H5I_INVALID_HID;
+ hid_t gid1 = H5I_INVALID_HID, gid2 = H5I_INVALID_HID;
+ hid_t datatype = H5I_INVALID_HID;
+ hid_t dset1 = H5I_INVALID_HID, dset2 = H5I_INVALID_HID;
+ hid_t dataspace = H5I_INVALID_HID;
hsize_t dimsf[2]; /* dataset dimensions */
int data1[NX][NY] = {{0,0},{1,1},{2,2},{3,3}};
int data2[NX][NY] = {{0,0},{0,1},{0,2},{3,3}};
@@ -1554,7 +1572,7 @@ gent_many(void)
dset1_t dset1[6];
hsize_t dim[4];
- herr_t ret;
+ herr_t H5_ATTR_NDEBUG_UNUSED ret;
fid = H5Fcreate(FILE12, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -1773,9 +1791,17 @@ static void gent_str(void) {
int a[8][10];
char s[12][33];
} compound_t;
- compound_t comp1[3][6];
+
+ compound_t **comp1 = NULL;
+ compound_t *comp1_data = NULL;
hsize_t mdims[2];
+ /* Set up data array */
+ comp1_data = (compound_t *)HDcalloc(3 * 6, sizeof(compound_t));
+ comp1 = (compound_t **)HDcalloc(3, sizeof(comp1_data));
+ for (i = 0; i < 3; i++)
+ comp1[i] = comp1_data + (i * 6);
+
fid = H5Fcreate(FILE13, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/* string 1 : nullterm string */
@@ -1861,7 +1887,7 @@ static void gent_str(void) {
}
dataset = H5Dcreate2(fid, "/comp1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Dwrite(dataset, f_type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, comp1);
+ H5Dwrite(dataset, f_type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, comp1_data);
H5Tclose(f_type);
H5Tclose(f_type2);
@@ -1869,6 +1895,9 @@ static void gent_str(void) {
H5Dclose(dataset);
H5Fclose(fid);
+
+ HDfree(comp1);
+ HDfree(comp1_data);
}
/*
@@ -2548,7 +2577,7 @@ static void gent_opaque(void)
static void gent_bitfields(void)
{
- hid_t file, grp=-1, type=-1, space=-1, dset=-1;
+ hid_t file, grp=H5I_INVALID_HID, type=H5I_INVALID_HID, space=H5I_INVALID_HID, dset=H5I_INVALID_HID;
size_t i;
hsize_t nelmts;
unsigned char buf[32];
@@ -2565,7 +2594,7 @@ static void gent_bitfields(void)
goto error;
for(i = 0; i < sizeof buf; i++)
- buf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ buf[i] = (uint8_t)(0xff ^ i);
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
goto error;
if(H5Sclose(space) < 0) goto error;
@@ -2579,7 +2608,7 @@ static void gent_bitfields(void)
(dset = H5Dcreate2(grp, "bitfield_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
for(i = 0; i < sizeof buf; i++)
- buf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ buf[i] = (uint8_t)(0xff ^ i);
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
goto error;
if(H5Sclose(space) < 0) goto error;
@@ -2603,7 +2632,7 @@ static void gent_vldatatypes(void)
hid_t file, dset, space, type;
hsize_t dims[] = { SPACE1_DIM1 };
int i;
- herr_t ret=0;
+ herr_t H5_ATTR_NDEBUG_UNUSED ret=0;
file = H5Fcreate(FILE21, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -2624,7 +2653,7 @@ static void gent_vldatatypes(void)
dset = H5Dcreate2(file, "Dataset1.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
HDassert(ret >= 0);
- ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(type, space, H5P_DEFAULT, wdata);
HDassert(ret >= 0);
ret = H5Dclose(dset);
@@ -2651,7 +2680,7 @@ static void gent_vldatatypes(void)
dset = H5Dcreate2(file, "Dataset2.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
HDassert(ret >= 0);
- ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(type, space, H5P_DEFAULT, wdata);
HDassert(ret >= 0);
ret = H5Dclose(dset);
@@ -2674,7 +2703,7 @@ static void gent_vldatatypes(void)
dset = H5Dcreate2(file, "Dataset3.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, &adata);
HDassert(ret >= 0);
- ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, &adata);
+ ret = H5Treclaim(type, space, H5P_DEFAULT, &adata);
HDassert(ret >= 0);
ret = H5Dclose(dset);
@@ -2698,7 +2727,7 @@ gent_vldatatypes2(void)
hid_t tid1, tid2; /* Datatype IDs */
hsize_t dims1[] = {SPACE1_DIM1};
unsigned i,j,k; /* counting variables */
- herr_t ret; /* Generic return value */
+ herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */
/* Allocate and initialize VL data to write */
for(i = 0; i < SPACE1_DIM1; i++) {
@@ -2740,7 +2769,7 @@ gent_vldatatypes2(void)
HDassert(ret >= 0);
/* Reclaim the write VL data */
- ret = H5Dvlen_reclaim(tid2, sid1, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(tid2, sid1, H5P_DEFAULT, wdata);
HDassert(ret >= 0);
/* Close Dataset */
@@ -2771,7 +2800,7 @@ static void gent_vldatatypes3(void)
hid_t tid1, tid2; /* Datatype IDs */
hsize_t dims1[] = {SPACE1_DIM1};
unsigned i,j; /* counting variables */
- herr_t ret; /* Generic return value */
+ herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */
/* Allocate and initialize VL data to write */
for(i=0; i<SPACE1_DIM1; i++) {
@@ -2811,7 +2840,7 @@ static void gent_vldatatypes3(void)
HDassert(ret >= 0);
/* Reclaim the write VL data */
- ret = H5Dvlen_reclaim(tid2, sid1, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(tid2, sid1, H5P_DEFAULT, wdata);
HDassert(ret >= 0);
/* Close Dataset */
@@ -2840,7 +2869,7 @@ static void gent_vldatatypes4(void)
hid_t tid1, tid2; /* Datatype IDs */
hsize_t dims1[] = {SPACE1_DIM1};
unsigned i,j; /* counting variables */
- herr_t ret; /* Generic return value */
+ herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */
/* Allocate and initialize VL data to write */
for(i=0; i<SPACE1_DIM1; i++) {
@@ -2878,7 +2907,7 @@ static void gent_vldatatypes4(void)
HDassert(ret >= 0);
/* Reclaim the write VL data */
- ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(tid1, sid1, H5P_DEFAULT, wdata);
HDassert(ret >= 0);
/* Close Dataset */
@@ -2897,14 +2926,14 @@ static void gent_vldatatypes4(void)
/* Generate a variable-length dataset with NULL values in it */
static void gent_vldatatypes5(void)
{
- hvl_t wdata [SPACE1_DIM1];
- hid_t fid1;
- hid_t dataset;
- hid_t sid1;
- hid_t tid1;
- hsize_t dims1[] = {SPACE1_DIM1};
- int i,j; /* counting variable */
- herr_t ret; /* Generic return value */
+ hvl_t wdata [SPACE1_DIM1];
+ hid_t fid1;
+ hid_t dataset;
+ hid_t sid1;
+ hid_t tid1;
+ hsize_t dims1[] = {SPACE1_DIM1};
+ int i,j; /* counting variable */
+ herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */
/* initialize data for dataset */
for(i=0; i<SPACE1_DIM1; i++) {
@@ -2942,7 +2971,7 @@ static void gent_vldatatypes5(void)
ret = H5Dclose(dataset);
HDassert(ret >= 0);
- ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(tid1, sid1, H5P_DEFAULT, wdata);
HDassert(ret >= 0);
ret = H5Tclose(tid1);
@@ -2966,16 +2995,15 @@ static void gent_vldatatypes5(void)
static void gent_array1_big(void)
{
- int *wdata; /* Information to write */
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1; /* Datatype ID */
- hsize_t sdims1[] = {SPACE_ARRAY1BIG_DIM};
- hsize_t tdims1[] = {ARRAY1BIG_DIM};
- int i,j; /* counting variables */
- herr_t ret; /* Generic return value */
-
+ int *wdata; /* Information to write */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1; /* Datatype ID */
+ hsize_t sdims1[] = {SPACE_ARRAY1BIG_DIM};
+ hsize_t tdims1[] = {ARRAY1BIG_DIM};
+ int i,j; /* counting variables */
+ herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */
/* for region reference dataset */
hid_t dset2;
@@ -3065,7 +3093,7 @@ static void gent_array1(void)
hsize_t sdims1[] = {SPACE1_DIM1};
hsize_t tdims1[] = {ARRAY1_DIM1};
int i,j; /* counting variables */
- herr_t ret; /* Generic return value */
+ herr_t ret H5_ATTR_NDEBUG_UNUSED; /* Generic return value */
/* Allocate and initialize array data to write */
for(i=0; i<SPACE1_DIM1; i++)
@@ -3101,15 +3129,15 @@ static void gent_array1(void)
static void gent_array2(void)
{
- int wdata[SPACE1_DIM1][ARRAY2_DIM1][ARRAY2_DIM2][ARRAY2_DIM3]; /* Information to write */
- hid_t fid; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t tid; /* Datatype ID */
- hsize_t sdims1[] = {SPACE1_DIM1};
- hsize_t tdims2[] = {ARRAY2_DIM1,ARRAY2_DIM2,ARRAY2_DIM3};
- int i,j,k,l; /* counting variables */
- herr_t ret; /* Generic return value */
+ int wdata[SPACE1_DIM1][ARRAY2_DIM1][ARRAY2_DIM2][ARRAY2_DIM3]; /* Information to write */
+ hid_t fid; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t tid; /* Datatype ID */
+ hsize_t sdims1[] = {SPACE1_DIM1};
+ hsize_t tdims2[] = {ARRAY2_DIM1,ARRAY2_DIM2,ARRAY2_DIM3};
+ int i,j,k,l; /* counting variables */
+ herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */
/* Allocate and initialize array data to write */
for(i=0; i<SPACE1_DIM1; i++)
@@ -3147,17 +3175,17 @@ static void gent_array2(void)
static void gent_array3(void)
{
- int wdata[SPACE1_DIM1][ARRAY1_DIM1][ARRAY3_DIM1][ARRAY3_DIM2]; /* Information to write */
- hid_t fid; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t tid1; /* 1-D array Datatype ID */
- hid_t tid2; /* 2-D array Datatype ID */
- hsize_t sdims1[] = {SPACE1_DIM1};
- hsize_t tdims1[] = {ARRAY1_DIM1};
- hsize_t tdims2[] = {ARRAY3_DIM1,ARRAY3_DIM2};
- int i,j,k,l; /* counting variables */
- herr_t ret; /* Generic return value */
+ int wdata[SPACE1_DIM1][ARRAY1_DIM1][ARRAY3_DIM1][ARRAY3_DIM2]; /* Information to write */
+ hid_t fid; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t tid1; /* 1-D array Datatype ID */
+ hid_t tid2; /* 2-D array Datatype ID */
+ hsize_t sdims1[] = {SPACE1_DIM1};
+ hsize_t tdims1[] = {ARRAY1_DIM1};
+ hsize_t tdims2[] = {ARRAY3_DIM1,ARRAY3_DIM2};
+ int i,j,k,l; /* counting variables */
+ herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */
/* Allocate and initialize array data to write */
for(i=0; i<SPACE1_DIM1; i++)
@@ -3204,16 +3232,16 @@ static void gent_array4(void)
int i;
float f;
} s2_t;
- s2_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1; /* Array Datatype ID */
- hid_t tid2; /* Compound Datatype ID */
- hsize_t sdims1[] = {SPACE1_DIM1};
- hsize_t tdims1[] = {ARRAY1_DIM1};
- int i,j; /* counting variables */
- herr_t ret; /* Generic return value */
+ s2_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1; /* Array Datatype ID */
+ hid_t tid2; /* Compound Datatype ID */
+ hsize_t sdims1[] = {SPACE1_DIM1};
+ hsize_t tdims1[] = {ARRAY1_DIM1};
+ int i,j; /* counting variables */
+ herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */
/* Initialize array data to write */
for(i=0; i<SPACE1_DIM1; i++)
@@ -3270,17 +3298,17 @@ static void gent_array5(void)
int i;
float f[ARRAY1_DIM1];
} s2_t;
- s2_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1; /* Array Datatype ID */
- hid_t tid2; /* Compound Datatype ID */
- hid_t tid3; /* Nested Array Datatype ID */
- hsize_t sdims1[] = {SPACE1_DIM1};
- hsize_t tdims1[] = {ARRAY1_DIM1};
- int i,j,k; /* counting variables */
- herr_t ret; /* Generic return value */
+ s2_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1; /* Array Datatype ID */
+ hid_t tid2; /* Compound Datatype ID */
+ hid_t tid3; /* Nested Array Datatype ID */
+ hsize_t sdims1[] = {SPACE1_DIM1};
+ hsize_t tdims1[] = {ARRAY1_DIM1};
+ int i,j,k; /* counting variables */
+ herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */
/* Initialize array data to write */
for(i=0; i<SPACE1_DIM1; i++)
@@ -3341,16 +3369,16 @@ static void gent_array5(void)
static void gent_array6(void)
{
- hvl_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1; /* Array Datatype ID */
- hid_t tid2; /* VL Datatype ID */
- hsize_t sdims1[] = {SPACE1_DIM1};
- hsize_t tdims1[] = {ARRAY1_DIM1};
- int i,j,k; /* counting variables */
- herr_t ret; /* Generic return value */
+ hvl_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1; /* Array Datatype ID */
+ hid_t tid2; /* VL Datatype ID */
+ hsize_t sdims1[] = {SPACE1_DIM1};
+ hsize_t tdims1[] = {ARRAY1_DIM1};
+ int i,j,k; /* counting variables */
+ herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */
/* Initialize array data to write */
for(i=0; i<SPACE1_DIM1; i++)
@@ -3385,7 +3413,7 @@ static void gent_array6(void)
HDassert(ret >= 0);
/* Reclaim the write VL data */
- ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(tid1, sid1, H5P_DEFAULT, wdata);
HDassert(ret >= 0);
/* Close Dataset */
@@ -3401,17 +3429,17 @@ static void gent_array6(void)
static void gent_array7(void)
{
- hvl_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1; /* Array Datatype ID */
- hid_t tid2; /* VL Datatype ID */
- hid_t tid3; /* Nested Array Datatype ID */
- hsize_t sdims1[] = {SPACE1_DIM1};
- hsize_t tdims1[] = {ARRAY1_DIM1};
- int i,j,k,l; /* Index variables */
- herr_t ret; /* Generic return value */
+ hvl_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1; /* Array Datatype ID */
+ hid_t tid2; /* VL Datatype ID */
+ hid_t tid3; /* Nested Array Datatype ID */
+ hsize_t sdims1[] = {SPACE1_DIM1};
+ hsize_t tdims1[] = {ARRAY1_DIM1};
+ int i,j,k,l; /* Index variables */
+ herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */
/* Initialize array data to write */
for(i=0; i<SPACE1_DIM1; i++)
@@ -3454,7 +3482,7 @@ static void gent_array7(void)
HDassert(ret >= 0);
/* Reclaim the write VL data */
- ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(tid1, sid1, H5P_DEFAULT, wdata);
HDassert(ret >= 0);
/* Close Dataset */
@@ -3471,11 +3499,11 @@ static void gent_array7(void)
/* Test the boundary of the display output buffer at the reallocation event */
static void gent_array8(void)
{
- hid_t file = -1; /* Handles */
- hid_t filetype = -1; /* Handles */
- hid_t space = -1; /* Handles */
- hid_t dset = -1; /* Handles */
- herr_t status = -1;
+ hid_t file = H5I_INVALID_HID; /* Handles */
+ hid_t filetype = H5I_INVALID_HID; /* Handles */
+ hid_t space = H5I_INVALID_HID; /* Handles */
+ hid_t dset = H5I_INVALID_HID; /* Handles */
+ herr_t H5_ATTR_NDEBUG_UNUSED status = -1;
hsize_t sdims[] = {F64_DIM0};
hsize_t tdims[] = {F64_DIM1};
int *wdata; /* Write buffer */
@@ -3542,7 +3570,7 @@ static void gent_empty(void)
} empty_struct;
hid_t file, dset, space, type;
hsize_t dims[] = { SPACE1_DIM1 };
- herr_t ret=0;
+ herr_t H5_ATTR_NDEBUG_UNUSED ret=0;
file = H5Fcreate(FILE32, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -3748,9 +3776,15 @@ void gent_multi(void)
H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES];
hid_t memb_fapl[H5FD_MEM_NTYPES];
const char *memb_name[H5FD_MEM_NTYPES];
- char sv[H5FD_MEM_NTYPES][1024];
+ char **sv = NULL;
+ char *sv_data = NULL;
haddr_t memb_addr[H5FD_MEM_NTYPES];
+ sv_data = (char *)HDcalloc(H5FD_MEM_NTYPES * 1024, sizeof(char));
+ sv = (char **)HDcalloc(H5FD_MEM_NTYPES, sizeof(sv_data));
+ for (i = 0; i < H5FD_MEM_NTYPES; i++)
+ sv[i] = sv_data + (i * 1024);
+
fapl = H5Pcreate(H5P_FILE_ACCESS);
HDmemset(memb_map, 0, sizeof memb_map);
@@ -3760,7 +3794,7 @@ void gent_multi(void)
HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES);
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) {
memb_fapl[mt] = H5P_DEFAULT;
memb_map[mt] = mt;
HDsprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
@@ -3791,6 +3825,9 @@ void gent_multi(void)
H5Dclose(dataset);
H5Fclose(fid);
H5Pclose(fapl);
+
+ HDfree(sv);
+ HDfree(sv_data);
}
static void gent_large_objname(void)
@@ -3930,7 +3967,7 @@ static void write_attr_in(hid_t loc_id,
hid_t aid;
hid_t sid;
hid_t tid;
- herr_t status;
+ herr_t H5_ATTR_NDEBUG_UNUSED status;
int val, i, j, k, n;
float f;
@@ -4054,7 +4091,7 @@ static void write_attr_in(hid_t loc_id,
aid = H5Acreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(aid, tid, buf5);
HDassert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf5);
HDassert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
@@ -4165,7 +4202,7 @@ static void write_attr_in(hid_t loc_id,
aid = H5Acreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(aid, tid, buf52);
HDassert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf52);
HDassert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
@@ -4298,7 +4335,7 @@ static void write_attr_in(hid_t loc_id,
aid = H5Acreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(aid, tid, buf53);
HDassert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf53);
HDassert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
@@ -4371,7 +4408,7 @@ static void write_dset_in(hid_t loc_id,
hid_t sid;
hid_t tid;
hid_t plist_id;
- herr_t status;
+ herr_t H5_ATTR_NDEBUG_UNUSED status;
int val, i, j, k, n;
float f;
int fillvalue=2;
@@ -4496,7 +4533,7 @@ static void write_dset_in(hid_t loc_id,
did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5);
HDassert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf5);
HDassert(status >= 0);
status = H5Dclose(did);
status = H5Tclose(tid);
@@ -4606,7 +4643,7 @@ static void write_dset_in(hid_t loc_id,
did = H5Dcreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf52);
HDassert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf52);
HDassert(status >= 0);
status = H5Dclose(did);
status = H5Tclose(tid);
@@ -4745,7 +4782,7 @@ static void write_dset_in(hid_t loc_id,
did = H5Dcreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf53);
HDassert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf53);
HDassert(status >= 0);
status = H5Dclose(did);
status = H5Tclose(tid);
@@ -4809,7 +4846,7 @@ static void gent_attr_all(void)
hid_t root_id;
hid_t sid;
hsize_t dims[1] = {2};
- herr_t status;
+ herr_t H5_ATTR_NDEBUG_UNUSED status;
/* Create a file and a dataset */
fid = H5Fcreate(FILE40, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -4967,7 +5004,7 @@ static void gent_compound_complex(void)
hid_t array4_tid; /* Array datatype handle */
hid_t datafile, dataset; /* Datafile/dataset handles */
hid_t dataspace; /* Dataspace handle */
- herr_t status; /* Error checking variable */
+ herr_t H5_ATTR_NDEBUG_UNUSED status; /* Error checking variable */
hsize_t dim[] = {F41_LENGTH}; /* Dataspace dimensions */
hsize_t array_dimb[] = {F41_DIMb}; /* Array dimensions */
hsize_t array_dimd[]={F41_ARRAY_DIMd1,F41_ARRAY_DIMd2}; /* Array dimensions */
@@ -5116,7 +5153,7 @@ static void gent_named_dtype_attr(void)
hid_t aid;
hid_t gid;
int data=8;
- herr_t ret;
+ herr_t H5_ATTR_NDEBUG_UNUSED ret;
/* Create a file */
fid=H5Fcreate(FILE42, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -5338,7 +5375,7 @@ make_external(hid_t fid)
hsize_t cur_size[1]; /*data space current size */
hsize_t max_size[1]; /*data space maximum size */
hsize_t size; /*bytes reserved for data in the external file*/
- int ret;
+ int H5_ATTR_NDEBUG_UNUSED ret;
cur_size[0] = max_size[0] = 100;
size = (max_size[0]*sizeof(int)/2);
@@ -5386,7 +5423,8 @@ static void gent_filters(void)
hsize_t dims1[RANK] = {DIM1,DIM2};
hsize_t chunk_dims[RANK] = {CDIM1,CDIM2};
int buf1[DIM1][DIM2];
- int i, j, n, ret;
+ int i, j, n;
+ int H5_ATTR_NDEBUG_UNUSED ret;
for(i=n=0; i<DIM1; i++){
for(j=0; j<DIM2; j++){
@@ -5732,8 +5770,7 @@ static void gent_fcontents(void)
hid_t tid; /* datatype ID */
hsize_t dims[1]={4};
int buf[4]={1,2,3,4};
- int ret;
-
+ int H5_ATTR_NDEBUG_UNUSED ret;
/* create a file */
fid = H5Fcreate(FILE46, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -5866,7 +5903,7 @@ static void gent_fvalues(void)
hvl_t fillval3; /* vlen fill value */
hsize_t dimarray[1]={3}; /* array dimension */
int buf4[2][3]= {{1,2,3},{4,5,6}}; /* array */
- int ret;
+ int H5_ATTR_NDEBUG_UNUSED ret;
/* create a file */
fid = H5Fcreate(FILE48, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -5966,7 +6003,7 @@ static void gent_fvalues(void)
did = H5Dcreate2(fid, "fill_vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
ret = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf3);
HDassert(ret >= 0);
- ret = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf3);
+ ret = H5Treclaim(tid, sid, H5P_DEFAULT, buf3);
HDassert(ret >= 0);
ret = H5Dclose(did);
ret = H5Tclose(tid);
@@ -6024,9 +6061,9 @@ static void gent_string(void)
c_t buf3 = {24, "Four score and seven\n years ago our forefathers brought forth on this continent a new nation"};
char buf4[] = {"Four score and seven\n years ago our forefathers brought forth on this continent a new nation"};
hsize_t dims1[] = {1};
- hsize_t dims2[] = {SPACE1_DIM1};
- hsize_t dims4[1];
- int ret;
+ hsize_t dims2[] = {SPACE1_DIM1};
+ hsize_t dims4[1];
+ int H5_ATTR_NDEBUG_UNUSED ret;
dims4[0] = sizeof(buf4);
@@ -6121,7 +6158,8 @@ static void gent_aindices(void)
int buf2[10][10];
int buf3[2][10][10];
int buf4[2][2][10][10];
- int i, j, k, l, n, ret;
+ int i, j, k, l, n;
+ int H5_ATTR_NDEBUG_UNUSED ret;
for(i = n = 0; i < 100; i++)
buf1[i] = n++;
@@ -6188,11 +6226,11 @@ static void gent_aindices(void)
*/
static void gent_longlinks(void)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group ID */
- hid_t gid2 = (-1); /* Datatype ID */
- char *objname = NULL; /* Name of object [Long] */
- size_t u; /* Local index variable */
+ hid_t fid = (-1); /* File ID */
+ hid_t gid = (-1); /* Group ID */
+ hid_t H5_ATTR_NDEBUG_UNUSED gid2 = (-1); /* Datatype ID */
+ char *objname = NULL; /* Name of object [Long] */
+ size_t u; /* Local index variable */
/* Create files */
fid = H5Fcreate(FILE51, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -6353,12 +6391,12 @@ gent_binary(void)
static void
gent_bigdims(void)
{
- hid_t fid = -1;
- hid_t did = -1;
- hid_t f_sid = -1;
- hid_t m_sid = -1;
- hid_t tid = -1;
- hid_t dcpl = -1;
+ hid_t fid = H5I_INVALID_HID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t f_sid = H5I_INVALID_HID;
+ hid_t m_sid = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
+ hid_t dcpl = H5I_INVALID_HID;
hsize_t dims[1]={DIM_4GB}; /* dataset dimensions */
hsize_t chunk_dims[1]={1024}; /* chunk dimensions */
hsize_t hs_start[1];
@@ -6369,7 +6407,7 @@ gent_bigdims(void)
hsize_t i;
char c;
size_t nelmts;
- int ret;
+ int H5_ATTR_NDEBUG_UNUSED ret;
/* create a file */
fid = H5Fcreate(FILE56, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -6418,19 +6456,19 @@ gent_bigdims(void)
/* close */
if(H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
if(H5Sclose(f_sid) < 0)
goto out;
- f_sid = -1;
+ f_sid = H5I_INVALID_HID;
if(H5Sclose(m_sid) < 0)
goto out;
- m_sid = -1;
+ m_sid = H5I_INVALID_HID;
if(H5Pclose(dcpl) < 0)
goto out;
- dcpl = -1;
+ dcpl = H5I_INVALID_HID;
if(H5Dclose(did) < 0)
goto out;
- did = -1;
+ did = H5I_INVALID_HID;
ret = H5Fclose(fid);
HDassert(ret >= 0);
@@ -6465,7 +6503,8 @@ gent_hyperslab(void)
hid_t fid; /* file id */
hsize_t dims[2] = {32,4097}; /* big enough data size to force a second stripmine read */
double *buf;
- int i, ret;
+ int i;
+ int H5_ATTR_NDEBUG_UNUSED ret;
buf = (double*) HDmalloc(32 * 4097 * sizeof(double) );
for(i = 0; i < 32 * 4097; i++)
@@ -6494,10 +6533,10 @@ gent_hyperslab(void)
static void
gent_group_creation_order(void)
{
- hid_t fid = -1; /* file ID */
- hid_t gid = -1; /* group ID */
- hid_t gcpl_id = -1; /* group creation property list ID */
- hid_t fcpl_id = -1; /* file creation property list ID (to set root group order) */
+ hid_t fid = H5I_INVALID_HID; /* file ID */
+ hid_t gid = H5I_INVALID_HID; /* group ID */
+ hid_t gcpl_id = H5I_INVALID_HID; /* group creation property list ID */
+ hid_t fcpl_id = H5I_INVALID_HID; /* file creation property list ID (to set root group order) */
if((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0)
goto out;
@@ -6523,45 +6562,45 @@ gent_group_creation_order(void)
goto out;
if(H5Gclose(gid) < 0)
goto out;
- gid = -1;
+ gid = H5I_INVALID_HID;
if((gid = H5Gcreate2(fid, "2/c", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if(H5Gclose(gid) < 0)
goto out;
- gid = -1;
+ gid = H5I_INVALID_HID;
if((gid = H5Gcreate2(fid, "2/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if(H5Gclose(gid) < 0)
goto out;
- gid = -1;
+ gid = H5I_INVALID_HID;
if((gid = H5Gcreate2(fid, "2/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if(H5Gclose(gid) < 0)
goto out;
- gid = -1;
+ gid = H5I_INVALID_HID;
if((gid = H5Gcreate2(fid, "2/a/a2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
goto out;
if(H5Gclose(gid) < 0)
goto out;
- gid = -1;
+ gid = H5I_INVALID_HID;
if((gid = H5Gcreate2(fid, "2/a/a1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
goto out;
if(H5Gclose(gid) < 0)
goto out;
- gid = -1;
+ gid = H5I_INVALID_HID;
if((gid = H5Gcreate2(fid, "2/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if(H5Gclose(gid) < 0)
goto out;
- gid = -1;
+ gid = H5I_INVALID_HID;
if((gid = H5Gcreate2(fid, "2/a/a2/a21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if(H5Gclose(gid) < 0)
goto out;
- gid = -1;
+ gid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
@@ -6576,56 +6615,56 @@ gent_group_creation_order(void)
goto out;
if(H5Gclose(gid) < 0)
goto out;
- gid = -1;
+ gid = H5I_INVALID_HID;
if((gid = H5Gcreate2(fid, "1/c", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if(H5Gclose(gid) < 0)
goto out;
- gid = -1;
+ gid = H5I_INVALID_HID;
if((gid = H5Gcreate2(fid, "1/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if(H5Gclose(gid) < 0)
goto out;
- gid = -1;
+ gid = H5I_INVALID_HID;
if((gid = H5Gcreate2(fid, "1/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if(H5Gclose(gid) < 0)
goto out;
- gid = -1;
+ gid = H5I_INVALID_HID;
if((gid = H5Gcreate2(fid, "1/a/a2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
goto out;
if(H5Gclose(gid) < 0)
goto out;
- gid = -1;
+ gid = H5I_INVALID_HID;
if((gid = H5Gcreate2(fid, "1/a/a1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
goto out;
if(H5Gclose(gid) < 0)
goto out;
- gid = -1;
+ gid = H5I_INVALID_HID;
if((gid = H5Gcreate2(fid, "1/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if(H5Gclose(gid) < 0)
goto out;
- gid = -1;
+ gid = H5I_INVALID_HID;
if((gid = H5Gcreate2(fid, "1/a/a2/a21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if(H5Gclose(gid) < 0)
goto out;
- gid = -1;
+ gid = H5I_INVALID_HID;
if(H5Pclose(gcpl_id) < 0)
goto out;
- gcpl_id = -1;
+ gcpl_id = H5I_INVALID_HID;
if(H5Pclose(fcpl_id) < 0)
goto out;
- fcpl_id = -1;
+ fcpl_id = H5I_INVALID_HID;
if(H5Fclose(fid) < 0)
goto out;
- fid = -1;
+ fid = H5I_INVALID_HID;
return;
@@ -6653,15 +6692,15 @@ gent_group_creation_order(void)
static void
gent_attr_creation_order(void)
{
- hid_t fid = -1; /* file id */
- hid_t gid = -1; /* group id */
- hid_t did = -1; /* dataset id */
- hid_t sid = -1; /* space id */
- hid_t aid = -1; /* attribute id */
- hid_t tid = -1; /* datatype id */
- hid_t gcpl_id = -1; /* group creation property list ID */
- hid_t dcpl_id = -1; /* dataset creation property list ID */
- hid_t tcpl_id = -1; /* datatype creation property list ID */
+ hid_t fid = H5I_INVALID_HID; /* file id */
+ hid_t gid = H5I_INVALID_HID; /* group id */
+ hid_t did = H5I_INVALID_HID; /* dataset id */
+ hid_t sid = H5I_INVALID_HID; /* space id */
+ hid_t aid = H5I_INVALID_HID; /* attribute id */
+ hid_t tid = H5I_INVALID_HID; /* datatype id */
+ hid_t gcpl_id = H5I_INVALID_HID; /* group creation property list ID */
+ hid_t dcpl_id = H5I_INVALID_HID; /* dataset creation property list ID */
+ hid_t tcpl_id = H5I_INVALID_HID; /* datatype creation property list ID */
int i;
const char *attr_name[3] = {"c", "b", "a" };
@@ -6714,12 +6753,12 @@ gent_attr_creation_order(void)
/* close attribute */
if(H5Aclose(aid) < 0)
goto out;
- aid = -1;
+ aid = H5I_INVALID_HID;
} /* end for */
if(H5Dclose(did) < 0)
goto out;
- did = -1;
+ did = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
@@ -6740,12 +6779,12 @@ gent_attr_creation_order(void)
/* close attribute */
if(H5Aclose(aid) < 0)
goto out;
- aid = -1;
+ aid = H5I_INVALID_HID;
} /* end for */
if(H5Dclose(did) < 0)
goto out;
- did = -1;
+ did = H5I_INVALID_HID;
@@ -6766,12 +6805,12 @@ gent_attr_creation_order(void)
/* close attribute */
if(H5Aclose(aid) < 0)
goto out;
- aid = -1;
+ aid = H5I_INVALID_HID;
} /* end for */
if(H5Gclose(gid) < 0)
goto out;
- gid = -1;
+ gid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* create a group without creation order tracked for attributes and atributes in it
@@ -6790,12 +6829,12 @@ gent_attr_creation_order(void)
/* close attribute */
if(H5Aclose(aid) < 0)
goto out;
- aid = -1;
+ aid = H5I_INVALID_HID;
} /* end for */
if(H5Gclose(gid) < 0)
goto out;
- gid = -1;
+ gid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* create a named datatype with creation order tracked for attributes and atributes in it
@@ -6817,12 +6856,12 @@ gent_attr_creation_order(void)
/* close attribute */
if(H5Aclose(aid) < 0)
goto out;
- aid = -1;
+ aid = H5I_INVALID_HID;
} /* end for */
if(H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* create a named datatype without creation order tracked for attributes and atributes in it
@@ -6844,12 +6883,12 @@ gent_attr_creation_order(void)
/* close attribute */
if(H5Aclose(aid) < 0)
goto out;
- aid = -1;
+ aid = H5I_INVALID_HID;
} /* end for */
if(H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* add some attributes to the root group
@@ -6867,12 +6906,12 @@ gent_attr_creation_order(void)
/* close attribute */
if(H5Aclose(aid) < 0)
goto out;
- aid = -1;
+ aid = H5I_INVALID_HID;
} /* end for */
if(H5Gclose(gid) < 0)
goto out;
- gid = -1;
+ gid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* close
@@ -6880,19 +6919,19 @@ gent_attr_creation_order(void)
*/
if(H5Sclose(sid) < 0)
goto out;
- sid = -1;
+ sid = H5I_INVALID_HID;
if(H5Pclose(dcpl_id) < 0)
goto out;
- dcpl_id = -1;
+ dcpl_id = H5I_INVALID_HID;
if(H5Pclose(gcpl_id) < 0)
goto out;
- gcpl_id = -1;
+ gcpl_id = H5I_INVALID_HID;
if(H5Pclose(tcpl_id) < 0)
goto out;
- tcpl_id = -1;
+ tcpl_id = H5I_INVALID_HID;
if(H5Fclose(fid) < 0)
goto out;
- fid = -1;
+ fid = H5I_INVALID_HID;
@@ -7091,7 +7130,8 @@ gent_dataset_idx(void)
hsize_t dims[2];
hsize_t maxdims[2];
int buf[20][10];
- int i, j, ret;
+ int i, j;
+ int H5_ATTR_NDEBUG_UNUSED ret;
/* Get a copy of the file aaccess property */
fapl = H5Pcreate(H5P_FILE_ACCESS);
@@ -7615,7 +7655,7 @@ static void
gent_charsets(void)
{
hid_t fid, did, sid;
- herr_t status;
+ herr_t H5_ATTR_NDEBUG_UNUSED status;
hsize_t dim[] = {1}; /* Dataspace dimensions */
typedef struct CharSetInfo {
const char *ascii_p_;
@@ -7689,7 +7729,7 @@ static void gent_compound_intsizes(void) {
Array1Struct *Array1;
hid_t Array1Structid; /* File datatype identifier */
- herr_t status; /* Error checking variable */
+ herr_t H5_ATTR_NDEBUG_UNUSED status; /* Error checking variable */
hsize_t dim[] = { F70_LENGTH }; /* Dataspace dimensions */
int m, n, o; /* Array init loop vars */
@@ -7959,14 +7999,16 @@ static void gent_compound_attr_intsizes(void) {
int64_t dset64[F70_XDIM][F70_YDIM64];
double dsetdbl[F70_XDIM][F70_YDIM8];
} Array1Struct;
- Array1Struct Array1[F70_LENGTH];
+ Array1Struct *Array1 = NULL;
hid_t Array1Structid; /* File datatype identifier */
- herr_t status; /* Error checking variable */
+ herr_t H5_ATTR_NDEBUG_UNUSED status; /* Error checking variable */
hsize_t dim[] = { F70_LENGTH }; /* Dataspace dimensions */
int m, n, o; /* Array init loop vars */
+ Array1 = (Array1Struct *)HDcalloc(F70_LENGTH, sizeof(Array1Struct));
+
/* Initialize the data in the arrays/datastructure */
for (m = 0; m < F70_LENGTH; m++) {
@@ -8198,6 +8240,8 @@ static void gent_compound_attr_intsizes(void) {
status = H5Fclose(fid);
HDassert(status >= 0);
+
+ HDfree(Array1);
}
static void gent_nested_compound_dt(void) { /* test nested data type */
@@ -8838,7 +8882,7 @@ static void gent_compound_int_array(void) {
Cmpd1Struct *Cmpd1;
hid_t Cmpd1Structid; /* File datatype identifier */
- herr_t status; /* Error checking variable */
+ herr_t H5_ATTR_NDEBUG_UNUSED status; /* Error checking variable */
hsize_t dim[] = { F76_LENGTH }; /* Dataspace dimensions */
int m, n; /* Array init loop vars */
@@ -9094,7 +9138,7 @@ static void gent_compound_ints(void) {
hid_t Cmpd1Structid; /* File datatype identifier */
hid_t Cmpd2Structid; /* File datatype identifier */
- herr_t status; /* Error checking variable */
+ herr_t H5_ATTR_NDEBUG_UNUSED status; /* Error checking variable */
hsize_t dim[] = { F77_LENGTH }; /* Dataspace dimensions */
int m; /* Array init loop vars */
@@ -9797,7 +9841,7 @@ static void gent_bitnopaquefields(void)
uint64_t d;
} s_t;
- hid_t file, grp=-1, type=-1, space=-1, dset=-1;
+ hid_t file_id=H5I_INVALID_HID, grp=H5I_INVALID_HID, type=H5I_INVALID_HID, space=H5I_INVALID_HID, dset=H5I_INVALID_HID;
size_t i;
hsize_t nelmts = F80_DIM32;
uint8_t buf[F80_DIM32]; /* bitfield, opaque */
@@ -9806,15 +9850,15 @@ static void gent_bitnopaquefields(void)
uint64_t buf4[F80_DIM32]; /* bitfield, opaque */
s_t buf5[F80_DIM32]; /* compound */
- file = H5Fcreate(FILE80, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ file_id = H5Fcreate(FILE80, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- if ((grp = H5Gcreate2(file, "bittypetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
+ if ((grp = H5Gcreate2(file_id, "bittypetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
/* bitfield_1 */
if ((type = H5Tcopy(H5T_STD_B8LE)) >= 0) {
if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) {
if ((dset = H5Dcreate2(grp, "bitfield_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
for (i = 0; i < nelmts; i++) {
- buf[i] = (uint8_t)0xff ^ (uint8_t)i;
+ buf[i] = (uint8_t)(0xff ^ i);
}
H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
H5Dclose(dset);
@@ -9829,7 +9873,7 @@ static void gent_bitnopaquefields(void)
if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) {
if ((dset = H5Dcreate2(grp, "bitfield_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
for (i = 0; i < nelmts; i++) {
- buf2[i] = (uint16_t)0xffff ^ (uint16_t)(i * 16);
+ buf2[i] = (uint16_t)(0xffff ^ (i * 16));
}
H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2);
H5Dclose(dset);
@@ -9872,14 +9916,14 @@ static void gent_bitnopaquefields(void)
H5Gclose(grp);
}
- if ((grp = H5Gcreate2(file, "opaquetypetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
+ if ((grp = H5Gcreate2(file_id, "opaquetypetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
/* opaque_1 */
if ((type = H5Tcreate(H5T_OPAQUE, 1)) >= 0) {
if ((H5Tset_tag(type, "1-byte opaque type")) >= 0) {
if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) {
if ((dset = H5Dcreate2(grp, "opaque_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
for(i = 0; i < nelmts; i++)
- buf[i] = (uint8_t)0xff ^ (uint8_t)i;
+ H5_CHECKED_ASSIGN(buf[i], uint8_t, 0xff ^ i, size_t);
H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
H5Dclose(dset);
}
@@ -9895,7 +9939,7 @@ static void gent_bitnopaquefields(void)
if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) {
if ((dset = H5Dcreate2(grp, "opaque_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
for(i = 0; i < nelmts; i++)
- buf2[i] = (uint16_t)0xffff ^ (uint16_t)(i * 16);
+ H5_CHECKED_ASSIGN(buf2[i], uint16_t, 0xffff ^ (i * 16), size_t);
H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2);
H5Dclose(dset);
@@ -9908,7 +9952,7 @@ static void gent_bitnopaquefields(void)
H5Gclose(grp);
}
- if ((grp = H5Gcreate2(file, "cmpdtypetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
+ if ((grp = H5Gcreate2(file_id, "cmpdtypetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
/* compound_1 */
if ((type = H5Tcreate(H5T_COMPOUND, sizeof(s_t))) >= 0) {
H5Tinsert(type, "a", HOFFSET(s_t, a), H5T_STD_B8LE);
@@ -9918,8 +9962,8 @@ static void gent_bitnopaquefields(void)
if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) {
if ((dset = H5Dcreate2(grp, "compound_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
for(i = 0; i < nelmts; i++) {
- buf5[i].a = (uint8_t)0xff ^ (uint8_t)i;
- buf5[i].b = (uint16_t)0xffff ^ (uint16_t)(i * 16);
+ H5_CHECKED_ASSIGN(buf5[i].a, uint8_t, 0xff ^ i, size_t);
+ H5_CHECKED_ASSIGN(buf5[i].b, uint16_t, 0xffff ^ (i * 16), size_t);
buf5[i].c = (uint32_t)0xffffffff ^ (uint32_t)(i * 32);
buf5[i].d = (uint64_t)0xffffffffffffffff ^ (uint64_t)(i * 64);
}
@@ -9934,7 +9978,7 @@ static void gent_bitnopaquefields(void)
H5Gclose(grp);
}
- H5Fclose(file);
+ H5Fclose(file_id);
}
/*-------------------------------------------------------------------------
@@ -10033,9 +10077,9 @@ static void gent_compound_complex2(void)
compound *buf; /* compound */
- hid_t file, type=-1, space=-1, dset=-1;
+ hid_t file, type=H5I_INVALID_HID, space=H5I_INVALID_HID, dset=H5I_INVALID_HID;
hid_t dset_array_a, dset_array_b, dset_array_c;
- hid_t cmpd_tid1 = -1, cmpd_tid2 = -1, cmpd_tid3 = -1;
+ hid_t cmpd_tid1 = H5I_INVALID_HID, cmpd_tid2 = H5I_INVALID_HID, cmpd_tid3 = H5I_INVALID_HID;
size_t i;
size_t j, k;
unsigned dset_array_ndims;
@@ -10321,7 +10365,7 @@ static void gent_vlenstr_array(void)
};
const char *buffer[F83_DIM*F83_ARRAYDIM];
- hid_t file, type=-1, space=-1, dset=-1;
+ hid_t file, type=H5I_INVALID_HID, space=H5I_INVALID_HID, dset=H5I_INVALID_HID;
hid_t cmpd_tid1, array_tid;
int i, j;
@@ -10396,7 +10440,8 @@ static void gent_udfilter(void)
hsize_t dims1[RANK] = {DIM1,DIM2};
hsize_t chunk_dims[RANK] = {CDIM1,CDIM2};
int buf1[DIM1][DIM2];
- int i, j, n, ret;
+ int i, j, n;
+ int H5_ATTR_NDEBUG_UNUSED ret;
for(i=n=0; i<DIM1; i++){
for(j=0; j<DIM2; j++){
@@ -10488,7 +10533,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts,
/* Subtract the original value with MULTIPLIER */
while(buf_left > 0) {
char temp = *int_ptr;
- *int_ptr = temp - MULTIPLIER;
+ *int_ptr = (int8_t)(temp - MULTIPLIER);
int_ptr++;
buf_left -= sizeof(*int_ptr);
} /* end while */
@@ -10497,7 +10542,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts,
/* Add the original value with MULTIPLIER */
while(buf_left > 0) {
char temp = *int_ptr;
- *int_ptr = temp + MULTIPLIER;
+ *int_ptr = (int8_t)(temp + MULTIPLIER);
int_ptr++;
buf_left -= sizeof(*int_ptr);
} /* end while */
@@ -10564,10 +10609,10 @@ static void gent_null_space_group(void)
static void
gent_err_attr_dspace(void)
{
- hid_t fid = -1; /* File identifier */
- hid_t fcpl = -1; /* File access property list */
- hid_t sid = -1; /* Dataspace identifier */
- hid_t aid = -1; /* Attribute identifier */
+ hid_t fid = H5I_INVALID_HID; /* File identifier */
+ hid_t fcpl = H5I_INVALID_HID; /* File access property list */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace identifier */
+ hid_t aid = H5I_INVALID_HID; /* Attribute identifier */
hsize_t dims = 2; /* Dimensino size */
int wdata[2] = {7, 42}; /* The buffer to write */
int fd = -1; /* The file descriptor */
diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in
index e5680cf..53c8927 100644
--- a/tools/test/h5dump/testh5dump.sh.in
+++ b/tools/test/h5dump/testh5dump.sh.in
@@ -906,12 +906,50 @@ TOOLTEST_HELP() {
}
# Call the h5dump tool and grep for a value
-#
+# txttype ERRTXT greps test error output, otherwise greps test output
GREPTEST()
{
- expectdata=$1
- actual=$TESTDIR/$2
- actual_err="$TESTDIR/`basename $2 .ddl`.oerr"
+ txttype=$1
+ expectdata=$2
+ actual=$TESTDIR/$3
+ actual_err="$TESTDIR/`basename $3 .ddl`.oerr"
+ shift
+ shift
+ shift
+
+ # Run test.
+ TESTING $DUMPER -p $@
+ (
+ cd $TESTDIR
+ $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@"
+ ) >$actual 2>$actual_err
+ if [ "$txttype" = "ERRTXT" ]; then
+ $GREP "$expectdata" $actual_err > /dev/null
+ else
+ $GREP "$expectdata" $actual > /dev/null
+ fi
+ if [ $? -eq 0 ]; then
+ echo " PASSED"
+ else
+ echo " FAILED"
+ nerrors="`expr $nerrors + 1`"
+ fi
+
+ # Clean up output file
+ if test -z "$HDF5_NOCLEANUP"; then
+ rm -f $actual $actual_err
+ fi
+}
+
+# Call the h5dump tool and grep for a value but disables plugin filter loading
+# txttype ERRTXT greps test error output, otherwise greps test output
+GREPTEST2()
+{
+ txttype=$1
+ expectdata=$2
+ actual=$TESTDIR/$3
+ actual_err="$TESTDIR/`basename $3 .ddl`.oerr"
+ shift
shift
shift
@@ -921,7 +959,11 @@ GREPTEST()
cd $TESTDIR
$ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@"
) >$actual 2>$actual_err
- $GREP $expectdata $actual > /dev/null
+ if [ "$txttype" = "ERRTXT" ]; then
+ $GREP "$expectdata" $actual_err > /dev/null
+ else
+ $GREP "$expectdata" $actual > /dev/null
+ fi
if [ $? -eq 0 ]; then
echo " PASSED"
else
@@ -1137,7 +1179,7 @@ TOOLTEST tvlenstr_array.ddl --enable-error-stack tvlenstr_array.h5
# test for files with array data
TOOLTEST tarray1.ddl --enable-error-stack tarray1.h5
# # added for bug# 2092 - tarray1_big.h
-TOOLTEST4 tarray1_big.ddl --enable-error-stack -R tarray1_big.h5
+GREPTEST ERRTXT "NULL token size" tarray1_big.ddl --enable-error-stack -R tarray1_big.h5
TOOLTEST tarray2.ddl --enable-error-stack tarray2.h5
TOOLTEST tarray3.ddl --enable-error-stack tarray3.h5
TOOLTEST tarray4.ddl --enable-error-stack tarray4.h5
@@ -1345,9 +1387,9 @@ fi
# test for dataset region references
TOOLTEST tdatareg.ddl --enable-error-stack tdatareg.h5
-TOOLTEST4 tdataregR.ddl --enable-error-stack -R tdatareg.h5
+GREPTEST ERRTXT "NULL token size" tdataregR.ddl --enable-error-stack -R tdatareg.h5
TOOLTEST tattrreg.ddl --enable-error-stack tattrreg.h5
-TOOLTEST4 tattrregR.ddl --enable-error-stack -R tattrreg.h5
+GREPTEST ERRTXT "NULL token size" tattrregR.ddl --enable-error-stack -R tattrreg.h5
TOOLTEST2 tbinregR.exp --enable-error-stack -d /Dataset1 -s 0 -R -y -o tbinregR.txt tdatareg.h5
# Clean up text output files
@@ -1384,7 +1426,7 @@ TOOLTEST4 textlinkfar.ddl --enable-error-stack textlinkfar.h5
TOOLTEST4 textlink.ddl --enable-error-stack textlink.h5
# test for error stack display (BZ2048)
-TOOLTEST5 filter_fail.ddl --enable-error-stack filter_fail.h5
+GREPTEST2 ERRTXT "filter plugins disabled" filter_fail.ddl --enable-error-stack filter_fail.h5
# test for -o -y for dataset with attributes
TOOLTEST2 tall-6.exp --enable-error-stack -y -o tall-6.txt -d /g1/g1.1/dset1.1.1 tall.h5
@@ -1396,7 +1438,7 @@ TOOLTEST3 non_existing.ddl --enable-error-stack tgroup.h5 non_existing.h5
TOOLTEST err_attr_dspace.ddl err_attr_dspace.h5
# test to verify HDFFV-9407: long double full precision
-GREPTEST "1.123456789012345" t128bit_float.ddl -m %.35Lf t128bit_float.h5
+GREPTEST OUTTXT "1.123456789012345" t128bit_float.ddl -m %.35Lf t128bit_float.h5
# Clean up temporary files/directories
CLEAN_TESTFILES_AND_TESTDIR
diff --git a/tools/test/h5format_convert/CMakeLists.txt b/tools/test/h5format_convert/CMakeLists.txt
index 55d5623..9e49c4f 100644
--- a/tools/test/h5format_convert/CMakeLists.txt
+++ b/tools/test/h5format_convert/CMakeLists.txt
@@ -25,4 +25,6 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
#add_test (NAME h5fc_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5fc_gentest>)
endif ()
-include (CMakeTests.cmake)
+if (HDF5_TEST_TOOLS AND HDF5_TEST_SERIAL)
+ include (CMakeTests.cmake)
+endif ()
diff --git a/tools/test/h5format_convert/CMakeTests.cmake b/tools/test/h5format_convert/CMakeTests.cmake
index 398866c..7bc33ce 100644
--- a/tools/test/h5format_convert/CMakeTests.cmake
+++ b/tools/test/h5format_convert/CMakeTests.cmake
@@ -97,12 +97,6 @@
##############################################################################
##############################################################################
- if (NOT BUILD_SHARED_LIBS)
- set (tgt_ext "")
- else ()
- set (tgt_ext "-shared")
- endif ()
-
macro (ADD_H5_OUTPUT testname resultfile resultcode testfile)
# If using memchecker add tests without using scripts
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
@@ -123,7 +117,7 @@
NAME H5FC-${testname}-${testfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>"
-D "TEST_ARGS=${ARGN};outtmp.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}.out"
@@ -139,7 +133,7 @@
NAME H5FC-${testname}-NA
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}.out"
@@ -172,7 +166,7 @@
NAME H5FC-${testname}-${testfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>"
-D "TEST_ARGS=${ARGN};outtmp.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}.out"
@@ -204,7 +198,7 @@
NAME H5FC-${testname}-${testfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>"
-D "TEST_ARGS=${ARGN};outtmp.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}.out"
@@ -237,7 +231,7 @@
NAME H5FC-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>"
-D "TEST_ARGS=${ARGN};./testfiles/tmp.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=testfiles/${testname}.out"
@@ -280,7 +274,7 @@
NAME H5FC-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>"
-D "TEST_ARGS=-d;${ARGN};./testfiles/chktmp.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=testfiles/${testname}.out"
@@ -317,7 +311,7 @@
NAME H5FC-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>"
-D "TEST_ARGS=${ARGN};./testfiles/dmptmp.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=testfiles/${testname}.out"
@@ -330,7 +324,7 @@
NAME H5FC_CHECK_DUMP-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=-BH;./testfiles/dmptmp.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=testfiles/${testname}_chk.out"
diff --git a/tools/test/h5format_convert/h5fc_chk_idx.c b/tools/test/h5format_convert/h5fc_chk_idx.c
index 8369668..ad1742b 100644
--- a/tools/test/h5format_convert/h5fc_chk_idx.c
+++ b/tools/test/h5format_convert/h5fc_chk_idx.c
@@ -45,8 +45,8 @@ main(int argc, char *argv[])
{
char *fname = NULL;
char *dname = NULL;
- hid_t fid = -1;
- hid_t did = -1;
+ hid_t fid = H5I_INVALID_HID;
+ hid_t did = H5I_INVALID_HID;
H5D_chunk_index_t idx_type;
/* h5fc_chk_idx fname dname */
diff --git a/tools/test/h5format_convert/h5fc_gentest.c b/tools/test/h5format_convert/h5fc_gentest.c
index b482dee..1e9e2cf 100644
--- a/tools/test/h5format_convert/h5fc_gentest.c
+++ b/tools/test/h5format_convert/h5fc_gentest.c
@@ -77,12 +77,12 @@ const char *FILENAME[] = {
static void
gen_non(const char *fname)
{
- hid_t fid = -1; /* file id */
- hid_t fcpl = -1; /* file creation property list */
- hid_t gid = -1; /* group id */
- hid_t sid = -1; /* space id */
- hid_t dcpl = -1; /* dataset creation property id */
- hid_t did1 = -1, did2 = -1; /* dataset id */
+ hid_t fid = H5I_INVALID_HID; /* file id */
+ hid_t fcpl = H5I_INVALID_HID; /* file creation property list */
+ hid_t gid = H5I_INVALID_HID; /* group id */
+ hid_t sid = H5I_INVALID_HID; /* space id */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation property id */
+ hid_t did1 = -1, did2 = H5I_INVALID_HID; /* dataset id */
hsize_t dims1[1] = {10}; /* dataset dimension */
hsize_t dims2[2] = {4, 6}; /* dataset dimension */
hsize_t max_dims[2]; /* maximum dataset dimension */
@@ -307,11 +307,11 @@ error:
static void
gen_edge(const char *fname)
{
- hid_t fid = -1; /* file id */
- hid_t fapl = -1; /* file access property list */
- hid_t sid = -1; /* dataspace id */
- hid_t dcpl = -1; /* dataset creation property id */
- hid_t did = -1; /* dataset id */
+ hid_t fid = H5I_INVALID_HID; /* file id */
+ hid_t fapl = H5I_INVALID_HID; /* file access property list */
+ hid_t sid = H5I_INVALID_HID; /* dataspace id */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation property id */
+ hid_t did = H5I_INVALID_HID; /* dataset id */
hsize_t dims2[2] = {12, 6}; /* Dataset dimensions */
hsize_t c_dims[2] = {5, 5}; /* Chunk dimensions */
float buf[12][6]; /* Buffer for writing data */
@@ -395,14 +395,14 @@ error:
static void
gen_err_level(const char *fname)
{
- hid_t fid = -1; /* file ID */
- hid_t fapl = -1; /* file access property list */
- hid_t fcpl = -1; /* file creation property list */
- hid_t sid = -1; /* dataspace id */
- hid_t dcpl = -1; /* dataset creation property list */
- hid_t did = -1; /* dataset ID */
- hid_t fsid = -1; /* file dataspace ID */
- hid_t msid = -1; /* memory dataspace ID */
+ hid_t fid = H5I_INVALID_HID; /* file ID */
+ hid_t fapl = H5I_INVALID_HID; /* file access property list */
+ hid_t fcpl = H5I_INVALID_HID; /* file creation property list */
+ hid_t sid = H5I_INVALID_HID; /* dataspace id */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list */
+ hid_t did = H5I_INVALID_HID; /* dataset ID */
+ hid_t fsid = H5I_INVALID_HID; /* file dataspace ID */
+ hid_t msid = H5I_INVALID_HID; /* memory dataspace ID */
unsigned char *buf = NULL; /* buffer for data */
hsize_t dims[2] = {0, 1}; /* dataset dimension sizes */
hsize_t max_dims[2] = {1, H5S_UNLIMITED}; /* dataset maximum dimension sizes */
@@ -534,13 +534,13 @@ error:
static void
gen_ext(const char *fname, unsigned new_format, unsigned what)
{
- hid_t fid = -1; /* file id */
- hid_t fapl = -1; /* file access property list */
- hid_t fcpl = -1; /* file creation property list */
- hid_t gid = -1; /* group id */
- hid_t sid = -1; /* space id */
- hid_t dcpl = -1; /* dataset creation property id */
- hid_t did1 = -1, did2 = -1; /* dataset id */
+ hid_t fid = H5I_INVALID_HID; /* file id */
+ hid_t fapl = H5I_INVALID_HID; /* file access property list */
+ hid_t fcpl = H5I_INVALID_HID; /* file creation property list */
+ hid_t gid = H5I_INVALID_HID; /* group id */
+ hid_t sid = H5I_INVALID_HID; /* space id */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation property id */
+ hid_t did1 = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* dataset id */
hsize_t dims1[1] = {10}; /* dataset dimension */
hsize_t dims2[2] = {4, 6}; /* dataset dimension */
hsize_t max_dims[2]; /* maximum dataset dimension */
diff --git a/tools/test/h5import/CMakeLists.txt b/tools/test/h5import/CMakeLists.txt
index 9364683..a77ba00 100644
--- a/tools/test/h5import/CMakeLists.txt
+++ b/tools/test/h5import/CMakeLists.txt
@@ -15,4 +15,6 @@ else ()
endif ()
set_target_properties (h5importtest PROPERTIES FOLDER tools)
-include (CMakeTests.cmake)
+if (HDF5_TEST_TOOLS AND HDF5_TEST_SERIAL)
+ include (CMakeTests.cmake)
+endif ()
diff --git a/tools/test/h5import/CMakeTests.cmake b/tools/test/h5import/CMakeTests.cmake
index 22ab848..00d5009 100644
--- a/tools/test/h5import/CMakeTests.cmake
+++ b/tools/test/h5import/CMakeTests.cmake
@@ -96,16 +96,10 @@
##############################################################################
##############################################################################
- if (NOT BUILD_SHARED_LIBS)
- set (tgt_ext "")
- else ()
- set (tgt_ext "-shared")
- endif ()
-
macro (ADD_H5_TEST testname importfile conffile testfile)
# If using memchecker skip macro based tests
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5IMPORT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_ext}> ${importfile} -c ${conffile} -o ${testfile})
+ add_test (NAME H5IMPORT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_file_ext}> ${importfile} -c ${conffile} -o ${testfile})
set_tests_properties (H5IMPORT-${testname} PROPERTIES
FIXTURES_REQUIRED set_h5importtest
)
@@ -118,7 +112,7 @@
FIXTURES_REQUIRED set_h5importtest
)
- add_test (NAME H5IMPORT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_ext}> ${importfile} -c ${conffile} -o ${testfile})
+ add_test (NAME H5IMPORT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_file_ext}> ${importfile} -c ${conffile} -o ${testfile})
set_tests_properties (H5IMPORT-${testname} PROPERTIES
DEPENDS H5IMPORT-${testname}-clear-objects
)
@@ -127,7 +121,7 @@
NAME H5IMPORT-${testname}-H5DMP
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${testfile}.new"
@@ -143,7 +137,7 @@
NAME H5IMPORT-${testname}-H5DMP_CMP
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=testfiles/${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${testfile}.out"
@@ -176,7 +170,7 @@
NAME H5IMPORT-DUMP-${testname}-H5DMP
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-b;NATIVE;testfiles/${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=d${testfile}.dmp"
@@ -189,7 +183,7 @@
NAME H5IMPORT-DUMP-${testname}-H5DMP
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-y;--width=1;testfiles/${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=d${testfile}.dmp"
@@ -206,7 +200,7 @@
NAME H5IMPORT-DUMP-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5import${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5import${tgt_file_ext}>"
-D "TEST_ARGS:STRING=d${testfile}.bin;-c;d${testfile}.dmp;-o;d${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=d${testfile}.imp"
@@ -222,7 +216,7 @@
NAME H5IMPORT-DUMP-${testname}-H5DFF
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5diff${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5diff${tgt_file_ext}>"
-D "TEST_ARGS:STRING=-r;d${testfile};testfiles/${testfile};${datasetname};${datasetname}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=d${testfile}.dff"
@@ -254,7 +248,7 @@
NAME H5IMPORT_SUB-DUMP-${testname}-H5DMP
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=-p;-d;${datasetname};${ARGN};-o;${testname}.bin;-b;NATIVE;testfiles/${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${testname}.dmp"
@@ -270,7 +264,7 @@
NAME H5IMPORT_SUB-DUMP-${testname}-H5IMP
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5import${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5import${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${testname}.bin;-c;${testname}.dmp;-o;d-${testname}.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${testname}.imp"
@@ -285,7 +279,7 @@
NAME H5IMPORT_SUB-DUMP-${testname}-CMP
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=-p;d-${testname}.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=d-${testname}.dmp"
diff --git a/tools/test/h5jam/CMakeLists.txt b/tools/test/h5jam/CMakeLists.txt
index 6fdf7b0..f00e781 100644
--- a/tools/test/h5jam/CMakeLists.txt
+++ b/tools/test/h5jam/CMakeLists.txt
@@ -36,4 +36,6 @@ else ()
endif ()
set_target_properties (tellub PROPERTIES FOLDER tools)
-include (CMakeTests.cmake)
+if (HDF5_TEST_TOOLS AND HDF5_TEST_SERIAL)
+ include (CMakeTests.cmake)
+endif ()
diff --git a/tools/test/h5jam/CMakeTests.cmake b/tools/test/h5jam/CMakeTests.cmake
index f108afc..aaa9a5c 100644
--- a/tools/test/h5jam/CMakeTests.cmake
+++ b/tools/test/h5jam/CMakeTests.cmake
@@ -47,12 +47,6 @@
##############################################################################
##############################################################################
- if (NOT BUILD_SHARED_LIBS)
- set (tgt_ext "")
- else ()
- set (tgt_ext "-shared")
- endif ()
-
# ============================================================
# TEST_H5JAM_OUTPUT
# For the purpose to verify only output & exitcode from h5jam
@@ -60,7 +54,7 @@
macro (TEST_H5JAM_OUTPUT expectfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5JAM-${expectfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_ext}> ${ARGN})
+ add_test (NAME H5JAM-${expectfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_file_ext}> ${ARGN})
if (${resultcode})
set_tests_properties (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true")
endif ()
@@ -69,7 +63,7 @@
NAME H5JAM-${expectfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5jam${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5jam${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${expectfile}.out"
@@ -89,7 +83,7 @@
macro (TEST_H5UNJAM_OUTPUT expectfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5JAM-UNJAM-${expectfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_ext}> ${ARGN})
+ add_test (NAME H5JAM-UNJAM-${expectfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_file_ext}> ${ARGN})
if (${resultcode})
set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true")
endif ()
@@ -98,7 +92,7 @@
NAME H5JAM-UNJAM-${expectfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam${tgt_file_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${expectfile}.out"
@@ -116,7 +110,7 @@
NAME H5JAM-${testname}-CHECKFILE-H5DMP
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=testfiles/${expected}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${actual}.new"
@@ -130,7 +124,7 @@
NAME H5JAM-${testname}-CHECKFILE-H5DMP_CMP
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${actual}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${actual}.out"
@@ -165,7 +159,7 @@
COMMAND ${CMAKE_COMMAND} -E remove ${ufile}
)
set_tests_properties (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects)
- add_test (NAME H5JAM-${testname}-UNJAM COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_ext}> -i ${infile} -u ${ufile} -o ${outfile})
+ add_test (NAME H5JAM-${testname}-UNJAM COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_file_ext}> -i ${infile} -u ${ufile} -o ${outfile})
set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects)
set (compare_test ${ufile})
else ()
@@ -174,7 +168,7 @@
NAME H5JAM-${testname}-UNJAM
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam${tgt_file_ext}>"
-D "TEST_ARGS:STRING=-i;${infile};-o;${outfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${outfile}.ufile.txt"
@@ -185,7 +179,7 @@
set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects)
set (compare_test "${outfile}.ufile.txt")
else ()
- add_test (NAME H5JAM-${testname}-UNJAM COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_ext}> -i ${infile} -o ${outfile})
+ add_test (NAME H5JAM-${testname}-UNJAM COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_file_ext}> -i ${infile} -o ${outfile})
set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects)
set (compare_test "")
endif ()
@@ -247,7 +241,7 @@
COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5
)
endif ()
- add_test (NAME H5JAM-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_ext}> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN})
+ add_test (NAME H5JAM-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_file_ext}> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN})
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
set_tests_properties (H5JAM-${testname} PROPERTIES DEPENDS H5JAM-${testname}-clear-objects)
set (compare_test ${outfile})
@@ -302,7 +296,7 @@
)
set_tests_properties (H5JAM-${testname}_NONE_COPY PROPERTIES DEPENDS H5JAM-${testname}_NONE-SETUP)
- add_test (NAME H5JAM-${testname}_NONE COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_ext}> -u testfiles/${jamfile} -i ${chkfile} ${ARGN})
+ add_test (NAME H5JAM-${testname}_NONE COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_file_ext}> -u testfiles/${jamfile} -i ${chkfile} ${ARGN})
set_tests_properties (H5JAM-${testname}_NONE PROPERTIES DEPENDS H5JAM-${testname}_NONE_COPY)
set (compare_test ${chkfile})
diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c
index 26a427d..f496a7a 100644
--- a/tools/test/h5jam/getub.c
+++ b/tools/test/h5jam/getub.c
@@ -81,7 +81,7 @@ parse_command_line(int argc, const char *argv[])
int
main(int argc, const char *argv[])
{
- int fd = -1;
+ int fd = H5I_INVALID_HID;
unsigned size;
char *filename = NULL;
long res;
diff --git a/tools/test/h5jam/testh5jam.sh.in b/tools/test/h5jam/testh5jam.sh.in
index 3ae180b..bf705b4 100644
--- a/tools/test/h5jam/testh5jam.sh.in
+++ b/tools/test/h5jam/testh5jam.sh.in
@@ -474,9 +474,9 @@ UNJAMTEST () {
#
TOOLTEST_OUTPUT() {
- if [ "$1" == "JAM" ]; then
+ if [ "$1" = "JAM" ]; then
TOOLCMD=$JAM_BIN/$JAM
- elif [ "$1" == "UNJAM" ]; then
+ elif [ "$1" = "UNJAM" ]; then
TOOLCMD=$JAM_BIN/$UNJAM
fi
shift
diff --git a/tools/test/h5ls/CMakeLists.txt b/tools/test/h5ls/CMakeLists.txt
index 0da03c5..abbe6d0 100644
--- a/tools/test/h5ls/CMakeLists.txt
+++ b/tools/test/h5ls/CMakeLists.txt
@@ -30,6 +30,8 @@ if (BUILD_SHARED_LIBS)
)
endif ()
-include (CMakeTests.cmake)
+if (HDF5_TEST_TOOLS AND HDF5_TEST_SERIAL)
+ include (CMakeTests.cmake)
-include (CMakeTestsVDS.cmake)
+ include (CMakeTestsVDS.cmake)
+endif ()
diff --git a/tools/test/h5ls/CMakeTests.cmake b/tools/test/h5ls/CMakeTests.cmake
index 2f3f3ab..2b7aa96 100644
--- a/tools/test/h5ls/CMakeTests.cmake
+++ b/tools/test/h5ls/CMakeTests.cmake
@@ -134,16 +134,10 @@
##############################################################################
##############################################################################
- if (NOT BUILD_SHARED_LIBS)
- set (tgt_ext "")
- else ()
- set (tgt_ext "-shared")
- endif ()
-
macro (ADD_H5_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN})
+ add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_file_ext}> ${ARGN})
set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
if (${resultcode} EQUAL 1)
set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true")
@@ -154,7 +148,7 @@
NAME H5LS-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_file_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -168,7 +162,7 @@
macro (ADD_H5_ERR_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls> ${ARGN})
+ add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_file_ext}> ${ARGN})
set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
if (${resultcode} EQUAL 1)
set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true")
@@ -178,7 +172,7 @@
NAME H5LS-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_file_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -196,7 +190,7 @@
NAME H5LS_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_file_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake
index cf5b6d7..3fc8aab 100644
--- a/tools/test/h5ls/CMakeTestsVDS.cmake
+++ b/tools/test/h5ls/CMakeTestsVDS.cmake
@@ -80,16 +80,10 @@
##############################################################################
##############################################################################
- if (NOT BUILD_SHARED_LIBS)
- set (tgt_ext "")
- else ()
- set (tgt_ext "-shared")
- endif ()
-
macro (ADD_H5_VDS_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN})
+ add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_file_ext}> ${ARGN})
set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
if (${resultcode} EQUAL 1)
set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true")
@@ -99,7 +93,7 @@
NAME H5LS-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_file_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -113,7 +107,7 @@
macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5LS_PREFIX-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN})
+ add_test (NAME H5LS_PREFIX-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_file_ext}> ${ARGN})
set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES
ENVIRONMENT "HDF5_VDS_PREFIX=\${ORIGIN}"
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
@@ -126,7 +120,7 @@
NAME H5LS_PREFIX-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_file_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=vds/prefix/${resultfile}.out"
diff --git a/tools/test/h5ls/dynlib_ls.c b/tools/test/h5ls/dynlib_ls.c
index 571452e..661a6dc 100644
--- a/tools/test/h5ls/dynlib_ls.c
+++ b/tools/test/h5ls/dynlib_ls.c
@@ -69,7 +69,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts,
/* Subtract the original value with MULTIPLIER */
while(buf_left > 0) {
char temp = *int_ptr;
- *int_ptr = temp - MULTIPLIER;
+ *int_ptr = (int8_t)(temp - MULTIPLIER);
int_ptr++;
buf_left -= sizeof(*int_ptr);
} /* end while */
@@ -78,7 +78,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts,
/* Add the original value with MULTIPLIER */
while(buf_left > 0) {
char temp = *int_ptr;
- *int_ptr = temp + MULTIPLIER;
+ *int_ptr = (int8_t)(temp + MULTIPLIER);
int_ptr++;
buf_left -= sizeof(*int_ptr);
} /* end while */
diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt
index f81ce4f..5722354 100644
--- a/tools/test/h5repack/CMakeLists.txt
+++ b/tools/test/h5repack/CMakeLists.txt
@@ -98,4 +98,6 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
#add_test (NAME h5repackgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repackgentest>)
endif ()
-include (CMakeTests.cmake)
+if (HDF5_TEST_TOOLS AND HDF5_TEST_SERIAL)
+ include (CMakeTests.cmake)
+endif ()
diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake
index c8db1c3..e654bce 100644
--- a/tools/test/h5repack/CMakeTests.cmake
+++ b/tools/test/h5repack/CMakeTests.cmake
@@ -85,6 +85,9 @@
${HDF5_TOOLS_DIR}/testfiles/tfamily00009.h5
${HDF5_TOOLS_DIR}/testfiles/tfamily00010.h5
${HDF5_TOOLS_DIR}/testfiles/tordergr.h5
+ # reference conversion files
+ ${HDF5_TOOLS_DIR}/testfiles/tattrreg.h5
+ ${HDF5_TOOLS_DIR}/testfiles/tdatareg.h5
# tools/testfiles/vds
${HDF5_TOOLS_DIR}/testfiles/vds/1_a.h5
${HDF5_TOOLS_DIR}/testfiles/vds/1_b.h5
@@ -148,6 +151,9 @@
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/3_1_vds.h5-vds_chunk2x5x8-v
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/4_vds.h5-vds_compa-v
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/4_vds.h5-vds_conti-v
+ # refs
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/attrregion.tattrreg.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/dataregion.tdatareg.h5
)
foreach (h5_file ${LIST_HDF5_TEST_FILES})
@@ -176,16 +182,10 @@
##############################################################################
##############################################################################
- if (NOT BUILD_SHARED_LIBS)
- set (tgt_ext "")
- else ()
- set (tgt_ext "-shared")
- endif ()
-
macro (ADD_HELP_TEST testname resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5REPACK-h5repack-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN})
+ add_test (NAME H5REPACK-h5repack-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN})
set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
)
@@ -194,7 +194,7 @@
NAME H5REPACK-h5repack-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=h5repack-${testname}.out"
@@ -226,14 +226,14 @@
)
add_test (
NAME H5REPACK_OLD-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
)
set_tests_properties (H5REPACK_OLD-${testname} PROPERTIES
DEPENDS H5REPACK_OLD-${testname}-clear-objects
)
add_test (
NAME H5REPACK_OLD-${testname}_DFF
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
)
set_tests_properties (H5REPACK_OLD-${testname}_DFF PROPERTIES
DEPENDS H5REPACK_OLD-${testname}
@@ -261,14 +261,14 @@
)
add_test (
NAME H5REPACK-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
)
set_tests_properties (H5REPACK-${testname} PROPERTIES
DEPENDS H5REPACK-${testname}-clear-objects
)
add_test (
NAME H5REPACK-${testname}_DFF
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
)
set_tests_properties (H5REPACK-${testname}_DFF PROPERTIES
DEPENDS H5REPACK-${testname}
@@ -290,7 +290,7 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5REPACK_CMP-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}
)
else ()
add_test (
@@ -304,7 +304,7 @@
NAME H5REPACK_CMP-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN};${resultfile};out-${testname}.${resultfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}-${testname}.out"
@@ -334,7 +334,7 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5REPACK_MASK-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}
)
set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES
FIXTURES_REQUIRED clear_h5repack
@@ -351,7 +351,7 @@
NAME H5REPACK_MASK-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN};${resultfile};out-${testname}.${resultfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}-${testname}.out"
@@ -385,7 +385,7 @@
)
add_test (
NAME H5REPACK_DMP-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}
)
set_tests_properties (H5REPACK_DMP-${testname} PROPERTIES
DEPENDS H5REPACK_DMP-${testname}-clear-objects
@@ -395,7 +395,7 @@
NAME H5REPACK_DMP-h5dump-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=-q;creation_order;-pH;out-${testname}.${resultfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}-${testname}.out"
@@ -429,7 +429,7 @@
)
add_test (
NAME H5REPACK_STAT-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile}
)
set_tests_properties (H5REPACK_STAT-${testname} PROPERTIES
DEPENDS H5REPACK_STAT-${testname}-clear-objects
@@ -439,7 +439,7 @@
NAME H5REPACK_STAT-h5stat-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_file_ext}>"
-D "TEST_ARGS:STRING=-S;-s;out-${statarg}.${resultfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}-${testname}.out"
@@ -474,14 +474,14 @@
)
add_test (
NAME H5REPACK_VERIFY_LAYOUT-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
)
set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES
DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects
)
add_test (
NAME H5REPACK_VERIFY_LAYOUT-${testname}_DFF
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
)
set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES
DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}
@@ -491,7 +491,7 @@
NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=-d;${testdset};-pH;out-${testname}.${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testfile}-${testname}-v.out"
@@ -517,7 +517,7 @@
NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=-pH;out-${testname}.${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testfile}-${testname}-v.out"
@@ -555,7 +555,7 @@
)
add_test (
NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
)
set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname} PROPERTIES
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
@@ -565,7 +565,7 @@
NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=-d;${testdset};-p;out-${testname}.${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testfile}-${testname}-v.out"
@@ -593,7 +593,7 @@
)
add_test (
NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
)
set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname} PROPERTIES
DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects
@@ -602,7 +602,7 @@
NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
-D "TEST_ARGS:STRING=-H;-B;out-${testname}.${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testfile}-${testname}-v.out"
@@ -627,7 +627,7 @@
)
add_test (
NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
)
set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} PROPERTIES
DEPENDS ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects
@@ -648,20 +648,20 @@
)
add_test (
NAME H5REPACK_META-${testname}_N
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5
)
set_tests_properties (H5REPACK_META-${testname}_N PROPERTIES
DEPENDS H5REPACK_META-${testname}_N-clear-objects
)
add_test (
NAME H5REPACK_META-${testname}_M
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5
)
set_tests_properties (H5REPACK_META-${testname}_M PROPERTIES
DEPENDS H5REPACK_META-${testname}_N
)
- add_test (NAME H5REPACK_META-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5)
+ add_test (NAME H5REPACK_META-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_IGNORE_EOL} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5)
set_tests_properties (H5REPACK_META-${testname} PROPERTIES
WILL_FAIL "true"
DEPENDS H5REPACK_META-${testname}_M
@@ -719,100 +719,100 @@
endmacro ()
macro (ADD_H5_EXTERNAL_TEST testname testtype testfile)
- # canonical file = h5repack_${testfile}.h5 - preexist
- # external file = h5repack_${testfile}_ex.h5 - preexist
- # repacked file = h5repack_${testfile}_rp.h5 - created
- # external data file = h5repack_${testfile}_ex-0.dat
- if ("${testtype}" STREQUAL "SKIP")
- if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ # canonical file = h5repack_${testfile}.h5 - preexist
+ # external file = h5repack_${testfile}_ex.h5 - preexist
+ # repacked file = h5repack_${testfile}_rp.h5 - created
+ # external data file = h5repack_${testfile}_ex-0.dat
+ if ("${testtype}" STREQUAL "SKIP")
add_test (
NAME H5REPACK_EXTERNAL-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}"
)
set_property(TEST H5REPACK_EXTERNAL-${testname} PROPERTY DISABLED)
+ else ()
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_rp.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}-clear-objects PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ FIXTURES_REQUIRED clear_h5repack
+ )
+ # make sure external data file 0 is available
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_CPY
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "${PROJECT_SOURCE_DIR}/testfiles/h5repack_${testfile}_ex-0.dat" "${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex-0.dat"
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_CPY PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}-clear-objects
+ )
+ # comparison of known files
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DFF1
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF1 PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_CPY
+ )
+ # repack the external file to the repacked file
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname} PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_DFF1
+ )
+ # comparison of repacked file to known files
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DFF2
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF2 PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}
+ )
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DFF3
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF3 PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_DFF2
+ )
+ # invalidate external file by removing its first data file
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DATA_RMV
+ COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_ex-0.dat
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DATA_RMV PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_DFF3
+ )
+ # verify comparison of repacked file to known file
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DFF4
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF4 PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_DATA_RMV
+ )
+ # verify comparison of repacked file to known external file fails
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DFF_FAIL
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF_FAIL PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_DFF4
+ WILL_FAIL "true"
+ )
endif ()
- else ()
- add_test (
- NAME H5REPACK_EXTERNAL-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_rp.h5
- )
- set_tests_properties (H5REPACK_EXTERNAL-${testname}-clear-objects PROPERTIES
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- FIXTURES_REQUIRED clear_h5repack
- )
- # make sure external data file 0 is available
- add_test (
- NAME H5REPACK_EXTERNAL-${testname}_CPY
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- "${PROJECT_SOURCE_DIR}/testfiles/h5repack_${testfile}_ex-0.dat" "${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex-0.dat"
- )
- set_tests_properties (H5REPACK_EXTERNAL-${testname}_CPY PROPERTIES
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- DEPENDS H5REPACK_EXTERNAL-${testname}-clear-objects
- )
- # comparison of known files
- add_test (
- NAME H5REPACK_EXTERNAL-${testname}_DFF1
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5
- )
- set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF1 PROPERTIES
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- DEPENDS H5REPACK_EXTERNAL-${testname}_CPY
- )
- # repack the external file to the repacked file
- add_test (
- NAME H5REPACK_EXTERNAL-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5
- )
- set_tests_properties (H5REPACK_EXTERNAL-${testname} PROPERTIES
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- DEPENDS H5REPACK_EXTERNAL-${testname}_DFF1
- )
- # comparison of repacked file to known files
- add_test (
- NAME H5REPACK_EXTERNAL-${testname}_DFF2
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5
- )
- set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF2 PROPERTIES
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- DEPENDS H5REPACK_EXTERNAL-${testname}
- )
- add_test (
- NAME H5REPACK_EXTERNAL-${testname}_DFF3
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5
- )
- set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF3 PROPERTIES
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- DEPENDS H5REPACK_EXTERNAL-${testname}_DFF2
- )
- # invalidate external file by removing its first data file
- add_test (
- NAME H5REPACK_EXTERNAL-${testname}_DATA_RMV
- COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_ex-0.dat
- )
- set_tests_properties (H5REPACK_EXTERNAL-${testname}_DATA_RMV PROPERTIES
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- DEPENDS H5REPACK_EXTERNAL-${testname}_DFF3
- )
- # verify comparison of repacked file to known file
- add_test (
- NAME H5REPACK_EXTERNAL-${testname}_DFF4
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5
- )
- set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF4 PROPERTIES
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- DEPENDS H5REPACK_EXTERNAL-${testname}_DATA_RMV
- )
- # verify comparison of repacked file to known external file fails
- add_test (
- NAME H5REPACK_EXTERNAL-${testname}_DFF_FAIL
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5
- )
- set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF_FAIL PROPERTIES
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- DEPENDS H5REPACK_EXTERNAL-${testname}_DFF4
- WILL_FAIL "true"
- )
endif ()
endmacro ()
@@ -1468,6 +1468,12 @@
endif ()
ADD_H5_VERIFY_VDS (vds_conti ${TESTTYPE} 0 ${FILEV4} vds_dset CONTIGUOUS -l vds_dset:CONTI)
+################################################################
+# reference new api conversions
+###############################################################
+ADD_H5_DMP_TEST (attrregion "TEST" 0 tattrreg.h5)
+ADD_H5_DMP_TEST (dataregion "TEST" 0 tdatareg.h5)
+
##############################################################################
### V E R S I O N B O U N D S T E S T S
##############################################################################
diff --git a/tools/test/h5repack/h5repackgentest.c b/tools/test/h5repack/h5repackgentest.c
index 12883b7..7604964 100644
--- a/tools/test/h5repack/h5repackgentest.c
+++ b/tools/test/h5repack/h5repackgentest.c
@@ -42,7 +42,10 @@
#define FILE_UINT8BE "h5repack_uint8be"
#define FILE_F32LE "h5repack_f32le"
-#define H5REPACKGENTEST_OOPS ret_value = -1; goto done;
+#define H5REPACKGENTEST_OOPS { \
+ ret_value = -1; \
+ goto done; \
+}
#define H5REPACKGENTEST_COMMON_CLEANUP(dcpl, file, space) { \
if ((dcpl) != H5P_DEFAULT && (dcpl) != H5I_INVALID_HID) { \
@@ -53,58 +56,37 @@
}
struct external_def {
- hsize_t type_size;
+ hsize_t type_size;
unsigned n_elts_per_file;
unsigned n_elts_total;
};
-
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Helper function to create and write a dataset to file.
* Returns 0 on success, -1 on failure.
*/
static int
-__make_dataset(
- hid_t file_id,
- const char *dset_name,
- hid_t mem_type_id,
- hid_t space_id,
- hid_t dcpl_id,
- void *wdata)
-{
- hid_t dset_id = H5I_INVALID_HID;
+__make_dataset(hid_t file_id, const char *dset_name,
+ hid_t mem_type_id, hid_t space_id, hid_t dcpl_id, void *wdata) {
+ hid_t dset_id = H5I_INVALID_HID;
int ret_value = 0;
- dset_id = H5Dcreate2(
- file_id,
- dset_name,
- mem_type_id,
- space_id,
- H5P_DEFAULT,
- dcpl_id,
- H5P_DEFAULT);
- if (dset_id == H5I_INVALID_HID) {
+ dset_id = H5Dcreate2(file_id, dset_name, mem_type_id, space_id,
+ H5P_DEFAULT, dcpl_id,
+ H5P_DEFAULT);
+ if (dset_id == H5I_INVALID_HID)
H5REPACKGENTEST_OOPS;
- }
- if (H5Dwrite(
- dset_id,
- mem_type_id,
- H5S_ALL,
- H5S_ALL,
- H5P_DEFAULT,
- wdata)
- < 0)
- {
+ if (H5Dwrite(dset_id, mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata) < 0)
H5REPACKGENTEST_OOPS;
- }
done:
- if (dset_id != H5I_INVALID_HID) { (void)H5Dclose(dset_id); }
+ if (dset_id != H5I_INVALID_HID)
+ (void) H5Dclose(dset_id);
+
return ret_value;
} /* end __make_dataset() */
-
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Helper function to populate the DCPL external storage list.
* Creates external files for the DCPL, with each file name following the
@@ -114,38 +96,30 @@ done:
* Returns 0 on success, -1 on failure.
*/
static int
-__set_dcpl_external_list(
- hid_t dcpl,
- const char *filename,
- unsigned n_elts_per_file,
- unsigned n_elts_total,
- hsize_t elt_size)
-{
+__set_dcpl_external_list(hid_t dcpl, const char *filename,
+ unsigned n_elts_per_file, unsigned n_elts_total, hsize_t elt_size) {
char name[MAX_NAME_SIZE];
unsigned n_external_files = 0;
unsigned i = 0;
- if (NULL == filename || '\0' == *filename) {
+ if (NULL == filename || '\0' == *filename)
return -1;
- }
n_external_files = n_elts_total / n_elts_per_file;
- if (n_elts_total != (n_external_files * n_elts_per_file)) {
+ if (n_elts_total != (n_external_files * n_elts_per_file))
return -1;
- }
+
for (i = 0; i < n_external_files; i++) {
- if (snprintf(name, MAX_NAME_SIZE, "%s_ex-%u.dat", filename, i) >= MAX_NAME_SIZE) {
+ if (HDsnprintf(name, MAX_NAME_SIZE, "%s_ex-%u.dat", filename, i) >= MAX_NAME_SIZE)
return -1;
- }
- if (H5Pset_external(dcpl, name, 0, n_elts_per_file * elt_size) < 0) {
+
+ if (H5Pset_external(dcpl, name, 0, n_elts_per_file * elt_size) < 0)
return -1;
- }
}
return 0;
} /* end __set_dcpl_external_list() */
-
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Generalized utility function to write a file with the specified data and
* dataset configuration. If `ext` is provided, will attempt to use external
@@ -153,141 +127,102 @@ __set_dcpl_external_list(
* Returns 0 on success, -1 on failure.
*/
static int
-__make_file(
- const char *basename,
- struct external_def *ext,
- hid_t type_id,
- hsize_t rank,
- hsize_t *dims,
- void *wdata)
-{
- char filename[MAX_NAME_SIZE];
- hid_t file_id = H5I_INVALID_HID;
- hid_t dcpl_id = H5P_DEFAULT;
- hid_t space_id = H5I_INVALID_HID;
- int ret_value = 0;
+__make_file(const char *basename, struct external_def *ext,
+ hid_t type_id, hsize_t rank, hsize_t *dims, void *wdata) {
+ char filename[MAX_NAME_SIZE];
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t dcpl_id = H5P_DEFAULT;
+ hid_t space_id = H5I_INVALID_HID;
+ int ret_value = 0;
- if (snprintf(filename,
- MAX_NAME_SIZE,
- "%s%s.h5",
- basename,
- (NULL != ext) ? "_ex" : "")
- >= MAX_NAME_SIZE)
- {
+ if (HDsnprintf(filename, MAX_NAME_SIZE, "%s%s.h5", basename, (NULL != ext) ? "_ex" : "") >= MAX_NAME_SIZE)
H5REPACKGENTEST_OOPS;
- }
if (NULL != ext) {
dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
- if (dcpl_id == H5I_INVALID_HID) {
+ if (dcpl_id == H5I_INVALID_HID)
H5REPACKGENTEST_OOPS;
- }
- if (__set_dcpl_external_list(
- dcpl_id,
- basename,
- ext->n_elts_per_file,
- ext->n_elts_total,
- ext->type_size)
- < 0)
- {
+
+ if (__set_dcpl_external_list(dcpl_id, basename, ext->n_elts_per_file, ext->n_elts_total, ext->type_size) < 0)
H5REPACKGENTEST_OOPS;
- }
}
- space_id = H5Screate_simple(rank, dims, NULL);
- if (space_id == H5I_INVALID_HID) {
+ space_id = H5Screate_simple((int)rank, dims, NULL);
+ if (space_id == H5I_INVALID_HID)
H5REPACKGENTEST_OOPS;
- }
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- if (file_id == H5I_INVALID_HID) {
+ if (file_id == H5I_INVALID_HID)
H5REPACKGENTEST_OOPS;
- }
- if (__make_dataset(
- file_id,
- "dset",
- type_id,
- space_id,
- dcpl_id,
- wdata)
- < 0)
- {
+
+ if (__make_dataset(file_id, "dset", type_id, space_id, dcpl_id, wdata) < 0)
H5REPACKGENTEST_OOPS;
- }
done:
H5REPACKGENTEST_COMMON_CLEANUP(dcpl_id, file_id, space_id);
- return ret_value;
+return ret_value;
} /* end __make_file() */
-
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Returns 0 on success, -1 on failure.
*/
static int
-generate_int32le_1d(hbool_t external)
-{
- int32_t wdata[12];
- hsize_t dims[] = {12};
- struct external_def *def_ptr = NULL;
- struct external_def def = { (hsize_t)sizeof(int32_t), 6, 12 };
- int32_t n = 0;
- int ret_value = 0;
+generate_int32le_1d(hbool_t external) {
+ int32_t wdata[12];
+ hsize_t dims[] = { 12 };
+ struct external_def *def_ptr = NULL;
+ struct external_def def = { (hsize_t) sizeof(int32_t), 6, 12 };
+ int32_t n = 0;
+ int ret_value = 0;
/* Generate values
- */
+ */
for (n = 0; n < 12; n++) {
- wdata[n] = n-6;
+ wdata[n] = n - 6;
}
def_ptr = (TRUE == external) ? (&def) : NULL;
- if (__make_file(FILE_INT32LE_1, def_ptr, H5T_STD_I32LE, 1, dims, wdata) < 0) {
+ if (__make_file(FILE_INT32LE_1, def_ptr, H5T_STD_I32LE, 1, dims, wdata) < 0)
ret_value = -1;
- }
return ret_value;
} /* end generate_int32le_1d() */
-
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Returns 0 on success, -1 on failure.
*/
static int
-generate_int32le_2d(hbool_t external)
-{
- int32_t wdata[64];
- hsize_t dims[] = {8, 8};
- struct external_def *def_ptr = NULL;
- struct external_def def = { (hsize_t)sizeof(int32_t), 64, 64 };
- int32_t n = 0;
- int ret_value = 0;
+generate_int32le_2d(hbool_t external) {
+ int32_t wdata[64];
+ hsize_t dims[] = { 8, 8 };
+ struct external_def *def_ptr = NULL;
+ struct external_def def = { (hsize_t) sizeof(int32_t), 64, 64 };
+ int32_t n = 0;
+ int ret_value = 0;
/* Generate values
- */
+ */
for (n = 0; n < 64; n++) {
- wdata[n] = n-32;
+ wdata[n] = n - 32;
}
def_ptr = (TRUE == external) ? (&def) : NULL;
- if (__make_file(FILE_INT32LE_2, def_ptr, H5T_STD_I32LE, 2, dims, wdata) < 0) {
+ if (__make_file(FILE_INT32LE_2, def_ptr, H5T_STD_I32LE, 2, dims, wdata) < 0)
ret_value = -1;
- }
return ret_value;
} /* end generate_int32le_2d() */
-
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Returns 0 on success, -1 on failure.
*/
static int
-generate_int32le_3d(hbool_t external)
-{
- hsize_t dims[] = {8, 8, 8};
- int32_t wdata[512]; /* 8^3, from dims */
+generate_int32le_3d(hbool_t external) {
+ hsize_t dims[] = { 8, 8, 8 };
+ int32_t wdata[512]; /* 8^3, from dims */
struct external_def *def_ptr = NULL;
- struct external_def def = { (hsize_t)sizeof(int32_t), 512, 512 };
+ struct external_def def = { (hsize_t) sizeof(int32_t), 512, 512 };
int32_t n = 0;
int i = 0;
int j = 0;
@@ -295,34 +230,31 @@ generate_int32le_3d(hbool_t external)
int ret_value = 0;
/* generate values, alternating positive and negative
- */
- for (i=0, n=0; i < dims[0]; i++) {
- for (j=0; j < dims[1]; j++) {
- for (k=0; k < dims[2]; k++, n++) {
- wdata[n] = (k + j*512 + i*4096) * ((n&1) ? (-1) : (1));
+ */
+ for (i = 0, n = 0; (hsize_t)i < dims[0]; i++) {
+ for (j = 0; (hsize_t)j < dims[1]; j++) {
+ for (k = 0; (hsize_t)k < dims[2]; k++, n++) {
+ wdata[n] = (k + j * 512 + i * 4096) * ((n & 1) ? (-1) : (1));
}
}
}
def_ptr = (TRUE == external) ? (&def) : NULL;
- if (__make_file(FILE_INT32LE_3, def_ptr, H5T_STD_I32LE, 3, dims, wdata) < 0) {
+ if (__make_file(FILE_INT32LE_3, def_ptr, H5T_STD_I32LE, 3, dims, wdata) < 0)
ret_value = -1;
- }
return ret_value;
} /* end generate_int32le_3d() */
-
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Returns 0 on success, -1 on failure.
*/
static int
-generate_uint8be(hbool_t external)
-{
- hsize_t dims[] = {4, 8, 8};
- uint8_t wdata[256]; /* 4*8*8, from dims */
+generate_uint8be(hbool_t external) {
+ hsize_t dims[] = { 4, 8, 8 };
+ uint8_t wdata[256]; /* 4*8*8, from dims */
struct external_def *def_ptr = NULL;
- struct external_def def = { (hsize_t)sizeof(uint8_t), 64, 256 };
+ struct external_def def = { (hsize_t) sizeof(uint8_t), 64, 256 };
uint8_t n = 0;
int i = 0;
int j = 0;
@@ -330,84 +262,78 @@ generate_uint8be(hbool_t external)
int ret_value = 0;
/* Generate values, ping-pong from ends of range
- */
- for (i=0, n=0; i < dims[0]; i++) {
- for (j=0; j < dims[1]; j++) {
- for (k=0; k < dims[2]; k++, n++) {
- wdata[n] = n * ((n&1) ? (-1) : (1));
+ */
+ for (i = 0, n = 0; (hsize_t)i < dims[0]; i++) {
+ for (j = 0; (hsize_t)j < dims[1]; j++) {
+ for (k = 0; (hsize_t)k < dims[2]; k++, n++) {
+ wdata[n] = (uint8_t)((n & 1) ? -n : n);
}
}
}
def_ptr = (TRUE == external) ? (&def) : NULL;
- if (__make_file(FILE_UINT8BE, def_ptr, H5T_STD_U8BE, 3, dims, wdata) < 0) {
+ if (__make_file(FILE_UINT8BE, def_ptr, H5T_STD_U8BE, 3, dims, wdata) < 0)
ret_value = -1;
- }
return ret_value;
} /* end generate_uint8be() */
-
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Returns 0 on success, -1 on failure.
*/
static int
-generate_f32le(hbool_t external)
-{
- hsize_t dims[] = {12, 6};
- float wdata[72]; /* 12*6, from dims */
+generate_f32le(hbool_t external) {
+ hsize_t dims[] = { 12, 6 };
+ float wdata[72]; /* 12*6, from dims */
struct external_def *def_ptr = NULL;
- struct external_def def = {
- (hsize_t)sizeof(float),
- 72,
- 72
- };
- float n = 0;
- int i = 0;
- int j = 0;
- int k = 0;
- int ret_value = 0;
+ struct external_def def = { (hsize_t) sizeof(float), 72, 72 };
+ float n = 0;
+ int i = 0;
+ int j = 0;
+ int k = 0;
+ int ret_value = 0;
/* Generate values */
- for (i=0, k=0, n=0; i < dims[0]; i++) {
- for (j=0; j < dims[1]; j++, k++, n++) {
- wdata[k] = n * 801.1 * ((k % 5 == 1) ? (-1) : (1));
+ for (i = 0, k = 0, n = 0; (hsize_t)i < dims[0]; i++) {
+ for (j = 0; (hsize_t)j < dims[1]; j++, k++, n++) {
+ wdata[k] = n * 801.1f * ((k % 5 == 1) ? (-1) : (1));
}
}
def_ptr = (TRUE == external) ? (&def) : NULL;
- if (__make_file(FILE_F32LE, def_ptr, H5T_IEEE_F32LE, 2, dims, wdata) < 0) {
+ if (__make_file(FILE_F32LE, def_ptr, H5T_IEEE_F32LE, 2, dims, wdata) < 0)
ret_value = -1;
- }
return ret_value;
} /* end generate_f32le() */
-
/* ----------------------------------------------------------------------------
* Create files.
* Return 0 on success, nonzero on failure.
*/
int
-main(void)
-{
- int i = 0;
- int ret_value = 0;
-
- for (i=0; i < 2; i++) {
- hbool_t external = (i&1) ? TRUE : FALSE;
- if (ret_value == 0) { ret_value -= generate_int32le_1d(external); }
- if (ret_value == 0) { ret_value -= generate_int32le_2d(external); }
- if (ret_value == 0) { ret_value -= generate_int32le_3d(external); }
- if (ret_value == 0) { ret_value -= generate_uint8be(external); }
- if (ret_value == 0) { ret_value -= generate_f32le(external); }
- } /* end for external data storage or not */
+main(void) {
+ int i = 0;
- if (ret_value != 0) {
- HDprintf("A problem occurred!\n");
- }
+ for (i = 0; i < 2; i++) {
+ hbool_t external = (i & 1) ? TRUE : FALSE;
+ if (generate_int32le_1d(external) < 0)
+ HDprintf("A generate_int32le_1d failed!\n");
- return ret_value;
-} /* end main() */
+ if (generate_int32le_2d(external) < 0)
+ HDprintf("A generate_int32le_2d failed!\n");
+
+ if (generate_int32le_3d(external) < 0)
+ HDprintf("A generate_int32le_3d failed!\n");
+ if (generate_uint8be(external) < 0)
+ HDprintf("A generate_uint8be failed!\n");
+
+ if (generate_f32le(external) < 0)
+ HDprintf("A generate_f32le failed!\n");
+
+ } /* end for external data storage or not */
+
+ return EXIT_SUCCESS;
+} /* end main() */
diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c
index ec8df3c..2654685 100644
--- a/tools/test/h5repack/h5repacktst.c
+++ b/tools/test/h5repack/h5repacktst.c
@@ -1779,9 +1779,9 @@ error:
static
int make_testfiles(void)
{
- hid_t fid = -1;
- hid_t fcpl = -1; /* File creation property list */
- hid_t fapl = -1; /* File access property list */
+ hid_t fid = H5I_INVALID_HID;
+ hid_t fcpl = H5I_INVALID_HID; /* File creation property list */
+ hid_t fapl = H5I_INVALID_HID; /* File access property list */
unsigned j; /* Local index variable */
/*-------------------------------------------------------------------------
@@ -2210,12 +2210,12 @@ out:
static
int make_all_objects(hid_t loc_id)
{
- hid_t did = -1;
- hid_t gid = -1;
- hid_t tid = -1;
- hid_t rid = -1;
- hid_t sid = -1;
- hid_t gcplid = -1;
+ hid_t did = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
+ hid_t rid = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t gcplid = H5I_INVALID_HID;
hsize_t dims[1] = {2};
/* compound datatype */
typedef struct s_t
@@ -2332,10 +2332,10 @@ out:
static
int make_attributes(hid_t loc_id)
{
- hid_t did = -1;
- hid_t gid = -1;
- hid_t rid = -1;
- hid_t sid = -1;
+ hid_t did = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID;
+ hid_t rid = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
hsize_t dims[1] = {2};
/*-------------------------------------------------------------------------
@@ -2403,8 +2403,8 @@ static
int make_hlinks(hid_t loc_id)
{
hid_t g1id =- 1;
- hid_t g2id = -1;
- hid_t g3id = -1;
+ hid_t g2id = H5I_INVALID_HID;
+ hid_t g3id = H5I_INVALID_HID;
hsize_t dims[2] = {3,2};
int buf[3][2] = {{1,1}, {1,2}, {2,2}};
@@ -2473,8 +2473,8 @@ out:
static
int make_szip(hid_t loc_id)
{
- hid_t dcpl = -1; /* dataset creation property list */
- hid_t sid = -1; /* dataspace ID */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list */
+ hid_t sid = H5I_INVALID_HID; /* dataspace ID */
unsigned szip_options_mask = H5_SZIP_ALLOW_K13_OPTION_MASK | H5_SZIP_NN_OPTION_MASK;
unsigned szip_pixels_per_block = 8;
hsize_t dims[RANK] = {DIM1, DIM2};
@@ -2544,8 +2544,8 @@ out:
static
int make_deflate(hid_t loc_id)
{
- hid_t dcpl = -1; /* dataset creation property list */
- hid_t sid = -1; /* dataspace ID */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list */
+ hid_t sid = H5I_INVALID_HID; /* dataspace ID */
hsize_t dims[RANK] = {DIM1,DIM2};
hsize_t chunk_dims[RANK] = {CDIM1,CDIM2};
int buf[DIM1][DIM2];
@@ -2684,8 +2684,8 @@ out:
static
int make_fletcher32(hid_t loc_id)
{
- hid_t dcpl = -1; /* dataset creation property list */
- hid_t sid = -1; /* dataspace ID */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list */
+ hid_t sid = H5I_INVALID_HID; /* dataspace ID */
hsize_t dims[RANK]={DIM1,DIM2};
hsize_t chunk_dims[RANK]={CDIM1,CDIM2};
int buf[DIM1][DIM2];
@@ -2751,10 +2751,10 @@ out:
static
int make_nbit(hid_t loc_id)
{
- hid_t dcpl = -1; /* dataset creation property list */
- hid_t sid = -1; /* dataspace ID */
- hid_t dtid = -1;
- hid_t dsid = -1;
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list */
+ hid_t sid = H5I_INVALID_HID; /* dataspace ID */
+ hid_t dtid = H5I_INVALID_HID;
+ hid_t dsid = H5I_INVALID_HID;
hsize_t dims[RANK]={DIM1,DIM2};
hsize_t chunk_dims[RANK]={CDIM1,CDIM2};
int buf[DIM1][DIM2];
@@ -2832,10 +2832,10 @@ out:
static
int make_scaleoffset(hid_t loc_id)
{
- hid_t dcpl = -1; /* dataset creation property list */
- hid_t sid = -1; /* dataspace ID */
- hid_t dtid = -1;
- hid_t dsid = -1;
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list */
+ hid_t sid = H5I_INVALID_HID; /* dataspace ID */
+ hid_t dtid = H5I_INVALID_HID;
+ hid_t dsid = H5I_INVALID_HID;
hsize_t dims[RANK] = {DIM1,DIM2};
hsize_t chunk_dims[RANK] = {CDIM1,CDIM2};
int buf[DIM1][DIM2];
@@ -3077,11 +3077,11 @@ int make_early(void)
{
hsize_t dims[1] ={3000};
hsize_t cdims[1]={30};
- hid_t fid=-1;
- hid_t did=-1;
- hid_t sid=-1;
- hid_t tid=-1;
- hid_t dcpl=-1;
+ hid_t fid=H5I_INVALID_HID;
+ hid_t did=H5I_INVALID_HID;
+ hid_t sid=H5I_INVALID_HID;
+ hid_t tid=H5I_INVALID_HID;
+ hid_t dcpl=H5I_INVALID_HID;
int i;
char name[16];
int iter=100;
@@ -3172,8 +3172,8 @@ out:
static
int make_layout(hid_t loc_id)
{
- hid_t dcpl=-1; /* dataset creation property list */
- hid_t sid=-1; /* dataspace ID */
+ hid_t dcpl=H5I_INVALID_HID; /* dataset creation property list */
+ hid_t sid=H5I_INVALID_HID; /* dataspace ID */
hsize_t dims[RANK]={DIM1,DIM2};
hsize_t chunk_dims[RANK]={CDIM1,CDIM2};
int buf[DIM1][DIM2];
@@ -3286,12 +3286,12 @@ static
int make_layout2(hid_t loc_id)
{
- hid_t contig_dcpl = -1; /* dataset creation property list */
- hid_t chunked_dcpl = -1; /* dataset creation property list */
+ hid_t contig_dcpl = H5I_INVALID_HID; /* dataset creation property list */
+ hid_t chunked_dcpl = H5I_INVALID_HID; /* dataset creation property list */
int i, j, n; /* Local index variables */
int ret_value = -1; /* Return value */
- hid_t s_sid = -1; /* dataspace ID */
+ hid_t s_sid = H5I_INVALID_HID; /* dataspace ID */
hsize_t s_dims[RANK] = {S_DIM1,S_DIM2}; /* Dataspace (< 1 k) */
hsize_t chunk_dims[RANK] = {S_DIM1/2, S_DIM2/2}; /* Dimension sizes for chunks */
@@ -3361,11 +3361,11 @@ out:
static
int make_layout3(hid_t loc_id)
{
- hid_t dcpl1=-1; /* dataset creation property list */
- hid_t dcpl2=-1; /* dataset creation property list */
- hid_t dcpl3=-1; /* dataset creation property list */
- hid_t sid1=-1; /* dataspace ID */
- hid_t sid2=-1; /* dataspace ID */
+ hid_t dcpl1=H5I_INVALID_HID; /* dataset creation property list */
+ hid_t dcpl2=H5I_INVALID_HID; /* dataset creation property list */
+ hid_t dcpl3=H5I_INVALID_HID; /* dataset creation property list */
+ hid_t sid1=H5I_INVALID_HID; /* dataspace ID */
+ hid_t sid2=H5I_INVALID_HID; /* dataspace ID */
hsize_t dims1[RANK]={DIM1_L3,DIM2_L3};
hsize_t dims2[RANK]={SDIM1_L3,SDIM2_L3};
hsize_t maxdims[RANK]={H5S_UNLIMITED, H5S_UNLIMITED};
@@ -3494,8 +3494,8 @@ out:
static
int make_fill(hid_t loc_id)
{
- hid_t did=-1;
- hid_t sid=-1;
+ hid_t did=H5I_INVALID_HID;
+ hid_t sid=H5I_INVALID_HID;
hid_t dcpl;
hsize_t dims[2]={3,2};
int buf[3][2]= {{1,1},{1,2},{2,2}};
@@ -3547,9 +3547,9 @@ out:
static
int make_big(hid_t loc_id)
{
- hid_t did=-1;
- hid_t f_sid=-1;
- hid_t m_sid=-1;
+ hid_t did=H5I_INVALID_HID;
+ hid_t f_sid=H5I_INVALID_HID;
+ hid_t m_sid=H5I_INVALID_HID;
hid_t tid;
hid_t dcpl;
hsize_t dims[1]={ H5TOOLS_MALLOCSIZE + 1}; /* dataset dimensions */
@@ -3628,8 +3628,8 @@ out:
static
int make_external(hid_t loc_id)
{
- hid_t did=-1;
- hid_t sid=-1;
+ hid_t did=H5I_INVALID_HID;
+ hid_t sid=H5I_INVALID_HID;
hid_t dcpl;
int buf[2]={1,2};
hsize_t cur_size[1]; /* data space current size */
@@ -3682,12 +3682,12 @@ out:
static int
make_userblock(void)
{
- hid_t fid = -1;
- hid_t fcpl = -1;
- int fd = -1; /* File descriptor for writing userblock */
- char ub[USERBLOCK_SIZE]; /* User block data */
- ssize_t nwritten; /* # of bytes written */
- size_t u; /* Local index variable */
+ hid_t fid = H5I_INVALID_HID;
+ hid_t fcpl = H5I_INVALID_HID;
+ int fd = -1; /* File descriptor for writing userblock */
+ char ub[USERBLOCK_SIZE]; /* User block data */
+ ssize_t H5_ATTR_NDEBUG_UNUSED nwritten; /* # of bytes written */
+ size_t u; /* Local index variable */
/* Create file creation property list with userblock set */
if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
@@ -3744,12 +3744,12 @@ out:
static int
verify_userblock( const char* filename)
{
- hid_t fid = -1;
- hid_t fcpl = -1;
+ hid_t fid = H5I_INVALID_HID;
+ hid_t fcpl = H5I_INVALID_HID;
int fd = -1; /* File descriptor for writing userblock */
char ub[USERBLOCK_SIZE]; /* User block data */
hsize_t ub_size = 0; /* User block size */
- ssize_t nread; /* # of bytes read */
+ ssize_t H5_ATTR_NDEBUG_UNUSED nread; /* # of bytes read */
size_t u; /* Local index variable */
/* Open file with userblock */
@@ -3816,7 +3816,7 @@ make_userblock_file(void)
{
int fd = -1; /* File descriptor for writing userblock */
char ub[USERBLOCK_SIZE]; /* User block data */
- ssize_t nwritten; /* # of bytes written */
+ ssize_t H5_ATTR_NDEBUG_UNUSED nwritten; /* # of bytes written */
size_t u; /* Local index variable */
/* initialize userblock data */
@@ -3874,10 +3874,10 @@ int write_dset_in(hid_t loc_id,
GREEN
} e_t;
- hid_t did=-1;
- hid_t sid=-1;
- hid_t tid=-1;
- hid_t pid=-1;
+ hid_t did=H5I_INVALID_HID;
+ hid_t sid=H5I_INVALID_HID;
+ hid_t tid=H5I_INVALID_HID;
+ hid_t pid=H5I_INVALID_HID;
unsigned i, j;
int val, k, n;
float f;
@@ -4079,7 +4079,7 @@ int write_dset_in(hid_t loc_id,
goto out;
if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5) < 0)
goto out;
- if (H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5) < 0)
+ if (H5Treclaim(tid, sid, H5P_DEFAULT, buf5) < 0)
goto out;
if (H5Dclose(did) < 0)
goto out;
@@ -4312,7 +4312,7 @@ int write_dset_in(hid_t loc_id,
goto out;
if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf52) < 0)
goto out;
- if (H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52) < 0)
+ if (H5Treclaim(tid, sid, H5P_DEFAULT, buf52) < 0)
goto out;
if (H5Dclose(did) < 0)
goto out;
@@ -4533,7 +4533,7 @@ int write_dset_in(hid_t loc_id,
if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf53) < 0)
goto out;
- if (H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53) < 0)
+ if (H5Treclaim(tid, sid, H5P_DEFAULT, buf53) < 0)
goto out;
if (H5Dclose(did) < 0)
@@ -4620,10 +4620,10 @@ out:
static
int make_dset_reg_ref(hid_t loc_id)
{
- hid_t did1=-1; /* Dataset ID */
- hid_t did2=-1; /* Dereferenced dataset ID */
- hid_t sid1=-1; /* Dataspace ID #1 */
- hid_t sid2=-1; /* Dataspace ID #2 */
+ hid_t did1=H5I_INVALID_HID; /* Dataset ID */
+ hid_t did2=H5I_INVALID_HID; /* Dereferenced dataset ID */
+ hid_t sid1=H5I_INVALID_HID; /* Dataspace ID #1 */
+ hid_t sid2=H5I_INVALID_HID; /* Dataspace ID #2 */
hsize_t dims1[] = {SPACE1_DIM1};
hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
@@ -4739,9 +4739,9 @@ int write_attr_in(hid_t loc_id,
GREEN
} e_t;
- hid_t aid = -1;
- hid_t sid = -1;
- hid_t tid = -1;
+ hid_t aid = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
int val, j, k, n;
unsigned i;
float f;
@@ -4824,7 +4824,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_BITFIELD
@@ -4854,7 +4854,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_OPAQUE
@@ -4881,7 +4881,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_COMPOUND
@@ -4919,7 +4919,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_REFERENCE
@@ -4968,7 +4968,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_VLEN
@@ -5009,17 +5009,17 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Awrite(aid, tid, buf5) < 0)
goto out;
- if (H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5) < 0)
+ if (H5Treclaim(tid, sid, H5P_DEFAULT, buf5) < 0)
goto out;
if (H5Aclose(aid) < 0)
goto out;
- aid = -1;
+ aid = H5I_INVALID_HID;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
if (H5Sclose(sid) < 0)
goto out;
- sid = -1;
+ sid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_ARRAY
@@ -5054,7 +5054,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_INTEGER and H5T_FLOAT
@@ -5132,7 +5132,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_BITFIELD
@@ -5165,7 +5165,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_OPAQUE
@@ -5193,7 +5193,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_COMPOUND
@@ -5229,7 +5229,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_REFERENCE
@@ -5284,7 +5284,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_VLEN
@@ -5331,17 +5331,17 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Awrite(aid, tid, buf52) < 0)
goto out;
- if (H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52) < 0)
+ if (H5Treclaim(tid, sid, H5P_DEFAULT, buf52) < 0)
goto out;
if (H5Aclose(aid) < 0)
goto out;
- aid = -1;
+ aid = H5I_INVALID_HID;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
if (H5Sclose(sid) < 0)
goto out;
- sid = -1;
+ sid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_ARRAY
@@ -5384,7 +5384,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_INTEGER and H5T_FLOAT
@@ -5504,7 +5504,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_BITFIELD
@@ -5558,7 +5558,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_OPAQUE
@@ -5572,7 +5572,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_COMPOUND
@@ -5658,7 +5658,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_REFERENCE
@@ -5743,7 +5743,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_VLEN
@@ -5793,17 +5793,17 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Awrite(aid, tid, buf53) < 0)
goto out;
- if (H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53) < 0)
+ if (H5Treclaim(tid, sid, H5P_DEFAULT, buf53) < 0)
goto out;
if (H5Aclose(aid) < 0)
goto out;
- aid = -1;
+ aid = H5I_INVALID_HID;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
if (H5Sclose(sid) < 0)
goto out;
- sid = -1;
+ sid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_ARRAY
@@ -5837,7 +5837,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Tclose(tid) < 0)
goto out;
- tid = -1;
+ tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_INTEGER and H5T_FLOAT
@@ -5917,7 +5917,7 @@ int make_dset(hid_t loc_id,
hid_t dcpl,
void *buf)
{
- hid_t did=-1;
+ hid_t did=H5I_INVALID_HID;
if ((did = H5Dcreate2(loc_id, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
return -1;
@@ -5954,8 +5954,8 @@ int write_dset( hid_t loc_id,
hid_t tid,
void *buf )
{
- hid_t did=-1;
- hid_t sid=-1;
+ hid_t did=H5I_INVALID_HID;
+ hid_t sid=H5I_INVALID_HID;
if ((sid = H5Screate_simple(rank, dims, NULL)) < 0)
return -1;
@@ -6040,11 +6040,11 @@ static
int make_named_dtype(hid_t loc_id)
{
hsize_t dims[1] ={3};
- hid_t did=-1;
- hid_t aid=-1;
- hid_t sid=-1;
- hid_t tid=-1;
- hid_t gid=-1;
+ hid_t did=H5I_INVALID_HID;
+ hid_t aid=H5I_INVALID_HID;
+ hid_t sid=H5I_INVALID_HID;
+ hid_t tid=H5I_INVALID_HID;
+ hid_t gid=H5I_INVALID_HID;
if ((sid = H5Screate_simple(1, dims, NULL)) < 0)
goto out;
@@ -7036,10 +7036,10 @@ static herr_t make_complex_attr_references(hid_t loc_id)
}
/* close resource for vlen data */
- status = H5Dvlen_reclaim (vlen_objref_attr_tid, vlen_objref_attr_sid, H5P_DEFAULT, vlen_objref_data);
+ status = H5Treclaim (vlen_objref_attr_tid, vlen_objref_attr_sid, H5P_DEFAULT, vlen_objref_data);
if (status < 0)
{
- HDfprintf(stderr, "Error: %s %d> H5Dvlen_reclaim failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Treclaim failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -7091,10 +7091,10 @@ static herr_t make_complex_attr_references(hid_t loc_id)
}
/* close resource for vlen data */
- status = H5Dvlen_reclaim (vlen_regref_attr_tid, vlen_regref_attr_sid, H5P_DEFAULT, vlen_regref_data);
+ status = H5Treclaim (vlen_regref_attr_tid, vlen_regref_attr_sid, H5P_DEFAULT, vlen_regref_data);
if (status < 0)
{
- HDfprintf(stderr, "Error: %s %d> H5Dvlen_reclaim failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Treclaim failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
diff --git a/tools/test/h5repack/testfiles/attrregion.tattrreg.h5.ddl b/tools/test/h5repack/testfiles/attrregion.tattrreg.h5.ddl
new file mode 100644
index 0000000..5a141aa
--- /dev/null
+++ b/tools/test/h5repack/testfiles/attrregion.tattrreg.h5.ddl
@@ -0,0 +1,46 @@
+HDF5 "out-attrregion.tattrreg.h5" {
+GROUP "/" {
+ DATASET "Dataset1" {
+ DATATYPE H5T_STD_I32LE
+ DATASPACE NULL
+ STORAGE_LAYOUT {
+ CONTIGUOUS
+ SIZE 0
+ OFFSET 18446744073709551615
+ }
+ FILTERS {
+ NONE
+ }
+ FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_DEFAULT
+ }
+ ALLOCATION_TIME {
+ H5D_ALLOC_TIME_LATE
+ }
+ ATTRIBUTE "Attribute1" {
+ DATATYPE H5T_REFERENCE { H5T_STD_REF_DSETREG }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+ }
+ }
+ DATASET "Dataset2" {
+ DATATYPE H5T_STD_U8BE
+ DATASPACE SIMPLE { ( 10, 10 ) / ( 10, 10 ) }
+ STORAGE_LAYOUT {
+ CONTIGUOUS
+ SIZE 100
+ OFFSET 2048
+ }
+ FILTERS {
+ NONE
+ }
+ FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_DEFAULT
+ }
+ ALLOCATION_TIME {
+ H5D_ALLOC_TIME_LATE
+ }
+ }
+}
+}
diff --git a/tools/test/h5repack/testfiles/dataregion.tdatareg.h5.ddl b/tools/test/h5repack/testfiles/dataregion.tdatareg.h5.ddl
new file mode 100644
index 0000000..bd31118
--- /dev/null
+++ b/tools/test/h5repack/testfiles/dataregion.tdatareg.h5.ddl
@@ -0,0 +1,42 @@
+HDF5 "out-dataregion.tdatareg.h5" {
+GROUP "/" {
+ DATASET "Dataset1" {
+ DATATYPE H5T_REFERENCE { H5T_STD_REF_DSETREG }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+ STORAGE_LAYOUT {
+ CONTIGUOUS
+ SIZE 48
+ OFFSET 6244
+ }
+ FILTERS {
+ NONE
+ }
+ FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_UNDEFINED
+ }
+ ALLOCATION_TIME {
+ H5D_ALLOC_TIME_LATE
+ }
+ }
+ DATASET "Dataset2" {
+ DATATYPE H5T_STD_U8BE
+ DATASPACE SIMPLE { ( 10, 10 ) / ( 10, 10 ) }
+ STORAGE_LAYOUT {
+ CONTIGUOUS
+ SIZE 100
+ OFFSET 2048
+ }
+ FILTERS {
+ NONE
+ }
+ FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_UNDEFINED
+ }
+ ALLOCATION_TIME {
+ H5D_ALLOC_TIME_LATE
+ }
+ }
+}
+}
diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst b/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst
index 4e69148..9e83ff8 100644
--- a/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst
+++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst
@@ -44,4 +44,4 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
#000: (file name) line (number) in do_copy_objects(): H5Dcreate2 failed
major: Failure in tools library
- minor: error in function
+ minor: function info
diff --git a/tools/test/h5stat/CMakeLists.txt b/tools/test/h5stat/CMakeLists.txt
index 5c17fd5..0e2ee5e 100644
--- a/tools/test/h5stat/CMakeLists.txt
+++ b/tools/test/h5stat/CMakeLists.txt
@@ -14,4 +14,6 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
#add_test (NAME h5stat_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat_gentest>)
endif ()
-include (CMakeTests.cmake)
+if (HDF5_TEST_TOOLS AND HDF5_TEST_SERIAL)
+ include (CMakeTests.cmake)
+endif ()
diff --git a/tools/test/h5stat/CMakeTests.cmake b/tools/test/h5stat/CMakeTests.cmake
index 9674a77..0c07418 100644
--- a/tools/test/h5stat/CMakeTests.cmake
+++ b/tools/test/h5stat/CMakeTests.cmake
@@ -93,16 +93,10 @@
##############################################################################
##############################################################################
- if (NOT BUILD_SHARED_LIBS)
- set (tgt_ext "")
- else ()
- set (tgt_ext "-shared")
- endif ()
-
macro (ADD_H5_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_ext}> ${ARGN})
+ add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_file_ext}> ${ARGN})
if (${resultcode})
set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
@@ -111,7 +105,7 @@
NAME H5STAT-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_file_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -125,7 +119,7 @@
macro (ADD_H5_ERR_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_ext}> ${ARGN})
+ add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_file_ext}> ${ARGN})
if (${resultcode})
set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
@@ -134,7 +128,7 @@
NAME H5STAT-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_file_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${resultfile}.out"
diff --git a/tools/test/h5stat/h5stat_gentest.c b/tools/test/h5stat/h5stat_gentest.c
index 2edfcf6..0bf1001 100644
--- a/tools/test/h5stat/h5stat_gentest.c
+++ b/tools/test/h5stat/h5stat_gentest.c
@@ -54,14 +54,14 @@
static void
gen_newgrat_file(const char *fname)
{
- hid_t fcpl = -1; /* File creation property */
- hid_t fapl = -1; /* File access property */
- hid_t fid = -1; /* File id */
- hid_t gid = -1; /* Group id */
- hid_t tid = -1; /* Datatype id */
- hid_t sid = -1; /* Dataspace id */
- hid_t attr_id = -1; /* Attribute id */
- hid_t did = -1; /* Dataset id */
+ hid_t fcpl = H5I_INVALID_HID; /* File creation property */
+ hid_t fapl = H5I_INVALID_HID; /* File access property */
+ hid_t fid = H5I_INVALID_HID; /* File id */
+ hid_t gid = H5I_INVALID_HID; /* Group id */
+ hid_t tid = H5I_INVALID_HID; /* Datatype id */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace id */
+ hid_t attr_id = H5I_INVALID_HID; /* Attribute id */
+ hid_t did = H5I_INVALID_HID; /* Dataset id */
char name[30]; /* Group name */
char attrname[30]; /* Attribute name */
int i; /* Local index variable */
@@ -139,15 +139,15 @@ error:
static void
gen_threshold_file(const char *fname)
{
- hid_t fid = -1; /* File ID */
- hid_t sid0 = -1; /* Dataspace IDs */
- hid_t sid1 = -1; /* Dataspace IDs */
- hid_t sid2 = -1; /* Dataspace IDs */
- hid_t sid3 = -1; /* Dataspace IDs */
- hid_t sid4 = -1; /* Dataspace IDs */
- hid_t did = -1; /* Dataset ID */
- hid_t attr_id = -1; /* Attribute ID */
- hid_t gid = -1; /* Group ID */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t sid0 = H5I_INVALID_HID; /* Dataspace IDs */
+ hid_t sid1 = H5I_INVALID_HID; /* Dataspace IDs */
+ hid_t sid2 = H5I_INVALID_HID; /* Dataspace IDs */
+ hid_t sid3 = H5I_INVALID_HID; /* Dataspace IDs */
+ hid_t sid4 = H5I_INVALID_HID; /* Dataspace IDs */
+ hid_t did = H5I_INVALID_HID; /* Dataset ID */
+ hid_t attr_id = H5I_INVALID_HID; /* Attribute ID */
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
hsize_t two_dims[] = {2, 5}; /* Dimension array */
hsize_t one_dims[] = {6}; /* Dimension array */
hsize_t zero_dims[] = {0}; /* Dimension array */
@@ -323,11 +323,11 @@ error:
static void
gen_idx_file(const char *fname)
{
- hid_t fapl = -1; /* file access property id */
- hid_t fid = -1; /* file id */
- hid_t sid = -1; /* space id */
- hid_t dcpl = -1; /* dataset creation property id */
- hid_t did = -1, did2 = -1; /* dataset id */
+ hid_t fapl = H5I_INVALID_HID; /* file access property id */
+ hid_t fid = H5I_INVALID_HID; /* file id */
+ hid_t sid = H5I_INVALID_HID; /* space id */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation property id */
+ hid_t did = -1, did2 = H5I_INVALID_HID; /* dataset id */
hsize_t dims[1] = {10}; /* dataset dimension */
hsize_t c_dims[1] = {2}; /* chunk dimension */
int i; /* local index variable */
@@ -413,12 +413,12 @@ error:
static void
gen_err_refcount(const char *fname)
{
- hid_t fid = -1; /* File identifier */
- hid_t sid = -1; /* Dataspace message */
- hid_t did = -1; /* Dataset identifier */
- hid_t gid = -1; /* Group identifier */
- hid_t aid1 = -1, aid2 = -1; /* Attribute identifier */
- hid_t tid = -1; /* Datatype identifier */
+ hid_t fid = H5I_INVALID_HID; /* File identifier */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace message */
+ hid_t did = H5I_INVALID_HID; /* Dataset identifier */
+ hid_t gid = H5I_INVALID_HID; /* Group identifier */
+ hid_t aid1 = -1, aid2 = H5I_INVALID_HID; /* Attribute identifier */
+ hid_t tid = H5I_INVALID_HID; /* Datatype identifier */
int i, n; /* Local index variables */
int buf[10]; /* Data buffer */
hsize_t dims[1]; /* Dimension size */
diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt
index a250222..089a302 100644
--- a/tools/test/misc/CMakeLists.txt
+++ b/tools/test/misc/CMakeLists.txt
@@ -55,6 +55,8 @@ else ()
endif ()
set_target_properties (clear_open_chk PROPERTIES FOLDER tools)
-include (CMakeTestsRepart.cmake)
-include (CMakeTestsClear.cmake)
-include (CMakeTestsMkgrp.cmake)
+if (HDF5_TEST_SERIAL)
+ include (CMakeTestsRepart.cmake)
+ include (CMakeTestsClear.cmake)
+ include (CMakeTestsMkgrp.cmake)
+endif ()
diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake
index a2c494d..cb285e4 100644
--- a/tools/test/misc/CMakeTestsClear.cmake
+++ b/tools/test/misc/CMakeTestsClear.cmake
@@ -83,12 +83,6 @@
##############################################################################
##############################################################################
- if (NOT BUILD_SHARED_LIBS)
- set (tgt_ext "")
- else ()
- set (tgt_ext "-shared")
- endif ()
-
# Need special dependencies for tests that use the same reference file
# This is an issue on Windows
macro (ADD_H5_CMP testname resultfile resultcode)
@@ -97,7 +91,7 @@
NAME H5CLEAR_CMP-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}.out"
@@ -114,7 +108,7 @@
NAME H5CLEAR_CMP-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}.out"
@@ -144,7 +138,7 @@
NAME H5CLEAR_CMP-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN};${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}.out"
@@ -176,7 +170,7 @@
NAME H5CLEAR_CMP-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN};${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}.out"
@@ -195,7 +189,7 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5CLEAR_RET-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> ${ARGN}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_file_ext}> ${ARGN}
)
set_tests_properties (H5CLEAR_RET-${testname} PROPERTIES
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
@@ -222,7 +216,7 @@
NAME H5CLEAR_FILESIZE_CMP-${testname}_before_size
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>"
-D "TEST_ARGS:STRING=--filesize;${testname}.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}_before_size.out"
@@ -236,12 +230,12 @@
if (NOT ${incr_size} MATCHES "NONE")
add_test (
NAME H5CLEAR_FILESIZE_INCR-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> --increment=${incr_size} ${testname}.h5
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_file_ext}> --increment=${incr_size} ${testname}.h5
)
else ()
add_test (
NAME H5CLEAR_FILESIZE_INCR-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> --increment ${testname}.h5
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_file_ext}> --increment ${testname}.h5
)
endif ()
set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES
@@ -253,7 +247,7 @@
NAME H5CLEAR_FILESIZE_CMP-${testname}_after_size
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>"
-D "TEST_ARGS:STRING=--filesize;${testname}.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}_after_size.out"
@@ -285,7 +279,7 @@
NAME H5CLEAR_FILESIZE_FAIL_CMP-${testname}_before_size
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>"
-D "TEST_ARGS:STRING=--filesize;${testname}.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}_before_size.out"
@@ -299,12 +293,12 @@
if (NOT ${incr_size} MATCHES "NONE")
add_test (
NAME H5CLEAR_FILESIZE_FAIL_INCR-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> -s --increment=${incr_size} ${testname}.h5
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_file_ext}> -s --increment=${incr_size} ${testname}.h5
)
else ()
add_test (
NAME H5CLEAR_FILESIZE_FAIL_INCR-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> -s --increment ${testname}.h5
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_file_ext}> -s --increment ${testname}.h5
)
endif ()
set_tests_properties (H5CLEAR_FILESIZE_FAIL_INCR-${testname} PROPERTIES
@@ -315,7 +309,7 @@
NAME H5CLEAR_FILESIZE_FAIL_CMP-${testname}_after_size
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_file_ext}>"
-D "TEST_ARGS:STRING=--filesize;${testname}.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}_after_size.out"
@@ -352,7 +346,7 @@
# After "h5clear" the file, the subsequent file open succeeds
add_test (
NAME H5CLEAR-h5clr-${testname}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> -s ${testfile}.h5
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_file_ext}> -s ${testfile}.h5
)
set_tests_properties (H5CLEAR-h5clr-${testname} PROPERTIES
DEPENDS H5CLEAR-clr_open_chk-${testname}_${resultcode}
diff --git a/tools/test/misc/CMakeTestsMkgrp.cmake b/tools/test/misc/CMakeTestsMkgrp.cmake
index 11fa3f2..fb9e5ba 100644
--- a/tools/test/misc/CMakeTestsMkgrp.cmake
+++ b/tools/test/misc/CMakeTestsMkgrp.cmake
@@ -54,34 +54,33 @@
##############################################################################
##############################################################################
- if (NOT BUILD_SHARED_LIBS)
- set (tgt_ext "")
- else ()
- set (tgt_ext "-shared")
- endif ()
-
macro (ADD_H5_TEST resultfile resultcode resultoption)
- add_test (
- NAME H5MKGRP-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.h5
- )
- set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- )
- add_test (
- NAME H5MKGRP-${resultfile}
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp${tgt_ext}> ${resultoption} ${resultfile}.h5 ${ARGN}
- )
- set_tests_properties (H5MKGRP-${resultfile} PROPERTIES
- DEPENDS H5MKGRP-${resultfile}-clear-objects
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
- )
- if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (
+ NAME H5MKGRP-${resultfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp${tgt_file_ext}> ${resultoption} ${resultfile}.h5 ${ARGN}
+ )
+ else ()
+ add_test (
+ NAME H5MKGRP-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.h5
+ )
+ set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ )
+ add_test (
+ NAME H5MKGRP-${resultfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp${tgt_file_ext}> ${resultoption} ${resultfile}.h5 ${ARGN}
+ )
+ set_tests_properties (H5MKGRP-${resultfile} PROPERTIES
+ DEPENDS H5MKGRP-${resultfile}-clear-objects
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ )
add_test (
NAME H5MKGRP-${resultfile}-h5ls
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_file_ext}>"
-D "TEST_ARGS:STRING=-v;-r;${resultfile}.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -96,7 +95,7 @@
macro (ADD_H5_CMP resultfile resultcode)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5MKGRP_CMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp> ${ARGN})
+ add_test (NAME H5MKGRP_CMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp${tgt_file_ext}> ${ARGN})
else ()
add_test (
NAME H5MKGRP_CMP-${resultfile}-clear-objects
@@ -109,7 +108,7 @@
NAME H5MKGRP_CMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5mkgrp${tgt_ext}>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5mkgrp${tgt_file_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
diff --git a/tools/test/misc/CMakeTestsRepart.cmake b/tools/test/misc/CMakeTestsRepart.cmake
index fa49c53..14b349c 100644
--- a/tools/test/misc/CMakeTestsRepart.cmake
+++ b/tools/test/misc/CMakeTestsRepart.cmake
@@ -58,12 +58,6 @@
##############################################################################
##############################################################################
- if (NOT BUILD_SHARED_LIBS)
- set (tgt_ext "")
- else ()
- set (tgt_ext "-shared")
- endif ()
-
# Remove any output file left over from previous test run
add_test (
NAME H5REPART-clearall-objects
@@ -82,7 +76,7 @@
# repartition family member size to 20,000 bytes.
add_test (
NAME H5REPART-h5repart_20K
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 family_file%05d.h5 fst_family%05d.h5
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_file_ext}> -m 20000 family_file%05d.h5 fst_family%05d.h5
)
set_tests_properties (H5REPART-h5repart_20K PROPERTIES
FIXTURES_REQUIRED clear_testrepart
@@ -91,7 +85,7 @@
# repartition family member size to 5 KB.
add_test (
NAME H5REPART-h5repart_5K
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 5k family_file%05d.h5 scd_family%05d.h5
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_file_ext}> -m 5k family_file%05d.h5 scd_family%05d.h5
)
set_tests_properties (H5REPART-h5repart_5K PROPERTIES
FIXTURES_REQUIRED clear_testrepart
@@ -100,7 +94,7 @@
# convert family file to sec2 file of 20,000 bytes
add_test (
NAME H5REPART-h5repart_single
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 -family_to_single family_file%05d.h5 family_to_single.h5
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_file_ext}> -m 20000 -family_to_single family_file%05d.h5 family_to_single.h5
)
set_tests_properties (H5REPART-h5repart_single PROPERTIES
FIXTURES_REQUIRED clear_testrepart
@@ -109,7 +103,7 @@
# convert family file to sec2 file of 20,000 bytes (old argument)
add_test (
NAME H5REPART-h5repart_sec2
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_file_ext}> -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5
)
set_tests_properties (H5REPART-h5repart_sec2 PROPERTIES
FIXTURES_REQUIRED clear_testrepart
diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c
index 96d7e75e7..1411c21 100644
--- a/tools/test/misc/h5clear_gentest.c
+++ b/tools/test/misc/h5clear_gentest.c
@@ -56,10 +56,10 @@ const char *FILENAME_ENHANCE[] = {
static int
gen_cache_image_file(const char *fname)
{
- hid_t fid = -1; /* File ID */
- hid_t did = -1, sid = -1; /* Dataset ID, dataspace ID */
- hid_t fapl = -1; /* File access property list */
- hid_t dcpl = -1; /* Dataset creation property list */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t did = -1, sid = H5I_INVALID_HID; /* Dataset ID, dataspace ID */
+ hid_t fapl = H5I_INVALID_HID; /* File access property list */
+ hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */
hsize_t dims[2]; /* Dimension sizes */
hsize_t chunks[2]; /* Chunked dimension sizes */
int buf[50][100]; /* Buffer for data to write */
@@ -164,10 +164,10 @@ error:
static int
gen_enhance_files(hbool_t user)
{
- hid_t fid = -1; /* File ID */
- hid_t fcpl = -1; /* File creation property list */
- hid_t sid = -1; /* Dataspace ID */
- hid_t did = -1; /* Dataset ID */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fcpl = H5I_INVALID_HID; /* File creation property list */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t did = H5I_INVALID_HID; /* Dataset ID */
hsize_t dim[1]; /* Dimension sizes */
int data[NUM_ELMTS]; /* Buffer for data */
int fd = -1; /* The file descriptor ID */
@@ -361,13 +361,13 @@ error:
int
main(void)
{
- hid_t fid = -1; /* File ID */
- hid_t fcpl = -1; /* File creation property list */
- hid_t fapl = -1, new_fapl = -1; /* File access property lists */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fcpl = H5I_INVALID_HID; /* File creation property list */
+ hid_t fapl = -1, new_fapl = H5I_INVALID_HID; /* File access property lists */
char fname[512]; /* File name */
unsigned new_format; /* To use latest library format or not */
- hid_t sid = -1; /* Dataspace ID */
- hid_t did = -1; /* Dataset ID */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t did = H5I_INVALID_HID; /* Dataset ID */
hsize_t dim[1]; /* Dimension sizes */
int data[NUM_ELMTS]; /* Buffer for data */
int i; /* Local index variables */
diff --git a/tools/test/misc/h5repart_gentest.c b/tools/test/misc/h5repart_gentest.c
index 5c1ff87..bd94104 100644
--- a/tools/test/misc/h5repart_gentest.c
+++ b/tools/test/misc/h5repart_gentest.c
@@ -25,7 +25,8 @@
#define FAMILY_SIZE 1024
#define FILENAME "family_file%05d.h5"
-static int buf[FAMILY_NUMBER][FAMILY_SIZE];
+int **buf = NULL;
+int *buf_data = NULL;
int main(void)
{
@@ -34,66 +35,82 @@ int main(void)
int i, j;
hsize_t dims[2]={FAMILY_NUMBER, FAMILY_SIZE};
+ /* Set up data array */
+ if(NULL == (buf_data = (int *)HDcalloc(FAMILY_NUMBER * FAMILY_SIZE, sizeof(int)))) {
+ HDperror("HDcalloc");
+ HDexit(EXIT_FAILURE);
+ }
+ if(NULL == (buf = (int **)HDcalloc(FAMILY_NUMBER, sizeof(buf_data)))) {
+ HDperror("HDcalloc");
+ HDexit(EXIT_FAILURE);
+ }
+ for (i = 0; i < FAMILY_NUMBER; i++)
+ buf[i] = buf_data + (i * FAMILY_SIZE);
+
/* Set property list and file name for FAMILY driver */
- if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) {
- perror ("H5Pcreate");
- exit (EXIT_FAILURE);
+ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
+ HDperror("H5Pcreate");
+ HDexit(EXIT_FAILURE);
}
if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0) {
- perror ("H5Pset_fapl_family");
- exit (EXIT_FAILURE);
+ HDperror("H5Pset_fapl_family");
+ HDexit(EXIT_FAILURE);
}
if((file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
- perror("H5Fcreate");
- exit(EXIT_FAILURE);
+ HDperror("H5Fcreate");
+ HDexit(EXIT_FAILURE);
}
/* Create and write dataset */
if((space = H5Screate_simple(2, dims, NULL)) < 0) {
- perror("H5Screate_simple");
- exit(EXIT_FAILURE);
+ HDperror("H5Screate_simple");
+ HDexit(EXIT_FAILURE);
}
if((dset = H5Dcreate2(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
- perror("H5Dcreate2");
- exit(EXIT_FAILURE);
+ HDperror("H5Dcreate2");
+ HDexit(EXIT_FAILURE);
}
- for(i = 0; i<FAMILY_NUMBER; i++)
- for(j = 0; j<FAMILY_SIZE; j++)
+ for(i = 0; i < FAMILY_NUMBER; i++)
+ for(j = 0; j < FAMILY_SIZE; j++)
buf[i][j] = i * 10000 + j;
- if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) {
- perror("H5Dwrite");
- exit(EXIT_FAILURE);
+ if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_data) < 0) {
+ HDperror("H5Dwrite");
+ HDexit(EXIT_FAILURE);
}
if(H5Sclose(space) < 0) {
- perror ("H5Sclose");
- exit (EXIT_FAILURE);
+ HDperror("H5Sclose");
+ HDexit(EXIT_FAILURE);
}
if(H5Dclose(dset) < 0) {
- perror ("H5Dclose");
- exit (EXIT_FAILURE);
+ HDperror("H5Dclose");
+ HDexit(EXIT_FAILURE);
}
if(H5Pclose(fapl) < 0) {
- perror ("H5Pclose");
- exit (EXIT_FAILURE);
+ HDperror("H5Pclose");
+ HDexit(EXIT_FAILURE);
}
if(H5Fclose(file) < 0) {
- perror ("H5Fclose");
- exit (EXIT_FAILURE);
+ HDperror("H5Fclose");
+ HDexit(EXIT_FAILURE);
}
- puts(" PASSED"); fflush(stdout);
+ HDfree(buf);
+ HDfree(buf_data);
+
+ HDputs(" PASSED");
+ HDfflush(stdout);
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/tools/test/misc/repart_test.c b/tools/test/misc/repart_test.c
index b8e0292..7227de0 100644
--- a/tools/test/misc/repart_test.c
+++ b/tools/test/misc/repart_test.c
@@ -47,8 +47,8 @@ herr_t test_single_h5repart_opens(void);
herr_t
test_family_h5repart_opens(void)
{
- hid_t fid = -1;
- hid_t fapl_id = -1;
+ hid_t fid = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
/* open 1st file(single member file) with correct family size(20000 byte) */
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
@@ -102,7 +102,7 @@ error:
herr_t
test_single_h5repart_opens(void)
{
- hid_t fid = -1;
+ hid_t fid = H5I_INVALID_HID;
/* open the single file */
if ((fid = H5Fopen(FILENAME[2], H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
diff --git a/tools/test/misc/talign.c b/tools/test/misc/talign.c
index 7f1f038..c69d1f7 100644
--- a/tools/test/misc/talign.c
+++ b/tools/test/misc/talign.c
@@ -32,11 +32,11 @@ const char *setname = "align";
int main(void)
{
- hid_t fil=-1, spc=-1, set=-1;
- hid_t cs6=-1, cmp=-1, fix=-1;
- hid_t cmp1=-1, cmp2=-1, cmp3=-1;
- hid_t plist=-1;
- hid_t array_dt=-1;
+ hid_t fil=H5I_INVALID_HID, spc=H5I_INVALID_HID, set=H5I_INVALID_HID;
+ hid_t cs6=H5I_INVALID_HID, cmp=H5I_INVALID_HID, fix=H5I_INVALID_HID;
+ hid_t cmp1=H5I_INVALID_HID, cmp2=H5I_INVALID_HID, cmp3=H5I_INVALID_HID;
+ hid_t plist=H5I_INVALID_HID;
+ hid_t array_dt=H5I_INVALID_HID;
hsize_t dim[2];
hsize_t cdim[4];
diff --git a/tools/test/misc/vds/UC_1_one_dim_gen.c b/tools/test/misc/vds/UC_1_one_dim_gen.c
index b997280..b5ddae3 100644
--- a/tools/test/misc/vds/UC_1_one_dim_gen.c
+++ b/tools/test/misc/vds/UC_1_one_dim_gen.c
@@ -59,16 +59,16 @@ static int UC_1_VDS_FILL_VALUE = -9;
int
main(void)
{
- hid_t src_sid = -1; /* source dataset's dataspace ID */
- hid_t src_dcplid = -1; /* source dataset property list ID */
+ hid_t src_sid = H5I_INVALID_HID; /* source dataset's dataspace ID */
+ hid_t src_dcplid = H5I_INVALID_HID; /* source dataset property list ID */
- hid_t vds_sid = -1; /* VDS dataspace ID */
- hid_t vds_dcplid = -1; /* VDS dataset property list ID */
+ hid_t vds_sid = H5I_INVALID_HID; /* VDS dataspace ID */
+ hid_t vds_dcplid = H5I_INVALID_HID; /* VDS dataset property list ID */
- hid_t fid = -1; /* HDF5 file ID */
- hid_t did = -1; /* dataset ID */
- hid_t msid = -1; /* memory dataspace ID */
- hid_t fsid = -1; /* file dataspace ID */
+ hid_t fid = H5I_INVALID_HID; /* HDF5 file ID */
+ hid_t did = H5I_INVALID_HID; /* dataset ID */
+ hid_t msid = H5I_INVALID_HID; /* memory dataspace ID */
+ hid_t fsid = H5I_INVALID_HID; /* file dataspace ID */
hsize_t extent[RANK]; /* dataset extents */
hsize_t start[RANK]; /* starting point for hyperslab */
diff --git a/tools/test/misc/vds/UC_2_two_dims_gen.c b/tools/test/misc/vds/UC_2_two_dims_gen.c
index bd70fda..8e1554b 100644
--- a/tools/test/misc/vds/UC_2_two_dims_gen.c
+++ b/tools/test/misc/vds/UC_2_two_dims_gen.c
@@ -68,16 +68,16 @@ static int UC_2_VDS_FILL_VALUE = -9;
int
main(void)
{
- hid_t src_sid = -1; /* source dataset's dataspace ID */
- hid_t src_dcplid = -1; /* source dataset property list ID */
+ hid_t src_sid = H5I_INVALID_HID; /* source dataset's dataspace ID */
+ hid_t src_dcplid = H5I_INVALID_HID; /* source dataset property list ID */
- hid_t vds_sid = -1; /* VDS dataspace ID */
- hid_t vds_dcplid = -1; /* VDS dataset property list ID */
+ hid_t vds_sid = H5I_INVALID_HID; /* VDS dataspace ID */
+ hid_t vds_dcplid = H5I_INVALID_HID; /* VDS dataset property list ID */
- hid_t fid = -1; /* HDF5 file ID */
- hid_t did = -1; /* dataset ID */
- hid_t msid = -1; /* memory dataspace ID */
- hid_t fsid = -1; /* file dataspace ID */
+ hid_t fid = H5I_INVALID_HID; /* HDF5 file ID */
+ hid_t did = H5I_INVALID_HID; /* dataset ID */
+ hid_t msid = H5I_INVALID_HID; /* memory dataspace ID */
+ hid_t fsid = H5I_INVALID_HID; /* file dataspace ID */
hsize_t start[RANK]; /* starting point for hyperslab */
hsize_t extent[RANK]; /* dataset extents */
diff --git a/tools/test/misc/vds/UC_3_gaps_gen.c b/tools/test/misc/vds/UC_3_gaps_gen.c
index e6e7226..74a23dc 100644
--- a/tools/test/misc/vds/UC_3_gaps_gen.c
+++ b/tools/test/misc/vds/UC_3_gaps_gen.c
@@ -29,12 +29,12 @@
static herr_t
create_3_1_vds(void)
{
- hid_t src_sid = -1; /* source dataset's dataspace ID */
- hid_t vds_sid = -1; /* VDS dataspace ID */
- hid_t vds_dcplid = -1; /* VDS dataset property list ID */
+ hid_t src_sid = H5I_INVALID_HID; /* source dataset's dataspace ID */
+ hid_t vds_sid = H5I_INVALID_HID; /* VDS dataspace ID */
+ hid_t vds_dcplid = H5I_INVALID_HID; /* VDS dataset property list ID */
- hid_t fid = -1; /* HDF5 file ID */
- hid_t did = -1; /* dataset ID */
+ hid_t fid = H5I_INVALID_HID; /* HDF5 file ID */
+ hid_t did = H5I_INVALID_HID; /* dataset ID */
hsize_t start[RANK]; /* source starting point for hyperslab */
hsize_t position[RANK]; /* vds mapping positions */
@@ -136,12 +136,12 @@ error:
static herr_t
create_3_2_vds(void)
{
- hid_t src_sid = -1; /* source dataset's dataspace ID */
- hid_t vds_sid = -1; /* VDS dataspace ID */
- hid_t vds_dcplid = -1; /* VDS dataset property list ID */
+ hid_t src_sid = H5I_INVALID_HID; /* source dataset's dataspace ID */
+ hid_t vds_sid = H5I_INVALID_HID; /* VDS dataspace ID */
+ hid_t vds_dcplid = H5I_INVALID_HID; /* VDS dataset property list ID */
- hid_t fid = -1; /* HDF5 file ID */
- hid_t did = -1; /* dataset ID */
+ hid_t fid = H5I_INVALID_HID; /* HDF5 file ID */
+ hid_t did = H5I_INVALID_HID; /* dataset ID */
hsize_t start[RANK]; /* source starting point for hyperslab */
diff --git a/tools/test/misc/vds/UC_4_printf_gen.c b/tools/test/misc/vds/UC_4_printf_gen.c
index b328046..24451e9 100644
--- a/tools/test/misc/vds/UC_4_printf_gen.c
+++ b/tools/test/misc/vds/UC_4_printf_gen.c
@@ -27,16 +27,16 @@
int
main(void)
{
- hid_t src_sid = -1; /* source dataset's dataspace ID */
- hid_t src_dcplid = -1; /* source dataset property list ID */
+ hid_t src_sid = H5I_INVALID_HID; /* source dataset's dataspace ID */
+ hid_t src_dcplid = H5I_INVALID_HID; /* source dataset property list ID */
- hid_t vds_sid = -1; /* VDS dataspace ID */
- hid_t vds_dcplid = -1; /* VDS dataset property list ID */
+ hid_t vds_sid = H5I_INVALID_HID; /* VDS dataspace ID */
+ hid_t vds_dcplid = H5I_INVALID_HID; /* VDS dataset property list ID */
- hid_t fid = -1; /* HDF5 file ID */
- hid_t did = -1; /* dataset ID */
- hid_t msid = -1; /* memory dataspace ID */
- hid_t fsid = -1; /* file dataspace ID */
+ hid_t fid = H5I_INVALID_HID; /* HDF5 file ID */
+ hid_t did = H5I_INVALID_HID; /* dataset ID */
+ hid_t msid = H5I_INVALID_HID; /* memory dataspace ID */
+ hid_t fsid = H5I_INVALID_HID; /* file dataspace ID */
/* Hyperslab arrays */
hsize_t start[RANK] = {0, 0, 0};
diff --git a/tools/test/misc/vds/UC_5_stride_gen.c b/tools/test/misc/vds/UC_5_stride_gen.c
index a105bbd..726ce6e 100644
--- a/tools/test/misc/vds/UC_5_stride_gen.c
+++ b/tools/test/misc/vds/UC_5_stride_gen.c
@@ -27,16 +27,16 @@
int
main(void)
{
- hid_t src_sid = -1; /* source dataset's dataspace ID */
- hid_t src_dcplid = -1; /* source dataset property list ID */
+ hid_t src_sid = H5I_INVALID_HID; /* source dataset's dataspace ID */
+ hid_t src_dcplid = H5I_INVALID_HID; /* source dataset property list ID */
- hid_t vds_sid = -1; /* VDS dataspace ID */
- hid_t vds_dcplid = -1; /* VDS dataset property list ID */
+ hid_t vds_sid = H5I_INVALID_HID; /* VDS dataspace ID */
+ hid_t vds_dcplid = H5I_INVALID_HID; /* VDS dataset property list ID */
- hid_t fid = -1; /* HDF5 file ID */
- hid_t did = -1; /* dataset ID */
- hid_t msid = -1; /* memory dataspace ID */
- hid_t fsid = -1; /* file dataspace ID */
+ hid_t fid = H5I_INVALID_HID; /* HDF5 file ID */
+ hid_t did = H5I_INVALID_HID; /* dataset ID */
+ hid_t msid = H5I_INVALID_HID; /* memory dataspace ID */
+ hid_t fsid = H5I_INVALID_HID; /* file dataspace ID */
hsize_t extent[RANK]; /* source dataset extents */
hsize_t start[RANK]; /* starting point for hyperslab */
diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt
index 38dd605..d788ffa 100644
--- a/tools/test/perform/CMakeLists.txt
+++ b/tools/test/perform/CMakeLists.txt
@@ -21,20 +21,21 @@ endif ()
set_target_properties (h5perf_serial PROPERTIES FOLDER perform)
if (HDF5_BUILD_PERFORM_STANDALONE)
- #-- Adding test for h5perf_serial_alone
+ #-- Adding test for h5perf_serial_alone - io_timer.c includes
set (h5perf_serial_alone_SOURCES
+ ${HDF5_TOOLS_DIR}/lib/io_timer.c
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_perf.c
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_engine.c
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_standalone.c
)
add_executable (h5perf_serial_alone ${h5perf_serial_alone_SOURCES})
- target_include_directories (h5perf_serial_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5perf_serial_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TOOLS_DIR}/lib;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (h5perf_serial_alone STATIC)
- target_link_libraries (h5perf_serial_alone PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+ target_link_libraries (h5perf_serial_alone PRIVATE ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
else ()
TARGET_C_PROPERTIES (h5perf_serial_alone SHARED)
- target_link_libraries (h5perf_serial_alone PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ target_link_libraries (h5perf_serial_alone PRIVATE ${HDF5_LIBSH_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
endif ()
set_target_properties (h5perf_serial_alone PROPERTIES FOLDER perform)
set_property (TARGET h5perf_serial_alone
@@ -132,7 +133,7 @@ else ()
endif ()
set_target_properties (zip_perf PROPERTIES FOLDER perform)
-if (H5_HAVE_PARALLEL AND BUILD_TESTING)
+if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL)
if (UNIX)
#-- Adding test for perf - only on unix systems
set (perf_SOURCES
@@ -169,18 +170,19 @@ if (H5_HAVE_PARALLEL AND BUILD_TESTING)
if (HDF5_BUILD_PERFORM_STANDALONE)
#-- Adding test for h5perf
set (h5perf_alone_SOURCES
+ ${HDF5_TOOLS_DIR}/lib/io_timer.c
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_perf.c
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_engine.c
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_standalone.c
)
add_executable (h5perf_alone ${h5perf_alone_SOURCES})
- target_include_directories (h5perf_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5perf_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TOOLS_DIR}/lib;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (h5perf_alone STATIC)
- target_link_libraries (h5perf_alone PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+ target_link_libraries (h5perf_alone PRIVATE ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
else ()
TARGET_C_PROPERTIES (h5perf_alone SHARED)
- target_link_libraries (h5perf_alone PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ target_link_libraries (h5perf_alone PRIVATE ${HDF5_LIBSH_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
endif ()
set_target_properties (h5perf_alone PROPERTIES FOLDER perform)
set_property (TARGET h5perf_alone
@@ -189,4 +191,6 @@ if (H5_HAVE_PARALLEL AND BUILD_TESTING)
endif ()
endif ()
-include (CMakeTests.cmake)
+if (HDF5_TEST_TOOLS)
+ include (CMakeTests.cmake)
+endif ()
diff --git a/tools/test/perform/CMakeTests.cmake b/tools/test/perform/CMakeTests.cmake
index f0ae416..5d61f7b 100644
--- a/tools/test/perform/CMakeTests.cmake
+++ b/tools/test/perform/CMakeTests.cmake
@@ -22,175 +22,176 @@ add_custom_target(zip_perf_files ALL COMMENT "Copying files needed by zip_perf t
#-----------------------------------------------------------------------------
# Add Tests
#-----------------------------------------------------------------------------
+if (HDF5_TEST_SERIAL)
+ # Remove any output file left over from previous test run
+ add_test (
+ NAME PERFORM_h5perform-clearall-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ chunk.h5
+ iopipe.h5
+ iopipe.raw
+ x-diag-rd.dat
+ x-diag-wr.dat
+ x-rowmaj-rd.dat
+ x-rowmaj-wr.dat
+ x-gnuplot
+ h5perf_serial.txt
+ h5perf_serial.txt.err
+ chunk.txt
+ chunk.txt.err
+ iopipe.txt
+ iopipe.txt.err
+ overhead.txt
+ overhead.txt.err
+ perf_meta.txt
+ perf_meta.txt.err
+ zip_perf-h.txt
+ zip_perf-h.txt.err
+ zip_perf.txt
+ zip_perf.txt.err
+ )
-# Remove any output file left over from previous test run
-add_test (
- NAME PERFORM_h5perform-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- chunk.h5
- iopipe.h5
- iopipe.raw
- x-diag-rd.dat
- x-diag-wr.dat
- x-rowmaj-rd.dat
- x-rowmaj-wr.dat
- x-gnuplot
- h5perf_serial.txt
- h5perf_serial.txt.err
- chunk.txt
- chunk.txt.err
- iopipe.txt
- iopipe.txt.err
- overhead.txt
- overhead.txt.err
- perf_meta.txt
- perf_meta.txt.err
- zip_perf-h.txt
- zip_perf-h.txt.err
- zip_perf.txt
- zip_perf.txt.err
-)
-
-if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_h5perf_serial COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5perf_serial>)
-else ()
- add_test (NAME PERFORM_h5perf_serial COMMAND "${CMAKE_COMMAND}"
- -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5perf_serial>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=h5perf_serial.txt"
- #-D "TEST_REFERENCE=h5perf_serial.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME PERFORM_h5perf_serial COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5perf_serial>)
+ else ()
+ add_test (NAME PERFORM_h5perf_serial COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5perf_serial>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=h5perf_serial.txt"
+ #-D "TEST_REFERENCE=h5perf_serial.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
+ set_tests_properties (PERFORM_h5perf_serial PROPERTIES
+ TIMEOUT ${CTEST_VERY_LONG_TIMEOUT}
+ DEPENDS "PERFORM_h5perform-clearall-objects"
)
-endif ()
-set_tests_properties (PERFORM_h5perf_serial PROPERTIES
- TIMEOUT ${CTEST_VERY_LONG_TIMEOUT}
- DEPENDS "PERFORM_h5perform-clearall-objects"
-)
-if (HDF5_BUILD_PERFORM_STANDALONE)
- add_test (NAME PERFORM_h5perf_serial_alone COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5perf_serial_alone>)
-endif ()
+ if (HDF5_BUILD_PERFORM_STANDALONE)
+ add_test (NAME PERFORM_h5perf_serial_alone COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5perf_serial_alone>)
+ endif ()
-if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_chunk COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:chunk>)
-else ()
- add_test (NAME PERFORM_chunk COMMAND "${CMAKE_COMMAND}"
- -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:chunk>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=chunk.txt"
- #-D "TEST_REFERENCE=chunk.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME PERFORM_chunk COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:chunk>)
+ else ()
+ add_test (NAME PERFORM_chunk COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:chunk>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=chunk.txt"
+ #-D "TEST_REFERENCE=chunk.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
+ set_tests_properties (PERFORM_chunk PROPERTIES
+ DEPENDS "PERFORM_h5perform-clearall-objects"
)
-endif ()
-set_tests_properties (PERFORM_chunk PROPERTIES
- DEPENDS "PERFORM_h5perform-clearall-objects"
-)
-if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_iopipe COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:iopipe>)
-else ()
- add_test (NAME PERFORM_iopipe COMMAND "${CMAKE_COMMAND}"
- -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:iopipe>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=iopipe.txt"
- #-D "TEST_REFERENCE=iopipe.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME PERFORM_iopipe COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:iopipe>)
+ else ()
+ add_test (NAME PERFORM_iopipe COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:iopipe>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=iopipe.txt"
+ #-D "TEST_REFERENCE=iopipe.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
+ set_tests_properties (PERFORM_iopipe PROPERTIES
+ DEPENDS "PERFORM_h5perform-clearall-objects"
)
-endif ()
-set_tests_properties (PERFORM_iopipe PROPERTIES
- DEPENDS "PERFORM_h5perform-clearall-objects"
-)
-if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_overhead COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:overhead>)
-else ()
- add_test (NAME PERFORM_overhead COMMAND "${CMAKE_COMMAND}"
- -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:overhead>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=overhead.txt"
- #-D "TEST_REFERENCE=overhead.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME PERFORM_overhead COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:overhead>)
+ else ()
+ add_test (NAME PERFORM_overhead COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:overhead>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=overhead.txt"
+ #-D "TEST_REFERENCE=overhead.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
+ set_tests_properties (PERFORM_overhead PROPERTIES
+ DEPENDS "PERFORM_h5perform-clearall-objects"
)
-endif ()
-set_tests_properties (PERFORM_overhead PROPERTIES
- DEPENDS "PERFORM_h5perform-clearall-objects"
-)
-if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_perf_meta COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:perf_meta>)
-else ()
- add_test (NAME PERFORM_perf_meta COMMAND "${CMAKE_COMMAND}"
- -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:perf_meta>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=perf_meta.txt"
- #-D "TEST_REFERENCE=perf_meta.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME PERFORM_perf_meta COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:perf_meta>)
+ else ()
+ add_test (NAME PERFORM_perf_meta COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:perf_meta>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=perf_meta.txt"
+ #-D "TEST_REFERENCE=perf_meta.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
+ set_tests_properties (PERFORM_perf_meta PROPERTIES
+ DEPENDS "PERFORM_h5perform-clearall-objects"
)
-endif ()
-set_tests_properties (PERFORM_perf_meta PROPERTIES
- DEPENDS "PERFORM_h5perform-clearall-objects"
-)
-if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_zip_perf_help COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:zip_perf> "-h")
-else ()
- add_test (NAME PERFORM_zip_perf_help COMMAND "${CMAKE_COMMAND}"
- -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:zip_perf>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=zip_perf-h.txt"
- #-D "TEST_REFERENCE=zip_perf-h.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME PERFORM_zip_perf_help COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:zip_perf> "-h")
+ else ()
+ add_test (NAME PERFORM_zip_perf_help COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:zip_perf>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=zip_perf-h.txt"
+ #-D "TEST_REFERENCE=zip_perf-h.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
+ set_tests_properties (PERFORM_zip_perf_help PROPERTIES
+ DEPENDS "PERFORM_h5perform-clearall-objects"
)
-endif ()
-set_tests_properties (PERFORM_zip_perf_help PROPERTIES
- DEPENDS "PERFORM_h5perform-clearall-objects"
-)
-if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_zip_perf COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:zip_perf> tfilters.h5)
-else ()
- add_test (NAME PERFORM_zip_perf COMMAND "${CMAKE_COMMAND}"
- -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:zip_perf>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=zip_perf.txt"
- #-D "TEST_REFERENCE=zip_perf.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME PERFORM_zip_perf COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:zip_perf> tfilters.h5)
+ else ()
+ add_test (NAME PERFORM_zip_perf COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:zip_perf>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=zip_perf.txt"
+ #-D "TEST_REFERENCE=zip_perf.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
+ set_tests_properties (PERFORM_zip_perf PROPERTIES
+ DEPENDS "PERFORM_zip_perf_help;PERFORM_h5perform-clearall-objects"
)
endif ()
-set_tests_properties (PERFORM_zip_perf PROPERTIES
- DEPENDS "PERFORM_zip_perf_help;PERFORM_h5perform-clearall-objects"
-)
-if (H5_HAVE_PARALLEL)
+if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL)
if (UNIX)
add_test (NAME MPI_TEST_PERFORM_perf COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:perf> ${MPIEXEC_POSTFLAGS})
endif ()
diff --git a/tools/test/perform/chunk.c b/tools/test/perform/chunk.c
index 804f88e..3603c9b 100644
--- a/tools/test/perform/chunk.c
+++ b/tools/test/perform/chunk.c
@@ -72,7 +72,7 @@
/* #define DIAG_NRDCC 521 */
static size_t nio_g;
-static hid_t fapl_g = -1;
+static hid_t fapl_g = H5I_INVALID_HID;
/* Local function prototypes */
static size_t
diff --git a/tools/test/perform/chunk_cache.c b/tools/test/perform/chunk_cache.c
index 1d2e791..5557558 100644
--- a/tools/test/perform/chunk_cache.c
+++ b/tools/test/perform/chunk_cache.c
@@ -247,7 +247,8 @@ static int check_partial_chunks_perf(hid_t file)
dataset = H5Dopen2 (file, DSET1_NAME, dapl);
- memspace = H5Screate_simple(row_rank, row_dim, NULL);
+ H5_CHECK_OVERFLOW(row_rank, hsize_t, int);
+ memspace = H5Screate_simple((int)row_rank, row_dim, NULL);
filespace = H5Dget_space(dataset);
nbytes_global = 0;
@@ -256,7 +257,7 @@ static int check_partial_chunks_perf(hid_t file)
/* Read the data row by row */
for(i = 0; i < DSET1_DIM1; i++) {
- start[0] = i;
+ start[0] = (hsize_t)i;
if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET,
start, NULL, count, NULL) < 0)
goto error;
@@ -318,7 +319,9 @@ static int check_hash_value_perf(hid_t file)
if((dataset = H5Dopen2 (file, DSET2_NAME, dapl)) < 0)
goto error;
- if((memspace = H5Screate_simple(column_rank, column_dim, NULL)) < 0)
+
+ H5_CHECK_OVERFLOW(column_rank, hsize_t, int);
+ if((memspace = H5Screate_simple((int)column_rank, column_dim, NULL)) < 0)
goto error;
if((filespace = H5Dget_space(dataset)) < 0)
goto error;
@@ -329,7 +332,7 @@ static int check_hash_value_perf(hid_t file)
/* Read the data column by column */
for(i = 0; i < DSET2_DIM2; i++) {
- start[1] = i;
+ start[1] = (hsize_t)i;
if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET,
start, NULL, count, NULL) < 0)
goto error;
diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c
index 2d9c44f..bf4728d 100644
--- a/tools/test/perform/iopipe.c
+++ b/tools/test/perform/iopipe.c
@@ -133,7 +133,7 @@ synchronize (void)
#if defined(H5_HAVE_WIN32_API) && ! defined(__CYGWIN__)
_flushall();
#else
- int status;
+ int H5_ATTR_NDEBUG_UNUSED status;
status = HDsystem("sync");
HDassert(status >= 0);
@@ -168,8 +168,7 @@ main (void)
static unsigned nread = NREAD_REQUESTS, nwrite = NWRITE_REQUESTS;
unsigned char *the_data = NULL;
- hid_t file, dset, file_space = -1;
- herr_t status;
+ hid_t file, dset, file_space = H5I_INVALID_HID;
#ifdef H5_HAVE_GETRUSAGE
struct rusage r_start, r_stop;
#else
@@ -178,8 +177,9 @@ main (void)
struct timeval t_start, t_stop;
int fd;
unsigned u;
- hssize_t n;
- off_t offset;
+ herr_t H5_ATTR_NDEBUG_UNUSED status;
+ hssize_t H5_ATTR_NDEBUG_UNUSED n;
+ off_t H5_ATTR_NDEBUG_UNUSED offset;
hsize_t start[2];
hsize_t count[2];
@@ -198,15 +198,15 @@ main (void)
/* Open the files */
file = H5Fcreate (HDF5_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- assert (file>=0);
+ HDassert (file>=0);
fd = HDopen (RAW_FILE_NAME, O_RDWR|O_CREAT|O_TRUNC, 0666);
- assert (fd>=0);
+ HDassert (fd>=0);
/* Create the dataset */
file_space = H5Screate_simple (2, size, size);
- assert(file_space >= 0);
+ HDassert(file_space >= 0);
dset = H5Dcreate2(file, "dset", H5T_NATIVE_UCHAR, file_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- assert(dset >= 0);
+ HDassert(dset >= 0);
the_data = (unsigned char *)malloc((size_t)(size[0] * size[1]));
/* initial fill for lazy malloc */
@@ -268,7 +268,7 @@ main (void)
HDfflush(stderr);
status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space,
H5P_DEFAULT, the_data);
- assert (status>=0);
+ HDassert (status>=0);
}
#ifdef H5_HAVE_GETRUSAGE
HDgetrusage(RUSAGE_SELF, &r_stop);
@@ -306,9 +306,9 @@ main (void)
putc (PROGRESS, stderr);
HDfflush(stderr);
offset = HDlseek (fd, (off_t)0, SEEK_SET);
- assert (0==offset);
+ HDassert (0==offset);
n = HDwrite (fd, the_data, (size_t)(size[0]*size[1]));
- assert (n>=0 && (size_t)n==size[0]*size[1]);
+ HDassert (n>=0 && (size_t)n==size[0]*size[1]);
}
#ifdef H5_HAVE_GETRUSAGE
HDgetrusage(RUSAGE_SELF, &r_stop);
@@ -347,7 +347,7 @@ main (void)
HDfflush(stderr);
status = H5Dwrite (dset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL,
H5P_DEFAULT, the_data);
- assert (status>=0);
+ HDassert (status>=0);
}
#ifdef H5_HAVE_GETRUSAGE
HDgetrusage(RUSAGE_SELF, &r_stop);
@@ -385,9 +385,9 @@ main (void)
putc (PROGRESS, stderr);
HDfflush(stderr);
offset = HDlseek (fd, (off_t)0, SEEK_SET);
- assert (0==offset);
+ HDassert (0==offset);
n = HDread (fd, the_data, (size_t)(size[0]*size[1]));
- assert (n>=0 && (size_t)n==size[0]*size[1]);
+ HDassert (n>=0 && (size_t)n==size[0]*size[1]);
}
#ifdef H5_HAVE_GETRUSAGE
HDgetrusage(RUSAGE_SELF, &r_stop);
@@ -427,7 +427,7 @@ main (void)
HDfflush(stderr);
status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space,
H5P_DEFAULT, the_data);
- assert (status>=0);
+ HDassert (status>=0);
}
#ifdef H5_HAVE_GETRUSAGE
HDgetrusage(RUSAGE_SELF, &r_stop);
@@ -449,11 +449,11 @@ main (void)
(size_t)(nread*size[0]*size[1]));
/* Read hyperslab */
- assert (size[0]>20 && size[1]>20);
+ HDassert (size[0]>20 && size[1]>20);
start[0] = start[1] = 10;
count[0] = count[1] = size[0]-20;
status = H5Sselect_hyperslab (file_space, H5S_SELECT_SET, start, NULL, count, NULL);
- assert (status>=0);
+ HDassert (status>=0);
synchronize ();
#ifdef H5_HAVE_GETRUSAGE
HDgetrusage(RUSAGE_SELF, &r_start);
@@ -471,7 +471,7 @@ main (void)
HDfflush(stderr);
status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space,
H5P_DEFAULT, the_data);
- assert (status>=0);
+ HDassert (status>=0);
}
#ifdef H5_HAVE_GETRUSAGE
HDgetrusage(RUSAGE_SELF, &r_stop);
diff --git a/tools/test/perform/perf.c b/tools/test/perform/perf.c
index 34b8a2d..364836f 100644
--- a/tools/test/perform/perf.c
+++ b/tools/test/perform/perf.c
@@ -110,15 +110,15 @@ const char *FILENAME[] = {
/* function prototypes */
static int parse_args(int argc, char **argv);
-extern int errno;
-
+#ifndef H5_HAVE_UNISTD_H
/* globals needed for getopt */
extern char *optarg;
+#endif
int main(int argc, char **argv)
{
- char *buf, *tmp, *buf2, *tmp2, *check;
- int i, j, mynod=0, nprocs=1, err, my_correct = 1, correct, myerrno;
+ char *buf, *tmp, *buf2 = NULL, *tmp2 = NULL, *check;
+ int i, j, mynod=0, nprocs=1, my_correct = 1, correct, myerrno;
double stim, etim;
double write_tim = 0;
double read_tim = 0;
@@ -127,10 +127,6 @@ int main(int argc, char **argv)
double min_read_tim, min_write_tim;
double ave_read_tim, ave_write_tim;
int64_t iter_jump = 0;
- int64_t seek_position = 0;
- MPI_File fh;
- MPI_Status status;
- int nchars;
char filename[MAX_PATH];
herr_t ret; /* Generic return value */
@@ -164,7 +160,7 @@ int main(int argc, char **argv)
iter_jump = nprocs * opt_block;
/* setup a buffer of data to write */
- if (!(tmp = (char *) malloc(opt_block + 256))) {
+ if (!(tmp = (char *) malloc((size_t)opt_block + 256))) {
perror("malloc");
goto die_jar_jar_die;
}
@@ -172,7 +168,7 @@ int main(int argc, char **argv)
if (opt_correct) {
/* do the same buffer setup for verifiable data */
- if (!(tmp2 = (char *) malloc(opt_block + 256))) {
+ if (!(tmp2 = (char *) malloc((size_t)opt_block + 256))) {
perror("malloc2");
goto die_jar_jar_die;
}
@@ -222,7 +218,7 @@ int main(int argc, char **argv)
VRFY((fid >= 0), "H5Fcreate succeeded", H5FATAL);
/* define a contiquous dataset of opt_iter*nprocs*opt_block chars */
- dims[0] = opt_iter * nprocs * opt_block;
+ dims[0] = (hsize_t)opt_iter * (hsize_t)nprocs * (hsize_t)opt_block;
sid = H5Screate_simple(RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded", H5FATAL);
dataset = H5Dcreate2(fid, "Dataset1", H5T_NATIVE_CHAR, sid,
@@ -230,7 +226,7 @@ int main(int argc, char **argv)
VRFY((dataset >= 0), "H5Dcreate2 succeeded", H5FATAL);
/* create the memory dataspace and the file dataspace */
- dims[0] = opt_block;
+ dims[0] = (hsize_t)opt_block;
mem_dataspace = H5Screate_simple(RANK, dims, NULL);
VRFY((mem_dataspace >= 0), "", H5FATAL);
file_dataspace = H5Dget_space(dataset);
@@ -242,7 +238,7 @@ int main(int argc, char **argv)
for(j=0; j < opt_iter; j++) {
/* setup a file dataspace selection */
start[0] = (hsize_t)((j * iter_jump) + (mynod * opt_block));
- stride[0] = block[0] = opt_block;
+ stride[0] = block[0] = (hsize_t)opt_block;
count[0]= 1;
ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded", H5FATAL);
@@ -295,7 +291,7 @@ int main(int argc, char **argv)
for (j=0; j < opt_iter; j++) {
/* setup a file dataspace selection */
start[0] = (hsize_t)((j * iter_jump) + (mynod * opt_block));
- stride[0] = block[0] = opt_block;
+ stride[0] = block[0] = (hsize_t)opt_block;
count[0]= 1;
ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded", H5FATAL);
@@ -326,7 +322,7 @@ int main(int argc, char **argv)
/* if the user wanted to check correctness, compare the write
* buffer to the read buffer */
- if (opt_correct && memcmp(buf, buf2, opt_block)) {
+ if (opt_correct && memcmp(buf, buf2, (size_t)opt_block)) {
HDfprintf(stderr, "node %d, correctness test failed\n", mynod);
my_correct = 0;
MPI_Allreduce(&my_correct, &correct, 1, MPI_INT, MPI_MIN,
@@ -367,8 +363,8 @@ int main(int argc, char **argv)
/* print out the results on one node */
if (mynod == 0) {
- read_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0);
- write_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0);
+ read_bw = (double)((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0);
+ write_bw = (double)((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0);
printf("nr_procs = %d, nr_iter = %d, blk_sz = %ld\n", nprocs,
opt_iter, (long)opt_block);
@@ -439,9 +435,9 @@ parse_args(int argc, char **argv)
{
char *p;
- opt_alignment = HDatoi(optarg);
+ opt_alignment = (hsize_t)HDatoi(optarg);
if(NULL != (p = (char*)HDstrchr(optarg, '/')))
- opt_threshold = HDatoi(p + 1);
+ opt_threshold = (hsize_t)HDatoi(p + 1);
}
HDfprintf(stdout,
"alignment/threshold=%Hu/%Hu\n",
diff --git a/tools/test/perform/pio_engine.c b/tools/test/perform/pio_engine.c
index 77c04ab..cdd698e 100644
--- a/tools/test/perform/pio_engine.c
+++ b/tools/test/perform/pio_engine.c
@@ -54,24 +54,15 @@
/* sizes of various items. these sizes won't change during program execution */
/* The following three must have the same type */
-#define ELMT_SIZE (sizeof(unsigned char)) /* we're doing bytes */
-#define ELMT_MPI_TYPE MPI_BYTE
#define ELMT_H5_TYPE H5T_NATIVE_UCHAR
#define GOTOERROR(errcode) { ret_code = errcode; goto done; }
-#define GOTODONE { goto done; }
#define ERRMSG(mesg) { \
HDfprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \
HDfprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", \
mesg, (int)__LINE__, __FILE__); \
}
-#define MSG(mesg) { \
- HDfprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \
- HDfprintf(stderr, "(%s) at line %4d in %s\n", \
- mesg, (int)__LINE__, __FILE__); \
-}
-
/* verify: if val is false (0), print mesg. */
#define VRFY(val, mesg) do { \
if (!val) { \
@@ -138,6 +129,7 @@ static herr_t do_fopen(parameters *param, char *fname, file_descr *fd /*out*/,
int flags);
static herr_t do_fclose(iotype iot, file_descr *fd);
static void do_cleanupfile(iotype iot, char *fname);
+static off_t sqrto(off_t);
/*
* Function: do_pio
@@ -208,7 +200,7 @@ do_pio(parameters param)
bsize = buf_size; /* Actual buffer size */
}
else {
- snbytes = (off_t)sqrt(nbytes); /* General dataset size */
+ snbytes = sqrto(nbytes); /* General dataset size */
bsize = buf_size * blk_size; /* Actual buffer size */
}
@@ -260,7 +252,7 @@ do_pio(parameters param)
}
if (!param.dim2d){
- if(((snbytes/pio_mpi_nprocs_g)%buf_size)!=0) {
+ if(((size_t)(snbytes/pio_mpi_nprocs_g)%buf_size)!=0) {
HDfprintf(stderr,
"Dataset size/process (%" H5_PRINTF_LL_WIDTH "d) must be a multiple of the "
"trasfer buffer size (%zu)\n",
@@ -269,7 +261,7 @@ do_pio(parameters param)
}
}
else {
- if((snbytes%buf_size)!=0) {
+ if(((size_t)snbytes%buf_size)!=0) {
HDfprintf(stderr,
"Dataset side size (%" H5_PRINTF_LL_WIDTH "d) must be a multiple of the "
"trasfer buffer size (%zu)\n",
@@ -371,15 +363,17 @@ done:
switch (iot) {
case POSIXIO:
if (fd.posixfd != -1)
- hrc = do_fclose(iot, &fd);
+ hrc = do_fclose(iot, &fd);
break;
case MPIO:
if (fd.mpifd != MPI_FILE_NULL)
- hrc = do_fclose(iot, &fd);
+ hrc = do_fclose(iot, &fd);
break;
case PHDF5:
if (fd.h5fd != -1)
- hrc = do_fclose(iot, &fd);
+ hrc = do_fclose(iot, &fd);
+ break;
+ default:
break;
}
@@ -422,6 +416,8 @@ pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si
case PHDF5:
suffix = ".h5";
break;
+ default:
+ break;
}
/* First use the environment variable and then try the constant */
@@ -557,16 +553,16 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
/* HDF5 variables */
herr_t hrc; /*HDF5 return code */
hsize_t h5dims[2]; /*dataset dim sizes */
- hid_t h5dset_space_id = -1; /*dataset space ID */
- hid_t h5mem_space_id = -1; /*memory dataspace ID */
- hid_t h5ds_id = -1; /*dataset handle */
+ hid_t h5dset_space_id = H5I_INVALID_HID; /*dataset space ID */
+ hid_t h5mem_space_id = H5I_INVALID_HID; /*memory dataspace ID */
+ hid_t h5ds_id = H5I_INVALID_HID; /*dataset handle */
hsize_t h5block[2]; /*dataspace selection */
hsize_t h5stride[2];
hsize_t h5count[2];
hsize_t h5start[2];
hssize_t h5offset[2]; /* Selection offset within dataspace */
- hid_t h5dcpl = -1; /* Dataset creation property list */
- hid_t h5dxpl = -1; /* Dataset transfer property list */
+ hid_t h5dcpl = H5I_INVALID_HID; /* Dataset creation property list */
+ hid_t h5dxpl = H5I_INVALID_HID; /* Dataset transfer property list */
/* Get the parameters from the parameter block */
blk_size=parms->blk_size;
@@ -589,7 +585,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
} /* end if */
/* Interleaved Pattern: */
else {
- bytes_begin[0] = (off_t)(blk_size*pio_mpi_rank_g);
+ bytes_begin[0] = (off_t)(blk_size*(size_t)pio_mpi_rank_g);
} /* end else */
/* Prepare buffer for verifying data */
@@ -601,7 +597,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
/* nbytes is always the number of bytes per dataset (1D or 2D). If the
dataspace is 2D, snbytes is the size of a side of the dataset square.
*/
- snbytes = (off_t)sqrt(nbytes);
+ snbytes = sqrto(nbytes);
/* Contiguous Pattern: */
if (!parms->interleaved) {
@@ -613,9 +609,9 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
bytes_begin[0] = 0;
if(!parms->h5_use_chunks || parms->io_type==PHDF5)
- bytes_begin[1] = (off_t)(blk_size*pio_mpi_rank_g);
+ bytes_begin[1] = (off_t)(blk_size*(size_t)pio_mpi_rank_g);
else
- bytes_begin[1] = (off_t)(blk_size*blk_size*pio_mpi_rank_g);
+ bytes_begin[1] = (off_t)(blk_size*blk_size*(size_t)pio_mpi_rank_g);
} /* end else */
/* Prepare buffer for verifying data */
@@ -693,7 +689,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_COMMIT");
/* Build contiguous file's derived type */
- mrc = MPI_Type_vector((int)blk_size, (int)1, (int)(snbytes/buf_size),
+ mrc = MPI_Type_vector((int)blk_size, (int)1, (int)((size_t)snbytes/buf_size),
mpi_partial_buffer_cont, &mpi_cont_type);
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_CREATE");
@@ -711,7 +707,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_COMMIT");
/* Build interleaved file's derived type */
- mrc = MPI_Type_vector((int)buf_size, (int)1, (int)(snbytes/blk_size),
+ mrc = MPI_Type_vector((int)buf_size, (int)1, (int)((size_t)snbytes/blk_size),
mpi_partial_buffer_inter, &mpi_inter_type);
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_CREATE");
@@ -738,7 +734,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_COMMIT");
/* Build chunk interleaved file's derived type */
- mrc = MPI_Type_vector((int)(buf_size/blk_size), (int)1, (int)(snbytes/blk_size),
+ mrc = MPI_Type_vector((int)(buf_size/blk_size), (int)1, (int)((size_t)snbytes/blk_size),
mpi_full_chunk, &mpi_chunk_inter_type);
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_CREATE");
@@ -754,22 +750,22 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
if (!parms->dim2d){
if(nbytes>0) {
/* define a contiguous dataset of nbytes native bytes */
- h5dims[0] = nbytes;
+ h5dims[0] = (hsize_t)nbytes;
h5dset_space_id = H5Screate_simple(1, h5dims, NULL);
VRFY((h5dset_space_id >= 0), "H5Screate_simple");
/* Set up the file dset space id to select the pattern to access */
if (!parms->interleaved){
/* Contiguous pattern */
- h5start[0] = bytes_begin[0];
+ h5start[0] = (hsize_t)bytes_begin[0];
h5stride[0] = h5block[0] = blk_size;
h5count[0] = buf_size/blk_size;
} /* end if */
else {
/* Interleaved access pattern */
/* Skip offset over blocks of other processes */
- h5start[0] = bytes_begin[0];
- h5stride[0] = blk_size*pio_mpi_nprocs_g;
+ h5start[0] = (hsize_t)bytes_begin[0];
+ h5stride[0] = blk_size*(size_t)pio_mpi_nprocs_g;
h5block[0] = blk_size;
h5count[0] = buf_size/blk_size;
} /* end else */
@@ -797,16 +793,16 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
else {
if(nbytes>0) {
/* define a contiguous dataset of nbytes native bytes */
- h5dims[0] = snbytes;
- h5dims[1] = snbytes;
+ h5dims[0] = (hsize_t)snbytes;
+ h5dims[1] = (hsize_t)snbytes;
h5dset_space_id = H5Screate_simple(2, h5dims, NULL);
VRFY((h5dset_space_id >= 0), "H5Screate_simple");
/* Set up the file dset space id to select the pattern to access */
if (!parms->interleaved){
/* Contiguous pattern */
- h5start[0] = bytes_begin[0];
- h5start[1] = bytes_begin[1];
+ h5start[0] = (hsize_t)bytes_begin[0];
+ h5start[1] = (hsize_t)bytes_begin[1];
h5stride[0] = 1;
h5stride[1] = h5block[0] = h5block[1] = blk_size;
h5count[0] = 1;
@@ -815,10 +811,10 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
else {
/* Interleaved access pattern */
/* Skip offset over blocks of other processes */
- h5start[0] = bytes_begin[0];
- h5start[1] = bytes_begin[1];
+ h5start[0] = (hsize_t)bytes_begin[0];
+ h5start[1] = (hsize_t)bytes_begin[1];
h5stride[0] = blk_size;
- h5stride[1] = blk_size*pio_mpi_nprocs_g;
+ h5stride[1] = blk_size*(size_t)pio_mpi_nprocs_g;
h5block[0] = h5block[1] = blk_size;
h5count[0] = buf_size/blk_size;
h5count[1] = 1;
@@ -866,6 +862,9 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
} /* end if */
} /* end if */
break;
+
+ default:
+ break;
} /* end switch */
for (ndset = 1; ndset <= ndsets; ++ndset) {
@@ -929,6 +928,9 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
GOTOERROR(FAIL);
}
break;
+
+ default:
+ break;
}
/* The task is to transfer bytes_count bytes, starting at
@@ -982,7 +984,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((rc != 0), "POSIXWRITE");
/* Advance global offset in dataset */
- nbytes_xfer+=buf_size;
+ nbytes_xfer+=(ssize_t)buf_size;
} /* end if */
/* Interleaved access pattern */
else {
@@ -1011,7 +1013,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
buf_p+=blk_size;
/* Advance global offset in dataset */
- nbytes_xfer+=blk_size;
+ nbytes_xfer+=(ssize_t)blk_size;
/* Decrement number of bytes left this time */
nbytes_toxfer-=blk_size;
@@ -1025,8 +1027,8 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Contiguous access pattern */
if (!parms->interleaved) {
/* Compute file offset */
- file_offset=posix_file_offset+(off_t)(((nbytes_xfer/blk_size)
- /snbytes)*(blk_size*snbytes)+((nbytes_xfer/blk_size)%snbytes));
+ file_offset=posix_file_offset+(off_t)((((size_t)nbytes_xfer/blk_size)
+ /(size_t)snbytes)*(blk_size*(size_t)snbytes)+(((size_t)nbytes_xfer/blk_size)%(size_t)snbytes));
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = buf_size;
@@ -1037,9 +1039,9 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Interleaved access pattern */
else {
/* Compute file offset */
- file_offset=posix_file_offset+(off_t)((((nbytes_xfer/buf_size)
- *pio_mpi_nprocs_g)/snbytes)*(buf_size*snbytes)
- +((nbytes_xfer/buf_size)*pio_mpi_nprocs_g)%snbytes);
+ file_offset=posix_file_offset+(off_t)(((((size_t)nbytes_xfer/buf_size)
+ *(size_t)pio_mpi_nprocs_g)/(size_t)snbytes)*(buf_size*(size_t)snbytes)
+ +(((size_t)nbytes_xfer/buf_size)*(size_t)pio_mpi_nprocs_g)%(size_t)snbytes);
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = blk_size;
@@ -1070,16 +1072,16 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
*snbytes/blk_size*(blk_size*blk_size))+((nbytes_xfer/(buf_size/blk_size))
*pio_mpi_nprocs_g)%(snbytes/blk_size*(blk_size*blk_size))); */
- file_offset=posix_file_offset+(off_t)(((nbytes_xfer/(buf_size/blk_size)
- *pio_mpi_nprocs_g)/(snbytes*blk_size))*(buf_size*snbytes)+((nbytes_xfer/(buf_size/blk_size))
- *pio_mpi_nprocs_g)%(snbytes*blk_size));
+ file_offset=posix_file_offset+(off_t)((((size_t)nbytes_xfer/(buf_size/blk_size)
+ *(size_t)pio_mpi_nprocs_g)/((size_t)snbytes*blk_size))*(buf_size*(size_t)snbytes)+(((size_t)nbytes_xfer/(buf_size/blk_size))
+ *(size_t)pio_mpi_nprocs_g)%((size_t)snbytes*blk_size));
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = blk_size * blk_size;
/* Global offset advance after each I/O operation */
/* file_offset_advance = (off_t)(snbytes/blk_size*(blk_size*blk_size)); */
- file_offset_advance = (off_t)(snbytes*blk_size);
+ file_offset_advance = (off_t)snbytes*(off_t)blk_size;
} /* end else */
} /* end else */
@@ -1106,7 +1108,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
buf_p+=nbytes_xfer_advance;
/* Advance global offset in dataset */
- nbytes_xfer+=nbytes_xfer_advance;
+ nbytes_xfer+=(ssize_t)nbytes_xfer_advance;
/* Decrement number of bytes left this time */
nbytes_toxfer-=nbytes_xfer_advance;
@@ -1137,7 +1139,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_WRITE");
/* Advance global offset in dataset */
- nbytes_xfer+=buf_size;
+ nbytes_xfer+=(ssize_t)buf_size;
} /* end if */
/* Interleaved access pattern */
else {
@@ -1162,7 +1164,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
buf_p+=blk_size;
/* Advance global offset in dataset */
- nbytes_xfer+=blk_size;
+ nbytes_xfer+=(ssize_t)blk_size;
/* Decrement number of bytes left this time */
nbytes_toxfer-=blk_size;
@@ -1183,7 +1185,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_WRITE");
/* Advance global offset in dataset */
- nbytes_xfer+=buf_size;
+ nbytes_xfer+=(ssize_t)buf_size;
} /* end if */
/* Interleaved access pattern */
else {
@@ -1202,7 +1204,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_WRITE");
/* Advance global offset in dataset */
- nbytes_xfer+=buf_size;
+ nbytes_xfer+=(ssize_t)buf_size;
} /* end else */
} /* end else */
} /* end if */
@@ -1213,8 +1215,8 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Contiguous access pattern */
if (!parms->interleaved) {
/* Compute offset in file */
- mpi_offset=mpi_file_offset+((nbytes_xfer/blk_size)/snbytes)*
- (blk_size*snbytes)+((nbytes_xfer/blk_size)%snbytes);
+ mpi_offset=mpi_file_offset+(MPI_Offset)((((size_t)nbytes_xfer/blk_size)/(size_t)snbytes)*
+ (blk_size*(size_t)snbytes))+(MPI_Offset)(((size_t)nbytes_xfer/blk_size)%(size_t)snbytes);
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = buf_size;
@@ -1228,8 +1230,8 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Interleaved access pattern */
else {
/* Compute offset in file */
- mpi_offset=mpi_file_offset+(((nbytes_xfer/buf_size)*pio_mpi_nprocs_g)/snbytes)*
- (buf_size*snbytes)+((nbytes_xfer/buf_size)*pio_mpi_nprocs_g)%snbytes;
+ mpi_offset=mpi_file_offset+(MPI_Offset)(((((size_t)nbytes_xfer/buf_size)*(size_t)pio_mpi_nprocs_g)/(size_t)snbytes)*
+ (buf_size*(size_t)snbytes))+(MPI_Offset)((((size_t)nbytes_xfer/buf_size)*(size_t)pio_mpi_nprocs_g)%(size_t)snbytes);
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = blk_size;
@@ -1266,16 +1268,16 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
(buf_size/blk_size*snbytes/blk_size*(blk_size*blk_size))+
((nbytes_xfer/(buf_size/blk_size))*pio_mpi_nprocs_g)%(snbytes
/blk_size*(blk_size*blk_size)); */
- mpi_offset=mpi_file_offset+((nbytes_xfer/(buf_size/blk_size)
- *pio_mpi_nprocs_g)/(snbytes*blk_size))*(buf_size*snbytes)
- +((nbytes_xfer/(buf_size/blk_size))*pio_mpi_nprocs_g)%(snbytes*blk_size);
+ mpi_offset=mpi_file_offset+(MPI_Offset)((((size_t)nbytes_xfer/(buf_size/blk_size)
+ *(size_t)pio_mpi_nprocs_g)/((size_t)snbytes*blk_size))*(buf_size*(size_t)snbytes))
+ +(MPI_Offset)((((size_t)nbytes_xfer/(buf_size/blk_size))*(size_t)pio_mpi_nprocs_g)%((size_t)snbytes*blk_size));
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = blk_size * blk_size;
/* Global offset advance after each I/O operation */
/* mpi_offset_advance = (MPI_Offset)(snbytes/blk_size*(blk_size*blk_size)); */
- mpi_offset_advance = (MPI_Offset)(snbytes*blk_size);
+ mpi_offset_advance = (MPI_Offset)((size_t)snbytes*blk_size);
/* MPI type to be used for collective access */
mpi_collective_type = mpi_chunk_inter_type;
@@ -1301,7 +1303,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
buf_p+=nbytes_xfer_advance;
/* Advance global offset in dataset */
- nbytes_xfer+=nbytes_xfer_advance;
+ nbytes_xfer+=(ssize_t)nbytes_xfer_advance;
/* Decrement number of bytes left this time */
nbytes_toxfer-=nbytes_xfer_advance;
@@ -1324,7 +1326,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_WRITE");
/* Advance global offset in dataset */
- nbytes_xfer+=buf_size*blk_size;
+ nbytes_xfer+=(off_t)buf_size*(off_t)blk_size;
} /* end else */
} /* end else */
@@ -1353,22 +1355,22 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((hrc >= 0), "H5Dwrite");
/* Increment number of bytes transferred */
- nbytes_xfer += buf_size;
+ nbytes_xfer += (ssize_t)buf_size;
} /* end if */
/* 2D dataspace */
else {
/* Set up the file dset space id to move the selection to process */
if (!parms->interleaved){
/* Contiguous pattern */
- h5offset[0] = (nbytes_xfer/(snbytes*blk_size))*blk_size;
- h5offset[1] = (nbytes_xfer%(snbytes*blk_size))/blk_size;
+ h5offset[0] = (hssize_t)(((size_t)nbytes_xfer/((size_t)snbytes*blk_size))*blk_size);
+ h5offset[1] = (hssize_t)(((size_t)nbytes_xfer%((size_t)snbytes*blk_size))/blk_size);
} /* end if */
else {
/* Interleaved access pattern */
/* Skip offset over blocks of other processes */
- h5offset[0] = ((nbytes_xfer*pio_mpi_nprocs_g)/(snbytes*buf_size))*buf_size;
- h5offset[1] = ((nbytes_xfer*pio_mpi_nprocs_g)%(snbytes*buf_size))/buf_size;
+ h5offset[0] = (hssize_t)((((size_t)nbytes_xfer*(size_t)pio_mpi_nprocs_g)/((size_t)snbytes*buf_size))*buf_size);
+ h5offset[1] = (hssize_t)((((size_t)nbytes_xfer*(size_t)pio_mpi_nprocs_g)%((size_t)snbytes*buf_size))/buf_size);
} /* end else */
hrc = H5Soffset_simple(h5dset_space_id, h5offset);
@@ -1380,11 +1382,14 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((hrc >= 0), "H5Dwrite");
/* Increment number of bytes transferred */
- nbytes_xfer += buf_size*blk_size;
+ nbytes_xfer += (off_t)buf_size*(off_t)blk_size;
} /* end else */
break;
+
+ default:
+ break;
} /* switch (parms->io_type) */
} /* end while */
@@ -1402,7 +1407,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
GOTOERROR(FAIL);
}
- h5ds_id = -1;
+ h5ds_id = H5I_INVALID_HID;
} /* end if */
} /* end for */
@@ -1458,7 +1463,7 @@ done:
HDfprintf(stderr, "HDF5 Dataset Space Close failed\n");
ret_code = FAIL;
} else {
- h5dset_space_id = -1;
+ h5dset_space_id = H5I_INVALID_HID;
}
}
@@ -1468,7 +1473,7 @@ done:
HDfprintf(stderr, "HDF5 Memory Space Close failed\n");
ret_code = FAIL;
} else {
- h5mem_space_id = -1;
+ h5mem_space_id = H5I_INVALID_HID;
}
}
@@ -1478,13 +1483,20 @@ done:
HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
ret_code = FAIL;
} else {
- h5dxpl = -1;
+ h5dxpl = H5I_INVALID_HID;
}
}
return ret_code;
}
+static off_t
+sqrto(off_t x)
+{
+ double root_x = sqrt((double)x);
+ return (off_t)root_x;
+}
+
/*
* Function: do_read
* Purpose: read the required amount of data from the file.
@@ -1537,15 +1549,15 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
/* HDF5 variables */
herr_t hrc; /*HDF5 return code */
hsize_t h5dims[2]; /*dataset dim sizes */
- hid_t h5dset_space_id = -1; /*dataset space ID */
- hid_t h5mem_space_id = -1; /*memory dataspace ID */
- hid_t h5ds_id = -1; /*dataset handle */
+ hid_t h5dset_space_id = H5I_INVALID_HID; /*dataset space ID */
+ hid_t h5mem_space_id = H5I_INVALID_HID; /*memory dataspace ID */
+ hid_t h5ds_id = H5I_INVALID_HID; /*dataset handle */
hsize_t h5block[2]; /*dataspace selection */
hsize_t h5stride[2];
hsize_t h5count[2];
hsize_t h5start[2];
hssize_t h5offset[2]; /* Selection offset within dataspace */
- hid_t h5dxpl = -1; /* Dataset transfer property list */
+ hid_t h5dxpl = H5I_INVALID_HID; /* Dataset transfer property list */
/* Get the parameters from the parameter block */
blk_size=parms->blk_size;
@@ -1569,7 +1581,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
} /* end if */
/* Interleaved Pattern: */
else {
- bytes_begin[0] = (off_t)(blk_size*pio_mpi_rank_g);
+ bytes_begin[0] = (off_t)blk_size*(off_t)pio_mpi_rank_g;
} /* end else */
}/* end if */
/* 2D dataspace */
@@ -1577,7 +1589,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
/* nbytes is always the number of bytes per dataset (1D or 2D). If the
dataspace is 2D, snbytes is the size of a side of the 'dataset square'.
*/
- snbytes = (off_t)sqrt(nbytes);
+ snbytes = sqrto(nbytes);
bsize = buf_size * blk_size;
@@ -1591,9 +1603,9 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
bytes_begin[0] = 0;
if (!parms->h5_use_chunks || parms->io_type==PHDF5)
- bytes_begin[1] = (off_t)(blk_size*pio_mpi_rank_g);
+ bytes_begin[1] = (off_t)blk_size*(off_t)pio_mpi_rank_g;
else
- bytes_begin[1] = (off_t)(blk_size*blk_size*pio_mpi_rank_g);
+ bytes_begin[1] = (off_t)blk_size*(off_t)blk_size*(off_t)pio_mpi_rank_g;
} /* end else */
} /* end else */
@@ -1665,7 +1677,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_COMMIT");
/* Build contiguous file's derived type */
- mrc = MPI_Type_vector((int)blk_size, (int)1, (int)(snbytes/buf_size),
+ mrc = MPI_Type_vector((int)blk_size, (int)1, (int)((size_t)snbytes/buf_size),
mpi_partial_buffer_cont, &mpi_cont_type);
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_CREATE");
@@ -1683,7 +1695,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_COMMIT");
/* Build interleaved file's derived type */
- mrc = MPI_Type_vector((int)buf_size, (int)1, (int)(snbytes/blk_size),
+ mrc = MPI_Type_vector((int)buf_size, (int)1, (int)((size_t)snbytes/blk_size),
mpi_partial_buffer_inter, &mpi_inter_type);
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_CREATE");
@@ -1710,7 +1722,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_COMMIT");
/* Build chunk interleaved file's derived type */
- mrc = MPI_Type_vector((int)(buf_size/blk_size), (int)1, (int)(snbytes/blk_size),
+ mrc = MPI_Type_vector((int)(buf_size/blk_size), (int)1, (int)((size_t)snbytes/blk_size),
mpi_full_chunk, &mpi_chunk_inter_type);
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_CREATE");
@@ -1725,22 +1737,22 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
if (!parms->dim2d){
if(nbytes>0) {
/* define a contiguous dataset of nbytes native bytes */
- h5dims[0] = nbytes;
+ h5dims[0] = (hsize_t)nbytes;
h5dset_space_id = H5Screate_simple(1, h5dims, NULL);
VRFY((h5dset_space_id >= 0), "H5Screate_simple");
/* Set up the file dset space id to select the pattern to access */
if (!parms->interleaved){
/* Contiguous pattern */
- h5start[0] = bytes_begin[0];
+ h5start[0] = (hsize_t)bytes_begin[0];
h5stride[0] = h5block[0] = blk_size;
h5count[0] = buf_size/blk_size;
} /* end if */
else {
/* Interleaved access pattern */
/* Skip offset over blocks of other processes */
- h5start[0] = bytes_begin[0];
- h5stride[0] = blk_size*pio_mpi_nprocs_g;
+ h5start[0] = (hsize_t)bytes_begin[0];
+ h5stride[0] = blk_size*(size_t)pio_mpi_nprocs_g;
h5block[0] = blk_size;
h5count[0] = buf_size/blk_size;
} /* end else */
@@ -1768,16 +1780,16 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
else {
if(nbytes>0) {
/* define a contiguous dataset of nbytes native bytes */
- h5dims[0] = snbytes;
- h5dims[1] = snbytes;
+ h5dims[0] = (hsize_t)snbytes;
+ h5dims[1] = (hsize_t)snbytes;
h5dset_space_id = H5Screate_simple(2, h5dims, NULL);
VRFY((h5dset_space_id >= 0), "H5Screate_simple");
/* Set up the file dset space id to select the pattern to access */
if (!parms->interleaved){
/* Contiguous pattern */
- h5start[0] = bytes_begin[0];
- h5start[1] = bytes_begin[1];
+ h5start[0] = (hsize_t)bytes_begin[0];
+ h5start[1] = (hsize_t)bytes_begin[1];
h5stride[0] = 1;
h5stride[1] = h5block[0] = h5block[1] = blk_size;
h5count[0] = 1;
@@ -1786,10 +1798,10 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
else {
/* Interleaved access pattern */
/* Skip offset over blocks of other processes */
- h5start[0] = bytes_begin[0];
- h5start[1] = bytes_begin[1];
+ h5start[0] = (hsize_t)bytes_begin[0];
+ h5start[1] = (hsize_t)bytes_begin[1];
h5stride[0] = blk_size;
- h5stride[1] = blk_size*pio_mpi_nprocs_g;
+ h5stride[1] = blk_size*(size_t)pio_mpi_nprocs_g;
h5block[0] = h5block[1] = blk_size;
h5count[0] = buf_size/blk_size;
h5count[1] = 1;
@@ -1824,19 +1836,22 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Create the dataset transfer property list */
h5dxpl = H5Pcreate(H5P_DATASET_XFER);
if (h5dxpl < 0) {
- HDfprintf(stderr, "HDF5 Property List Create failed\n");
- GOTOERROR(FAIL);
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
+ GOTOERROR(FAIL);
}
/* Change to collective I/O, if asked */
if(parms->collective) {
- hrc = H5Pset_dxpl_mpio(h5dxpl, H5FD_MPIO_COLLECTIVE);
- if (hrc < 0) {
- HDfprintf(stderr, "HDF5 Property List Set failed\n");
- GOTOERROR(FAIL);
- } /* end if */
+ hrc = H5Pset_dxpl_mpio(h5dxpl, H5FD_MPIO_COLLECTIVE);
+ if (hrc < 0) {
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
+ GOTOERROR(FAIL);
+ } /* end if */
} /* end if */
break;
+
+ default:
+ break;
} /* end switch */
for (ndset = 1; ndset <= ndsets; ++ndset) {
@@ -1847,19 +1862,21 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
switch (parms->io_type) {
case POSIXIO:
case MPIO:
- /* both posix and mpi io just need dataset offset in file*/
- dset_offset = (ndset - 1) * nbytes;
- break;
+ /* both posix and mpi io just need dataset offset in file*/
+ dset_offset = (ndset - 1) * nbytes;
+ break;
case PHDF5:
HDsprintf(dname, "Dataset_%ld", ndset);
- h5ds_id = H5DOPEN(fd->h5fd, dname);
- if (h5ds_id < 0) {
- HDfprintf(stderr, "HDF5 Dataset open failed\n");
- GOTOERROR(FAIL);
- }
+ h5ds_id = H5DOPEN(fd->h5fd, dname);
+ if (h5ds_id < 0) {
+ HDfprintf(stderr, "HDF5 Dataset open failed\n");
+ GOTOERROR(FAIL);
+ }
+ break;
- break;
+ default:
+ break;
}
/* The task is to transfer bytes_count bytes, starting at
@@ -1913,7 +1930,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((rc != 0), "POSIXREAD");
/* Advance global offset in dataset */
- nbytes_xfer+=buf_size;
+ nbytes_xfer+=(off_t)buf_size;
} /* end if */
/* Interleaved access pattern */
else {
@@ -1942,7 +1959,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
buf_p+=blk_size;
/* Advance global offset in dataset */
- nbytes_xfer+=blk_size;
+ nbytes_xfer+=(off_t)blk_size;
/* Decrement number of bytes left this time */
nbytes_toxfer-=blk_size;
@@ -1956,8 +1973,8 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Contiguous access pattern */
if (!parms->interleaved) {
/* Compute file offset */
- file_offset=posix_file_offset+(off_t)(((nbytes_xfer/blk_size)
- /snbytes)*(blk_size*snbytes)+((nbytes_xfer/blk_size)%snbytes));
+ file_offset=posix_file_offset+(off_t)((((size_t)nbytes_xfer/blk_size)
+ /(size_t)snbytes)*(blk_size*(size_t)snbytes)+(((size_t)nbytes_xfer/blk_size)%(size_t)snbytes));
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = buf_size;
@@ -1968,9 +1985,9 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Interleaved access pattern */
else {
/* Compute file offset */
- file_offset=posix_file_offset+(off_t)((((nbytes_xfer/buf_size)
- *pio_mpi_nprocs_g)/snbytes)*(buf_size*snbytes)
- +((nbytes_xfer/buf_size)*pio_mpi_nprocs_g)%snbytes);
+ file_offset=posix_file_offset+(off_t)(((((size_t)nbytes_xfer/buf_size)
+ *(size_t)pio_mpi_nprocs_g)/(size_t)snbytes)*(buf_size*(size_t)snbytes)
+ +(((size_t)nbytes_xfer/buf_size)*(size_t)pio_mpi_nprocs_g)%(size_t)snbytes);
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = blk_size;
@@ -2001,16 +2018,16 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
*snbytes/blk_size*(blk_size*blk_size))+((nbytes_xfer/(buf_size/blk_size))
*pio_mpi_nprocs_g)%(snbytes/blk_size*(blk_size*blk_size))); */
- file_offset=posix_file_offset+(off_t)(((nbytes_xfer/(buf_size/blk_size)
- *pio_mpi_nprocs_g)/(snbytes*blk_size))*(buf_size*snbytes)+((nbytes_xfer/(buf_size/blk_size))
- *pio_mpi_nprocs_g)%(snbytes*blk_size));
+ file_offset=posix_file_offset+(off_t)((((size_t)nbytes_xfer/(buf_size/blk_size)
+ *(size_t)pio_mpi_nprocs_g)/((size_t)snbytes*blk_size))*(buf_size*(size_t)snbytes)+(((size_t)nbytes_xfer/(buf_size/blk_size))
+ *(size_t)pio_mpi_nprocs_g)%((size_t)snbytes*blk_size));
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = blk_size * blk_size;
/* Global offset advance after each I/O operation */
/* file_offset_advance = (off_t)(snbytes/blk_size*(blk_size*blk_size)); */
- file_offset_advance = (off_t)(snbytes*blk_size);
+ file_offset_advance = (off_t)((size_t)snbytes*blk_size);
} /* end else */
} /* end else */
@@ -2037,7 +2054,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
buf_p+=nbytes_xfer_advance;
/* Advance global offset in dataset */
- nbytes_xfer+=nbytes_xfer_advance;
+ nbytes_xfer+=(off_t)nbytes_xfer_advance;
/* Decrement number of bytes left this time */
nbytes_toxfer-=nbytes_xfer_advance;
@@ -2067,7 +2084,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_READ");
/* Advance global offset in dataset */
- nbytes_xfer+=buf_size;
+ nbytes_xfer+=(off_t)buf_size;
} /* end if */
/* Interleaved access pattern */
else {
@@ -2092,7 +2109,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
buf_p+=blk_size;
/* Advance global offset in dataset */
- nbytes_xfer+=blk_size;
+ nbytes_xfer+=(off_t)blk_size;
/* Decrement number of bytes left this time */
nbytes_toxfer-=blk_size;
@@ -2113,7 +2130,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_READ");
/* Advance global offset in dataset */
- nbytes_xfer+=buf_size;
+ nbytes_xfer+=(off_t)buf_size;
} /* end if */
/* Interleaved access pattern */
else {
@@ -2132,7 +2149,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_READ");
/* Advance global offset in dataset */
- nbytes_xfer+=buf_size;
+ nbytes_xfer+=(off_t)buf_size;
} /* end else */
} /* end else */
} /* end if */
@@ -2143,8 +2160,8 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Contiguous access pattern */
if (!parms->interleaved) {
/* Compute offset in file */
- mpi_offset=mpi_file_offset+((nbytes_xfer/blk_size)/snbytes)*
- (blk_size*snbytes)+((nbytes_xfer/blk_size)%snbytes);
+ mpi_offset=mpi_file_offset+(MPI_Offset)((((size_t)nbytes_xfer/blk_size)/(size_t)snbytes)*
+ (blk_size*(size_t)snbytes))+(MPI_Offset)(((size_t)nbytes_xfer/blk_size)%(size_t)snbytes);
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = buf_size;
@@ -2158,8 +2175,8 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Interleaved access pattern */
else {
/* Compute offset in file */
- mpi_offset=mpi_file_offset+(((nbytes_xfer/buf_size)*pio_mpi_nprocs_g)/snbytes)*
- (buf_size*snbytes)+((nbytes_xfer/buf_size)*pio_mpi_nprocs_g)%snbytes;
+ mpi_offset=mpi_file_offset+(MPI_Offset)(((((size_t)nbytes_xfer/buf_size)*(size_t)pio_mpi_nprocs_g)/(size_t)snbytes)*
+ (buf_size*(size_t)snbytes))+(MPI_Offset)((((size_t)nbytes_xfer/buf_size)*(size_t)pio_mpi_nprocs_g)%(size_t)snbytes);
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = blk_size;
@@ -2196,16 +2213,16 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
(buf_size/blk_size*snbytes/blk_size*(blk_size*blk_size))+
((nbytes_xfer/(buf_size/blk_size))*pio_mpi_nprocs_g)%(snbytes
/blk_size*(blk_size*blk_size)); */
- mpi_offset=mpi_file_offset+((nbytes_xfer/(buf_size/blk_size)
- *pio_mpi_nprocs_g)/(snbytes*blk_size))*(buf_size*snbytes)
- +((nbytes_xfer/(buf_size/blk_size))*pio_mpi_nprocs_g)%(snbytes*blk_size);
+ mpi_offset=mpi_file_offset+(MPI_Offset)((((size_t)nbytes_xfer/(buf_size/blk_size)
+ *(size_t)pio_mpi_nprocs_g)/((size_t)snbytes*blk_size))*(buf_size*(size_t)snbytes))
+ +(MPI_Offset)((((size_t)nbytes_xfer/(buf_size/blk_size))*(size_t)pio_mpi_nprocs_g)%((size_t)snbytes*blk_size));
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = blk_size * blk_size;
/* Global offset advance after each I/O operation */
/* mpi_offset_advance = (MPI_Offset)(snbytes/blk_size*(blk_size*blk_size)); */
- mpi_offset_advance = (MPI_Offset)(snbytes*blk_size);
+ mpi_offset_advance = (MPI_Offset)((size_t)snbytes*blk_size);
/* MPI type to be used for collective access */
mpi_collective_type = mpi_chunk_inter_type;
@@ -2231,7 +2248,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
buf_p+=nbytes_xfer_advance;
/* Advance global offset in dataset */
- nbytes_xfer+=nbytes_xfer_advance;
+ nbytes_xfer+=(off_t)nbytes_xfer_advance;
/* Decrement number of bytes left this time */
nbytes_toxfer-=nbytes_xfer_advance;
@@ -2254,7 +2271,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_READ");
/* Advance global offset in dataset */
- nbytes_xfer+=buf_size*blk_size;
+ nbytes_xfer+=(off_t)buf_size*(off_t)blk_size;
} /* end else */
} /* end else */
@@ -2282,21 +2299,21 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((hrc >= 0), "H5Dread");
/* Increment number of bytes transferred */
- nbytes_xfer += buf_size;
+ nbytes_xfer += (off_t)buf_size;
} /* end if */
/* 2D dataspace */
else {
/* Set up the file dset space id to move the selection to process */
if (!parms->interleaved){
/* Contiguous pattern */
- h5offset[0] = (nbytes_xfer/(snbytes*blk_size))*blk_size;
- h5offset[1] = (nbytes_xfer%(snbytes*blk_size))/blk_size;
+ h5offset[0] = (hssize_t)(((size_t)nbytes_xfer/((size_t)snbytes*blk_size))*blk_size);
+ h5offset[1] = (hssize_t)(((size_t)nbytes_xfer%((size_t)snbytes*blk_size))/blk_size);
} /* end if */
else {
/* Interleaved access pattern */
/* Skip offset over blocks of other processes */
- h5offset[0] = ((nbytes_xfer*pio_mpi_nprocs_g)/(snbytes*buf_size))*buf_size;
- h5offset[1] = ((nbytes_xfer*pio_mpi_nprocs_g)%(snbytes*buf_size))/buf_size;
+ h5offset[0] = (hssize_t)((((size_t)nbytes_xfer*(size_t)pio_mpi_nprocs_g)/((size_t)snbytes*buf_size))*buf_size);
+ h5offset[1] = (hssize_t)((((size_t)nbytes_xfer*(size_t)pio_mpi_nprocs_g)%((size_t)snbytes*buf_size))/buf_size);
} /* end else */
hrc = H5Soffset_simple(h5dset_space_id, h5offset);
@@ -2308,10 +2325,13 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((hrc >= 0), "H5Dread");
/* Increment number of bytes transferred */
- nbytes_xfer += buf_size*blk_size;
+ nbytes_xfer += (off_t)buf_size*(off_t)blk_size;
} /* end else */
break;
+
+ default:
+ break;
} /* switch (parms->io_type) */
/* Verify raw data, if asked */
@@ -2357,7 +2377,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
GOTOERROR(FAIL);
}
- h5ds_id = -1;
+ h5ds_id = H5I_INVALID_HID;
} /* end if */
} /* end for */
@@ -2413,7 +2433,7 @@ done:
HDfprintf(stderr, "HDF5 Dataset Space Close failed\n");
ret_code = FAIL;
} else {
- h5dset_space_id = -1;
+ h5dset_space_id = H5I_INVALID_HID;
}
}
@@ -2423,7 +2443,7 @@ done:
HDfprintf(stderr, "HDF5 Memory Space Close failed\n");
ret_code = FAIL;
} else {
- h5mem_space_id = -1;
+ h5mem_space_id = H5I_INVALID_HID;
}
}
@@ -2433,7 +2453,7 @@ done:
HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
ret_code = FAIL;
} else {
- h5dxpl = -1;
+ h5dxpl = H5I_INVALID_HID;
}
}
@@ -2451,7 +2471,7 @@ done:
do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
{
int ret_code = SUCCESS, mrc;
- hid_t acc_tpl = -1; /* file access templates */
+ hid_t acc_tpl = H5I_INVALID_HID; /* file access templates */
switch (param->io_type) {
case POSIXIO:
@@ -2541,6 +2561,9 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
}
break;
+
+ default:
+ break;
}
done:
@@ -2561,38 +2584,41 @@ do_fclose(iotype iot, file_descr *fd /*out*/)
int mrc = 0, rc = 0;
switch (iot) {
- case POSIXIO:
- rc = POSIXCLOSE(fd->posixfd);
+ case POSIXIO:
+ rc = POSIXCLOSE(fd->posixfd);
- if (rc != 0){
- HDfprintf(stderr, "POSIX File Close failed\n");
- GOTOERROR(FAIL);
- }
+ if (rc != 0){
+ HDfprintf(stderr, "POSIX File Close failed\n");
+ GOTOERROR(FAIL);
+ }
- fd->posixfd = -1;
- break;
+ fd->posixfd = -1;
+ break;
- case MPIO:
- mrc = MPI_File_close(&fd->mpifd);
+ case MPIO:
+ mrc = MPI_File_close(&fd->mpifd);
- if (mrc != MPI_SUCCESS){
- HDfprintf(stderr, "MPI File close failed\n");
- GOTOERROR(FAIL);
- }
+ if (mrc != MPI_SUCCESS){
+ HDfprintf(stderr, "MPI File close failed\n");
+ GOTOERROR(FAIL);
+ }
- fd->mpifd = MPI_FILE_NULL;
- break;
+ fd->mpifd = MPI_FILE_NULL;
+ break;
- case PHDF5:
- hrc = H5Fclose(fd->h5fd);
+ case PHDF5:
+ hrc = H5Fclose(fd->h5fd);
- if (hrc < 0) {
- HDfprintf(stderr, "HDF5 File Close failed\n");
- GOTOERROR(FAIL);
- }
+ if (hrc < 0) {
+ HDfprintf(stderr, "HDF5 File Close failed\n");
+ GOTOERROR(FAIL);
+ }
- fd->h5fd = -1;
- break;
+ fd->h5fd = -1;
+ break;
+
+ default:
+ break;
}
done:
@@ -2619,15 +2645,17 @@ do_cleanupfile(iotype iot, char *fname)
clean_file_g = (getenv("HDF5_NOCLEANUP")==NULL) ? 1 : 0;
if (clean_file_g){
- switch (iot){
- case POSIXIO:
- HDremove(fname);
- break;
- case MPIO:
- case PHDF5:
- MPI_File_delete(fname, h5_io_info_g);
- break;
- }
+ switch (iot){
+ case POSIXIO:
+ HDremove(fname);
+ break;
+ case MPIO:
+ case PHDF5:
+ MPI_File_delete(fname, h5_io_info_g);
+ break;
+ default:
+ break;
+ }
}
}
diff --git a/tools/test/perform/pio_perf.c b/tools/test/perform/pio_perf.c
index 9f4d116..826e7a9 100644
--- a/tools/test/perform/pio_perf.c
+++ b/tools/test/perform/pio_perf.c
@@ -80,8 +80,13 @@
#define PIO_MPI 0x2
#define PIO_HDF5 0x4
+#ifdef STANDALONE
+#define DBL_EPSILON 2.2204460492503131e-16
+#define H5_DBL_ABS_EQUAL(X,Y) (fabs((X)-(Y)) < DBL_EPSILON)
+#endif
+
/* report 0.0 in case t is zero too */
-#define MB_PER_SEC(bytes,t) (((t)==0.0) ? 0.0 : ((((double)bytes) / ONE_MB) / (t)))
+#define MB_PER_SEC(bytes,t) (H5_DBL_ABS_EQUAL((t), 0.0) ? 0.0 : ((((double)bytes) / ONE_MB) / (t)))
#ifndef TRUE
#define TRUE 1
@@ -311,6 +316,7 @@ static void output_report(const char *fmt, ...);
static void print_indent(register int indent);
static void usage(const char *prog);
static void report_parameters(struct options *opts);
+static off_t squareo(off_t);
/*
* Function: main
@@ -393,6 +399,12 @@ finish:
return exit_value;
}
+off_t
+squareo(off_t x)
+{
+ return x * x;
+}
+
/*
* Function: run_test_loop
* Purpose: Run the I/O tests. Write the results to OUTPUT.
@@ -428,8 +440,8 @@ run_test_loop(struct options *opts)
parms.interleaved = opts->interleaved;
parms.collective = opts->collective;
parms.dim2d = opts->dim2d;
- parms.h5_align = opts->h5_alignment;
- parms.h5_thresh = opts->h5_threshold;
+ parms.h5_align = (hsize_t)opts->h5_alignment;
+ parms.h5_thresh = (hsize_t)opts->h5_threshold;
parms.h5_use_chunks = opts->h5_use_chunks;
parms.h5_write_only = opts->h5_write_only;
parms.verify = opts->verify;
@@ -456,7 +468,7 @@ run_test_loop(struct options *opts)
parms.buf_size = buf_size;
if (parms.dim2d){
- parms.num_bytes = (off_t)pow((double)(opts->num_bpp*parms.num_procs),2);
+ parms.num_bytes = squareo(opts->num_bpp * parms.num_procs);
if (parms.interleaved)
output_report("Transfer Buffer Size: %ldx%ld bytes, File size: %.2f MB\n",
buf_size, opts->blk_size,
@@ -558,6 +570,8 @@ run_test(iotype iot, parameters parms, struct options *opts)
case PHDF5:
output_report("PHDF5 (w/MPI-IO driver)\n");
break;
+ default:
+ break;
}
MPI_Comm_size(pio_comm_g, &comm_size);
@@ -879,7 +893,7 @@ accumulate_minmax_stuff(minmax *mm, int count)
int i;
minmax total_mm;
- total_mm.sum = 0.0;
+ total_mm.sum = 0.0f;
total_mm.max = -DBL_MAX;
total_mm.min = DBL_MAX;
total_mm.num = count;
@@ -1155,10 +1169,10 @@ report_parameters(struct options *opts)
recover_size_and_print((long long)(opts->num_bpp * opts->max_num_procs), "\n");
HDfprintf(output, "rank %d: File size=", rank);
- recover_size_and_print((long long)(pow(opts->num_bpp * opts->min_num_procs,2)
- * opts->num_dsets), ":");
- recover_size_and_print((long long)(pow(opts->num_bpp * opts->max_num_procs,2)
- * opts->num_dsets), "\n");
+ recover_size_and_print((long long)(squareo(opts->num_bpp * opts->min_num_procs)
+ * opts->num_dsets), ":");
+ recover_size_and_print((long long)(squareo(opts->num_bpp * opts->max_num_procs)
+ * opts->num_dsets), "\n");
HDfprintf(output, "rank %d: Transfer buffer size=", rank);
if(opts->interleaved){
@@ -1322,7 +1336,7 @@ parse_command_line(int argc, char *argv[])
break;
#endif /* 0 */
case 'B':
- cl_opts->blk_size = parse_size_directive(opt_arg);
+ cl_opts->blk_size = (size_t)parse_size_directive(opt_arg);
break;
case 'c':
/* Turn on chunked HDF5 dataset creation */
@@ -1423,10 +1437,10 @@ parse_command_line(int argc, char *argv[])
cl_opts->h5_write_only = TRUE;
break;
case 'x':
- cl_opts->min_xfer_size = parse_size_directive(opt_arg);
+ cl_opts->min_xfer_size = (size_t)parse_size_directive(opt_arg);
break;
case 'X':
- cl_opts->max_xfer_size = parse_size_directive(opt_arg);
+ cl_opts->max_xfer_size = (size_t)parse_size_directive(opt_arg);
break;
case 'h':
case '?':
@@ -1446,13 +1460,13 @@ parse_command_line(int argc, char *argv[])
}
if (cl_opts->max_xfer_size == 0)
- cl_opts->max_xfer_size = cl_opts->num_bpp;
+ cl_opts->max_xfer_size = (size_t)cl_opts->num_bpp;
if (cl_opts->min_xfer_size == 0)
- cl_opts->min_xfer_size = (cl_opts->num_bpp)/2;
+ cl_opts->min_xfer_size = (size_t)(cl_opts->num_bpp)/2;
if (cl_opts->blk_size == 0)
- cl_opts->blk_size = (cl_opts->num_bpp)/2;
+ cl_opts->blk_size = (size_t)(cl_opts->num_bpp)/2;
/* set default if none specified yet */
@@ -1462,15 +1476,15 @@ parse_command_line(int argc, char *argv[])
/* verify parameters sanity. Adjust if needed. */
/* cap xfer_size with bytes per process */
if (!cl_opts->dim2d) {
- if (cl_opts->min_xfer_size > cl_opts->num_bpp)
- cl_opts->min_xfer_size = cl_opts->num_bpp;
- if (cl_opts->max_xfer_size > cl_opts->num_bpp)
- cl_opts->max_xfer_size = cl_opts->num_bpp;
+ if (cl_opts->min_xfer_size > (size_t)cl_opts->num_bpp)
+ cl_opts->min_xfer_size = (size_t)cl_opts->num_bpp;
+ if (cl_opts->max_xfer_size > (size_t)cl_opts->num_bpp)
+ cl_opts->max_xfer_size = (size_t)cl_opts->num_bpp;
}
if (cl_opts->min_xfer_size > cl_opts->max_xfer_size)
cl_opts->min_xfer_size = cl_opts->max_xfer_size;
- if (cl_opts->blk_size > cl_opts->num_bpp )
- cl_opts->blk_size = cl_opts->num_bpp;
+ if (cl_opts->blk_size > (size_t)cl_opts->num_bpp )
+ cl_opts->blk_size = (size_t)cl_opts->num_bpp;
/* check range of number of processes */
if (cl_opts->min_num_procs <= 0)
cl_opts->min_num_procs = 1;
diff --git a/tools/test/perform/pio_perf.h b/tools/test/perform/pio_perf.h
index 7605f20..55d721e 100644
--- a/tools/test/perform/pio_perf.h
+++ b/tools/test/perform/pio_perf.h
@@ -13,12 +13,13 @@
#ifndef PIO_PERF_H__
#define PIO_PERF_H__
-#include "io_timer.h"
#ifndef STANDALONE
+#include "io_timer.h"
#include "h5test.h"
#include "h5tools.h"
#include "h5tools_utils.h"
#else
+#include "io_timer.h"
#include "pio_standalone.h"
#endif
diff --git a/tools/test/perform/pio_standalone.c b/tools/test/perform/pio_standalone.c
index 022e390..8cdca85 100644
--- a/tools/test/perform/pio_standalone.c
+++ b/tools/test/perform/pio_standalone.c
@@ -18,6 +18,9 @@
#include "pio_perf.h"
+#ifdef STANDALONE
+MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */
+#endif
/** From h5tools_utils.c **/
@@ -162,8 +165,134 @@ print_version(const char *progname)
H5_VERS_SUBRELEASE[0] ? "-" : "", H5_VERS_SUBRELEASE);
}
-#ifdef H5_HAVE_PARALLEL
-MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */
-#endif
+#ifdef STANDALONE
+/*
+ * Function: h5_set_info_object
+ * Purpose: Process environment variables setting to set up MPI Info
+ * object.
+ * Return: 0 if all is fine; otherwise non-zero.
+ * Programmer: Albert Cheng, 2002/05/21.
+ * Modifications:
+ * Bill Wendling, 2002/05/31
+ * Modified so that the HDF5_MPI_INFO environment variable can
+ * be a semicolon separated list of "key=value" pairings. Most
+ * of the code is to remove any whitespaces which might be
+ * surrounding the "key=value" pairs.
+ */
+int
+h5_set_info_object(void)
+{
+ char *envp; /* environment pointer */
+ int ret_value=0;
+
+ /* handle any MPI INFO hints via $HDF5_MPI_INFO */
+ if ((envp = HDgetenv("HDF5_MPI_INFO")) != NULL){
+ char *next, *valp;
+
+ valp = envp = next = HDstrdup(envp);
+
+ if (!valp) return 0;
+
+ /* create an INFO object if not created yet */
+ if (h5_io_info_g == MPI_INFO_NULL)
+ MPI_Info_create(&h5_io_info_g);
+
+ do {
+ size_t len;
+ char *key_val, *endp, *namep;
+
+ if (*valp == ';')
+ valp++;
+
+ /* copy key/value pair into temporary buffer */
+ len = strcspn(valp, ";");
+ next = &valp[len];
+ key_val = (char *)HDcalloc(1, len + 1);
+
+ /* increment the next pointer past the terminating semicolon */
+ if (*next == ';')
+ ++next;
+
+ namep = HDstrncpy(key_val, valp, len);
+
+ /* pass up any beginning whitespaces */
+ while (*namep && (*namep == ' ' || *namep == '\t'))
+ namep++;
+
+ if (!*namep) continue; /* was all white space, so move to next k/v pair */
+
+ /* eat up any ending white spaces */
+ endp = &namep[HDstrlen(namep) - 1];
+
+ while (endp && (*endp == ' ' || *endp == '\t'))
+ *endp-- = '\0';
+
+ /* find the '=' */
+ valp = HDstrchr(namep, '=');
+ if (valp != NULL) { /* it's a valid key/value pairing */
+ char *tmp_val = valp + 1;
+
+ /* change '=' to \0, move valp down one */
+ *valp-- = '\0';
+
+ /* eat up ending whitespace on the "key" part */
+ while (*valp == ' ' || *valp == '\t')
+ *valp-- = '\0';
+
+ valp = tmp_val;
+
+ /* eat up beginning whitespace on the "value" part */
+ while (*valp == ' ' || *valp == '\t')
+ *valp++ = '\0';
+
+ /* actually set the darned thing */
+ if (MPI_SUCCESS != MPI_Info_set(h5_io_info_g, namep, valp)) {
+ HDprintf("MPI_Info_set failed\n");
+ ret_value = -1;
+ }
+ }
+
+ valp = next;
+ HDfree(key_val);
+ } while (next && *next);
+
+ HDfree(envp);
+ }
+
+ return ret_value;
+}
+
+
+/*
+ * Function: h5_dump_info_object
+ * Purpose: Display content of an MPI Info object
+ * Return: void
+ * Programmer: Albert Cheng 2002/05/21
+ * Modifications:
+ */
+void
+h5_dump_info_object(MPI_Info info)
+{
+ char key[MPI_MAX_INFO_KEY+1];
+ char value[MPI_MAX_INFO_VAL+1];
+ int flag;
+ int i, nkeys;
+
+ HDprintf("Dumping MPI Info Object (up to %d bytes per item):\n", MPI_MAX_INFO_VAL);
+ if (info==MPI_INFO_NULL){
+ HDprintf("object is MPI_INFO_NULL\n");
+ }
+ else {
+ MPI_Info_get_nkeys(info, &nkeys);
+ HDprintf("object has %d items\n", nkeys);
+ for (i=0; i<nkeys; i++){
+ MPI_Info_get_nthkey(info, i, key);
+ MPI_Info_get(info, key, MPI_MAX_INFO_VAL, value, &flag);
+ HDprintf("%s=%s\n", key, value);
+ }
+
+ }
+}
+#endif /* STANDALONE */
diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h
index e6db2e8..cf6d980 100644
--- a/tools/test/perform/pio_standalone.h
+++ b/tools/test/perform/pio_standalone.h
@@ -483,8 +483,8 @@ extern MPI_Info h5_io_info_g; /* MPI INFO object for IO */
#endif
#ifdef H5_HAVE_PARALLEL
-H5TEST_DLL int h5_set_info_object(void);
-H5TEST_DLL void h5_dump_info_object(MPI_Info info);
+int h5_set_info_object(void);
+void h5_dump_info_object(MPI_Info info);
#endif
diff --git a/tools/test/perform/sio_engine.c b/tools/test/perform/sio_engine.c
index 07a39cb..9ea94cb 100644
--- a/tools/test/perform/sio_engine.c
+++ b/tools/test/perform/sio_engine.c
@@ -114,11 +114,11 @@ static const char *multi_letters = "msbrglo"; /* string for multi driver */
/* HDF5 global variables */
static hsize_t h5count[MAX_DIMS]; /*selection count */
static hssize_t h5offset[MAX_DIMS]; /* Selection offset within dataspace */
-static hid_t h5dset_space_id = -1; /*dataset space ID */
-static hid_t h5mem_space_id = -1; /*memory dataspace ID */
-static hid_t h5ds_id = -1; /*dataset handle */
-static hid_t h5dcpl = -1; /* Dataset creation property list */
-static hid_t h5dxpl = -1; /* Dataset transfer property list */
+static hid_t h5dset_space_id = H5I_INVALID_HID; /*dataset space ID */
+static hid_t h5mem_space_id = H5I_INVALID_HID; /*memory dataspace ID */
+static hid_t h5ds_id = H5I_INVALID_HID; /*dataset handle */
+static hid_t h5dcpl = H5I_INVALID_HID; /* Dataset creation property list */
+static hid_t h5dxpl = H5I_INVALID_HID; /* Dataset transfer property list */
/*
* Function: do_sio
@@ -575,7 +575,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
GOTOERROR(FAIL);
}
- h5ds_id = -1;
+ h5ds_id = H5I_INVALID_HID;
} /* end if */
done:
@@ -587,7 +587,7 @@ done:
HDfprintf(stderr, "HDF5 Dataset Space Close failed\n");
ret_code = FAIL;
} else {
- h5dset_space_id = -1;
+ h5dset_space_id = H5I_INVALID_HID;
}
}
@@ -597,7 +597,7 @@ done:
HDfprintf(stderr, "HDF5 Memory Space Close failed\n");
ret_code = FAIL;
} else {
- h5mem_space_id = -1;
+ h5mem_space_id = H5I_INVALID_HID;
}
}
@@ -607,7 +607,7 @@ done:
HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
ret_code = FAIL;
} else {
- h5dxpl = -1;
+ h5dxpl = H5I_INVALID_HID;
}
}
@@ -894,7 +894,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
GOTOERROR(FAIL);
}
- h5ds_id = -1;
+ h5ds_id = H5I_INVALID_HID;
} /* end if */
done:
@@ -906,7 +906,7 @@ done:
HDfprintf(stderr, "HDF5 Dataset Space Close failed\n");
ret_code = FAIL;
} else {
- h5dset_space_id = -1;
+ h5dset_space_id = H5I_INVALID_HID;
}
}
@@ -916,7 +916,7 @@ done:
HDfprintf(stderr, "HDF5 Memory Space Close failed\n");
ret_code = FAIL;
} else {
- h5mem_space_id = -1;
+ h5mem_space_id = H5I_INVALID_HID;
}
}
@@ -926,7 +926,7 @@ done:
HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
ret_code = FAIL;
} else {
- h5dxpl = -1;
+ h5dxpl = H5I_INVALID_HID;
}
}
@@ -1137,7 +1137,7 @@ done:
hid_t
set_vfd(parameters *param)
{
- hid_t my_fapl = -1;
+ hid_t my_fapl = H5I_INVALID_HID;
vfdtype vfd;
vfd = param->vfd;
@@ -1174,7 +1174,7 @@ set_vfd(parameters *param)
HDmemset(memb_addr, 0, sizeof memb_addr);
HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES);
- for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
+ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) {
memb_fapl[mt] = H5P_DEFAULT;
HDsprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
memb_name[mt] = sv[mt];
@@ -1268,8 +1268,7 @@ done:
* 'temp' in the code below, but early (4.4.7, at least) gcc only
* allows diagnostic pragmas to be toggled outside of functions.
*/
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+H5_GCC_DIAG_OFF(format-nonliteral)
static void
do_cleanupfile(iotype iot, char *filename)
{
@@ -1312,7 +1311,7 @@ do_cleanupfile(iotype iot, char *filename)
H5FD_mem_t mt;
assert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES);
- for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
+ for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) {
HDsnprintf(temp, sizeof temp, "%s-%c.h5",
filename, multi_letters[mt]);
HDremove(temp); /*don't care if it fails*/
@@ -1331,5 +1330,5 @@ do_cleanupfile(iotype iot, char *filename)
}
}
}
-#pragma GCC diagnostic pop
+H5_GCC_DIAG_ON(format-nonliteral)
diff --git a/tools/test/perform/sio_perf.h b/tools/test/perform/sio_perf.h
index 83caf54..d26c78b 100644
--- a/tools/test/perform/sio_perf.h
+++ b/tools/test/perform/sio_perf.h
@@ -13,12 +13,13 @@
#ifndef SIO_PERF_H__
#define SIO_PERF_H__
-#include "io_timer.h"
#ifndef STANDALONE
+#include "io_timer.h"
#include "h5test.h"
#include "h5tools.h"
#include "h5tools_utils.h"
#else
+#include "io_timer.h"
#include "sio_standalone.h"
#endif
diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h
index 5ce922b..45f6d25 100644
--- a/tools/test/perform/sio_standalone.h
+++ b/tools/test/perform/sio_standalone.h
@@ -47,13 +47,6 @@
#define MAX3(a,b,c) MAX(a,MAX(b,c))
#define MAX4(a,b,c,d) MAX(MAX(a,b),MAX(c,d))
-/*
- * A macro to portably increment enumerated types.
- */
-#ifndef H5_INC_ENUM
-# define H5_INC_ENUM(TYPE,VAR) (VAR)=((TYPE)((VAR)+1))
-#endif
-
#define H5_FLT_ABS_EQUAL(X,Y) (HDfabsf((X)-(Y)) < FLT_EPSILON)
#define H5_DBL_ABS_EQUAL(X,Y) (HDfabs ((X)-(Y)) < DBL_EPSILON)
#define H5_LDBL_ABS_EQUAL(X,Y) (HDfabsl((X)-(Y)) < LDBL_EPSILON)
@@ -505,8 +498,8 @@ extern MPI_Info h5_io_info_g; /* MPI INFO object for IO */
#endif
#ifdef H5_HAVE_PARALLEL
-H5TEST_DLL int h5_set_info_object(void);
-H5TEST_DLL void h5_dump_info_object(MPI_Info info);
+int h5_set_info_object(void);
+void h5_dump_info_object(MPI_Info info);
#endif
@@ -534,4 +527,10 @@ typedef struct long_options {
extern int get_option(int argc, const char **argv, const char *opt,
const struct long_options *l_opt);
+
+extern int nCols; /*max number of columns for outputting */
+
+/* Definitions of useful routines */
+extern void print_version(const char *progname);
+
#endif