summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2013-11-19 23:00:19 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2013-11-19 23:00:19 (GMT)
commit9dfe3e854f023fb2351cdd014c1954297e9fd921 (patch)
treefbe8d544de76a35a7b46b2733ebdae20f8007b33
parent612faec1aceceb595c77da52b092b7683581e776 (diff)
downloadhdf5-9dfe3e854f023fb2351cdd014c1954297e9fd921.zip
hdf5-9dfe3e854f023fb2351cdd014c1954297e9fd921.tar.gz
hdf5-9dfe3e854f023fb2351cdd014c1954297e9fd921.tar.bz2
[svn-r24457] Bring revisions #24333 - #24432 from trunk to revise_chunks.
h5committested.
-rw-r--r--CMakeInstallation.cmake13
-rw-r--r--MANIFEST6
-rw-r--r--README.txt2
-rw-r--r--c++/src/Makefile.in2
-rw-r--r--c++/test/CMakeTests.cmake25
-rw-r--r--c++/test/Makefile.am3
-rw-r--r--c++/test/Makefile.in5
-rw-r--r--c++/test/tcompound.cpp56
-rw-r--r--config/cmake/H5pubconf.h.in6
-rw-r--r--config/cmake/HDF518_Examples.cmake.in15
-rw-r--r--config/lt_vers.am2
-rwxr-xr-xconfigure26
-rw-r--r--configure.ac6
-rw-r--r--examples/CMakeTests.cmake3
-rw-r--r--fortran/examples/CMakeTests.cmake24
-rw-r--r--fortran/src/H5Df.c40
-rw-r--r--fortran/src/H5Sf.c4
-rw-r--r--fortran/src/Makefile.in2
-rw-r--r--hl/c++/examples/CMakeTests.cmake8
-rw-r--r--hl/c++/src/Makefile.in2
-rw-r--r--hl/examples/CMakeLists.txt2
-rw-r--r--hl/examples/CMakeTests.cmake36
-rw-r--r--hl/fortran/src/H5IMcc.c4
-rw-r--r--hl/fortran/src/H5IMfc.c32
-rw-r--r--hl/fortran/src/H5LTfc.c66
-rw-r--r--hl/fortran/src/Makefile.in2
-rw-r--r--hl/fortran/test/CMakeTests.cmake3
-rw-r--r--hl/fortran/test/Makefile.am2
-rw-r--r--hl/fortran/test/Makefile.in2
-rw-r--r--hl/src/H5DS.c94
-rw-r--r--hl/src/H5HLprivate2.h94
-rw-r--r--hl/src/H5IM.c12
-rw-r--r--hl/src/H5LT.c5
-rw-r--r--hl/src/H5PT.c34
-rw-r--r--hl/src/H5TB.c118
-rw-r--r--hl/src/Makefile.in2
-rw-r--r--hl/src/hdf5_hl.h2
-rw-r--r--hl/test/CMakeTests.cmake3
-rw-r--r--hl/test/gen_test_ds.c4
-rw-r--r--hl/test/test_dset_opt.c10
-rw-r--r--hl/test/test_file_image.c10
-rw-r--r--release_docs/RELEASE.txt2
-rw-r--r--release_docs/USING_CMake_Examples.txt93
-rw-r--r--src/H5F.c132
-rw-r--r--src/H5detect.c47
-rw-r--r--src/H5public.h4
-rw-r--r--src/Makefile.in2
-rw-r--r--test/CMakeTests.cmake2
-rw-r--r--test/Makefile.am2
-rw-r--r--test/Makefile.in2
-rw-r--r--test/accum.c8
-rw-r--r--test/big.c320
-rw-r--r--test/cmpd_dset.c32
-rw-r--r--test/dsets.c10
-rw-r--r--test/dt_arith.c74
-rw-r--r--test/dtypes.c81
-rw-r--r--test/h5test.c2
-rw-r--r--test/ntypes.c4
-rw-r--r--test/tarray.c28
-rw-r--r--test/tattr.c2
-rw-r--r--test/test_plugin.sh.in3
-rw-r--r--test/tfile.c34
-rw-r--r--test/tgenprop.c6
-rw-r--r--test/tid.c14
-rw-r--r--test/tmisc.c2
-rw-r--r--test/trefer.c40
-rw-r--r--test/tselect.c36
-rw-r--r--test/tsohm.c4
-rw-r--r--test/ttsafe_acreate.c4
-rw-r--r--test/ttsafe_cancel.c4
-rw-r--r--test/tunicode.c4
-rw-r--r--testpar/t_coll_chunk.c10
-rw-r--r--testpar/t_dset.c130
-rw-r--r--testpar/t_filter_read.c4
-rw-r--r--testpar/t_mpi.c2
-rw-r--r--testpar/t_posix_compliant.c32
-rw-r--r--tools/h5copy/h5copygentest.c12
-rw-r--r--tools/h5copy/testh5copy.sh.in17
-rw-r--r--tools/h5diff/h5diff_common.c2
-rw-r--r--tools/h5diff/h5diffgentest.c22
-rw-r--r--tools/h5diff/testh5diff.sh.in17
-rw-r--r--tools/h5dump/CMakeTests.cmake10
-rw-r--r--tools/h5dump/h5dumpgentest.c501
-rw-r--r--tools/h5dump/testh5dump.sh.in17
-rw-r--r--tools/h5dump/testh5dumppbits.sh.in17
-rw-r--r--tools/h5dump/testh5dumpxml.sh.in16
-rw-r--r--tools/h5import/CMakeTests.cmake23
-rw-r--r--tools/h5import/Makefile.am3
-rw-r--r--tools/h5import/Makefile.in4
-rw-r--r--tools/h5import/h5importtestutil.sh.in17
-rw-r--r--tools/h5jam/Makefile.am2
-rw-r--r--tools/h5jam/Makefile.in3
-rw-r--r--tools/h5jam/getub.c4
-rw-r--r--tools/h5jam/testh5jam.sh.in21
-rw-r--r--tools/h5ls/testh5ls.sh.in16
-rw-r--r--tools/h5repack/Makefile.am2
-rw-r--r--tools/h5repack/Makefile.in3
-rw-r--r--tools/h5repack/h5repack.sh.in17
-rw-r--r--tools/h5repack/h5repack_plugin.sh.in19
-rw-r--r--tools/h5repack/h5repacktst.c32
-rw-r--r--tools/h5stat/h5stat.c8
-rw-r--r--tools/h5stat/testh5stat.sh.in17
-rw-r--r--tools/misc/h5repart.c4
-rw-r--r--tools/misc/talign.c10
-rw-r--r--tools/misc/testh5mkgrp.sh.in16
-rw-r--r--tools/testfiles/tcmpdintarray.ddl64
-rw-r--r--tools/testfiles/tcmpdintarray.h5bin0 -> 9888 bytes
-rw-r--r--tools/testfiles/tcmpdints.ddl1444
-rw-r--r--tools/testfiles/tcmpdints.h5bin0 -> 9312 bytes
-rw-r--r--vms/src/h5pubconf.h6
110 files changed, 3398 insertions, 931 deletions
diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake
index 18464ac..1a4c2fa 100644
--- a/CMakeInstallation.cmake
+++ b/CMakeInstallation.cmake
@@ -200,11 +200,11 @@ ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES)
SET (CPACK_PACKAGE_VENDOR "HDF_Group")
SET (CPACK_PACKAGE_NAME "${HDF5_PACKAGE_NAME}")
- SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${HDF5_PACKAGE_NAME}")
SET (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}")
SET (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}")
SET (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}")
SET (CPACK_PACKAGE_VERSION_PATCH "")
+ SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${HDF5_PACKAGE_NAME}/${CPACK_PACKAGE_VERSION}")
IF (EXISTS "${HDF5_SOURCE_DIR}/release_docs")
SET (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt")
SET (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/COPYING")
@@ -215,6 +215,7 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES)
SET (CPACK_GENERATOR "TGZ")
IF (WIN32)
LIST (APPEND CPACK_GENERATOR "NSIS")
+ SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${HDF5_PACKAGE_NAME}\\\\${CPACK_PACKAGE_VERSION}")
SET (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${LIB_TYPE}")
SET (CPACK_MONOLITHIC_INSTALL ON)
SET (CPACK_NSIS_CONTACT "${HDF5_PACKAGE_BUGREPORT}")
@@ -253,7 +254,9 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES)
SET (CPACK_DEBIAN_PACKAGE_SECTION "Libraries")
SET (CPACK_DEBIAN_PACKAGE_MAINTAINER "${HDF5_PACKAGE_BUGREPORT}")
-
+
+# LIST (APPEND CPACK_GENERATOR "RPM")
+ SET (CPACK_RPM_PACKAGE_RELEASE "1")
SET (CPACK_RPM_COMPONENT_INSTALL ON)
SET (CPACK_RPM_PACKAGE_RELOCATABLE ON)
SET (CPACK_RPM_PACKAGE_LICENSE "BSD-style")
@@ -276,6 +279,12 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES)
The HDF5 data model, file format, API, library, and tools are open and distributed without charge.
"
)
+
+ #-----------------------------------------------------------------------------
+ # Configure the spec file for the install RPM
+ #-----------------------------------------------------------------------------
+# CONFIGURE_FILE ("${HDF5_RESOURCES_DIR}/hdf5.spec.in" "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec" @ONLY IMMEDIATE)
+# SET (CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec")
ENDIF (WIN32)
INCLUDE(InstallRequiredSystemLibraries)
diff --git a/MANIFEST b/MANIFEST
index 846ebc0..4afe5b8 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -539,11 +539,11 @@
./perform/sio_timer.h
./perform/zip_perf.c
-./release_docs/INSTALL_CMake.txt
./release_docs/COPYING
./release_docs/HISTORY-1_0-1_8_0_rc3.txt
./release_docs/HISTORY-1_9.txt
./release_docs/INSTALL
+./release_docs/INSTALL_CMake.txt
./release_docs/INSTALL_Cygwin.txt
./release_docs/INSTALL_parallel
./release_docs/INSTALL_VMS.txt
@@ -1510,8 +1510,12 @@
./tools/testfiles/tcontents.ddl
./tools/testfiles/tcontiguos.ddl
./tools/testfiles/tcmpdattrintsize.ddl
+./tools/testfiles/tcmpdintarray.ddl
+./tools/testfiles/tcmpdints.ddl
./tools/testfiles/tcmpdintsize.ddl
./tools/testfiles/tcmpdattrintsize.h5
+./tools/testfiles/tcmpdintarray.h5
+./tools/testfiles/tcmpdints.h5
./tools/testfiles/tcmpdintsize.h5
./tools/testfiles/tcomp-1.ddl
./tools/testfiles/tcomp-2.ddl
diff --git a/README.txt b/README.txt
index d0df1bf..992f8f2 100644
--- a/README.txt
+++ b/README.txt
@@ -1,4 +1,4 @@
-HDF5 version 1.9.167-swmr0 currently under development
+HDF5 version 1.9.169-swmr0 currently under development
Please refer to the release_docs/INSTALL file for installation instructions.
------------------------------------------------------------------------------
diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in
index 78ea36f..2a39e46 100644
--- a/c++/src/Makefile.in
+++ b/c++/src/Makefile.in
@@ -469,7 +469,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 157
+LT_VERS_REVISION = 159
LT_VERS_AGE = 0
# Include src directory
diff --git a/c++/test/CMakeTests.cmake b/c++/test/CMakeTests.cmake
index f2a10e2..3e4f6d9 100644
--- a/c++/test/CMakeTests.cmake
+++ b/c++/test/CMakeTests.cmake
@@ -4,8 +4,21 @@
### T E S T I N G ###
##############################################################################
##############################################################################
+# Remove any output file left over from previous test run
+ADD_TEST (
+ NAME cpp_testhdf5-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ tattr_basic.h5
+ tattr_compound.h5
+ tattr_dtype.h5
+ tattr_multi.h5
+ tattr_scalar.h5
+ tfattrs.h5
+)
ADD_TEST (NAME cpp_testhdf5 COMMAND $<TARGET_FILE:cpp_testhdf5>)
+SET_TESTS_PROPERTIES (cpp_testhdf5 PROPERTIES DEPENDS cpp_testhdf5-clear-objects)
IF (HDF5_TEST_VFD)
@@ -25,6 +38,17 @@ IF (HDF5_TEST_VFD)
MACRO (ADD_VFD_TEST vfdname resultcode)
IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
ADD_TEST (
+ NAME VFD-${vfdname}-cpp_testhdf5-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ tattr_basic.h5
+ tattr_compound.h5
+ tattr_dtype.h5
+ tattr_multi.h5
+ tattr_scalar.h5
+ tfattrs.h5
+ )
+ ADD_TEST (
NAME VFD-${vfdname}-cpp_testhdf5
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:cpp_testhdf5>"
@@ -35,6 +59,7 @@ IF (HDF5_TEST_VFD)
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-P "${HDF5_RESOURCES_DIR}/vfdTest.cmake"
)
+ SET_TESTS_PROPERTIES (VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS VFD-${vfdname}-cpp_testhdf5-clear-objects)
ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
ENDMACRO (ADD_VFD_TEST)
diff --git a/c++/test/Makefile.am b/c++/test/Makefile.am
index 687f0ca..3f62bda 100644
--- a/c++/test/Makefile.am
+++ b/c++/test/Makefile.am
@@ -51,5 +51,8 @@ mostlyclean-local:
@if test -d ii_files; then \
$(RM) -rf ii_files; \
fi
+# Temporary files
+CHECK_CLEANFILES+=tattr_multi.h5 tfattrs.h5 tattr_scalar.h5 tattr_compound.h5 \
+ tattr_dtype.h5 tattr_basic.h5
include $(top_srcdir)/config/conclude.am
diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in
index 3c4c645..0aad590 100644
--- a/c++/test/Makefile.in
+++ b/c++/test/Makefile.in
@@ -424,7 +424,10 @@ TRACE = perl $(top_srcdir)/bin/trace
# .chkexe files are used to mark tests that have run successfully.
# .chklog files are output from those tests.
# *.clog are from the MPE option.
-CHECK_CLEANFILES = *.chkexe *.chklog *.clog
+# Temporary files
+CHECK_CLEANFILES = *.chkexe *.chklog *.clog tattr_multi.h5 tfattrs.h5 \
+ tattr_scalar.h5 tattr_compound.h5 tattr_dtype.h5 \
+ tattr_basic.h5
# Include src, test, and c++/src directories
INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/test -I$(top_srcdir)/c++/src
diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp
index 28d8a1e..6ae3f82 100644
--- a/c++/test/tcompound.cpp
+++ b/c++/test/tcompound.cpp
@@ -122,9 +122,9 @@ static void test_compound_2()
SUBTEST("Compound Element Reordering");
try {
// Sizes should be the same, but be careful just in case
- buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
- bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t));
- orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t));
+ buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
+ bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t));
+ orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t));
for (i=0; i<nelmts; i++) {
s_ptr = ((src_typ_t*)orig) + i;
s_ptr->a = i*8+0;
@@ -190,9 +190,9 @@ static void test_compound_2()
}
}
// Release resources
- free(buf);
- free(bkg);
- free(orig);
+ HDfree(buf);
+ HDfree(bkg);
+ HDfree(orig);
s_ptr = NULL;
d_ptr = NULL;
st.close();
@@ -247,9 +247,9 @@ static void test_compound_3()
SUBTEST("Compound Datatype Subset Conversions");
try {
/* Initialize */
- buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
- bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t));
- orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t));
+ buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
+ bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t));
+ orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t));
for (i=0; i<nelmts; i++) {
s_ptr = ((src_typ_t*)orig) + i;
s_ptr->a = i*8+0;
@@ -312,9 +312,9 @@ static void test_compound_3()
} // for
/* Release resources */
- free(buf);
- free(bkg);
- free(orig);
+ HDfree(buf);
+ HDfree(bkg);
+ HDfree(orig);
s_ptr = NULL;
d_ptr = NULL;
st.close();
@@ -374,9 +374,9 @@ static void test_compound_4()
SUBTEST("Compound Element Shrinking & Reordering");
try {
/* Sizes should be the same, but be careful just in case */
- buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
- bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t));
- orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t));
+ buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
+ bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t));
+ orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t));
for (i=0; i<nelmts; i++) {
s_ptr = ((src_typ_t*)orig) + i;
s_ptr->a = i*8+0;
@@ -444,9 +444,9 @@ static void test_compound_4()
} // for
/* Release resources */
- free(buf);
- free(bkg);
- free(orig);
+ HDfree(buf);
+ HDfree(bkg);
+ HDfree(orig);
s_ptr = NULL;
d_ptr = NULL;
st.close();
@@ -499,8 +499,8 @@ static void test_compound_5()
src_typ_t src[2] = {{"one", 102, {104, 105, 106, 107}},
{"two", 202, {204, 205, 206, 207}}};
dst_typ_t *dst;
- void *buf = calloc(2, sizeof(dst_typ_t));
- void *bkg = calloc(2, sizeof(dst_typ_t));
+ void *buf = HDcalloc(2, sizeof(dst_typ_t));
+ void *bkg = HDcalloc(2, sizeof(dst_typ_t));
ArrayType* array_dt = NULL;
// Output message about test being performed
@@ -552,8 +552,8 @@ static void test_compound_5()
{ H5_FAILED(); }
/* Free memory buffers */
- free(buf);
- free(bkg);
+ HDfree(buf);
+ HDfree(bkg);
dst = NULL;
PASSED();
} // end of try block
@@ -606,9 +606,9 @@ static void test_compound_6()
SUBTEST("Compound Element Growing");
try {
/* Sizes should be the same, but be careful just in case */
- buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
- bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t));
- orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t));
+ buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
+ bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t));
+ orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t));
for (i=0; i<nelmts; i++) {
s_ptr = ((src_typ_t*)orig) + i;
s_ptr->b = (i*8+1) & 0x7fff;
@@ -645,9 +645,9 @@ static void test_compound_6()
} // for
/* Release resources */
- free(buf);
- free(bkg);
- free(orig);
+ HDfree(buf);
+ HDfree(bkg);
+ HDfree(orig);
s_ptr = NULL;
d_ptr = NULL;
st.close();
diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in
index bef9d77..287fa0f 100644
--- a/config/cmake/H5pubconf.h.in
+++ b/config/cmake/H5pubconf.h.in
@@ -754,7 +754,7 @@
#cmakedefine H5_USING_MEMCHECKER @H5_USING_MEMCHECKER@
/* Version number of package */
-#define VERSION "@HDF5_PACKAGE_VERSION@"
+#define H5_VERSION "@HDF5_PACKAGE_VERSION@"
/* Define if vsnprintf() returns the correct value for formatted strings that
don't fit into size allowed */
@@ -781,10 +781,10 @@
#cmakedefine WORDS_BIGENDIAN @H5_WORDS_BIGENDIANR@
/* Number of bits in a file offset, on hosts where this is settable. */
-#cmakedefine _FILE_OFFSET_BITS
+#cmakedefine H5__FILE_OFFSET_BITS
/* Define for large files, on AIX-style hosts. */
-#cmakedefine _LARGE_FILES
+#cmakedefine H5__LARGE_FILES
/* Define to empty if `const' does not conform to ANSI C. */
#cmakedefine H5_const
diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in
index 699e2d0..c6be9ff 100644
--- a/config/cmake/HDF518_Examples.cmake.in
+++ b/config/cmake/HDF518_Examples.cmake.in
@@ -11,13 +11,16 @@ set(STATICLIBRARIES "@H5_ENABLE_STATIC_LIB@")
set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG})
set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY})
set(CTEST_BUILD_CONFIGURATION "Release")
+#set(NO_MAC_FORTRAN "true")
+#set(BUILD_OPTIONS ""${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF")
+#set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_ENABLE_F2003:BOOL=ON)
###############################################################################################################
# Adjust the following SET Commands as needed
###############################################################################################################
if(WIN32)
if(STATICLIBRARIES)
- set(BUILD_OPTIONS "-DUSE_SHARED_LIBS:BOOL=OFF")
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DUSE_SHARED_LIBS:BOOL=OFF")
endif(STATICLIBRARIES)
set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake/hdf5")
set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build)
@@ -25,7 +28,7 @@ if(WIN32)
set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
else(WIN32)
if(STATICLIBRARIES)
- set(BUILD_OPTIONS "-DUSE_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DUSE_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
endif(STATICLIBRARIES)
set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake/hdf5")
set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib")
@@ -48,8 +51,12 @@ if(APPLE)
execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE)
set(ENV{CC} "${XCODE_CC}")
set(ENV{CXX} "${XCODE_CXX}")
- # Shared fortran is not supported, build static
- set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
+ if(NOT NO_MAC_FORTRAN)
+ # Shared fortran is not supported, build static
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
+ else(NOT NO_MAC_FORTRAN)
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
+ endif(NOT NO_MAC_FORTRAN)
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
endif(APPLE)
diff --git a/config/lt_vers.am b/config/lt_vers.am
index 1037868..7027aaa 100644
--- a/config/lt_vers.am
+++ b/config/lt_vers.am
@@ -17,7 +17,7 @@
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 157
+LT_VERS_REVISION = 159
LT_VERS_AGE = 0
## If the API changes *at all*, increment LT_VERS_INTERFACE and
diff --git a/configure b/configure
index cdd4696..ff41ef3 100755
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest .
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for HDF5 1.9.167-swmr0.
+# Generated by GNU Autoconf 2.69 for HDF5 1.9.169-swmr0.
#
# Report bugs to <help@hdfgroup.org>.
#
@@ -591,8 +591,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='HDF5'
PACKAGE_TARNAME='hdf5'
-PACKAGE_VERSION='1.9.167-swmr0'
-PACKAGE_STRING='HDF5 1.9.167-swmr0'
+PACKAGE_VERSION='1.9.169-swmr0'
+PACKAGE_STRING='HDF5 1.9.169-swmr0'
PACKAGE_BUGREPORT='help@hdfgroup.org'
PACKAGE_URL=''
@@ -1492,7 +1492,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures HDF5 1.9.167-swmr0 to adapt to many kinds of systems.
+\`configure' configures HDF5 1.9.169-swmr0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1562,7 +1562,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of HDF5 1.9.167-swmr0:";;
+ short | recursive ) echo "Configuration of HDF5 1.9.169-swmr0:";;
esac
cat <<\_ACEOF
@@ -1761,7 +1761,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-HDF5 configure 1.9.167-swmr0
+HDF5 configure 1.9.169-swmr0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2855,7 +2855,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by HDF5 $as_me 1.9.167-swmr0, which was
+It was created by HDF5 $as_me 1.9.169-swmr0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3687,7 +3687,7 @@ fi
# Define the identity of the package.
PACKAGE='hdf5'
- VERSION='1.9.167-swmr0'
+ VERSION='1.9.169-swmr0'
cat >>confdefs.h <<_ACEOF
@@ -30805,7 +30805,7 @@ if test -n "$cc_version_info"; then
fi
-## Strip anything that looks like a flag off of $CC
+## Strip anything that looks like a flag off of $FC
FC_NOFLAGS=`echo $FC | sed 's/ -.*//'`
if `echo $FC_NOFLAGS | grep ^/ >/dev/null 2>&1`; then
@@ -30824,7 +30824,7 @@ if test -n "$fc_version_info"; then
fi
-## Strip anything that looks like a flag off of $CC
+## Strip anything that looks like a flag off of $CXX
CXX_NOFLAGS=`echo $CXX | sed 's/ -.*//'`
if `echo $CXX_NOFLAGS | grep ^/ >/dev/null 2>&1`; then
@@ -31676,7 +31676,7 @@ Usage: $0 [OPTIONS]
Report bugs to <bug-libtool@gnu.org>."
lt_cl_version="\
-HDF5 config.lt 1.9.167-swmr0
+HDF5 config.lt 1.9.169-swmr0
configured by $0, generated by GNU Autoconf 2.69.
Copyright (C) 2011 Free Software Foundation, Inc.
@@ -33814,7 +33814,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by HDF5 $as_me 1.9.167-swmr0, which was
+This file was extended by HDF5 $as_me 1.9.169-swmr0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -33880,7 +33880,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-HDF5 config.status 1.9.167-swmr0
+HDF5 config.status 1.9.169-swmr0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index a837ca1..5aaf765 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,7 @@ AC_PREREQ([2.69])
## NOTE: Do not forget to change the version number here when we do a
## release!!!
##
-AC_INIT([HDF5], [1.9.167-swmr0], [help@hdfgroup.org])
+AC_INIT([HDF5], [1.9.169-swmr0], [help@hdfgroup.org])
AC_CONFIG_SRCDIR([src/H5.c])
AC_CONFIG_HEADER([src/H5config.h])
@@ -4097,7 +4097,7 @@ if test -n "$cc_version_info"; then
fi
AC_SUBST([FC_VERSION])
-## Strip anything that looks like a flag off of $CC
+## Strip anything that looks like a flag off of $FC
FC_NOFLAGS=`echo $FC | sed 's/ -.*//'`
if `echo $FC_NOFLAGS | grep ^/ >/dev/null 2>&1`; then
@@ -4116,7 +4116,7 @@ if test -n "$fc_version_info"; then
fi
AC_SUBST([CXX_VERSION])
-## Strip anything that looks like a flag off of $CC
+## Strip anything that looks like a flag off of $CXX
CXX_NOFLAGS=`echo $CXX | sed 's/ -.*//'`
if `echo $CXX_NOFLAGS | grep ^/ >/dev/null 2>&1`; then
diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake
index 1f896df..58a2858 100644
--- a/examples/CMakeTests.cmake
+++ b/examples/CMakeTests.cmake
@@ -39,6 +39,9 @@
soft_link.h5
subset.h5
unix2win.h5
+ blue/prefix_target.h5
+ red/prefix_target.h5
+ u2w/u2w_target.h5
)
IF (NOT "${last_test}" STREQUAL "")
SET_TESTS_PROPERTIES (EXAMPLES-clear-objects PROPERTIES DEPENDS ${last_test})
diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake
index d5b201c..aebd39b 100644
--- a/fortran/examples/CMakeTests.cmake
+++ b/fortran/examples/CMakeTests.cmake
@@ -5,6 +5,30 @@
##############################################################################
##############################################################################
+ # Remove any output file left over from previous test run
+ ADD_TEST (
+ NAME f90_ex-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ compound.h5
+ copy1.h5
+ copy2.h5
+ dsetf.h5
+ extend.h5
+ FORTRAN.h5
+ groupf.h5
+ groupsf.h5
+ h5_cmprss.h5
+ mount1.h5
+ mount2.h5
+ sdsf.h5
+ subset.h5
+ )
+ IF (NOT "${last_test}" STREQUAL "")
+ SET_TESTS_PROPERTIES (f90_ex-clear-objects PROPERTIES DEPENDS ${last_test})
+ ENDIF (NOT "${last_test}" STREQUAL "")
+ SET (last_test "f90_ex-clear-objects")
+
FOREACH (example ${examples})
ADD_TEST (NAME f90_ex_${example} COMMAND $<TARGET_FILE:f90_ex_${example}>)
IF (NOT "${last_test}" STREQUAL "")
diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c
index ab7adf7..deab4f3 100644
--- a/fortran/src/H5Df.c
+++ b/fortran/src/H5Df.c
@@ -1582,7 +1582,7 @@ nh5dvlen_get_max_len_c ( hid_t_f *dset_id , hid_t_f *type_id, hid_t_f *space_id
num_elem = H5Sget_select_npoints(c_space_id);
if( num_elem < 0) return ret_value;
- c_buf = (hvl_t *)malloc(sizeof(hvl_t)*(size_t)num_elem);
+ c_buf = (hvl_t *)HDmalloc(sizeof(hvl_t)*(size_t)num_elem);
if (c_buf == NULL) return ret_value;
status = H5Dread(c_dset_id, c_type_id, H5S_ALL, c_space_id, H5P_DEFAULT, c_buf);
if(status < 0) goto DONE;
@@ -1595,7 +1595,7 @@ nh5dvlen_get_max_len_c ( hid_t_f *dset_id , hid_t_f *type_id, hid_t_f *space_id
DONE:
- free(c_buf);
+ HDfree(c_buf);
return ret_value;
}
/****if* H5Df/nh5dwrite_vl_integer_c
@@ -1651,7 +1651,7 @@ nh5dwrite_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_
c_file_space_id = (hid_t)*file_space_id;
c_xfer_prp = (hid_t)*xfer_prp;
- c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t));
+ c_buf = (hvl_t *)HDmalloc((size_t)num_elem * sizeof(hvl_t));
if (c_buf == NULL) return ret_value;
tmp = (int_f *)buf;
for (i=0; i < num_elem; i++) {
@@ -1667,7 +1667,7 @@ nh5dwrite_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_
if( status < 0) goto DONE;
ret_value = 0;
DONE:
- free(c_buf);
+ HDfree(c_buf);
return ret_value;
}
@@ -1725,7 +1725,7 @@ nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_s
num_elem = H5Sget_select_npoints(c_mem_space_id);
if(num_elem != dims[1]) return ret_value;
- c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t));
+ c_buf = (hvl_t *)HDmalloc((size_t)num_elem * sizeof(hvl_t));
if (c_buf == NULL) return ret_value;
/*
* Call H5Dread function.
@@ -1739,7 +1739,7 @@ nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_s
H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf);
ret_value = 0;
DONE:
- free(c_buf);
+ HDfree(c_buf);
return ret_value;
}
@@ -1798,12 +1798,12 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp
/*
* Allocate arra of character pointers
*/
- c_buf = (char **)malloc((size_t)num_elem * sizeof(char *));
+ c_buf = (char **)HDmalloc((size_t)num_elem * sizeof(char *));
if (c_buf == NULL) return ret_value;
/* Copy data to long C string */
tmp = (char *)HD5f2cstring(buf, (size_t)(max_len*num_elem));
- if (tmp == NULL) { free(c_buf);
+ if (tmp == NULL) { HDfree(c_buf);
return ret_value;
}
/*
@@ -1811,7 +1811,7 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp
*/
tmp_p = tmp;
for (i=0; i < num_elem; i++) {
- c_buf[i] = (char *) malloc((size_t)len[i]+1);
+ c_buf[i] = (char *) HDmalloc((size_t)len[i]+1);
memcpy(c_buf[i], tmp_p, (size_t)len[i]);
c_buf[i][len[i]] = '\0';
tmp_p = tmp_p + max_len;
@@ -1826,8 +1826,8 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp
ret_value = 0;
DONE:
H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf);
- free(c_buf);
- free(tmp);
+ HDfree(c_buf);
+ HDfree(tmp);
return ret_value;
}
/****if* H5Df/nh5dread_vl_string_c
@@ -1885,18 +1885,18 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa
/*
* Allocate array of character pointers
*/
- c_buf = (char **)malloc((size_t)num_elem * sizeof(char *));
+ c_buf = (char **)HDmalloc((size_t)num_elem * sizeof(char *));
if (c_buf == NULL) return ret_value;
/*
* Call H5Dread function.
*/
status = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, c_buf);
- if (status < 0) { free(c_buf);
+ if (status < 0) { HDfree(c_buf);
return ret_value;
}
/* Copy data to long C string */
- tmp = (char *)malloc((size_t)(max_len*num_elem) +1);
+ tmp = (char *)HDmalloc((size_t)(max_len*num_elem) +1);
tmp_p = tmp;
for (i=0; i<max_len*num_elem; i++) tmp[i] = ' ';
tmp[max_len*num_elem] = '\0';
@@ -1908,8 +1908,8 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa
HD5packFstring(tmp, _fcdtocp(buf), (size_t)(max_len*num_elem));
ret_value = 0;
H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf);
- free(c_buf);
- free(tmp);
+ HDfree(c_buf);
+ HDfree(tmp);
return ret_value;
}
@@ -1966,7 +1966,7 @@ nh5dwrite_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa
c_file_space_id = (hid_t)*file_space_id;
c_xfer_prp = (hid_t)*xfer_prp;
- c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t));
+ c_buf = (hvl_t *)HDmalloc((size_t)num_elem * sizeof(hvl_t));
if (c_buf == NULL) return ret_value;
tmp = (real_f *)buf;
for (i=0; i < num_elem; i++) {
@@ -1982,7 +1982,7 @@ nh5dwrite_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa
if( status < 0) goto DONE;
ret_value = 0;
DONE:
- free(c_buf);
+ HDfree(c_buf);
return ret_value;
}
@@ -2040,7 +2040,7 @@ nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac
num_elem = H5Sget_select_npoints(c_mem_space_id);
if(num_elem != dims[1]) return ret_value;
- c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t));
+ c_buf = (hvl_t *)HDmalloc((size_t)num_elem * sizeof(hvl_t));
if (c_buf == NULL) return ret_value;
/*
* Call H5Dread function.
@@ -2055,7 +2055,7 @@ nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac
H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf);
ret_value = 0;
DONE:
- free(c_buf);
+ HDfree(c_buf);
return ret_value;
}
diff --git a/fortran/src/H5Sf.c b/fortran/src/H5Sf.c
index 2cfb1eb..a944e20 100644
--- a/fortran/src/H5Sf.c
+++ b/fortran/src/H5Sf.c
@@ -298,7 +298,7 @@ nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock,
if (rank < 0 ) return ret_value;
c_startblock = (hsize_t)*startblock;
- c_buf = (hsize_t*)malloc(sizeof(hsize_t)*(size_t)(c_num_blocks*2*rank));
+ c_buf = (hsize_t*)HDmalloc(sizeof(hsize_t)*(size_t)(c_num_blocks*2*rank));
if (!c_buf) return ret_value;
ret_value = H5Sget_select_hyper_blocklist(c_space_id, c_startblock,
@@ -425,7 +425,7 @@ nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint,
if (rank < 0 ) return ret_value;
c_startpoint = (hsize_t)*startpoint;
- c_buf = (hsize_t*)malloc(sizeof(hsize_t)*(size_t)(c_num_points*rank));
+ c_buf = (hsize_t*)HDmalloc(sizeof(hsize_t)*(size_t)(c_num_points*rank));
if (!c_buf) return ret_value;
ret_value = H5Sget_select_elem_pointlist(c_space_id, c_startpoint,
c_num_points, c_buf);
diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in
index bb25a03..df3a1a6 100644
--- a/fortran/src/Makefile.in
+++ b/fortran/src/Makefile.in
@@ -520,7 +520,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 157
+LT_VERS_REVISION = 159
LT_VERS_AGE = 0
# Include src directory in both Fortran and C flags (C compiler is used
diff --git a/hl/c++/examples/CMakeTests.cmake b/hl/c++/examples/CMakeTests.cmake
index 95cc8b4..c73ceeb 100644
--- a/hl/c++/examples/CMakeTests.cmake
+++ b/hl/c++/examples/CMakeTests.cmake
@@ -4,5 +4,13 @@
### T E S T I N G ###
##############################################################################
##############################################################################
+# Remove any output file left over from previous test run
+ADD_TEST (
+ NAME cpp_hl_ex_ptExampleFL-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ PTcppexampleFL.h5
+)
ADD_TEST (NAME cpp_hl_ex_ptExampleFL COMMAND $<TARGET_FILE:ptExampleFL>)
+SET_TESTS_PROPERTIES (cpp_hl_ex_ptExampleFL PROPERTIES DEPENDS cpp_hl_ex_ptExampleFL-clear-objects)
diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in
index 850339c..9daaccc 100644
--- a/hl/c++/src/Makefile.in
+++ b/hl/c++/src/Makefile.in
@@ -460,7 +460,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 157
+LT_VERS_REVISION = 159
LT_VERS_AGE = 0
# Include src directory
diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt
index 36c799d..a9c5258 100644
--- a/hl/examples/CMakeLists.txt
+++ b/hl/examples/CMakeLists.txt
@@ -6,7 +6,7 @@ PROJECT (HDF5_HL_EXAMPLES )
#-----------------------------------------------------------------------------
SET (examples
ex_lite1
- ex_lite2
+ ex_lite2 #ex_lite2 PROPERTIES DEPENDS ex_lite1)
ex_lite3
ptExampleFL
ex_image1
diff --git a/hl/examples/CMakeTests.cmake b/hl/examples/CMakeTests.cmake
index e1ccba0..0f9ca11 100644
--- a/hl/examples/CMakeTests.cmake
+++ b/hl/examples/CMakeTests.cmake
@@ -21,8 +21,40 @@ FOREACH (h5_file ${HDF5_TEST_FILES})
)
ENDFOREACH (h5_file ${HDF5_TEST_FILES})
+ # Remove any output file left over from previous test run
+ ADD_TEST (
+ NAME hl_ex-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ex_lite1.h5
+ ex_lite2.h5
+ ex_lite3.h5
+ packet_table_FLexample.h5
+ ex_image1.h5
+ ex_image2.h5
+ ex_table_01.h5
+ ex_table_02.h5
+ ex_table_03.h5
+ ex_table_04.h5
+ ex_table_05.h5
+ ex_table_06.h5
+ ex_table_07.h5
+ ex_table_08.h5
+ ex_table_09.h5
+ ex_table_10.h5
+ ex_table_11.h5
+ ex_table_12.h5
+ ex_ds1.h5
+ )
+ IF (NOT "${last_test}" STREQUAL "")
+ SET_TESTS_PROPERTIES (hl_ex-clear-objects PROPERTIES DEPENDS ${last_test})
+ ENDIF (NOT "${last_test}" STREQUAL "")
+ SET (last_test "hl_ex-clear-objects")
+
FOREACH (example ${examples})
ADD_TEST (NAME hl_ex_${example} COMMAND $<TARGET_FILE:hl_ex_${example}>)
+ IF (NOT "${last_test}" STREQUAL "")
+ SET_TESTS_PROPERTIES (hl_ex_${example} PROPERTIES DEPENDS ${last_test})
+ ENDIF (NOT "${last_test}" STREQUAL "")
+ SET (last_test "hl_ex_${example}")
ENDFOREACH (example ${examples})
-
-SET_TESTS_PROPERTIES (hl_ex_ex_lite2 PROPERTIES DEPENDS hl_ex_ex_lite1)
diff --git a/hl/fortran/src/H5IMcc.c b/hl/fortran/src/H5IMcc.c
index 22a7a3e..b4ea067 100644
--- a/hl/fortran/src/H5IMcc.c
+++ b/hl/fortran/src/H5IMcc.c
@@ -505,7 +505,7 @@ herr_t H5IM_get_palette(hid_t loc_id,
dim_ref = n_refs;
- refbuf = malloc(sizeof(hobj_ref_t) * (int)dim_ref);
+ refbuf = HDmalloc(sizeof(hobj_ref_t) * (int)dim_ref);
if(H5Aread(attr_id, attr_type, refbuf) < 0)
goto out;
@@ -525,7 +525,7 @@ herr_t H5IM_get_palette(hid_t loc_id,
if(H5Dclose(pal_id) < 0)
goto out;
- free(refbuf);
+ HDfree(refbuf);
} /* H5T_REFERENCE */
diff --git a/hl/fortran/src/H5IMfc.c b/hl/fortran/src/H5IMfc.c
index 818096e..39cb990 100644
--- a/hl/fortran/src/H5IMfc.c
+++ b/hl/fortran/src/H5IMfc.c
@@ -75,7 +75,7 @@ nh5immake_image_8bit_c (hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
return ret_value;
@@ -135,7 +135,7 @@ nh5imread_image_c (hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
return ret_value;
}
@@ -206,9 +206,9 @@ nh5immake_image_24bit_c (hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
if(c_il!=NULL)
- free(c_il);
+ HDfree(c_il);
return ret_value;
}
@@ -265,7 +265,7 @@ nh5imget_image_info_c(hid_t_f *loc_id,
/*
* allocate buffer to hold name of an attribute
*/
- if ((c_buf = malloc((size_t)*ilen +1)) == NULL)
+ if ((c_buf = HDmalloc((size_t)*ilen +1)) == NULL)
goto done;
/*
@@ -292,9 +292,9 @@ nh5imget_image_info_c(hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
if(c_buf!=NULL)
- free(c_buf);
+ HDfree(c_buf);
return ret_value;
}
@@ -344,7 +344,7 @@ nh5imis_image_c(hid_t_f *loc_id,
ret = H5IMis_image(c_loc_id, c_name);
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
return ret;
@@ -467,9 +467,9 @@ nh5imlink_palette_c (hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
if(c_namepal!=NULL)
- free(c_namepal);
+ HDfree(c_namepal);
return ret_value;
}
@@ -537,9 +537,9 @@ nh5imunlink_palette_c (hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
if(c_namepal!=NULL)
- free(c_namepal);
+ HDfree(c_namepal);
return ret_value;
}
@@ -602,7 +602,7 @@ nh5imget_npalettes_c(hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
return ret_value;
}
@@ -672,7 +672,7 @@ nh5imget_palette_info_c(hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
return ret_value;
}
@@ -733,7 +733,7 @@ nh5imget_palette_c(hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
return ret_value;
}
@@ -783,7 +783,7 @@ nh5imis_palette_c(hid_t_f *loc_id,
ret = H5IMis_palette(c_loc_id, c_name);
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
return ret;
diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c
index 674636d..4f8f7b6 100644
--- a/hl/fortran/src/H5LTfc.c
+++ b/hl/fortran/src/H5LTfc.c
@@ -64,7 +64,7 @@ nh5ltmake_dataset_c (hid_t_f *loc_id,
if (c_name == NULL)
goto done;
- c_dims = malloc(sizeof(hsize_t) * (*rank ));
+ c_dims = HDmalloc(sizeof(hsize_t) * (*rank ));
if (c_dims == NULL)
goto done;
@@ -91,9 +91,9 @@ nh5ltmake_dataset_c (hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
if(c_dims!=NULL)
- free(c_dims);
+ HDfree(c_dims);
return ret_value;
}
@@ -616,7 +616,7 @@ nh5ltread_dataset_c (hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
return ret_value;
}
@@ -1102,9 +1102,9 @@ nh5ltmake_dataset_string_c (hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
if(c_buf!=NULL)
- free(c_buf);
+ HDfree(c_buf);
return ret_value;
}
@@ -1163,7 +1163,7 @@ nh5ltread_dataset_string_c (hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
return ret_value;
}
@@ -1242,9 +1242,9 @@ nh5ltset_attribute_int_c(hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
if(c_attrname!=NULL)
- free(c_attrname);
+ HDfree(c_attrname);
return ret_value;
}
@@ -1314,9 +1314,9 @@ nh5ltset_attribute_float_c(hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
if(c_attrname!=NULL)
- free(c_attrname);
+ HDfree(c_attrname);
return ret_value;
}
@@ -1388,9 +1388,9 @@ nh5ltset_attribute_double_c(hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
if(c_attrname!=NULL)
- free(c_attrname);
+ HDfree(c_attrname);
return ret_value;
}
@@ -1467,11 +1467,11 @@ nh5ltset_attribute_string_c(hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
if(c_attrname!=NULL)
- free(c_attrname);
+ HDfree(c_attrname);
if(c_buf!=NULL)
- free(c_buf);
+ HDfree(c_buf);
return ret_value;
}
@@ -1545,9 +1545,9 @@ nh5ltget_attribute_int_c(hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
if(c_attrname!=NULL)
- free(c_attrname);
+ HDfree(c_attrname);
return ret_value;
@@ -1616,9 +1616,9 @@ nh5ltget_attribute_float_c(hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
if(c_attrname!=NULL)
- free(c_attrname);
+ HDfree(c_attrname);
return ret_value;
}
@@ -1686,9 +1686,9 @@ nh5ltget_attribute_double_c(hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
if(c_attrname!=NULL)
- free(c_attrname);
+ HDfree(c_attrname);
return ret_value;
}
@@ -1762,11 +1762,11 @@ nh5ltget_attribute_string_c(hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
if(c_attrname!=NULL)
- free(c_attrname);
+ HDfree(c_attrname);
if(c_buf!=NULL)
- free(c_buf);
+ HDfree(c_buf);
return ret_value;
}
@@ -1828,7 +1828,7 @@ nh5ltget_dataset_ndims_c(hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
return ret_value;
}
@@ -1878,7 +1878,7 @@ nh5ltfind_dataset_c(hid_t_f *loc_id,
ret = H5LTfind_dataset(c_loc_id, c_name);
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
return ret;
@@ -1960,7 +1960,7 @@ nh5ltget_dataset_info_c(hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
return ret_value;
}
@@ -2030,9 +2030,9 @@ nh5ltget_attribute_ndims_c(hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
if(c_attrname!=NULL)
- free(c_attrname);
+ HDfree(c_attrname);
return ret_value;
}
@@ -2123,9 +2123,9 @@ nh5ltget_attribute_info_c(hid_t_f *loc_id,
done:
if(c_name!=NULL)
- free(c_name);
+ HDfree(c_name);
if(c_attrname!=NULL)
- free(c_attrname);
+ HDfree(c_attrname);
return ret_value;
@@ -2177,7 +2177,7 @@ nh5ltpath_valid_c(hid_t_f *loc_id,
done:
if(c_path != NULL)
- free(c_path);
+ HDfree(c_path);
return (int_f)ret;
}
diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in
index 89ed0ff..860aa09 100644
--- a/hl/fortran/src/Makefile.in
+++ b/hl/fortran/src/Makefile.in
@@ -476,7 +476,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 157
+LT_VERS_REVISION = 159
LT_VERS_AGE = 0
INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \
-I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src
diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake
index 96209aa..81253bd 100644
--- a/hl/fortran/test/CMakeTests.cmake
+++ b/hl/fortran/test/CMakeTests.cmake
@@ -15,8 +15,9 @@ ADD_TEST (
dsetf3.h5
dsetf4.h5
dsetf5.h5
- f1image.h5
+ f1img.h5
f1tab.h5
+ tstds.h5
)
ADD_TEST (NAME hl_f90_tstds COMMAND $<TARGET_FILE:hl_f90_tstds>)
diff --git a/hl/fortran/test/Makefile.am b/hl/fortran/test/Makefile.am
index cd281b7..fa3a803 100644
--- a/hl/fortran/test/Makefile.am
+++ b/hl/fortran/test/Makefile.am
@@ -45,7 +45,7 @@ tstimage_SOURCES=tstimage.f90
tsttable_SOURCES=tsttable.f90
# Temporary files.
-CHECK_CLEANFILES+=dsetf[1-4].h5 f1img.h5 f1tab.h5 tstds.h5
+CHECK_CLEANFILES+=dsetf[1-5].h5 f1img.h5 f1tab.h5 tstds.h5
# Mark this directory as part of the Fortran API (this affects output
# from tests in conclude.am)
diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in
index 5d576d0..024cb0f 100644
--- a/hl/fortran/test/Makefile.in
+++ b/hl/fortran/test/Makefile.in
@@ -436,7 +436,7 @@ TRACE = perl $(top_srcdir)/bin/trace
# *.clog are from the MPE option.
# Temporary files.
-CHECK_CLEANFILES = *.chkexe *.chklog *.clog dsetf[1-4].h5 f1img.h5 \
+CHECK_CLEANFILES = *.chkexe *.chklog *.clog dsetf[1-5].h5 f1img.h5 \
f1tab.h5 tstds.h5
# Our main target, the test programs
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c
index 5f8cd50..06ce078 100644
--- a/hl/src/H5DS.c
+++ b/hl/src/H5DS.c
@@ -254,7 +254,7 @@ herr_t H5DSattach_scale(hid_t did,
goto out;
/* allocate and initialize the VL */
- buf = (hvl_t *)malloc((size_t)rank * sizeof(hvl_t));
+ buf = (hvl_t *)HDmalloc((size_t)rank * sizeof(hvl_t));
if(buf == NULL)
goto out;
@@ -265,7 +265,7 @@ herr_t H5DSattach_scale(hid_t did,
/* store the REF information in the index of the dataset that has the DS */
buf[idx].len = 1;
- buf[idx].p = malloc( 1 * sizeof(hobj_ref_t));
+ buf[idx].p = HDmalloc( 1 * sizeof(hobj_ref_t));
((hobj_ref_t *)buf[idx].p)[0] = ref_to_ds;
/* write the attribute with the reference */
@@ -282,7 +282,7 @@ herr_t H5DSattach_scale(hid_t did,
if(H5Aclose(aid) < 0)
goto out;
- free(buf);
+ HDfree(buf);
buf = NULL;
}
@@ -303,7 +303,7 @@ herr_t H5DSattach_scale(hid_t did,
goto out;
/* allocate and initialize the VL */
- buf = (hvl_t *)malloc((size_t)rank * sizeof(hvl_t));
+ buf = (hvl_t *)HDmalloc((size_t)rank * sizeof(hvl_t));
if(buf == NULL)
goto out;
@@ -343,13 +343,13 @@ herr_t H5DSattach_scale(hid_t did,
if(buf[idx].len > 0) {
buf[idx].len++;
len = buf[idx].len;
- buf[idx].p = realloc(buf[idx].p, len * sizeof(hobj_ref_t));
+ buf[idx].p = HDrealloc(buf[idx].p, len * sizeof(hobj_ref_t));
((hobj_ref_t *)buf[idx].p)[len - 1] = ref_to_ds;
} /* end if */
else {
/* store the REF information in the index of the dataset that has the DS */
buf[idx].len = 1;
- buf[idx].p = malloc(sizeof(hobj_ref_t));
+ buf[idx].p = HDmalloc(sizeof(hobj_ref_t));
((hobj_ref_t *)buf[idx].p)[0] = ref_to_ds;
} /* end else */
} /* end if */
@@ -367,7 +367,7 @@ herr_t H5DSattach_scale(hid_t did,
goto out;
if(H5Aclose(aid) < 0)
goto out;
- free(buf);
+ HDfree(buf);
buf = NULL;
} /* has_dimlist */
@@ -447,7 +447,7 @@ herr_t H5DSattach_scale(hid_t did,
nelmts++;
- dsbuf = (ds_list_t*) malloc((size_t)nelmts * sizeof(ds_list_t));
+ dsbuf = (ds_list_t*) HDmalloc((size_t)nelmts * sizeof(ds_list_t));
if(dsbuf == NULL)
goto out;
@@ -497,7 +497,7 @@ herr_t H5DSattach_scale(hid_t did,
if (H5Tclose(ntid) < 0)
goto out;
- free(dsbuf);
+ HDfree(dsbuf);
dsbuf = NULL;
} /* has_reflist */
@@ -519,9 +519,9 @@ herr_t H5DSattach_scale(hid_t did,
/* error zone */
out:
if(buf)
- free(buf);
+ HDfree(buf);
if(dsbuf)
- free(dsbuf);
+ HDfree(dsbuf);
H5E_BEGIN_TRY {
H5Sclose(sid);
@@ -673,7 +673,7 @@ herr_t H5DSdetach_scale(hid_t did,
goto out;
/* allocate and initialize the VL */
- buf = (hvl_t *)malloc((size_t)rank * sizeof(hvl_t));
+ buf = (hvl_t *)HDmalloc((size_t)rank * sizeof(hvl_t));
if(buf == NULL)
goto out;
@@ -718,7 +718,7 @@ herr_t H5DSdetach_scale(hid_t did,
((hobj_ref_t *)buf[idx].p)[j] = ((hobj_ref_t *)buf[idx].p)[len-1];
len = --buf[idx].len;
if(len == 0) {
- free(buf[idx].p);
+ HDfree(buf[idx].p);
buf[idx].p = NULL;
}
/* Since a reference to a dim. scale can be inserted only once,
@@ -760,7 +760,7 @@ herr_t H5DSdetach_scale(hid_t did,
if(H5Aclose(aid) < 0)
goto out;
- free(buf);
+ HDfree(buf);
buf = NULL;
@@ -786,7 +786,7 @@ herr_t H5DSdetach_scale(hid_t did,
if((nelmts = H5Sget_simple_extent_npoints(sid)) < 0)
goto out;
- dsbuf = (ds_list_t*) malloc((size_t)nelmts * sizeof(ds_list_t));
+ dsbuf = (ds_list_t*) HDmalloc((size_t)nelmts * sizeof(ds_list_t));
if(dsbuf == NULL)
goto out;
@@ -876,7 +876,7 @@ herr_t H5DSdetach_scale(hid_t did,
if (H5Tclose(ntid) < 0)
goto out;
- free(dsbuf);
+ HDfree(dsbuf);
dsbuf = NULL;
return SUCCEED;
@@ -890,7 +890,7 @@ out:
H5Tclose(tid);
if(dsbuf) {
- free(dsbuf);
+ HDfree(dsbuf);
dsbuf = NULL;
}
if(buf) {
@@ -898,9 +898,9 @@ out:
free the pointers allocated when we read data in */
for(i = 0; i < rank; i++) {
if(buf[i].p)
- free(buf[i].p);
+ HDfree(buf[i].p);
}
- free(buf);
+ HDfree(buf);
buf = NULL;
}
} H5E_END_TRY;
@@ -1033,7 +1033,7 @@ htri_t H5DSis_attached(hid_t did,
goto out;
/* allocate and initialize the VL */
- buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t));
+ buf = (hvl_t*)HDmalloc((size_t)rank * sizeof(hvl_t));
if(buf == NULL)
goto out;
@@ -1079,7 +1079,7 @@ htri_t H5DSis_attached(hid_t did,
goto out;
if (H5Aclose(aid) < 0)
goto out;
- free(buf);
+ HDfree(buf);
buf = NULL;
} /* has_dimlist */
@@ -1116,7 +1116,7 @@ htri_t H5DSis_attached(hid_t did,
if((nelmts = H5Sget_simple_extent_npoints(sid)) < 0)
goto out;
- dsbuf = (ds_list_t*) malloc((size_t)nelmts * sizeof(ds_list_t));
+ dsbuf = (ds_list_t*) HDmalloc((size_t)nelmts * sizeof(ds_list_t));
if (dsbuf == NULL)
goto out;
@@ -1170,7 +1170,7 @@ htri_t H5DSis_attached(hid_t did,
if (H5Aclose(aid) < 0)
goto out;
- free(dsbuf);
+ HDfree(dsbuf);
dsbuf = NULL;
} /* has_reflist */
@@ -1189,11 +1189,11 @@ out:
} H5E_END_TRY;
if (buf) {
- free(buf);
+ HDfree(buf);
buf = NULL;
}
if(dsbuf) {
- free(dsbuf);
+ HDfree(dsbuf);
dsbuf = NULL;
}
return FAIL;
@@ -1317,7 +1317,7 @@ herr_t H5DSiterate_scales(hid_t did,
goto out;
/* allocate and initialize the VL */
- buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t));
+ buf = (hvl_t*)HDmalloc((size_t)rank * sizeof(hvl_t));
if(buf == NULL)
goto out;
@@ -1380,7 +1380,7 @@ herr_t H5DSiterate_scales(hid_t did,
if (H5Aclose(aid) < 0)
goto out;
- free(buf);
+ HDfree(buf);
buf = NULL;
} /* if has_dimlist */
@@ -1390,7 +1390,7 @@ out:
H5E_BEGIN_TRY {
if(buf) {
H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf);
- free(buf);
+ HDfree(buf);
}
H5Sclose(sid);
H5Aclose(aid);
@@ -1489,7 +1489,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label)
goto out;
/* allocate and initialize */
- buf = (const char **) malloc((size_t) rank * sizeof(char *));
+ buf = (const char **) HDmalloc((size_t) rank * sizeof(char *));
if (buf == NULL)
goto out;
@@ -1513,7 +1513,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label)
goto out;
if (buf)
{
- free(buf);
+ HDfree(buf);
buf = NULL;
}
}
@@ -1532,7 +1532,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label)
goto out;
/* allocate and initialize */
- buf = (const char **) malloc((size_t) rank * sizeof(char *));
+ buf = (const char **) HDmalloc((size_t) rank * sizeof(char *));
if (buf == NULL)
goto out;
@@ -1543,7 +1543,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label)
/* free the ptr that will be replaced by label */
if (buf[idx])
- free((void *)buf[idx]);
+ HDfree((void *)buf[idx]);
/* store the label information in the required index */
buf[idx] = label;
@@ -1559,7 +1559,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label)
for (i = 0; i < (unsigned int) rank; i++)
{
if (buf[i])
- free((void *)buf[i]);
+ HDfree((void *)buf[i]);
}
/* close */
@@ -1569,7 +1569,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label)
goto out;
if (buf)
{
- free(buf);
+ HDfree(buf);
buf = NULL;
}
}
@@ -1586,9 +1586,9 @@ out:
for (i = 0; i < (unsigned int) rank; i++)
{
if (buf[i])
- free((void *)buf[i]);
+ HDfree((void *)buf[i]);
}
- free(buf);
+ HDfree(buf);
}
H5E_BEGIN_TRY
{
@@ -1692,7 +1692,7 @@ ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size)
goto out;
/* allocate and initialize */
- buf = (char **) malloc((size_t) rank * sizeof(char *));
+ buf = (char **) HDmalloc((size_t) rank * sizeof(char *));
if (buf == NULL)
goto out;
@@ -1724,7 +1724,7 @@ ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size)
for (i = 0; i < rank; i++)
{
if (buf[i])
- free(buf[i]);
+ HDfree(buf[i]);
}
/* close */
@@ -1734,7 +1734,7 @@ ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size)
goto out;
if (buf)
{
- free(buf);
+ HDfree(buf);
buf = NULL;
}
@@ -1748,9 +1748,9 @@ out:
for (i = 0; i < rank; i++)
{
if (buf[i])
- free(buf[i]);
+ HDfree(buf[i]);
}
- free(buf);
+ HDfree(buf);
}
H5E_BEGIN_TRY
{
@@ -1845,7 +1845,7 @@ ssize_t H5DSget_scale_name(hid_t did,
goto out;
/* allocate a temporary buffer */
- buf = (char*)malloc(nbytes * sizeof(char));
+ buf = (char*)HDmalloc(nbytes * sizeof(char));
if (buf == NULL)
goto out;
@@ -1872,7 +1872,7 @@ ssize_t H5DSget_scale_name(hid_t did,
if (H5Sclose(sid) < 0)
goto out;
if (buf)
- free(buf);
+ HDfree(buf);
return (ssize_t)(nbytes - 1);
@@ -1884,7 +1884,7 @@ out:
H5Sclose(sid);
} H5E_END_TRY;
if (buf)
- free(buf);
+ HDfree(buf);
return FAIL;
}
@@ -2052,7 +2052,7 @@ int H5DSget_num_scales(hid_t did,
goto out;
/* allocate and initialize the VL */
- buf = (hvl_t *)malloc((size_t)rank * sizeof(hvl_t));
+ buf = (hvl_t *)HDmalloc((size_t)rank * sizeof(hvl_t));
if(buf == NULL)
goto out;
@@ -2071,7 +2071,7 @@ int H5DSget_num_scales(hid_t did,
goto out;
if(H5Aclose(aid) < 0)
goto out;
- free(buf);
+ HDfree(buf);
buf = NULL;
} /* has_dimlist */
@@ -2086,7 +2086,7 @@ out:
} H5E_END_TRY;
if(buf)
- free(buf);
+ HDfree(buf);
return FAIL;
}
diff --git a/hl/src/H5HLprivate2.h b/hl/src/H5HLprivate2.h
index 556c86f..1b67c70 100644
--- a/hl/src/H5HLprivate2.h
+++ b/hl/src/H5HLprivate2.h
@@ -22,98 +22,8 @@
/* Public High-Level header */
#include "hdf5_hl.h"
-/* The following is copied from src/H5private.h */
-
-/*
- * Status return values for the `herr_t' type.
- * Since some unix/c routines use 0 and -1 (or more precisely, non-negative
- * vs. negative) as their return code, and some assumption had been made in
- * the code about that, it is important to keep these constants the same
- * values. When checking the success or failure of an integer-valued
- * function, remember to compare against zero and not one of these two
- * values.
- */
-#define SUCCEED 0
-#define FAIL (-1)
-#define UFAIL (unsigned)(-1)
-
-/* minimum of two, three, or four values */
-#undef MIN
-#define MIN(a,b) (((a)<(b)) ? (a) : (b))
-#define MIN2(a,b) MIN(a,b)
-#define MIN3(a,b,c) MIN(a,MIN(b,c))
-#define MIN4(a,b,c,d) MIN(MIN(a,b),MIN(c,d))
-
-/* maximum of two, three, or four values */
-#undef MAX
-#define MAX(a,b) (((a)>(b)) ? (a) : (b))
-#define MAX2(a,b) MAX(a,b)
-#define MAX3(a,b,c) MAX(a,MAX(b,c))
-#define MAX4(a,b,c,d) MAX(MAX(a,b),MAX(c,d))
-
-/*
- * HDF Boolean type.
- */
-#ifndef FALSE
-# define FALSE 0
-#endif
-#ifndef TRUE
-# define TRUE 1
-#endif
-#ifndef HDassert
- #define HDassert(X) assert(X)
-#endif /* HDassert */
-#ifndef HDcalloc
- #define HDcalloc(N,Z) calloc(N,Z)
-#endif /* HDcalloc */
-#ifndef HDfflush
- #define HDfflush(F) fflush(F)
-#endif /* HDfflush */
-H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
-#ifndef HDfree
- #define HDfree(M) free(M)
-#endif /* HDfree */
-#ifndef HDmemcpy
- #define HDmemcpy(X,Y,Z) memcpy((char*)(X),(const char*)(Y),Z)
-#endif /* HDmemcpy */
-#ifndef HDmemset
- #define HDmemset(X,C,Z) memset(X,C,Z)
-#endif /* HDmemset */
-#ifndef HDrealloc
- #define HDrealloc(M,Z) realloc(M,Z)
-#endif /* HDrealloc */
-#ifndef HDsleep
- #define HDsleep(N) sleep(N)
-#endif /* HDsleep */
-#ifndef HDstrcat
- #define HDstrcat(X,Y) strcat(X,Y)
-#endif /* HDstrcat */
-#ifndef HDstrcmp
- #define HDstrcmp(X,Y) strcmp(X,Y)
-#endif /* HDstrcmp */
-#ifndef HDstrlen
- #define HDstrlen(S) strlen(S)
-#endif /* HDstrlen */
-#ifndef HDstrrchr
- #define HDstrrchr(S,C) strrchr(S,C)
-#endif /* HDstrrchr */
-#ifndef HDstrtod
- #define HDstrtod(S,R) strtod(S,R)
-#endif /* HDstrtod */
-#ifndef HDstrtol
- #define HDstrtol(S,R,N) strtol(S,R,N)
-#endif /* HDstrtol */
-/*
- * And now for a couple non-Posix functions... Watch out for systems that
- * define these in terms of macros.
- */
-#if !defined strdup && !defined H5_HAVE_STRDUP
-extern char *strdup(const char *s);
-#endif
-
-#ifndef HDstrdup
- #define HDstrdup(S) strdup(S)
-#endif /* HDstrdup */
+/* HDF5 private functions */
+#include "H5private.h"
#endif /* _H5HLprivate2_H */
diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c
index e55aaf8..9c7c7e8 100644
--- a/hl/src/H5IM.c
+++ b/hl/src/H5IM.c
@@ -594,7 +594,7 @@ herr_t H5IMlink_palette( hid_t loc_id,
dim_ref = n_refs + 1;
- refbuf = (hobj_ref_t*)malloc( sizeof(hobj_ref_t) * (int)dim_ref );
+ refbuf = (hobj_ref_t*)HDmalloc( sizeof(hobj_ref_t) * (int)dim_ref );
if ( H5Aread( aid, atid, refbuf ) < 0)
goto out;
@@ -635,7 +635,7 @@ herr_t H5IMlink_palette( hid_t loc_id,
if(H5Aclose(aid) < 0)
goto out;
- free( refbuf );
+ HDfree( refbuf );
} /* ok_pal == 1 */
@@ -901,7 +901,7 @@ herr_t H5IMget_palette_info( hid_t loc_id,
dim_ref = n_refs;
- refbuf = (hobj_ref_t*)malloc( sizeof(hobj_ref_t) * (int)dim_ref );
+ refbuf = (hobj_ref_t*)HDmalloc( sizeof(hobj_ref_t) * (int)dim_ref );
if ( H5Aread( aid, atid, refbuf ) < 0)
goto out;
@@ -930,7 +930,7 @@ herr_t H5IMget_palette_info( hid_t loc_id,
goto out;
if ( H5Aclose( aid ) < 0)
goto out;
- free( refbuf );
+ HDfree( refbuf );
}
@@ -1012,7 +1012,7 @@ herr_t H5IMget_palette( hid_t loc_id,
dim_ref = n_refs;
- refbuf = (hobj_ref_t*)malloc( sizeof(hobj_ref_t) * (int)dim_ref );
+ refbuf = (hobj_ref_t*)HDmalloc( sizeof(hobj_ref_t) * (int)dim_ref );
if ( H5Aread( aid, atid, refbuf ) < 0)
goto out;
@@ -1034,7 +1034,7 @@ herr_t H5IMget_palette( hid_t loc_id,
goto out;
if ( H5Aclose( aid ) < 0)
goto out;
- free( refbuf );
+ HDfree( refbuf );
}
/* Close the image dataset. */
diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c
index 98f2ff2..d175099 100644
--- a/hl/src/H5LT.c
+++ b/hl/src/H5LT.c
@@ -13,13 +13,12 @@
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#include <string.h>
-#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include "H5LTprivate.h"
-#include "H5private.h"
/* For Lex and Yacc */
#define COL 3
diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c
index 92b041a..d3a03cd 100644
--- a/hl/src/H5PT.c
+++ b/hl/src/H5PT.c
@@ -13,9 +13,10 @@
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#include <stdlib.h>
+
#include "H5PTprivate.h"
#include "H5TBprivate.h"
-#include <stdlib.h>
/* Packet Table private data */
@@ -33,6 +34,7 @@ static H5I_type_t H5PT_ptable_id_type = H5I_UNINIT;
#define H5PT_HASH_TABLE_SIZE 64
/* Packet Table private functions */
+static herr_t H5PT_free_id(void *id);
static herr_t H5PT_close( htbl_t* table );
static herr_t H5PT_create_index(htbl_t *table_id);
static herr_t H5PT_set_index(htbl_t *table_id, hsize_t pt_index);
@@ -84,11 +86,11 @@ hid_t H5PTcreate_fl ( hid_t loc_id,
/* Register the packet table ID type if this is the first table created */
if(H5PT_ptable_id_type < 0)
- if((H5PT_ptable_id_type = H5Iregister_type((size_t)H5PT_HASH_TABLE_SIZE, 0, (H5I_free_t)free)) < 0)
+ if((H5PT_ptable_id_type = H5Iregister_type((size_t)H5PT_HASH_TABLE_SIZE, 0, (H5I_free_t)H5PT_free_id)) < 0)
goto out;
/* Get memory for the table identifier */
- table = (htbl_t *)malloc(sizeof(htbl_t));
+ table = (htbl_t *)HDmalloc(sizeof(htbl_t));
/* Create a simple data space with unlimited size */
dims[0] = 0;
@@ -142,7 +144,7 @@ hid_t H5PTcreate_fl ( hid_t loc_id,
H5Pclose(plist_id);
H5Dclose(dset_id);
if(table)
- free(table);
+ HDfree(table);
H5E_END_TRY
return H5I_INVALID_HID;
}
@@ -232,10 +234,10 @@ hid_t H5PTopen( hid_t loc_id,
/* Register the packet table ID type if this is the first table created */
if( H5PT_ptable_id_type < 0)
- if((H5PT_ptable_id_type = H5Iregister_type((size_t)H5PT_HASH_TABLE_SIZE, 0, (H5I_free_t)free)) < 0)
+ if((H5PT_ptable_id_type = H5Iregister_type((size_t)H5PT_HASH_TABLE_SIZE, 0, (H5I_free_t)H5PT_free_id)) < 0)
goto out;
- table = (htbl_t *)malloc(sizeof(htbl_t));
+ table = (htbl_t *)HDmalloc(sizeof(htbl_t));
if ( table == NULL ) {
goto out;
@@ -291,12 +293,26 @@ out:
{
H5Dclose(table->dset_id);
H5Tclose(table->type_id);
- free(table);
+ HDfree(table);
}
H5E_END_TRY
return H5I_INVALID_HID;
}
+/*-------------------------------------------------------------------------
+ * Function: H5PT_free_id
+ *
+ * Purpose: Free an id. Callback for H5Iregister_type.
+ *
+ * Return: Success: 0, Failure: N/A
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5PT_free_id(void *id)
+{
+ HDfree(id);
+ return 0;
+}
/*-------------------------------------------------------------------------
* Function: H5PT_close
@@ -331,7 +347,7 @@ H5PT_close( htbl_t* table)
if(H5Tclose(table->type_id) < 0)
goto out;
- free(table);
+ HDfree(table);
return 0;
@@ -342,7 +358,7 @@ out:
H5Dclose(table->dset_id);
H5Tclose(table->type_id);
H5E_END_TRY
- free(table);
+ HDfree(table);
}
return -1;
}
diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c
index 0b6305b..1547e00 100644
--- a/hl/src/H5TB.c
+++ b/hl/src/H5TB.c
@@ -15,7 +15,7 @@
#include <stdlib.h>
#include <string.h>
-#include "H5private.h"
+
#include "H5LTprivate.h"
#include "H5TBprivate.h"
@@ -196,7 +196,7 @@ herr_t H5TBmake_table( const char *table_title,
if (H5LTset_attribute_string( loc_id, dset_name, attr_name, member_name ) < 0)
goto out;
- free( member_name );
+ HDfree( member_name );
}
@@ -234,7 +234,7 @@ herr_t H5TBmake_table( const char *table_title,
if (H5Aclose(attr_id) < 0)
goto out;
- free(member_name);
+ HDfree(member_name);
}
/* terminate access to the data space. */
@@ -570,7 +570,7 @@ herr_t H5TBwrite_fields_name( hid_t loc_id,
goto out;
}
- free( member_name );
+ HDfree( member_name );
}
@@ -734,7 +734,7 @@ herr_t H5TBwrite_fields_index( hid_t loc_id,
if(H5Tclose( nmtype_id ) < 0)
goto out;
- free( member_name );
+ HDfree( member_name );
}
@@ -1059,7 +1059,7 @@ herr_t H5TBread_fields_name( hid_t loc_id,
goto out;
j++;
}
- free( member_name );
+ HDfree( member_name );
}
/* get the dataspace handle */
@@ -1221,7 +1221,7 @@ herr_t H5TBread_fields_index( hid_t loc_id,
if (H5Tclose( nmtype_id ) < 0)
goto out;
- free( member_name );
+ HDfree( member_name );
}
/* get the dataspace handle */
@@ -1328,9 +1328,9 @@ herr_t H5TBdelete_record( hid_t loc_id,
if (H5TBget_table_info ( loc_id, dset_name, &nfields, &ntotal_records ) < 0)
goto out;
- if(NULL == (src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t))))
+ if(NULL == (src_offset = (size_t *)HDmalloc((size_t)nfields * sizeof(size_t))))
goto out;
- if(NULL == (src_sizes = (size_t *)malloc((size_t)nfields * sizeof(size_t))))
+ if(NULL == (src_sizes = (size_t *)HDmalloc((size_t)nfields * sizeof(size_t))))
goto out;
/* get field info */
@@ -1351,7 +1351,7 @@ herr_t H5TBdelete_record( hid_t loc_id,
if ( read_nrecords )
{
- if(NULL == (tmp_buf = (unsigned char *)calloc((size_t) read_nrecords, src_size )))
+ if(NULL == (tmp_buf = (unsigned char *)HDcalloc((size_t) read_nrecords, src_size )))
goto out;
/* read the records after the deleted one(s) */
@@ -1415,22 +1415,22 @@ herr_t H5TBdelete_record( hid_t loc_id,
goto out;
if(tmp_buf)
- free(tmp_buf);
+ HDfree(tmp_buf);
if(src_offset)
- free(src_offset);
+ HDfree(src_offset);
if(src_sizes)
- free(src_sizes);
+ HDfree(src_sizes);
return 0;
/* error zone */
out:
if(tmp_buf)
- free(tmp_buf);
+ HDfree(tmp_buf);
if(src_offset)
- free(src_offset);
+ HDfree(src_offset);
if(src_sizes)
- free(src_sizes);
+ HDfree(src_sizes);
H5E_BEGIN_TRY
{
H5Tclose(mem_type_id);
@@ -1509,7 +1509,7 @@ herr_t H5TBinsert_record( hid_t loc_id,
goto out;
read_nrecords = ntotal_records - start;
- tmp_buf = (unsigned char *)calloc((size_t) read_nrecords, type_size);
+ tmp_buf = (unsigned char *)HDcalloc((size_t) read_nrecords, type_size);
/* read the records after the inserted one(s) */
if (H5TBread_records( loc_id, dset_name, start, read_nrecords, type_size, field_offset, field_sizes, tmp_buf ) < 0)
@@ -1585,7 +1585,7 @@ herr_t H5TBinsert_record( hid_t loc_id,
if (H5Dclose( did ) < 0)
return -1;
- free( tmp_buf );
+ HDfree( tmp_buf );
return 0;
@@ -1652,9 +1652,9 @@ herr_t H5TBadd_records_from( hid_t loc_id,
if (H5TBget_table_info ( loc_id, dset_name1, &nfields, &ntotal_records ) < 0)
goto out;
- if(NULL == (src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t))))
+ if(NULL == (src_offset = (size_t *)HDmalloc((size_t)nfields * sizeof(size_t))))
goto out;
- if(NULL == (src_sizes = (size_t *)malloc((size_t)nfields * sizeof(size_t))))
+ if(NULL == (src_sizes = (size_t *)HDmalloc((size_t)nfields * sizeof(size_t))))
goto out;
/* get field info */
@@ -1682,7 +1682,7 @@ herr_t H5TBadd_records_from( hid_t loc_id,
if (( type_size1 = H5Tget_size( tid_1 )) == 0 )
goto out;
- if(NULL == (tmp_buf = (unsigned char *)calloc((size_t)nrecords, type_size1 )))
+ if(NULL == (tmp_buf = (unsigned char *)HDcalloc((size_t)nrecords, type_size1 )))
goto out;
/* define a hyperslab in the dataset of the size of the records */
@@ -1721,22 +1721,22 @@ herr_t H5TBadd_records_from( hid_t loc_id,
goto out;
if(tmp_buf)
- free(tmp_buf);
+ HDfree(tmp_buf);
if(src_offset)
- free(src_offset);
+ HDfree(src_offset);
if(src_sizes)
- free(src_sizes);
+ HDfree(src_sizes);
return 0;
/* error zone */
out:
if(tmp_buf)
- free(tmp_buf);
+ HDfree(tmp_buf);
if(src_offset)
- free(src_offset);
+ HDfree(src_offset);
if(src_sizes)
- free(src_sizes);
+ HDfree(src_sizes);
H5E_BEGIN_TRY
{
H5Dclose(did_1);
@@ -1998,7 +1998,7 @@ herr_t H5TBcombine_tables(hid_t loc_id1,
did_1 = H5I_BADID;
/* Release resources. */
- free(tmp_buf);
+ HDfree(tmp_buf);
tmp_buf = NULL;
/*-------------------------------------------------------------------------
@@ -2100,13 +2100,13 @@ herr_t H5TBcombine_tables(hid_t loc_id1,
out:
if(tmp_buf)
- free(tmp_buf);
+ HDfree(tmp_buf);
if(tmp_fill_buf)
- free(tmp_fill_buf);
+ HDfree(tmp_fill_buf);
if(src_offset)
- free(src_offset);
+ HDfree(src_offset);
if(src_sizes)
- free(src_sizes);
+ HDfree(src_sizes);
H5E_BEGIN_TRY {
if(member_type_id > 0)
@@ -2254,7 +2254,7 @@ herr_t H5TBinsert_field( hid_t loc_id,
goto out;
/* alloc fill value attribute buffer */
- tmp_fill_buf = (unsigned char *)malloc(total_size );
+ tmp_fill_buf = (unsigned char *)HDmalloc(total_size );
/* get the fill value attributes */
if ((H5TBAget_fill( loc_id, dset_name, did_1, tmp_fill_buf )) < 0)
@@ -2314,7 +2314,7 @@ herr_t H5TBinsert_field( hid_t loc_id,
curr_offset += member_size;
- free( member_name );
+ HDfree( member_name );
/* close the member type */
if(H5Tclose( member_type_id ) < 0)
@@ -2349,7 +2349,7 @@ herr_t H5TBinsert_field( hid_t loc_id,
*-------------------------------------------------------------------------
*/
- tmp_buf = (unsigned char *)calloc((size_t)nrecords, (size_t)total_size);
+ tmp_buf = (unsigned char *)HDcalloc((size_t)nrecords, (size_t)total_size);
/* define a hyperslab in the dataset of the size of the records */
offset[0] = 0;
@@ -2557,8 +2557,8 @@ herr_t H5TBinsert_field( hid_t loc_id,
goto out;
/* release resources. */
- free ( tmp_buf );
- free ( tmp_fill_buf );
+ HDfree ( tmp_buf );
+ HDfree ( tmp_fill_buf );
return 0;
@@ -2694,13 +2694,13 @@ herr_t H5TBdelete_field( hid_t loc_id,
if (H5Tclose( member_type_id ) < 0)
goto out;
- free( member_name );
+ HDfree( member_name );
break;
}
- free( member_name );
+ HDfree( member_name );
} /* i */
@@ -2722,7 +2722,7 @@ herr_t H5TBdelete_field( hid_t loc_id,
curr_offset = 0;
/* alloc fill value attribute buffer */
- tmp_fill_buf = (unsigned char *)malloc((size_t) type_size2 );
+ tmp_fill_buf = (unsigned char *)HDmalloc((size_t) type_size2 );
/*-------------------------------------------------------------------------
* get attributes from previous table in the process
@@ -2742,7 +2742,7 @@ herr_t H5TBdelete_field( hid_t loc_id,
/* we want to skip the field to delete */
if (H5TB_find_field( member_name, field_name ) > 0 )
{
- free( member_name );
+ HDfree( member_name );
continue;
}
@@ -2780,7 +2780,7 @@ herr_t H5TBdelete_field( hid_t loc_id,
curr_offset += member_size;
- free(member_name);
+ HDfree(member_name);
/* close the member type */
if (H5Tclose(member_type_id) < 0)
@@ -2821,7 +2821,7 @@ herr_t H5TBdelete_field( hid_t loc_id,
/* skip the field to delete */
if (H5TB_find_field(member_name, field_name) > 0)
{
- free(member_name);
+ HDfree(member_name);
continue;
}
@@ -2840,7 +2840,7 @@ herr_t H5TBdelete_field( hid_t loc_id,
if (H5Tinsert( read_type_id, member_name, (size_t)0, member_type_id ) < 0)
goto out;
- tmp_buf = (unsigned char *)calloc((size_t) nrecords, member_size );
+ tmp_buf = (unsigned char *)HDcalloc((size_t) nrecords, member_size );
/* read */
if (H5Dread( did_1, read_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp_buf ) < 0)
@@ -2881,8 +2881,8 @@ herr_t H5TBdelete_field( hid_t loc_id,
goto out;
/* release resources. */
- free( member_name );
- free ( tmp_buf );
+ HDfree( member_name );
+ HDfree ( tmp_buf );
} /* i */
@@ -3007,7 +3007,7 @@ herr_t H5TBdelete_field( hid_t loc_id,
goto out;
/* Release resources. */
- free ( tmp_fill_buf );
+ HDfree ( tmp_fill_buf );
return 0;
@@ -3101,7 +3101,7 @@ htri_t H5TBAget_fill(hid_t loc_id,
if (H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0)
return -1;
- src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t));
+ src_offset = (size_t *)HDmalloc((size_t)nfields * sizeof(size_t));
if (src_offset == NULL )
return -1;
@@ -3130,12 +3130,12 @@ htri_t H5TBAget_fill(hid_t loc_id,
}
- free( src_offset );
+ HDfree( src_offset );
return has_fill;
out:
- free( src_offset );
+ HDfree( src_offset );
return -1;
}
@@ -3306,7 +3306,7 @@ herr_t H5TBget_field_info( hid_t loc_id,
member_name = H5Tget_member_name(tid, (unsigned)i);
strcpy(field_names[i], member_name);
- free(member_name);
+ HDfree(member_name);
} /* end if */
/* get the member type */
@@ -3459,7 +3459,7 @@ herr_t H5TB_attach_attributes( const char *table_title,
if (H5LTset_attribute_string( loc_id, dset_name, attr_name, member_name ) < 0)
goto out;
- free( member_name );
+ HDfree( member_name );
}
@@ -3508,14 +3508,14 @@ hid_t H5TB_create_type(hid_t loc_id,
if (H5TBget_table_info(loc_id,dset_name,&nfields,NULL) < 0)
return -1;
- if ((fnames = (char**) malloc(sizeof(char*)*(size_t)nfields))==NULL)
+ if ((fnames = (char**) HDmalloc(sizeof(char*)*(size_t)nfields))==NULL)
return -1;
for ( i = 0; i < nfields; i++)
{
- if ((fnames[i] = (char*) malloc(sizeof(char)*HLTB_MAX_FIELD_LEN))==NULL)
+ if ((fnames[i] = (char*) HDmalloc(sizeof(char)*HLTB_MAX_FIELD_LEN))==NULL)
{
- free(fnames);
+ HDfree(fnames);
return -1;
}
}
@@ -3551,9 +3551,9 @@ hid_t H5TB_create_type(hid_t loc_id,
for ( i=0; i<nfields; i++)
{
- free (fnames[i]);
+ HDfree (fnames[i]);
}
- free (fnames);
+ HDfree (fnames);
return mem_type_id;
@@ -3567,10 +3567,10 @@ out:
for ( i=0; i<nfields; i++)
{
if (fnames[i])
- free (fnames[i]);
+ HDfree (fnames[i]);
}
if (fnames)
- free (fnames);
+ HDfree (fnames);
return -1;
}
diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in
index 1c5c5ab..839dac9 100644
--- a/hl/src/Makefile.in
+++ b/hl/src/Makefile.in
@@ -459,7 +459,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 157
+LT_VERS_REVISION = 159
LT_VERS_AGE = 0
# This library is our main target.
diff --git a/hl/src/hdf5_hl.h b/hl/src/hdf5_hl.h
index 6693b14..65f7a4f 100644
--- a/hl/src/hdf5_hl.h
+++ b/hl/src/hdf5_hl.h
@@ -27,7 +27,7 @@
#include "H5LTpublic.h" /* lite */
#include "H5IMpublic.h" /* image */
#include "H5TBpublic.h" /* table */
-#include "H5PTpublic.h" /* table */
+#include "H5PTpublic.h" /* packet table */
#include "H5LDpublic.h" /* lite dataset */
#endif /*H5_INCLUDE_HL*/
diff --git a/hl/test/CMakeTests.cmake b/hl/test/CMakeTests.cmake
index aa9c1c3..5d42b57 100644
--- a/hl/test/CMakeTests.cmake
+++ b/hl/test/CMakeTests.cmake
@@ -47,12 +47,15 @@ ADD_TEST (
test_ds7.h5
test_ds8.h5
test_ds9.h5
+ test_ds10.h5
test_dectris.h5
test_image1.h5
test_image2.h5
test_image3.h5
test_lite1.h5
test_lite2.h5
+ test_lite3.h5
+ test_lite4.h5
test_packet_compress.h5
test_packet_table.h5
test_table.h5
diff --git a/hl/test/gen_test_ds.c b/hl/test/gen_test_ds.c
index a60a560..2fc8140 100644
--- a/hl/test/gen_test_ds.c
+++ b/hl/test/gen_test_ds.c
@@ -255,13 +255,13 @@ herr_t test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *sc
if((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) {
if(H5DSis_attached(did, dsid, idx) == 1) {
if((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0)) > 0) {
- name_out = (char*)malloc((size_t)name_len * sizeof (char));
+ name_out = (char*)HDmalloc((size_t)name_len * sizeof (char));
if(name_out != NULL) {
if(H5DSget_scale_name(dsid, name_out, (size_t)name_len) >= 0) {
if(strcmp(scalename,name_out)==0) {
ret_value = SUCCEED;
}
- free(name_out);
+ HDfree(name_out);
name_out=NULL;
}
}
diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c
index 9a0ffb0..08d1c46 100644
--- a/hl/test/test_dset_opt.c
+++ b/hl/test/test_dset_opt.c
@@ -176,7 +176,7 @@ test_direct_chunk_write (hid_t file)
direct_buf[i][j] = n++;
/* Allocate output (compressed) buffer */
- outbuf = malloc(z_dst_nbytes);
+ outbuf = HDmalloc(z_dst_nbytes);
z_dst = (Bytef *)outbuf;
/* Perform compression from the source to the destination buffer */
@@ -206,7 +206,7 @@ test_direct_chunk_write (hid_t file)
}
if(outbuf)
- free(outbuf);
+ HDfree(outbuf);
if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0)
goto error;
@@ -249,7 +249,7 @@ test_direct_chunk_write (hid_t file)
direct_buf[i][j] = i + j;
/* Allocate output (compressed) buffer */
- outbuf = malloc(z_dst_nbytes);
+ outbuf = HDmalloc(z_dst_nbytes);
z_dst = (Bytef *)outbuf;
/* Perform compression from the source to the destination buffer */
@@ -280,7 +280,7 @@ test_direct_chunk_write (hid_t file)
}
if(outbuf)
- free(outbuf);
+ HDfree(outbuf);
if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0)
goto error;
@@ -329,7 +329,7 @@ error:
} H5E_END_TRY;
if(outbuf)
- free(outbuf);
+ HDfree(outbuf);
return 1;
}
diff --git a/hl/test/test_file_image.c b/hl/test/test_file_image.c
index 9729421..831fa23 100644
--- a/hl/test/test_file_image.c
+++ b/hl/test/test_file_image.c
@@ -77,23 +77,23 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array of pointers for each of the open images */
- if (NULL == (buf_ptr = (void **)malloc(sizeof(void *) * open_images)))
+ if (NULL == (buf_ptr = (void **)HDmalloc(sizeof(void *) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array to store the name of each of the open images */
- if (NULL == (filename = (char **)malloc(sizeof(char *) * open_images)))
+ if (NULL == (filename = (char **)HDmalloc(sizeof(char *) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array to store the size of each of the open images */
- if (NULL == (buf_size = (ssize_t *)malloc(sizeof(ssize_t) * open_images)))
+ if (NULL == (buf_size = (ssize_t *)HDmalloc(sizeof(ssize_t) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array for each of the file identifiers */
- if (NULL == (file_id = (hid_t *)malloc(sizeof(hid_t) * open_images)))
+ if (NULL == (file_id = (hid_t *)HDmalloc(sizeof(hid_t) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array for each of the dataset identifiers */
- if (NULL == (dset_id = (hid_t *)malloc(sizeof(hid_t) * open_images)))
+ if (NULL == (dset_id = (hid_t *)HDmalloc(sizeof(hid_t) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
TESTING("get file images");
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index fa6d9e0..da441e70 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -1,4 +1,4 @@
-HDF5 version 1.9.167-swmr0 currently under development
+HDF5 version 1.9.169-swmr0 currently under development
INTRODUCTION
diff --git a/release_docs/USING_CMake_Examples.txt b/release_docs/USING_CMake_Examples.txt
index 33c43a3..4dae021 100644
--- a/release_docs/USING_CMake_Examples.txt
+++ b/release_docs/USING_CMake_Examples.txt
@@ -1,12 +1,81 @@
-The compressed examples file, located in the HDF5 install folder,
-can be built and tested with CMake and the supplied
-HDF518_Examples.cmake file. It is recommended that you copy those
-two files to your development location before continuing.
-
-The command line to be used is shown at the top of the file. Also,
-the location of the HDF5 installation should be verified and
-changed if necessary.
-
-When executed, the ctest script will save the results to the log file
-indicated by the ctest command. If you wish the to see more build
-and test information, add "-VV" to the ctest command.
+************************************************************************
+* Build and Test HDF5 Examples with CMake *
+************************************************************************
+
+Notes: This short instruction is written for users who want to quickly
+ test the installation of HDF5 by using the CMake tools to build
+ and test the HDF5 Examples. The following instructions will show
+ the default usage and then present common changes for non-default
+ installations.
+ For more information, see the USING_HDF5_CMake.txt file.
+
+ More information about using CMake can be found at the KitWare
+ site, www.cmake.org.
+
+ CMake uses the command line and these instructions use the script
+ method of the ctest command.
+
+
+========================================================================
+I. Preconditions
+========================================================================
+
+ 1. We suggest you obtain the latest CMake for windows from the Kitware
+ web site. The HDF5 1.8.x product requires a minimum CMake version
+ of 2.8.10.
+
+ 2. You have installed the HDF5 library built with CMake, by executing
+ the HDF Install Utility (the *.exe file in the binary package for
+ Windows or the *.sh on Linux). If you are using a Windows platform,
+ you can obtain a pre-built Windows binary from The HDF Group's website
+ at www.hdfgroup.org. See Section "III. Common changes to the
+ HDF518_Examples.cmake file", for the line to change the location.
+
+ 3. On Windows, you have installed the 7Zip package. See Section "III.
+ Common changes to the HDF518_Examples.cmake file", for the line to
+ change the command.
+
+
+
+========================================================================
+II. Building HDF5 Examples with CMake
+========================================================================
+
+Files in the HDF5 install directory:
+ HDF5Examples-0.1.1-Source.zip (or HDF5Examples-0.1.1-Source.tar.gz)
+ HDF518_Examples.cmake
+
+Default installation process:
+ Create a directory to run the examples, i.e. \test_hdf5.
+ Copy HDF5Examples-0.1.1-Source.zip(.tar.gz) to this directory, do NOT unzip.
+ Copy HDF518_Examples.cmake to this directory.
+ Edit line 8 of the HDF518_Examples.cmake file and change the INSTALLDIR
+ to the HDF5 install location.
+
+ Execute from this directory:
+ ctest -S HDF518_Examples.cmake,HDF5Examples-0.1.1-Source -C Release -O test.log
+
+The script will uncompress the examples file HDF5Examples-0.1.1-Source.zip(.tar.gz),
+ and create a build directory inside the HDF5Examples-0.1.1-Source directory.
+ It will then configure, build, and execute the examples. All the log files
+ will be found under the build\Testing\Temporary directory, check these for
+ errors.
+
+The amount of script information can be increased by adding -V to the ctest
+ command. Even more information can be shown by adding -VV instead of -V.
+
+
+========================================================================
+III. Common changes to the HDF518_Examples.cmake file
+========================================================================
+
+Line 8: change the INSTALLDIR to a different HDF5 install location.
+
+Line 14: uncomment to allow Mac machines to build shared examples.
+
+Line 15: uncomment to not build and test Fortran examples.
+
+Line 16: uncomment to build and test Fortran examples with F2003 option.
+
+Line 68: change the CTEST_7Z_COMMAND to a different unzip program.
+
diff --git a/src/H5F.c b/src/H5F.c
index 90163c5..31c0415 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -63,7 +63,7 @@ typedef struct H5F_olist_t {
} ptr;
} file_info;
size_t list_index; /* Current index in open ID array */
- size_t max_index; /* Maximum # of IDs to put into array */
+ size_t max_nobjs; /* Maximum # of IDs to put into array */
} H5F_olist_t;
@@ -506,7 +506,8 @@ H5Fget_obj_ids(hid_t file_id, unsigned types, size_t max_objs, hid_t *oid_list)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file id")
if(0 == (types & H5F_OBJ_ALL))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not an object type")
- HDassert(oid_list);
+ if(!oid_list)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "object ID list is NULL")
/* Perform the query */
if(H5F_get_obj_ids(f, types, max_objs, oid_list, TRUE, &obj_id_count) < 0)
@@ -565,7 +566,7 @@ done:
*---------------------------------------------------------------------------
*/
static herr_t
-H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_list, hbool_t app_ref, size_t *obj_id_count_ptr)
+H5F_get_objects(const H5F_t *f, unsigned types, size_t max_nobjs, hid_t *obj_id_list, hbool_t app_ref, size_t *obj_id_count_ptr)
{
size_t obj_id_count=0; /* Number of open IDs */
H5F_olist_t olist; /* Structure to hold search results */
@@ -577,10 +578,10 @@ H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_
HDassert(obj_id_count_ptr);
/* Set up search information */
- olist.obj_id_list = (max_index==0 ? NULL : obj_id_list);
+ olist.obj_id_list = (max_nobjs==0 ? NULL : obj_id_list);
olist.obj_id_count = &obj_id_count;
olist.list_index = 0;
- olist.max_index = max_index;
+ olist.max_nobjs = max_nobjs;
/* Determine if we are searching for local or global objects */
if(types & H5F_OBJ_LOCAL) {
@@ -600,38 +601,54 @@ H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_
HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed(1)")
} /* end if */
- /* Search through dataset IDs to count number of datasets, and put their
+ /* If the caller just wants to count the number of objects (OLIST.MAX_NOBJS is zero),
+ * or the caller wants to get the list of IDs and the list isn't full,
+ * search through dataset IDs to count number of datasets, and put their
* IDs on the object list */
- if(types & H5F_OBJ_DATASET) {
- olist.obj_type = H5I_DATASET;
- if(H5I_iterate(H5I_DATASET, H5F_get_objects_cb, &olist, app_ref) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed(2)")
- } /* end if */
+ if(!olist.max_nobjs || (olist.max_nobjs && olist.list_index<olist.max_nobjs)) {
+ if (types & H5F_OBJ_DATASET) {
+ olist.obj_type = H5I_DATASET;
+ if(H5I_iterate(H5I_DATASET, H5F_get_objects_cb, &olist, app_ref) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed(2)")
+ } /* end if */
+ }
- /* Search through group IDs to count number of groups, and put their
+ /* If the caller just wants to count the number of objects (OLIST.MAX_NOBJS is zero),
+ * or the caller wants to get the list of IDs and the list isn't full,
+ * search through group IDs to count number of groups, and put their
* IDs on the object list */
- if(types & H5F_OBJ_GROUP) {
- olist.obj_type = H5I_GROUP;
- if(H5I_iterate(H5I_GROUP, H5F_get_objects_cb, &olist, app_ref) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed(3)")
- } /* end if */
+ if(!olist.max_nobjs || (olist.max_nobjs && olist.list_index<olist.max_nobjs)) {
+ if(types & H5F_OBJ_GROUP) {
+ olist.obj_type = H5I_GROUP;
+ if(H5I_iterate(H5I_GROUP, H5F_get_objects_cb, &olist, app_ref) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed(3)")
+ } /* end if */
+ }
- /* Search through datatype IDs to count number of named datatypes, and put their
+ /* If the caller just wants to count the number of objects (OLIST.MAX_NOBJS is zero),
+ * or the caller wants to get the list of IDs and the list isn't full,
+ * search through datatype IDs to count number of named datatypes, and put their
* IDs on the object list */
- if(types & H5F_OBJ_DATATYPE) {
- olist.obj_type = H5I_DATATYPE;
- if(H5I_iterate(H5I_DATATYPE, H5F_get_objects_cb, &olist, app_ref) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed(4)")
- } /* end if */
+ if(!olist.max_nobjs || (olist.max_nobjs && olist.list_index<olist.max_nobjs)) {
+ if(types & H5F_OBJ_DATATYPE) {
+ olist.obj_type = H5I_DATATYPE;
+ if(H5I_iterate(H5I_DATATYPE, H5F_get_objects_cb, &olist, app_ref) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed(4)")
+ } /* end if */
+ }
- /* Search through attribute IDs to count number of attributes, and put their
+ /* If the caller just wants to count the number of objects (OLIST.MAX_NOBJS is zero),
+ * or the caller wants to get the list of IDs and the list isn't full,
+ * search through attribute IDs to count number of attributes, and put their
* IDs on the object list */
- if(types & H5F_OBJ_ATTR) {
- olist.obj_type = H5I_ATTR;
- if(H5I_iterate(H5I_ATTR, H5F_get_objects_cb, &olist, app_ref) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed(5)")
- } /* end if */
-
+ if(!olist.max_nobjs || (olist.max_nobjs && olist.list_index<olist.max_nobjs)) {
+ if(types & H5F_OBJ_ATTR) {
+ olist.obj_type = H5I_ATTR;
+ if(H5I_iterate(H5I_ATTR, H5F_get_objects_cb, &olist, app_ref) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed(5)")
+ } /* end if */
+ }
+
/* Set the number of objects currently open */
*obj_id_count_ptr = obj_id_count;
@@ -647,8 +664,8 @@ done:
* object is in the file, and either count it or put its ID
* on the list.
*
- * Return: TRUE if the array of object IDs is filled up.
- * FALSE otherwise.
+ * Return: H5_ITER_STOP if the array of object IDs is filled up.
+ * H5_ITER_CONT otherwise.
*
* Programmer: Raymond Lu
* Wednesday, Dec 5, 2001
@@ -659,35 +676,21 @@ static int
H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key)
{
H5F_olist_t *olist = (H5F_olist_t *)key; /* Alias for search info */
- int ret_value = FALSE; /* Return value */
+ int ret_value = H5_ITER_CONT; /* Return value */
+ hbool_t add_obj = FALSE;
FUNC_ENTER_NOAPI_NOINIT
HDassert(obj_ptr);
HDassert(olist);
- /* Check if we've filled up the array. Return TRUE only if
- * we have filled up the array. Otherwise return FALSE(RET_VALUE is
- * preset to FALSE) because H5I_iterate needs the return value of
- * FALSE to continue the iteration. */
- if(olist->max_index>0 && olist->list_index>=olist->max_index)
- HGOTO_DONE(TRUE) /* Indicate that the iterator should stop */
-
/* Count file IDs */
if(olist->obj_type == H5I_FILE) {
if((olist->file_info.local &&
(!olist->file_info.ptr.file || (olist->file_info.ptr.file && (H5F_t*)obj_ptr == olist->file_info.ptr.file) ))
|| (!olist->file_info.local &&
( !olist->file_info.ptr.shared || (olist->file_info.ptr.shared && ((H5F_t*)obj_ptr)->shared == olist->file_info.ptr.shared) ))) {
- /* Add the object's ID to the ID list, if appropriate */
- if(olist->obj_id_list) {
- olist->obj_id_list[olist->list_index] = obj_id;
- olist->list_index++;
- }
-
- /* Increment the number of open objects */
- if(olist->obj_id_count)
- (*olist->obj_id_count)++;
+ add_obj = TRUE;
}
} /* end if */
else { /* either count opened object IDs or put the IDs on the list */
@@ -726,7 +729,7 @@ H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key)
case H5I_ERROR_STACK:
case H5I_NTYPES:
default:
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unknown data object")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5_ITER_ERROR, "unknown data object")
} /* end switch */
if((olist->file_info.local &&
@@ -737,18 +740,29 @@ H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key)
((!olist->file_info.ptr.shared && olist->obj_type == H5I_DATATYPE && H5T_is_immutable((H5T_t *)obj_ptr) == FALSE)
|| (!olist->file_info.ptr.shared && olist->obj_type != H5I_DATATYPE)
|| (oloc && oloc->file && oloc->file->shared == olist->file_info.ptr.shared)))) {
- /* Add the object's ID to the ID list, if appropriate */
- if(olist->obj_id_list) {
- olist->obj_id_list[olist->list_index] = obj_id;
- olist->list_index++;
- } /* end if */
-
- /* Increment the number of open objects */
- if(olist->obj_id_count)
- (*olist->obj_id_count)++;
+ add_obj = TRUE;
} /* end if */
} /* end else */
+ if(TRUE==add_obj) {
+ /* Add the object's ID to the ID list, if appropriate */
+ if(olist->obj_id_list) {
+ olist->obj_id_list[olist->list_index] = obj_id;
+ olist->list_index++;
+ } /* end if */
+
+ /* Increment the number of open objects */
+ if(olist->obj_id_count)
+ (*olist->obj_id_count)++;
+
+ /* Check if we've filled up the array. Return H5_ITER_STOP only if
+ * we have filled up the array. Otherwise return H5_ITER_CONT(RET_VALUE is
+ * preset to H5_ITER_CONT) because H5I_iterate needs the return value of
+ * H5_ITER_CONT to continue the iteration. */
+ if(olist->max_nobjs>0 && olist->list_index>=olist->max_nobjs)
+ HGOTO_DONE(H5_ITER_STOP) /* Indicate that the iterator should stop */
+ }
+
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_get_objects_cb() */
diff --git a/src/H5detect.c b/src/H5detect.c
index 3554d50..0f8d051 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -60,9 +60,9 @@ static const char *FileHeader = "\n\
#define MAXDETECT 64
-/* The ALIGNMENT test code may generate the SIGBUS or SIGSEGV signals. We use
- * setjmp/longjmp in the signal handlers for recovery. But setjmp/longjmp do
- * not necessary restore the signal blocking status while sigsetjmp/siglongjmp
+/* The ALIGNMENT test code may generate the SIGBUS, SIGSEGV, or SIGILL signals.
+ * We use setjmp/longjmp in the signal handlers for recovery. But setjmp/longjmp
+ * do not necessary restore the signal blocking status while sigsetjmp/siglongjmp
* do. If sigsetjmp/siglongjmp are not supported, need to use sigprocmask to
* unblock the signal before doing longjmp.
*/
@@ -139,7 +139,8 @@ static void detect_alignments(void);
static size_t align_g[] = {1, 2, 4, 8, 16};
static int align_status_g = 0; /* ALIGNMENT Signal Status */
static int sigbus_handler_called_g = 0; /* how many times called */
-static int sigsegv_handler_called_g = 0; /* how many times called */
+static int sigsegv_handler_called_g = 0;/* how many times called */
+static int sigill_handler_called_g = 0; /* how many times called */
static int signal_handler_tested_g = 0; /* how many times tested */
#if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL)
static int verify_signal_handlers(int signum, void (*handler)(int));
@@ -425,6 +426,7 @@ precision (detected_t *d)
volatile size_t _ano = 0; \
void (*_handler)(int) = HDsignal(SIGBUS, sigbus_handler); \
void (*_handler2)(int) = HDsignal(SIGSEGV, sigsegv_handler);\
+ void (*_handler3)(int) = HDsignal(SIGILL, sigill_handler); \
\
_buf = (char*)HDmalloc(sizeof(TYPE) + align_g[NELMTS(align_g) - 1]); \
if(H5SETJMP(jbuf_g)) _ano++; \
@@ -454,6 +456,7 @@ precision (detected_t *d)
HDfree(_buf); \
HDsignal(SIGBUS, _handler); /*restore original handler*/ \
HDsignal(SIGSEGV, _handler2); /*restore original handler*/ \
+ HDsignal(SIGILL, _handler3); /*restore original handler*/ \
}
#else
#define ALIGNMENT(TYPE,INFO) { \
@@ -539,6 +542,42 @@ sigbus_handler(int UNUSED signo)
#endif
+#if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL)
+/*-------------------------------------------------------------------------
+ * Function: sigill_handler
+ *
+ * Purpose: Handler for SIGILL. We use signal() instead of sigaction()
+ * because it's more portable to non-Posix systems. Although
+ * it's not nearly as nice to work with, it does the job for
+ * this simple stuff.
+ *
+ * Return: Returns via H5LONGJMP to jbuf_g.
+ *
+ * Programmer: Raymond Lu
+ * 28 October 2013
+ *
+ *-------------------------------------------------------------------------
+ */
+static void
+sigill_handler(int UNUSED signo)
+{
+#if !defined(H5HAVE_SIGJMP) && defined(H5_HAVE_SIGPROCMASK)
+ /* Use sigprocmask to unblock the signal if sigsetjmp/siglongjmp are not */
+ /* supported. */
+ sigset_t set;
+
+ HDsigemptyset(&set);
+ HDsigaddset(&set, SIGILL);
+ HDsigprocmask(SIG_UNBLOCK, &set, NULL);
+#endif
+
+ sigill_handler_called_g++;
+ HDsignal(SIGILL, sigill_handler);
+ H5LONGJMP(jbuf_g, SIGILL);
+}
+#endif
+
+
/*-------------------------------------------------------------------------
* Function: print_results
*
diff --git a/src/H5public.h b/src/H5public.h
index fad88b1..6496e45 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -75,10 +75,10 @@ extern "C" {
/* Version numbers */
#define H5_VERS_MAJOR 1 /* For major interface/format changes */
#define H5_VERS_MINOR 9 /* For minor interface/format changes */
-#define H5_VERS_RELEASE 167 /* For tweaks, bug-fixes, or development */
+#define H5_VERS_RELEASE 169 /* For tweaks, bug-fixes, or development */
#define H5_VERS_SUBRELEASE "swmr0" /* For pre-releases like snap0 */
/* Empty string for real releases. */
-#define H5_VERS_INFO "HDF5 library version: 1.9.167-swmr0" /* Full version string */
+#define H5_VERS_INFO "HDF5 library version: 1.9.169-swmr0" /* Full version string */
#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \
H5_VERS_RELEASE)
diff --git a/src/Makefile.in b/src/Makefile.in
index 104a7ed..ecbcaa1 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -523,7 +523,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 157
+LT_VERS_REVISION = 159
LT_VERS_AGE = 0
# Our main target, the HDF5 library
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index b64eeca..58ef1e6 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -142,6 +142,7 @@ ADD_TEST (
COMMAND ${CMAKE_COMMAND}
-E remove
coord.h5
+ dtypes10.h5
sys_file1
tattr.h5
tfile1.h5
@@ -150,6 +151,7 @@ ADD_TEST (
tfile4.h5
tfile5.h5
tfile6.h5
+ tfile7.h5
th5o_file
th5s1.h5
tselect.h5
diff --git a/test/Makefile.am b/test/Makefile.am
index e1c152c..5f814ec 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -139,7 +139,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 \
huge_chunks.h5 chunk_cache.h5 big_chunk.h5 chunk_fast.h5 \
chunk_expand.h5 layout_extend.h5 swmr_fail.h5 partial_chunks.h5 \
copy_dcpl_newfile.h5 extend.h5 istore.h5 extlinks*.h5 frspace.h5 links*.h5 \
- sys_file1 tfile[1-6].h5 th5s[1-4].h5 lheap.h5 fheap.h5 ohdr.h5 \
+ sys_file1 tfile[1-7].h5 th5s[1-4].h5 lheap.h5 fheap.h5 ohdr.h5 \
stab.h5 extern_[1-3].h5 extern_[1-4][ab].raw gheap[0-4].h5 \
dt_arith[1-2] links.h5 links[0-6]*.h5 extlinks[0-15].h5 tmp \
big.data big[0-9][0-9][0-9][0-9][0-9].h5 \
diff --git a/test/Makefile.in b/test/Makefile.in
index 62a2a7f..ce8c39a 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -955,7 +955,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog accum.h5 cmpd_dset.h5 \
huge_chunks.h5 chunk_cache.h5 big_chunk.h5 chunk_fast.h5 \
chunk_expand.h5 layout_extend.h5 swmr_fail.h5 \
partial_chunks.h5 copy_dcpl_newfile.h5 extend.h5 istore.h5 \
- extlinks*.h5 frspace.h5 links*.h5 sys_file1 tfile[1-6].h5 \
+ extlinks*.h5 frspace.h5 links*.h5 sys_file1 tfile[1-7].h5 \
th5s[1-4].h5 lheap.h5 fheap.h5 ohdr.h5 stab.h5 extern_[1-3].h5 \
extern_[1-4][ab].raw gheap[0-4].h5 dt_arith[1-2] links.h5 \
links[0-6]*.h5 extlinks[0-15].h5 tmp big.data \
diff --git a/test/accum.c b/test/accum.c
index 1a218c6..fc7546d 100644
--- a/test/accum.c
+++ b/test/accum.c
@@ -1670,9 +1670,9 @@ test_random_write(void)
unsigned u; /* Local index variable */
/* Allocate space for the write & read buffers */
- wbuf = (uint8_t *)malloc((size_t)RANDOM_BUF_SIZE);
+ wbuf = (uint8_t *)HDmalloc((size_t)RANDOM_BUF_SIZE);
HDassert(wbuf);
- rbuf = (uint8_t *)calloc((size_t)RANDOM_BUF_SIZE, (size_t)1);
+ rbuf = (uint8_t *)HDcalloc((size_t)RANDOM_BUF_SIZE, 1);
HDassert(rbuf);
/* Initialize write buffer */
@@ -1690,9 +1690,9 @@ HDfprintf(stderr, "Random # seed was: %u\n", seed);
HDsrandom(seed);
/* Allocate space for the segment length buffer */
- off = (size_t *)malloc(MAX_RANDOM_SEGMENTS * sizeof(size_t));
+ off = (size_t *)HDmalloc(MAX_RANDOM_SEGMENTS * sizeof(size_t));
HDassert(off);
- len = (size_t *)malloc(MAX_RANDOM_SEGMENTS * sizeof(size_t));
+ len = (size_t *)HDmalloc(MAX_RANDOM_SEGMENTS * sizeof(size_t));
HDassert(len);
/* Randomly choose lengths of segments */
diff --git a/test/big.c b/test/big.c
index 7465e47..db03c99 100644
--- a/test/big.c
+++ b/test/big.c
@@ -76,8 +76,6 @@
* NOFILE stands for "no file" to be tested.
*/
typedef enum fsizes_t { SFILE, LFILE, XLFILE, HUGEFILE, NOFILE} fsizes_t;
-/* Lists of vfd to test */
-typedef enum vfd_t { SEC2_VFD, STDIO_VFD, FAMILY_VFD } vfd_t;
fsizes_t file_size= NOFILE;
const char *FILENAME[] = {
@@ -91,9 +89,11 @@ int sparse_support=0; /* sparse file supported, default false */
int have_space=0; /* enough space for huge file test, default false */
hsize_t family_size_def=FAMILY_SIZE; /* default family file size */
-/* Protocols */
+/* Prototypes */
static void usage(void);
-int testvfd(vfd_t vfd);
+static int test_sec2(hid_t fapl);
+static int test_stdio(hid_t fapl);
+static int test_family(hid_t fapl);
/* Array used to record all addresses at which data has been written */
/* so far. Used to prevent overlapping writes. */
@@ -207,66 +207,55 @@ is_sparse(void)
*-------------------------------------------------------------------------
*/
static fsizes_t
-supports_big(vfd_t vfd)
+supports_big(void)
{
int fd = -1;
fsizes_t fsize = NOFILE;
- switch (vfd){
- case FAMILY_VFD:
- case SEC2_VFD:
- case STDIO_VFD:
- if ((fd=HDopen("y.h5", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0)
- goto error;
-
- /* Write a few byte at the beginning */
- if (5!=HDwrite(fd, "hello", (size_t)5))
- goto quit;
- fsize = SFILE;
-
- /* Write a few bytes at 2GB */
- if (HDlseek(fd, 2*GB, SEEK_SET)!=2*GB)
- goto quit;
- if (5!=HDwrite(fd, "hello", (size_t)5))
- goto quit;
- fsize = LFILE;
-
- /* Write a few bytes at 4GB */
- if (HDlseek(fd, 4*GB, SEEK_SET) != 4*GB)
- goto quit;
- if (5!=HDwrite(fd, "hello", (size_t)5))
- goto quit;
- fsize = XLFILE;
-
- /* If this supports sparse_file, write a few bytes at 32GB */
- if (!sparse_support)
- goto quit;
- if (HDlseek(fd, 32*GB, SEEK_SET) != 32*GB)
- goto quit;
- if (5!=HDwrite(fd, "hello", (size_t)5))
- goto quit;
- fsize = HUGEFILE;
-
- break;
- default:
- /* unknown or unsupported VFD */
+ if((fd=HDopen("y.h5", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0)
goto error;
- break;
- }
+
+ /* Write a few byte at the beginning */
+ if(5!=HDwrite(fd, "hello", (size_t)5))
+ goto quit;
+ fsize = SFILE;
+
+ /* Write a few bytes at 2GB */
+ if(HDlseek(fd, 2*GB, SEEK_SET)!=2*GB)
+ goto quit;
+ if(5!=HDwrite(fd, "hello", (size_t)5))
+ goto quit;
+ fsize = LFILE;
+
+ /* Write a few bytes at 4GB */
+ if(HDlseek(fd, 4*GB, SEEK_SET) != 4*GB)
+ goto quit;
+ if(5!=HDwrite(fd, "hello", (size_t)5))
+ goto quit;
+ fsize = XLFILE;
+
+ /* If this supports sparse_file, write a few bytes at 32GB */
+ if(!sparse_support)
+ goto quit;
+ if(HDlseek(fd, 32*GB, SEEK_SET) != 32*GB)
+ goto quit;
+ if(5!=HDwrite(fd, "hello", (size_t)5))
+ goto quit;
+ fsize = HUGEFILE;
quit:
- if (HDclose(fd) < 0)
+ if(HDclose(fd) < 0)
goto error;
- if (HDremove("y.h5") < 0)
+ if(HDremove("y.h5") < 0)
goto error;
- return(fsize);
+ return fsize;
error:
- if (fd >= 0){
+ if(fd >= 0){
HDclose(fd);
HDremove("y.h5");
}
- return (fsize);
+ return fsize;
}
@@ -301,11 +290,11 @@ enough_room(hid_t fapl)
/* Get file name template */
HDassert(H5FD_FAMILY==H5Pget_driver(fapl));
- h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
+ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
/* Create files */
for (i=0; i<NELMTS(fd); i++) {
- HDsnprintf(name, sizeof name, filename, i);
+ HDsnprintf(name, sizeof(name), filename, i);
if ((fd[i]=HDopen(name, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0) {
goto done;
}
@@ -320,7 +309,7 @@ enough_room(hid_t fapl)
done:
for (i=0; i<NELMTS(fd) && fd[i]>=0; i++) {
- HDsnprintf(name, sizeof name, filename, i);
+ HDsnprintf(name, sizeof(name), filename, i);
if(HDclose(fd[i]) < 0)
ret_value=0;
HDremove(name);
@@ -603,123 +592,138 @@ usage(void)
, (hsize_t)FAMILY_SIZE);
}
-
-
-/* Flush stdout at the end of this test routine to ensure later output to */
-/* stderr will not come out before it.*/
-int testvfd(vfd_t vfd)
+static int
+test_sec2(hid_t fapl)
{
- hid_t fapl=-1;
char filename[1024];
fsizes_t testsize;
+ testsize = supports_big();
+ if(testsize == NOFILE) {
+ HDfprintf(stdout, "Test for sec2 is skipped because file system does not support big files.\n");
+ goto quit;
+ }
+ /* Test big file with the SEC2 driver */
+ HDputs("Testing big file with the SEC2 Driver ");
- switch(vfd){
- case FAMILY_VFD:
- /* Test huge file with the family driver */
- HDputs("Testing big file with the Family Driver ");
- if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0)
- goto error;
+ h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
- if (H5Pset_fapl_family(fapl, family_size_def, H5P_DEFAULT) < 0)
- goto error;
+ if(writer(filename, fapl, testsize, WRT_N))
+ goto error;
+ if(reader(filename, fapl))
+ goto error;
- if (cflag){
- /*
- * We shouldn't run this test if the file system doesn't support holes
- * because we would generate multi-gigabyte files.
- */
- HDputs("Checking if file system is adequate for this test...");
- if (sizeof(long long)<8 || 0==GB8LL) {
- HDputs("Test skipped because sizeof(long long) is too small. This");
- HDputs("hardware apparently doesn't support 64-bit integer types.");
- usage();
- goto quit;
- }
- if (!sparse_support) {
- HDputs("Test skipped because file system does not support holes.");
- usage();
- goto quit;
- }
- if (!enough_room(fapl)) {
- HDputs("Test skipped because of quota (file size or num open files).");
- usage();
- goto quit;
- }
- }
+ HDputs("Test passed with the SEC2 Driver.");
- /* Do the test with the Family Driver */
- h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
+quit:
+ /* End with normal return code */
+ /* Clean up the test file */
+ if(h5_cleanup(FILENAME, fapl))
+ HDremove(DNAME);
+ return 0;
- if (writer(filename, fapl, HUGEFILE, WRT_N)) goto error;
- if (reader(filename, fapl)) goto error;
+error:
+ HDputs("*** TEST FAILED ***");
+ return 1;
+} /* end test_sec2() */
- HDputs("Test passed with the Family Driver.");
- break;
+static int
+test_stdio(hid_t fapl)
+{
+ char filename[1024];
+ fsizes_t testsize;
- case SEC2_VFD:
- testsize = supports_big(SEC2_VFD);
- if (testsize == NOFILE) {
- HDfprintf(stdout, "Test for sec2 is skipped because file system does not support big files.\n");
- goto quit;
- }
- /* Test big file with the SEC2 driver */
- HDputs("Testing big file with the SEC2 Driver ");
+ testsize = supports_big();
+ if(testsize == NOFILE) {
+ HDfprintf(stdout, "Test for stdio is skipped because file system does not support big files.\n");
+ goto quit;
+ }
+ HDputs("\nTesting big file with the STDIO Driver ");
- if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0)
- goto error;
- if(H5Pset_fapl_sec2(fapl) < 0)
- goto error;
+ h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
- h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
+ if(writer(filename, fapl, testsize, WRT_N))
+ goto error;
+ if(reader(filename, fapl))
+ goto error;
+ HDputs("Test passed with the STDIO Driver.");
- if (writer(filename, fapl, testsize, WRT_N)) goto error;
- if (reader(filename, fapl)) goto error;
+ /* Flush stdout at the end of this test routine to ensure later
+ * output to stderr will not come out before it.
+ */
- HDputs("Test passed with the SEC2 Driver.");
- break;
+quit:
+ /* End with normal return code */
+ /* Clean up the test file */
+ if(h5_cleanup(FILENAME, fapl))
+ HDremove(DNAME);
+ HDfflush(stdout);
+ return 0;
+
+error:
+ HDputs("*** TEST FAILED ***");
+ HDfflush(stdout);
+ return 1;
+} /* end test_stdio() */
- case STDIO_VFD:
- testsize = supports_big(STDIO_VFD);
- if (testsize == NOFILE) {
- HDfprintf(stdout, "Test for stdio is skipped because file system does not support big files.\n");
+static int
+test_family(hid_t fapl)
+{
+ char filename[1024];
+
+ /* Test huge file with the family driver */
+ HDputs("Testing big file with the Family Driver ");
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ goto error;
+
+ if(H5Pset_fapl_family(fapl, family_size_def, H5P_DEFAULT) < 0)
+ goto error;
+
+ if(cflag){
+ /*
+ * We shouldn't run this test if the file system doesn't support holes
+ * because we would generate multi-gigabyte files.
+ */
+ HDputs("Checking if file system is adequate for this test...");
+ if(sizeof(long long) < 8 || 0 == GB8LL) {
+ HDputs("Test skipped because sizeof(long long) is too small. This");
+ HDputs("hardware apparently doesn't support 64-bit integer types.");
+ usage();
goto quit;
}
- HDputs("\nTesting big file with the STDIO Driver ");
-
- if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0)
- goto error;
- if(H5Pset_fapl_stdio(fapl) < 0)
- goto error;
+ if(!sparse_support) {
+ HDputs("Test skipped because file system does not support holes.");
+ usage();
+ goto quit;
+ }
+ if(!enough_room(fapl)) {
+ HDputs("Test skipped because of quota (file size or num open files).");
+ usage();
+ goto quit;
+ }
+ }
- h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
+ /* Do the test with the Family Driver */
+ h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- if (writer(filename, fapl, testsize, WRT_N)) goto error;
- if (reader(filename, fapl)) goto error;
- HDputs("Test passed with the STDIO Driver.");
- break;
+ if(writer(filename, fapl, HUGEFILE, WRT_N))
+ goto error;
+ if(reader(filename, fapl))
+ goto error;
- default:
- HDputs("Unsupprted VFD");
- usage();
- goto error;;
- } /* end of switch (vfd) */
+ HDputs("Test passed with the Family Driver.");
quit:
/* End with normal return code */
/* Clean up the test file */
- if (h5_cleanup(FILENAME, fapl)) HDremove(DNAME);
- HDfflush(stdout);
+ if(h5_cleanup(FILENAME, fapl))
+ HDremove(DNAME);
return 0;
-
error:
- if (fapl>=0) H5Pclose(fapl);
HDputs("*** TEST FAILED ***");
- HDfflush(stdout);
return 1;
-}
-
+} /* end test_family() */
/*-------------------------------------------------------------------------
@@ -749,6 +753,8 @@ int
main (int ac, char **av)
{
unsigned long seed = 0; /* Random # seed */
+ hid_t fapl = -1;
+ hid_t driver = -1;
/* parameters setup */
@@ -779,11 +785,16 @@ main (int ac, char **av)
}
}
+ /* check VFD to see if this is one we test */
+ if((fapl = h5_fileaccess()) < 0)
+ goto error;
+ if((driver = H5Pget_driver(fapl)) < 0)
+ goto error;
+
/* check sparse file support unless cflag is not set. */
- if (cflag)
+ if(cflag)
sparse_support = is_sparse();
-
/* Choose random # seed */
seed = (unsigned long)HDtime(NULL);
#ifdef QAK
@@ -792,19 +803,30 @@ main (int ac, char **av)
#endif /* QAK */
HDsrandom(seed);
- /*=================================================*/
- if (testvfd(FAMILY_VFD) != 0)
- goto error;
- if (testvfd(SEC2_VFD) != 0)
- goto error;
- if (testvfd(STDIO_VFD) != 0)
- goto error;
+ /* run VFD-specific test */
+ if(H5FD_SEC2 == driver) {
+ if(test_sec2(fapl) != 0)
+ goto error;
+ }
+ else if(H5FD_STDIO == driver) {
+ if(test_stdio(fapl) != 0)
+ goto error;
+ }
+ else if(H5FD_FAMILY == driver) {
+ if(test_family(fapl) != 0)
+ goto error;
+ }
+ else
+ HDputs("This VFD is not supported");
/* End with normal exit code */
+ /* fapls are cleaned up in the vfd test code */
return 0;
error:
HDputs("*** TEST FAILED ***");
+ if(fapl > 0)
+ H5Pclose(fapl);
return 1;
}
diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c
index 433c488..b3d17dc 100644
--- a/test/cmpd_dset.c
+++ b/test/cmpd_dset.c
@@ -614,7 +614,7 @@ test_compound (char *filename, hid_t fapl)
if ((s8_m_sid = H5Screate_simple (2, h_size, NULL)) < 0) goto error;
/* Read the dataset */
- s8 = (s1_t *) calloc ((size_t)(h_size[0]*h_size[1]), sizeof(s1_t));
+ s8 = (s1_t *) HDcalloc ((size_t)(h_size[0]*h_size[1]), sizeof(s1_t));
assert (s8);
if (H5Dread (dataset, s1_tid, s8_m_sid, s8_f_sid, H5P_DEFAULT, s8) < 0) {
goto error;
@@ -641,7 +641,7 @@ test_compound (char *filename, hid_t fapl)
}
}
- free (s8);
+ HDfree (s8);
s8 = NULL;
PASSED();
@@ -781,7 +781,7 @@ test_compound (char *filename, hid_t fapl)
f_offset[1] = NY/3;
h_size[0] = 2*NX/3 - f_offset[0];
h_size[1] = 2*NY/3 - f_offset[1];
- s11 = (s4_t *) malloc ((size_t)h_size[0]*(size_t)h_size[1]*sizeof(s4_t));
+ s11 = (s4_t *) HDmalloc ((size_t)h_size[0]*(size_t)h_size[1]*sizeof(s4_t));
assert (s11);
/* Initialize */
@@ -793,7 +793,7 @@ test_compound (char *filename, hid_t fapl)
if (H5Dwrite (dataset, s4_tid, s8_m_sid, s8_f_sid, PRESERVE, s11) < 0) {
goto error;
}
- free (s11);
+ HDfree (s11);
s11=NULL;
/* Read the whole thing */
@@ -1380,12 +1380,12 @@ test_hdf5_src_subset(char *filename, hid_t fapl)
goto error;
/* Allocate space and initialize data */
- orig = (unsigned char*)malloc(NX * NY * sizeof(stype1));
+ orig = (unsigned char*)HDmalloc(NX * NY * sizeof(stype1));
initialize_stype1(orig, (size_t)NX*NY);
- rbuf = (unsigned char*)malloc(NX * NY * sizeof(stype2));
+ rbuf = (unsigned char*)HDmalloc(NX * NY * sizeof(stype2));
- rew_buf = (unsigned char*)malloc(NX * NY * sizeof(stype3));
+ rew_buf = (unsigned char*)HDmalloc(NX * NY * sizeof(stype3));
initialize_stype3(rew_buf, (size_t)NX*NY);
@@ -1515,9 +1515,9 @@ test_hdf5_src_subset(char *filename, hid_t fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- free(orig);
- free(rbuf);
- free(rew_buf);
+ HDfree(orig);
+ HDfree(rbuf);
+ HDfree(rew_buf);
PASSED();
return 0;
@@ -1585,12 +1585,12 @@ test_hdf5_dst_subset(char *filename, hid_t fapl)
goto error;
/* Allocate space and initialize data */
- orig = (unsigned char*)malloc(NX * NY * sizeof(stype2));
+ orig = (unsigned char*)HDmalloc(NX * NY * sizeof(stype2));
initialize_stype2(orig, (size_t)NX*NY);
- rbuf = (unsigned char*)malloc(NX * NY * sizeof(stype1));
+ rbuf = (unsigned char*)HDmalloc(NX * NY * sizeof(stype1));
- rew_buf = (unsigned char*)malloc(NX * NY * sizeof(stype4));
+ rew_buf = (unsigned char*)HDmalloc(NX * NY * sizeof(stype4));
initialize_stype4(rew_buf, (size_t)NX*NY);
/* Create dataset creation property list */
@@ -1719,9 +1719,9 @@ test_hdf5_dst_subset(char *filename, hid_t fapl)
if(H5Fclose(file) < 0)
goto error;
- free(orig);
- free(rbuf);
- free(rew_buf);
+ HDfree(orig);
+ HDfree(rbuf);
+ HDfree(rew_buf);
PASSED();
return 0;
diff --git a/test/dsets.c b/test/dsets.c
index 736c5da..245b993 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -565,7 +565,7 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl)
HDclose(f);
- free (tconv_buf);
+ HDfree (tconv_buf);
PASSED();
} /* end if */
else {
@@ -1936,13 +1936,13 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if(H5Dclose (dataset) < 0) goto error;
if(H5Sclose (sid) < 0) goto error;
if(H5Pclose (dxpl) < 0) goto error;
- free (tconv_buf);
+ HDfree (tconv_buf);
return(0);
error:
if(tconv_buf)
- free (tconv_buf);
+ HDfree (tconv_buf);
return -1;
}
@@ -6621,7 +6621,7 @@ auxread_fdata(hid_t fid, const char *name)
if(H5Dclose(dset_id) < 0)
goto error;
if(buf)
- free(buf);
+ HDfree(buf);
return 0;
@@ -6633,7 +6633,7 @@ error:
H5Tclose(ftype_id);
H5Tclose(mtype_id);
if(buf)
- free(buf);
+ HDfree(buf);
} H5E_END_TRY;
return -1;
}
diff --git a/test/dt_arith.c b/test/dt_arith.c
index 9f003a6..c3692d0 100644
--- a/test/dt_arith.c
+++ b/test/dt_arith.c
@@ -296,8 +296,8 @@ static int without_hardware_g = 0;
HDmemset(BUF, 0, NELMTS*MAX(SRC_SIZE, DST_SIZE)); \
HDmemset(SAVED, 0, NELMTS*MAX(SRC_SIZE, DST_SIZE)); \
\
- tmp1 = (unsigned char*)calloc((size_t)1, (size_t)SRC_SIZE); \
- tmp2 = (unsigned char*)calloc((size_t)1, (size_t)SRC_SIZE); \
+ tmp1 = (unsigned char*)HDcalloc((size_t)1, (size_t)SRC_SIZE); \
+ tmp2 = (unsigned char*)HDcalloc((size_t)1, (size_t)SRC_SIZE); \
\
buf_p = BUF; \
saved_p = SAVED; \
@@ -325,8 +325,8 @@ static int without_hardware_g = 0;
buf_p += SRC_SIZE; \
saved_p += SRC_SIZE; \
} \
- free(tmp1); \
- free(tmp2); \
+ HDfree(tmp1); \
+ HDfree(tmp2); \
}
/* Allocate buffer and initialize it with floating-point special values, +/-0, +/-infinity,
@@ -348,7 +348,7 @@ static int without_hardware_g = 0;
SAVED = (unsigned char*)aligned_malloc( NELMTS*MAX(SRC_SIZE, DST_SIZE)); \
HDmemset(BUF, 0, NELMTS*MAX(SRC_SIZE, DST_SIZE)); \
HDmemset(SAVED, 0, NELMTS*MAX(SRC_SIZE, DST_SIZE)); \
- value = (unsigned char*)calloc(SRC_SIZE, sizeof(unsigned char)); \
+ value = (unsigned char*)HDcalloc(SRC_SIZE, sizeof(unsigned char)); \
\
buf_p = BUF; \
\
@@ -391,7 +391,7 @@ static int without_hardware_g = 0;
} \
\
HDmemcpy(SAVED, BUF, NELMTS*MAX(SRC_SIZE, DST_SIZE)); \
- free(value); \
+ HDfree(value); \
}
void some_dummy_func(float x);
@@ -751,8 +751,8 @@ static int test_particular_fp_integer(void)
endian = H5Tget_order(H5T_NATIVE_DOUBLE);
src_size1 = H5Tget_size(H5T_NATIVE_DOUBLE);
dst_size1 = H5Tget_size(H5T_NATIVE_SCHAR);
- buf1 = (unsigned char*)calloc((size_t)1, (size_t)MAX(src_size1, dst_size1));
- saved_buf1 = (unsigned char*)calloc((size_t)1, (size_t)MAX(src_size1, dst_size1));
+ buf1 = (unsigned char*)HDcalloc((size_t)1, (size_t)MAX(src_size1, dst_size1));
+ saved_buf1 = (unsigned char*)HDcalloc((size_t)1, (size_t)MAX(src_size1, dst_size1));
memcpy(buf1, &src_d, src_size1);
memcpy(saved_buf1, &src_d, src_size1);
@@ -801,8 +801,8 @@ static int test_particular_fp_integer(void)
/* Test conversion from float (the value is INT_MAX) to int. */
src_size2 = H5Tget_size(H5T_NATIVE_FLOAT);
dst_size2 = H5Tget_size(H5T_NATIVE_INT);
- buf2 = (unsigned char*)calloc((size_t)1, (size_t)MAX(src_size2, dst_size2));
- saved_buf2 = (unsigned char*)calloc((size_t)1, (size_t)MAX(src_size2, dst_size2));
+ buf2 = (unsigned char*)HDcalloc((size_t)1, (size_t)MAX(src_size2, dst_size2));
+ saved_buf2 = (unsigned char*)HDcalloc((size_t)1, (size_t)MAX(src_size2, dst_size2));
HDmemcpy(buf2, &src_f, src_size2);
HDmemcpy(saved_buf2, &src_f, src_size2);
@@ -852,13 +852,13 @@ static int test_particular_fp_integer(void)
}
if(buf1)
- free(buf1);
+ HDfree(buf1);
if(buf2)
- free(buf2);
+ HDfree(buf2);
if(saved_buf1)
- free(saved_buf1);
+ HDfree(saved_buf1);
if(saved_buf2)
- free(saved_buf2);
+ HDfree(saved_buf2);
PASSED();
return 0;
@@ -869,13 +869,13 @@ error:
H5Pclose(dxpl_id);
} H5E_END_TRY;
if(buf1)
- free(buf1);
+ HDfree(buf1);
if(buf2)
- free(buf2);
+ HDfree(buf2);
if(saved_buf1)
- free(saved_buf1);
+ HDfree(saved_buf1);
if(saved_buf2)
- free(saved_buf2);
+ HDfree(saved_buf2);
reset_hdf5(); /*print statistics*/
return MAX((int)fails_this_test, 1);
@@ -1044,11 +1044,11 @@ test_derived_flt(void)
*/
src_size = H5Tget_size(H5T_NATIVE_INT);
endian = H5Tget_order(H5T_NATIVE_INT);
- buf = (unsigned char*)malloc(nelmts * (MAX(src_size, size)));
- saved_buf = (unsigned char*)malloc(nelmts * src_size);
+ buf = (unsigned char*)HDmalloc(nelmts * (MAX(src_size, size)));
+ saved_buf = (unsigned char*)HDmalloc(nelmts * src_size);
HDmemset(buf, 0, nelmts * MAX(src_size, size));
HDmemset(saved_buf, 0, nelmts * src_size);
- aligned = (int*)calloc((size_t)1, src_size);
+ aligned = (int*)HDcalloc((size_t)1, src_size);
for(i = 0; i < nelmts * src_size; i++)
buf[i] = saved_buf[i] = HDrand();
@@ -1105,9 +1105,9 @@ test_derived_flt(void)
}
fails_this_test = 0;
- free(buf);
- free(saved_buf);
- free(aligned);
+ HDfree(buf);
+ HDfree(saved_buf);
+ HDfree(aligned);
buf = NULL;
saved_buf = NULL;
aligned = NULL;
@@ -1204,8 +1204,8 @@ test_derived_flt(void)
src_size = H5Tget_size(tid2);
dst_size = H5Tget_size(tid1);
endian = H5Tget_order(tid2);
- buf = (unsigned char*)malloc(nelmts*(MAX(src_size, dst_size)));
- saved_buf = (unsigned char*)malloc(nelmts*src_size);
+ buf = (unsigned char*)HDmalloc(nelmts*(MAX(src_size, dst_size)));
+ saved_buf = (unsigned char*)HDmalloc(nelmts*src_size);
HDmemset(buf, 0, nelmts*MAX(src_size, dst_size));
HDmemset(saved_buf, 0, nelmts*src_size);
@@ -1268,8 +1268,8 @@ test_derived_flt(void)
}
}
- if (buf) free(buf);
- if (saved_buf) free(saved_buf);
+ if (buf) HDfree(buf);
+ if (saved_buf) HDfree(saved_buf);
if(H5Tclose(tid1) < 0) {
H5_FAILED();
@@ -1301,9 +1301,9 @@ test_derived_flt(void)
return 0;
error:
- if (buf) free(buf);
- if (saved_buf) free(saved_buf);
- if (aligned) free(aligned);
+ if (buf) HDfree(buf);
+ if (saved_buf) HDfree(saved_buf);
+ if (aligned) HDfree(aligned);
HDfflush(stdout);
H5E_BEGIN_TRY {
H5Tclose (tid1);
@@ -1594,8 +1594,8 @@ test_derived_integer(void)
goto error;
} /* end if */
- free(buf);
- free(saved_buf);
+ HDfree(buf);
+ HDfree(saved_buf);
PASSED();
reset_hdf5(); /*print statistics*/
@@ -1603,8 +1603,8 @@ test_derived_integer(void)
return 0;
error:
- if (buf) free(buf);
- if (saved_buf) free(saved_buf);
+ if (buf) HDfree(buf);
+ if (saved_buf) HDfree(saved_buf);
HDfflush(stdout);
H5E_BEGIN_TRY {
H5Tclose (tid1);
@@ -2781,7 +2781,7 @@ my_isinf(int endian, unsigned char *val, size_t size,
int retval = 0;
size_t i;
- bits = (unsigned char*)calloc((size_t)1, size);
+ bits = (unsigned char*)HDcalloc((size_t)1, size);
#ifdef H5_VMS
if(H5T_ORDER_VAX==endian) {
@@ -2805,7 +2805,7 @@ my_isinf(int endian, unsigned char *val, size_t size,
H5T__bit_find(bits, epos, esize, H5T_BIT_LSB, 0) < 0)
retval = 1;
- free(bits);
+ HDfree(bits);
return retval;
}
diff --git a/test/dtypes.c b/test/dtypes.c
index de64713..5826097 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -697,9 +697,9 @@ test_compound_2(void)
FAIL_STACK_ERROR
/* Sizes should be the same, but be careful just in case */
- buf = (unsigned char*)malloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt)));
- bkg = (unsigned char*)malloc(nelmts * sizeof(struct dt));
- orig = (unsigned char*)malloc(nelmts * sizeof(struct st));
+ buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt)));
+ bkg = (unsigned char*)HDmalloc(nelmts * sizeof(struct dt));
+ orig = (unsigned char*)HDmalloc(nelmts * sizeof(struct st));
for (i=0; i<(int)nelmts; i++) {
s_ptr = ((struct st*)orig) + i;
s_ptr->a = i*8+0;
@@ -762,9 +762,9 @@ test_compound_2(void)
}
/* Release resources */
- free(buf);
- free(bkg);
- free(orig);
+ HDfree(buf);
+ HDfree(bkg);
+ HDfree(orig);
CHECK_NMEMBS(nmembs , st, dt)
PASSED();
@@ -818,9 +818,9 @@ test_compound_3(void)
FAIL_STACK_ERROR
/* Initialize */
- buf = (unsigned char*)malloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt)));
- bkg = (unsigned char*)malloc(nelmts * sizeof(struct dt));
- orig = (unsigned char*)malloc(nelmts * sizeof(struct st));
+ buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt)));
+ bkg = (unsigned char*)HDmalloc(nelmts * sizeof(struct dt));
+ orig = (unsigned char*)HDmalloc(nelmts * sizeof(struct st));
for (i=0; i<(int)nelmts; i++) {
s_ptr = ((struct st*)orig) + i;
s_ptr->a = i*8+0;
@@ -880,9 +880,9 @@ test_compound_3(void)
}
/* Release resources */
- free(buf);
- free(bkg);
- free(orig);
+ HDfree(buf);
+ HDfree(bkg);
+ HDfree(orig);
CHECK_NMEMBS(nmembs, st, dt)
PASSED();
@@ -940,9 +940,9 @@ test_compound_4(void)
FAIL_STACK_ERROR
/* Sizes should be the same, but be careful just in case */
- buf = (unsigned char*)malloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt)));
- bkg = (unsigned char*)malloc(nelmts * sizeof(struct dt));
- orig = (unsigned char*)malloc(nelmts * sizeof(struct st));
+ buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt)));
+ bkg = (unsigned char*)HDmalloc(nelmts * sizeof(struct dt));
+ orig = (unsigned char*)HDmalloc(nelmts * sizeof(struct st));
for (i=0; i<(int)nelmts; i++) {
s_ptr = ((struct st*)orig) + i;
s_ptr->a = i*8+0;
@@ -1006,9 +1006,9 @@ test_compound_4(void)
}
/* Release resources */
- free(buf);
- free(bkg);
- free(orig);
+ HDfree(buf);
+ HDfree(bkg);
+ HDfree(orig);
CHECK_NMEMBS(nmembs, st, dt)
PASSED();
@@ -1175,9 +1175,9 @@ test_compound_6(void)
FAIL_STACK_ERROR
/* Sizes should be the same, but be careful just in case */
- buf = (unsigned char*)malloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt)));
- bkg = (unsigned char*)malloc(nelmts * sizeof(struct dt));
- orig = (unsigned char*)malloc(nelmts * sizeof(struct st));
+ buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt)));
+ bkg = (unsigned char*)HDmalloc(nelmts * sizeof(struct dt));
+ orig = (unsigned char*)HDmalloc(nelmts * sizeof(struct st));
for (i=0; i<(int)nelmts; i++) {
s_ptr = ((struct st*)orig) + i;
s_ptr->b = (i*8+1) & 0x7fff;
@@ -1223,9 +1223,9 @@ test_compound_6(void)
}
/* Release resources */
- free(buf);
- free(bkg);
- free(orig);
+ HDfree(buf);
+ HDfree(bkg);
+ HDfree(orig);
CHECK_NMEMBS(nmembs, st, dt)
PASSED();
@@ -1790,7 +1790,7 @@ test_compound_9(void)
} /* end if */
rdata.i1 = rdata.i2 = 0;
- if(rdata.str) free(rdata.str);
+ if(rdata.str) HDfree(rdata.str);
if(H5Dread(dset_id, dup_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) {
H5_FAILED(); AT();
@@ -1804,7 +1804,7 @@ test_compound_9(void)
goto error;
} /* end if */
- if(rdata.str) free(rdata.str);
+ if(rdata.str) HDfree(rdata.str);
if(H5Dclose(dset_id) < 0)
goto error;
@@ -1983,10 +1983,10 @@ test_compound_10(void)
goto error;
}
- free(t1);
- free(t2);
- free(wdata[i].str);
- free(rdata[i].str);
+ HDfree(t1);
+ HDfree(t2);
+ HDfree(wdata[i].str);
+ HDfree(rdata[i].str);
} /* end for */
if(H5Dclose(dset_id) < 0)
@@ -4547,7 +4547,7 @@ test_conv_enum_2(void)
H5Tenum_insert(dsttype, mname[i], &i);
/* Source data */
- data = (int*)malloc(NTESTELEM*sizeof(int));
+ data = (int*)HDmalloc(NTESTELEM*sizeof(int));
for (i=0; i<NTESTELEM; i++) {
((char*)data)[i*3+2] = (char)(i % 8);
((char*)data)[i*3+0] = 0;
@@ -4569,7 +4569,7 @@ test_conv_enum_2(void)
}
/* Cleanup */
- free(data);
+ HDfree(data);
H5Tclose(srctype);
H5Tclose(dsttype);
H5Tclose(oddsize);
@@ -5387,7 +5387,7 @@ test_encode(void)
printf("Can't close datatype\n");
goto error;
} /* end if */
- free(cmpd_buf);
+ HDfree(cmpd_buf);
cmpd_buf_size = 0;
/* Commit enumeration datatype and close it */
@@ -5406,7 +5406,7 @@ test_encode(void)
printf("Can't close datatype\n");
goto error;
} /* end if */
- free(enum_buf);
+ HDfree(enum_buf);
enum_buf_size = 0;
/* Commit enumeration datatype and close it */
@@ -5425,7 +5425,7 @@ test_encode(void)
printf("Can't close datatype\n");
goto error;
} /* end if */
- free(vlstr_buf);
+ HDfree(vlstr_buf);
vlstr_buf_size = 0;
/* Open the dataytpe for query */
@@ -5543,7 +5543,7 @@ test_encode(void)
printf("Can't decode VL string type\n");
goto error;
} /* end if */
- free(vlstr_buf);
+ HDfree(vlstr_buf);
/* Verify that the datatype was copied exactly */
if(H5Tequal(decoded_tid3, tid3)<=0) {
@@ -5656,8 +5656,8 @@ test_encode(void)
goto error;
} /* end if */
- free(cmpd_buf);
- free(enum_buf);
+ HDfree(cmpd_buf);
+ HDfree(enum_buf);
PASSED();
return 0;
@@ -7062,7 +7062,7 @@ test_utf_ascii_conv(void)
char *ascii_r = NULL;
const char *ascii_w = "bar!";
char *utf8_r = NULL;
-
+ char filename[1024];
char ascii2[4], utf8_2[4];
herr_t status;
@@ -7095,7 +7095,8 @@ test_utf_ascii_conv(void)
FAIL_STACK_ERROR
/* Create a file */
- if((fid = H5Fcreate(FILENAME[10], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ h5_fixname(FILENAME[10], H5P_DEFAULT, filename, sizeof filename);
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Create a scalar dataspace for the dataset */
if((sid = H5Screate(H5S_SCALAR)) < 0) FAIL_STACK_ERROR
diff --git a/test/h5test.c b/test/h5test.c
index 32d78bd..30a3adf 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -751,7 +751,7 @@ h5_set_info_object(void)
/* copy key/value pair into temporary buffer */
len = strcspn(valp, ";");
next = &valp[len];
- key_val = (char *)calloc(1, len + 1);
+ key_val = (char *)HDcalloc(1, len + 1);
/* increment the next pointer past the terminating semicolon */
if (*next == ';')
diff --git a/test/ntypes.c b/test/ntypes.c
index 0af3a3f..c52c08f 100644
--- a/test/ntypes.c
+++ b/test/ntypes.c
@@ -2605,7 +2605,7 @@ test_bitfield_dtype(hid_t file)
if((ntype_size = H5Tget_size(native_type)) == 0) TEST_ERROR;
- rbuf = malloc((size_t)nelmts*ntype_size);
+ rbuf = HDmalloc((size_t)nelmts*ntype_size);
/* Read the data and compare them */
if(H5Dread(dataset1, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) TEST_ERROR;
@@ -2624,7 +2624,7 @@ test_bitfield_dtype(hid_t file)
if(H5Tclose(dtype) < 0) TEST_ERROR;
if(H5Tclose(native_type) < 0) TEST_ERROR;
if(H5Dclose(dataset1) < 0) TEST_ERROR;
- if(rbuf) free(rbuf);
+ if(rbuf) HDfree(rbuf);
/* Open dataset2 again to check H5Tget_native_type */
if((dataset2 = H5Dopen2(file, DSET2_BITFIELD_NAME, H5P_DEFAULT)) < 0) TEST_ERROR;
diff --git a/test/tarray.c b/test/tarray.c
index 299c74e..e3999bb 100644
--- a/test/tarray.c
+++ b/test/tarray.c
@@ -637,7 +637,7 @@ test_array_compound_atomic(void)
CHECK(mname, NULL, "H5Tget_member_name");
if(HDstrcmp(mname, "i") != 0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n", mname);
- free(mname);
+ HDfree(mname);
/* Check the 1st field's offset */
off = H5Tget_member_offset(tid2, 0);
@@ -656,7 +656,7 @@ test_array_compound_atomic(void)
CHECK(mname, NULL, "H5Tget_member_name");
if(HDstrcmp(mname, "f") != 0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n", mname);
- free(mname);
+ HDfree(mname);
/* Check the 2nd field's offset */
off = H5Tget_member_offset(tid2, 1);
@@ -849,7 +849,7 @@ test_array_compound_array(void)
CHECK(mname, NULL, "H5Tget_member_name");
if(HDstrcmp(mname,"i")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- free(mname);
+ HDfree(mname);
/* Check the 1st field's offset */
off=H5Tget_member_offset(tid2,0);
@@ -868,7 +868,7 @@ test_array_compound_array(void)
CHECK(mname, NULL, "H5Tget_member_name");
if(HDstrcmp(mname,"f")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- free(mname);
+ HDfree(mname);
/* Check the 2nd field's offset */
off=H5Tget_member_offset(tid2,1);
@@ -1041,7 +1041,7 @@ test_array_vlen_atomic(void)
/* Initialize array data to write */
for(i=0; i<SPACE1_DIM1; i++)
for(j=0; j<ARRAY1_DIM1; j++) {
- wdata[i][j].p=malloc((i+j+1)*sizeof(unsigned int));
+ wdata[i][j].p=HDmalloc((i+j+1)*sizeof(unsigned int));
wdata[i][j].len=i+j+1;
for(k=0; k<(i+j+1); k++)
((unsigned int *)wdata[i][j].p)[k]=i*100+j*10+k;
@@ -1252,7 +1252,7 @@ test_array_vlen_array(void)
/* Initialize array data to write */
for(i=0; i<SPACE1_DIM1; i++)
for(j=0; j<ARRAY1_DIM1; j++) {
- wdata[i][j].p=malloc((i+j+1)*(sizeof(unsigned int)*ARRAY1_DIM1));
+ wdata[i][j].p=HDmalloc((i+j+1)*(sizeof(unsigned int)*ARRAY1_DIM1));
wdata[i][j].len=i+j+1;
for(k=0; k<(i+j+1); k++)
for(l=0; l<ARRAY1_DIM1; l++)
@@ -1633,7 +1633,7 @@ test_array_bkg(void)
/* Release memory resources */
/* ------------------------ */
for (i = 0; i < dtsinfo.nsubfields; i++)
- free(dtsinfo.name[i]);
+ HDfree(dtsinfo.name[i]);
/* Release IDs */
@@ -1848,7 +1848,7 @@ test_compat(void)
CHECK(mname, NULL, "H5Tget_member_name");
if(HDstrcmp(mname,"i")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- free(mname);
+ HDfree(mname);
/* Check the 1st field's offset */
off=H5Tget_member_offset(tid1,0);
@@ -1867,7 +1867,7 @@ test_compat(void)
CHECK(mname, NULL, "H5Tget_member_name");
if(HDstrcmp(mname,"f")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- free(mname);
+ HDfree(mname);
/* Check the 2nd field's offset */
off=H5Tget_member_offset(tid1,1);
@@ -1886,7 +1886,7 @@ test_compat(void)
CHECK(mname, NULL, "H5Tget_member_name");
if(HDstrcmp(mname,"l")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- free(mname);
+ HDfree(mname);
/* Check the 3rd field's offset */
off=H5Tget_member_offset(tid1,2);
@@ -1930,7 +1930,7 @@ test_compat(void)
CHECK(mname, NULL, "H5Tget_member_name");
if(mname && HDstrcmp(mname,"i")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- if(mname) free(mname);
+ if(mname) HDfree(mname);
/* Check the 1st field's offset */
off=H5Tget_member_offset(tid1,0);
@@ -1949,7 +1949,7 @@ test_compat(void)
CHECK(mname, NULL, "H5Tget_member_name");
if(mname && HDstrcmp(mname,"f")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- if(mname) free(mname);
+ if(mname) HDfree(mname);
/* Check the 2nd field's offset */
off=H5Tget_member_offset(tid1,1);
@@ -1994,7 +1994,7 @@ test_compat(void)
CHECK(mname, NULL, "H5Tget_member_name");
if(mname && HDstrcmp(mname,"l")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- if(mname) free(mname);
+ if(mname) HDfree(mname);
/* Check the 3rd field's offset */
off=H5Tget_member_offset(tid1,2);
@@ -2039,7 +2039,7 @@ test_compat(void)
CHECK(mname, NULL, "H5Tget_member_name");
if(mname && HDstrcmp(mname,"d")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- if(mname) free(mname);
+ if(mname) HDfree(mname);
/* Check the 4th field's offset */
off=H5Tget_member_offset(tid1,3);
diff --git a/test/tattr.c b/test/tattr.c
index 1285f0e..a5a61bc 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -829,7 +829,7 @@ test_attr_compound_read(hid_t fapl)
HDstrcmp(fieldname, ATTR4_FIELDNAME2) ||
HDstrcmp(fieldname, ATTR4_FIELDNAME3)))
TestErrPrintf("invalid field name for field #%d: %s\n", i, fieldname);
- free(fieldname);
+ HDfree(fieldname);
} /* end for */
offset = H5Tget_member_offset(type, 0);
VERIFY(offset, attr4_field1_off, "H5Tget_member_offset");
diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in
index 569e938..b268661 100644
--- a/test/test_plugin.sh.in
+++ b/test/test_plugin.sh.in
@@ -89,5 +89,6 @@ else
fi
# Clean up temporary files/directories and leave
-$RM $PLUGIN_LIBDIR2
+$RM $PLUGIN_LIBDIR1 $PLUGIN_LIBDIR2
+
exit $exit_code
diff --git a/test/tfile.c b/test/tfile.c
index 7ea50c6..1f20368 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -1044,6 +1044,40 @@ test_get_obj_ids(void)
H5Fclose(fid);
HDfree(oid_list);
+
+ /* Reopen the file to check whether H5Fget_obj_count and H5Fget_obj_ids still works
+ * when the file is closed first */
+ fid = H5Fopen(FILE7, H5F_ACC_RDONLY, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fopen");
+
+ /* Open NDSETS datasets under the root group */
+ for(n = 0; n < NDSETS; n++) {
+ sprintf(dname, "dataset%d", n);
+ dset[n] = H5Dopen2(fid, dname, H5P_DEFAULT);
+ CHECK(dset[n], FAIL, "H5Dcreate2");
+ }
+
+ /* Close the file first */
+ H5Fclose(fid);
+
+ /* Get the number of all opened objects */
+ oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ALL);
+ CHECK(oid_count, FAIL, "H5Fget_obj_count");
+ VERIFY(oid_count, NDSETS, "H5Fget_obj_count");
+
+ oid_list = (hid_t *)HDcalloc((size_t)oid_count, sizeof(hid_t));
+ CHECK(oid_list, NULL, "HDcalloc");
+
+ /* Get the list of all opened objects */
+ ret_count = H5Fget_obj_ids(H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list);
+ CHECK(ret_count, FAIL, "H5Fget_obj_ids");
+ VERIFY(ret_count, NDSETS, "H5Fget_obj_count");
+
+ /* Close all open objects with H5Oclose */
+ for(n = 0; n < oid_count; n++)
+ H5Oclose(oid_list[n]);
+
+ HDfree(oid_list);
}
/****************************************************************
diff --git a/test/tgenprop.c b/test/tgenprop.c
index f304f11..5f8d8f5 100644
--- a/test/tgenprop.c
+++ b/test/tgenprop.c
@@ -88,7 +88,7 @@ test_genprop_basic_class(void)
CHECK_PTR(name, "H5Pget_class_name");
if(HDstrcmp(name,CLASS1_NAME)!=0)
TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n",name,CLASS1_NAME);
- free(name);
+ HDfree(name);
/* Check class parent */
cid2 = H5Pget_class_parent(cid1);
@@ -119,7 +119,7 @@ test_genprop_basic_class(void)
CHECK_PTR(name, "H5Pget_class_name");
if(HDstrcmp(name,CLASS2_NAME)!=0)
TestErrPrintf("Class names don't match!, name=%s, CLASS2_NAME=%s\n",name,CLASS2_NAME);
- free(name);
+ HDfree(name);
/* Check class parent */
cid2 = H5Pget_class_parent(cid1);
@@ -1818,7 +1818,7 @@ test_genprop_path(void)
VERIFY(ret, 1, "H5Pequal");
/* Release the path string */
- free(path);
+ HDfree(path);
/* Close class */
ret = H5Pclose_class(cid3);
diff --git a/test/tid.c b/test/tid.c
index 87f3d37..4ea45db 100644
--- a/test/tid.c
+++ b/test/tid.c
@@ -81,13 +81,13 @@ static int basic_id_test(void)
/* Register an ID and retrieve the object it points to.
* Once the ID has been registered, testObj will be freed when
* its ID type is destroyed. */
- testObj = malloc(7 * sizeof(int));
+ testObj = HDmalloc(7 * sizeof(int));
arrayID = H5Iregister(myType, testObj);
CHECK(arrayID, H5I_INVALID_HID, "H5Iregister");
if(arrayID == H5I_INVALID_HID)
{
- free(testObj);
+ HDfree(testObj);
goto out;
}
@@ -175,13 +175,13 @@ static int basic_id_test(void)
* freed when the previous type was destroyed. Allocate new
* memory for it.
*/
- testObj = malloc(7 * sizeof(int));
+ testObj = HDmalloc(7 * sizeof(int));
arrayID = H5Iregister(myType, testObj);
CHECK(arrayID, H5I_INVALID_HID, "H5Iregister");
if(arrayID == H5I_INVALID_HID)
{
- free(testObj);
+ HDfree(testObj);
goto out;
}
@@ -250,7 +250,7 @@ static int id_predefined_test(void )
void * testPtr;
herr_t testErr;
- testObj = malloc(sizeof(int));
+ testObj = HDmalloc(sizeof(int));
/* Try to perform illegal functions on various predefined types */
H5E_BEGIN_TRY
@@ -319,14 +319,14 @@ static int id_predefined_test(void )
/* testObj was never registered as an atom, so it will not be
* automatically freed. */
- free(testObj);
+ HDfree(testObj);
return 0;
out:
if(typeID != H5I_INVALID_HID)
H5Tclose(typeID);
if(testObj != NULL)
- free(testObj);
+ HDfree(testObj);
return -1;
}
diff --git a/test/tmisc.c b/test/tmisc.c
index 6fcf557..512d029 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -1677,7 +1677,7 @@ test_misc8(void)
/* Free the read & write buffers */
HDfree(wdata);
#ifdef VERIFY_DATA
- free(rdata);
+ HDfree(rdata);
#endif /* VERIFY_DATA */
} /* end test_misc8() */
diff --git a/test/trefer.c b/test/trefer.c
index 9031fdb..698e95a 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -90,9 +90,9 @@ test_reference_params(void)
MESSAGE(5, ("Testing Reference Parameters\n"));
/* Allocate write & read buffers */
- wbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
- rbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
- tbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
+ wbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
+ rbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
+ tbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
/* Create file */
fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -234,9 +234,9 @@ test_reference_params(void)
CHECK(ret, FAIL, "H5Fclose");
/* Free memory buffers */
- free(wbuf);
- free(rbuf);
- free(tbuf);
+ HDfree(wbuf);
+ HDfree(rbuf);
+ HDfree(tbuf);
} /* test_reference_obj() */
/****************************************************************
@@ -271,9 +271,9 @@ test_reference_obj(void)
MESSAGE(5, ("Testing Object Reference Functions\n"));
/* Allocate write & read buffers */
- wbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
- rbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
- tbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
+ wbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
+ rbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
+ tbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
/* Create file */
fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -482,9 +482,9 @@ test_reference_obj(void)
CHECK(ret, FAIL, "H5Fclose");
/* Free memory buffers */
- free(wbuf);
- free(rbuf);
- free(tbuf);
+ HDfree(wbuf);
+ HDfree(rbuf);
+ HDfree(tbuf);
} /* test_reference_obj() */
/****************************************************************
@@ -763,10 +763,10 @@ test_reference_region(void)
CHECK(ret, FAIL, "H5Fclose");
/* Free memory buffers */
- free(wbuf);
- free(rbuf);
- free(dwbuf);
- free(drbuf);
+ HDfree(wbuf);
+ HDfree(rbuf);
+ HDfree(dwbuf);
+ HDfree(drbuf);
} /* test_reference_region() */
/****************************************************************
@@ -1048,10 +1048,10 @@ test_reference_region_1D(void)
CHECK(ret, FAIL, "H5Fclose");
/* Free memory buffers */
- free(wbuf);
- free(rbuf);
- free(dwbuf);
- free(drbuf);
+ HDfree(wbuf);
+ HDfree(rbuf);
+ HDfree(dwbuf);
+ HDfree(drbuf);
} /* test_reference_region_1D() */
/****************************************************************
diff --git a/test/tselect.c b/test/tselect.c
index 1041ab3..8ca3c24 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -354,8 +354,8 @@ test_select_hyper(hid_t xfer_plist)
CHECK(ret, FAIL, "H5Fclose");
/* Free memory buffers */
- free(wbuf);
- free(rbuf);
+ HDfree(wbuf);
+ HDfree(rbuf);
} /* test_select_hyper() */
struct pnt_iter {
@@ -637,8 +637,8 @@ test_select_point(hid_t xfer_plist)
CHECK(ret, FAIL, "H5Fclose");
/* Free memory buffers */
- free(wbuf);
- free(rbuf);
+ HDfree(wbuf);
+ HDfree(rbuf);
} /* test_select_point() */
/****************************************************************
@@ -750,8 +750,8 @@ test_select_all(hid_t xfer_plist)
CHECK(ret, FAIL, "H5Fclose");
/* Free memory buffers */
- free(wbuf);
- free(rbuf);
+ HDfree(wbuf);
+ HDfree(rbuf);
} /* test_select_all() */
/****************************************************************
@@ -890,8 +890,8 @@ test_select_all_hyper(hid_t xfer_plist)
CHECK(ret, FAIL, "H5Fclose");
/* Free memory buffers */
- free(wbuf);
- free(rbuf);
+ HDfree(wbuf);
+ HDfree(rbuf);
} /* test_select_all_hyper() */
/****************************************************************
@@ -5406,8 +5406,8 @@ test_select_hyper_and_2d(void)
CHECK(ret, FAIL, "H5Fclose");
/* Free memory buffers */
- free(wbuf);
- free(rbuf);
+ HDfree(wbuf);
+ HDfree(rbuf);
} /* test_select_hyper_and_2d() */
/****************************************************************
@@ -5537,8 +5537,8 @@ test_select_hyper_xor_2d(void)
CHECK(ret, FAIL, "H5Fclose");
/* Free memory buffers */
- free(wbuf);
- free(rbuf);
+ HDfree(wbuf);
+ HDfree(rbuf);
} /* test_select_hyper_xor_2d() */
/****************************************************************
@@ -5667,8 +5667,8 @@ test_select_hyper_notb_2d(void)
CHECK(ret, FAIL, "H5Fclose");
/* Free memory buffers */
- free(wbuf);
- free(rbuf);
+ HDfree(wbuf);
+ HDfree(rbuf);
} /* test_select_hyper_notb_2d() */
/****************************************************************
@@ -6440,8 +6440,8 @@ test_select_point_chunk(void)
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
- free(data);
- free (data_out);
+ HDfree(data);
+ HDfree (data_out);
} /* test_select_point_chunk() */
/****************************************************************
@@ -7620,8 +7620,8 @@ test_select_none(void)
CHECK(ret, FAIL, "H5Fclose");
/* Free memory buffers */
- free(wbuf);
- free(rbuf);
+ HDfree(wbuf);
+ HDfree(rbuf);
} /* test_select_none() */
/****************************************************************
diff --git a/test/tsohm.c b/test/tsohm.c
index eb5f7c5..8ebfd52 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -3884,7 +3884,7 @@ test_sohm_external_dtype(void)
CHECK_I(dset1_tid, "H5Dget_type");
/* Allocate space and initialize data */
- orig = (s1_t*)malloc(NX * NY * sizeof(s1_t));
+ orig = (s1_t*)HDmalloc(NX * NY * sizeof(s1_t));
for(i=0; i<NX*NY; i++) {
s_ptr = (s1_t*)orig + i;
s_ptr->a = i*3 + 1;
@@ -3963,7 +3963,7 @@ test_sohm_external_dtype(void)
ret = H5Fclose(file2);
CHECK_I(ret, "H5Fclose");
- free(orig);
+ HDfree(orig);
}
diff --git a/test/ttsafe_acreate.c b/test/ttsafe_acreate.c
index 0efd02c..dec2eee 100644
--- a/test/ttsafe_acreate.c
+++ b/test/ttsafe_acreate.c
@@ -113,7 +113,7 @@ void tts_acreate(void)
* with the dataset
*/
for(i = 0; i < NUM_THREADS; i++) {
- attrib_data = malloc(sizeof(ttsafe_name_data_t));
+ attrib_data = HDmalloc(sizeof(ttsafe_name_data_t));
attrib_data->dataset = dataset;
attrib_data->datatype = datatype;
attrib_data->dataspace = dataspace;
@@ -170,7 +170,7 @@ void *tts_acreate_thread(void *client_data)
H5P_DEFAULT, H5P_DEFAULT);
/* Write data to the attribute */
- attribute_data = malloc(sizeof(int));
+ attribute_data = HDmalloc(sizeof(int));
*attribute_data = attrib_data->current_index;
H5Awrite(attribute, H5T_NATIVE_INT, attribute_data);
H5Aclose(attribute);
diff --git a/test/ttsafe_cancel.c b/test/ttsafe_cancel.c
index 8264403..56f431e 100644
--- a/test/ttsafe_cancel.c
+++ b/test/ttsafe_cancel.c
@@ -145,7 +145,7 @@ void *tts_cancel_thread(void UNUSED *arg)
assert(dataset >= 0);
/* If thread is cancelled, make cleanup call */
- cleanup_structure = (cancel_cleanup_t*)malloc(sizeof(cancel_cleanup_t));
+ cleanup_structure = (cancel_cleanup_t*)HDmalloc(sizeof(cancel_cleanup_t));
cleanup_structure->dataset = dataset;
cleanup_structure->datatype = datatype;
cleanup_structure->dataspace = dataspace;
@@ -156,7 +156,7 @@ void *tts_cancel_thread(void UNUSED *arg)
ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &datavalue);
assert(ret>=0);
- buffer = malloc(sizeof(int));
+ buffer = HDmalloc(sizeof(int));
ret=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer);
assert(ret>=0);
ret=H5Diterate(buffer, H5T_NATIVE_INT, dataspace, tts_cancel_callback, &dataset);
diff --git a/test/tunicode.c b/test/tunicode.c
index 0386352..7dfda16 100644
--- a/test/tunicode.c
+++ b/test/tunicode.c
@@ -605,7 +605,7 @@ void test_compound(hid_t fid, const char * string)
readbuf = H5Tget_member_name(s1_tid, 0);
ret = HDstrcmp(readbuf, string);
VERIFY(ret, 0, "strcmp");
- free(readbuf);
+ HDfree(readbuf);
/* Add the other fields to the datatype */
ret = H5Tinsert(s1_tid, "c_name", HOFFSET(s1_t, c), H5T_NATIVE_DOUBLE);
@@ -718,7 +718,7 @@ void test_opaque(hid_t UNUSED fid, const char * string)
read_buf = H5Tget_tag(type_id);
ret = strcmp(read_buf, string);
VERIFY(ret, 0, "H5Tget_tag");
- free(read_buf);
+ HDfree(read_buf);
ret = H5Tclose(type_id);
CHECK(ret, FAIL, "H5Tclose");
diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c
index 73e7f09..5dac36f 100644
--- a/testpar/t_coll_chunk.c
+++ b/testpar/t_coll_chunk.c
@@ -553,7 +553,7 @@ coll_chunktest(const char* filename,
/* allocate memory for data buffer */
- data_array1 = (int *)malloc(dims[0] * dims[1] * sizeof(int));
+ data_array1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
/* set up dimensions of the slab this process accesses */
@@ -748,11 +748,11 @@ coll_chunktest(const char* filename,
/* Use collective read to verify the correctness of collective write. */
/* allocate memory for data buffer */
- data_array1 = (int *)malloc(dims[0]*dims[1]*sizeof(int));
+ data_array1 = (int *)HDmalloc(dims[0]*dims[1]*sizeof(int));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
/* allocate memory for data buffer */
- data_origin1 = (int *)malloc(dims[0]*dims[1]*sizeof(int));
+ data_origin1 = (int *)HDmalloc(dims[0]*dims[1]*sizeof(int));
VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded");
acc_plist = create_faccess_plist(comm, info, facc_type, use_gpfs);
@@ -813,8 +813,8 @@ coll_chunktest(const char* filename,
H5Fclose(file);
/* release data buffers */
- if (data_array1) free(data_array1);
- if (data_origin1) free(data_origin1);
+ if (data_array1) HDfree(data_array1);
+ if (data_origin1) HDfree(data_origin1);
}
diff --git a/testpar/t_dset.c b/testpar/t_dset.c
index 39ca686..3cb627f 100644
--- a/testpar/t_dset.c
+++ b/testpar/t_dset.c
@@ -255,8 +255,8 @@ dataset_writeInd(void)
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
- VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
+ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
/* ----------------------------------------
* CREATE AN HDF5 FILE WITH PARALLEL ACCESS
@@ -365,7 +365,7 @@ MPI_Barrier(MPI_COMM_WORLD);
H5Fclose(fid);
/* release data buffers */
- if(data_array1) free(data_array1);
+ if(data_array1) HDfree(data_array1);
}
/* Example of using the parallel HDF5 library to read a dataset */
@@ -401,10 +401,10 @@ dataset_readInd(void)
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
- VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
- data_origin1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
- VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded");
+ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
+ data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded");
/* setup file access template */
acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs);
@@ -474,8 +474,8 @@ dataset_readInd(void)
H5Fclose(fid);
/* release data buffers */
- if(data_array1) free(data_array1);
- if(data_origin1) free(data_origin1);
+ if(data_array1) HDfree(data_array1);
+ if(data_origin1) HDfree(data_origin1);
}
@@ -527,8 +527,8 @@ dataset_writeAll(void)
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
- VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
+ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
/* -------------------
* START AN HDF5 FILE
@@ -862,7 +862,7 @@ dataset_writeAll(void)
H5Fclose(fid);
/* release data buffers */
- if(data_array1) free(data_array1);
+ if(data_array1) HDfree(data_array1);
}
/*
@@ -907,10 +907,10 @@ dataset_readAll(void)
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
- VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
- data_origin1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
- VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded");
+ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
+ data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded");
/* -------------------
* OPEN AN HDF5 FILE
@@ -1090,8 +1090,8 @@ dataset_readAll(void)
H5Fclose(fid);
/* release data buffers */
- if(data_array1) free(data_array1);
- if(data_origin1) free(data_origin1);
+ if(data_array1) HDfree(data_array1);
+ if(data_origin1) HDfree(data_origin1);
}
@@ -1149,8 +1149,8 @@ extend_writeInd(void)
chunk_dims[1] = chunkdim1;
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
- VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
+ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
/* -------------------
* START AN HDF5 FILE
@@ -1329,7 +1329,7 @@ extend_writeInd(void)
H5Fclose(fid);
/* release data buffers */
- if(data_array1) free(data_array1);
+ if(data_array1) HDfree(data_array1);
}
/*
@@ -1535,12 +1535,12 @@ extend_readInd(void)
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
- VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
- data_array2 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
- VRFY((data_array2 != NULL), "data_array2 malloc succeeded");
- data_origin1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
- VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded");
+ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
+ data_array2 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded");
+ data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded");
/* -------------------
* OPEN AN HDF5 FILE
@@ -1663,9 +1663,9 @@ extend_readInd(void)
H5Fclose(fid);
/* release data buffers */
- if(data_array1) free(data_array1);
- if(data_array2) free(data_array2);
- if(data_origin1) free(data_origin1);
+ if(data_array1) HDfree(data_array1);
+ if(data_array2) HDfree(data_array2);
+ if(data_origin1) HDfree(data_origin1);
}
/*
@@ -1723,8 +1723,8 @@ extend_writeAll(void)
chunk_dims[1] = chunkdim1;
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
- VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
+ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
/* -------------------
* START AN HDF5 FILE
@@ -1928,7 +1928,7 @@ extend_writeAll(void)
H5Fclose(fid);
/* release data buffers */
- if(data_array1) free(data_array1);
+ if(data_array1) HDfree(data_array1);
}
/* Example of using the parallel HDF5 library to read an extendible dataset */
@@ -1967,12 +1967,12 @@ extend_readAll(void)
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
- VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
- data_array2 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
- VRFY((data_array2 != NULL), "data_array2 malloc succeeded");
- data_origin1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
- VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded");
+ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
+ data_array2 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded");
+ data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded");
/* -------------------
* OPEN AN HDF5 FILE
@@ -2119,9 +2119,9 @@ extend_readAll(void)
H5Fclose(fid);
/* release data buffers */
- if(data_array1) free(data_array1);
- if(data_array2) free(data_array2);
- if(data_origin1) free(data_origin1);
+ if(data_array1) HDfree(data_array1);
+ if(data_array2) HDfree(data_array2);
+ if(data_origin1) HDfree(data_origin1);
}
/*
@@ -2163,9 +2163,9 @@ compress_readAll(void)
/* Allocate data buffer */
data_orig = (DATATYPE *)HDmalloc((size_t)dim*sizeof(DATATYPE));
- VRFY((data_orig != NULL), "data_origin1 malloc succeeded");
+ VRFY((data_orig != NULL), "data_origin1 HDmalloc succeeded");
data_read = (DATATYPE *)HDmalloc((size_t)dim*sizeof(DATATYPE));
- VRFY((data_read != NULL), "data_array1 malloc succeeded");
+ VRFY((data_read != NULL), "data_array1 HDmalloc succeeded");
/* Initialize data buffers */
for(u=0; u<dim;u++)
@@ -2412,11 +2412,11 @@ none_selection_chunk(void)
/* allocate memory for data buffer. Only allocate enough buffer for
* each processor's data. */
if(mpi_rank) {
- data_origin = (DATATYPE *)malloc(block[0]*block[1]*sizeof(DATATYPE));
- VRFY((data_origin != NULL), "data_origin malloc succeeded");
+ data_origin = (DATATYPE *)HDmalloc(block[0]*block[1]*sizeof(DATATYPE));
+ VRFY((data_origin != NULL), "data_origin HDmalloc succeeded");
- data_array = (DATATYPE *)malloc(block[0]*block[1]*sizeof(DATATYPE));
- VRFY((data_array != NULL), "data_array malloc succeeded");
+ data_array = (DATATYPE *)HDmalloc(block[0]*block[1]*sizeof(DATATYPE));
+ VRFY((data_array != NULL), "data_array HDmalloc succeeded");
/* put some trivial data in the data_array */
mstart[0] = mstart[1] = 0;
@@ -2513,8 +2513,8 @@ none_selection_chunk(void)
H5Fclose(fid);
/* release data buffers */
- if(data_origin) free(data_origin);
- if(data_array) free(data_array);
+ if(data_origin) HDfree(data_origin);
+ if(data_array) HDfree(data_array);
}
@@ -2867,7 +2867,7 @@ test_actual_io_mode(int selection_mode) {
/* Allocate and initialize the buffer */
buffer = (int *)HDmalloc(sizeof(int) * length);
- VRFY((buffer != NULL), "malloc of buffer succeeded");
+ VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
for(i = 0; i < length; i++)
buffer[i] = i;
@@ -3341,7 +3341,7 @@ test_no_collective_cause_mode(int selection_mode)
/* Allocate and initialize the buffer */
buffer = (int *)HDmalloc(sizeof(int) * length);
- VRFY((buffer != NULL), "malloc of buffer succeeded");
+ VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
for(i = 0; i < length; i++)
buffer[i] = i;
@@ -3589,7 +3589,7 @@ test_no_collective_cause_mode_filter(int selection_mode)
/* Allocate and initialize the buffer */
buffer = (int *)HDmalloc(sizeof(int) * length);
- VRFY((buffer != NULL), "malloc of buffer succeeded");
+ VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
for(i = 0; i < length; i++)
buffer[i] = i;
@@ -3781,11 +3781,11 @@ dataset_atomicity(void)
buf_size = dim0 * dim1;
/* allocate memory for data buffer */
- write_buf = (int *)calloc(buf_size, sizeof(int));
- VRFY((write_buf != NULL), "write_buf malloc succeeded");
+ write_buf = (int *)HDcalloc(buf_size, sizeof(int));
+ VRFY((write_buf != NULL), "write_buf HDcalloc succeeded");
/* allocate memory for data buffer */
- read_buf = (int *)calloc(buf_size, sizeof(int));
- VRFY((read_buf != NULL), "read_buf malloc succeeded");
+ read_buf = (int *)HDcalloc(buf_size, sizeof(int));
+ VRFY((read_buf != NULL), "read_buf HDcalloc succeeded");
/* setup file access template */
acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs);
@@ -3927,19 +3927,19 @@ dataset_atomicity(void)
VRFY((ret >= 0), "H5D close succeeded");
/* release data buffers */
- if(write_buf) free(write_buf);
- if(read_buf) free(read_buf);
+ if(write_buf) HDfree(write_buf);
+ if(read_buf) HDfree(read_buf);
/* open dataset2 (non-contiguous case) */
dataset2 = H5Dopen2(fid, DATASETNAME6, H5P_DEFAULT);
VRFY((dataset2 >= 0), "H5Dopen2 succeeded");
/* allocate memory for data buffer */
- write_buf = (int *)calloc(buf_size, sizeof(int));
- VRFY((write_buf != NULL), "write_buf malloc succeeded");
+ write_buf = (int *)HDcalloc(buf_size, sizeof(int));
+ VRFY((write_buf != NULL), "write_buf HDcalloc succeeded");
/* allocate memory for data buffer */
- read_buf = (int *)calloc(buf_size, sizeof(int));
- VRFY((read_buf != NULL), "read_buf malloc succeeded");
+ read_buf = (int *)HDcalloc(buf_size, sizeof(int));
+ VRFY((read_buf != NULL), "read_buf HDcalloc succeeded");
for (i=0 ; i<buf_size ; i++) {
write_buf[i] = 5;
@@ -4049,8 +4049,8 @@ dataset_atomicity(void)
VRFY((ret >= 0), "H5Sclose succeeded");
/* release data buffers */
- if(write_buf) free(write_buf);
- if(read_buf) free(read_buf);
+ if(write_buf) HDfree(write_buf);
+ if(read_buf) HDfree(read_buf);
ret = H5Fclose(fid);
VRFY((ret >= 0), "H5Fclose succeeded");
diff --git a/testpar/t_filter_read.c b/testpar/t_filter_read.c
index 8d6b5a3..5a711cd 100644
--- a/testpar/t_filter_read.c
+++ b/testpar/t_filter_read.c
@@ -186,8 +186,8 @@ filter_read_internal(const char *filename, hid_t dcpl,
hrc = H5Fclose (file);
VRFY(hrc>=0, "H5Fclose");
- free(points);
- free(check);
+ HDfree(points);
+ HDfree(check);
MPI_Barrier(MPI_COMM_WORLD);
}
diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c
index fa9cf9d..a74aa22 100644
--- a/testpar/t_mpi.c
+++ b/testpar/t_mpi.c
@@ -282,7 +282,7 @@ test_mpio_gb_file(char *filename)
printf("Skipped GB file range test "
"because MPI_Offset cannot support it\n");
}else{
- buf = malloc(MB);
+ buf = HDmalloc(MB);
VRFY((buf!=NULL), "malloc succeed");
/* open a new file. Remove it first in case it exists. */
diff --git a/testpar/t_posix_compliant.c b/testpar/t_posix_compliant.c
index 1bc0053..207f07e 100644
--- a/testpar/t_posix_compliant.c
+++ b/testpar/t_posix_compliant.c
@@ -105,8 +105,8 @@ static int allwrite_allread_blocks(int numprocs, int rank, int write_size)
int amode, i;
MPI_Offset offset = rank*write_size*sizeof(int);
MPI_Status Status;
- int* writebuf = (int*)malloc(write_size*sizeof(int));
- int* readbuf = (int*)malloc (write_size*sizeof(int));
+ int* writebuf = (int*)HDmalloc(write_size*sizeof(int));
+ int* readbuf = (int*)HDmalloc (write_size*sizeof(int));
for(i=0; i<write_size; i++)
writebuf[i] = i;
@@ -143,8 +143,8 @@ static int posix_allwrite_allread_blocks(int numprocs, int rank, int write_size)
int ret;
int i;
int offset = rank*write_size*sizeof(int);
- int* writebuf = (int*)malloc(write_size*sizeof(int));
- int* readbuf = (int*)malloc (write_size*sizeof(int));
+ int* writebuf = (int*)HDmalloc(write_size*sizeof(int));
+ int* readbuf = (int*)HDmalloc (write_size*sizeof(int));
FILE* file = NULL;
for(i=0; i<write_size; i++)
@@ -216,8 +216,8 @@ static int posix_onewrite_allread_blocks(int numprocs, int rank, int write_size)
int ret;
int i;
int offset = rank*write_size*sizeof(int);
- int* writebuf = (int*)malloc(write_size*sizeof(int));
- int* readbuf = (int*)malloc (write_size*sizeof(int));
+ int* writebuf = (int*)HDmalloc(write_size*sizeof(int));
+ int* readbuf = (int*)HDmalloc (write_size*sizeof(int));
FILE* file = NULL;
for(i=0; i<write_size; i++)
@@ -295,8 +295,8 @@ static int posix_onewrite_allread_interlaced(int numprocs, int rank, int write_s
int ret;
int i, fill, index;
int offset = rank*write_size*sizeof(int);
- int* writebuf = (int*)malloc(write_size*sizeof(int));
- int* readbuf = (int*)malloc (write_size*sizeof(int));
+ int* writebuf = (int*)HDmalloc(write_size*sizeof(int));
+ int* readbuf = (int*)HDmalloc (write_size*sizeof(int));
FILE* file = NULL;
if(rank==0)
@@ -389,8 +389,8 @@ static int allwrite_allread_interlaced(int numprocs, int rank, int write_size)
int amode, i, counter = 0;
MPI_Datatype filetype;
MPI_Status Status;
- int* writebuf = (int*)malloc(write_size*sizeof(int));
- int* readbuf = (int*) malloc(numprocs*sizeof(int));
+ int* writebuf = (int*)HDmalloc(write_size*sizeof(int));
+ int* readbuf = (int*) HDmalloc(numprocs*sizeof(int));
int offset=0;
for(i=0; i<write_size; i++)
@@ -488,8 +488,8 @@ static int allwrite_allread_overlap(int numprocs, int rank, int write_size)
int amode, i, counter = 0;
MPI_Datatype filetype;
MPI_Status Status;
- int* writebuf = (int*) malloc(write_size*(numprocs-1)*sizeof(int)); /* An upper bound...not all the elements will be written */
- int* readbuf = (int*) malloc(write_size*(numprocs-1)*sizeof(int));
+ int* writebuf = (int*) HDmalloc(write_size*(numprocs-1)*sizeof(int)); /* An upper bound...not all the elements will be written */
+ int* readbuf = (int*) HDmalloc(write_size*(numprocs-1)*sizeof(int));
if(numprocs < 2)
{
@@ -581,8 +581,8 @@ static int onewrite_allread_blocks(int numprocs, int rank, int write_size)
int mpio_result;
int amode, i;
MPI_Status Status;
- int* writebuf = (int*)malloc(write_size*sizeof(int));
- int* readbuf = (int*)malloc (write_size*sizeof(int));
+ int* writebuf = (int*)HDmalloc(write_size*sizeof(int));
+ int* readbuf = (int*)HDmalloc (write_size*sizeof(int));
for(i=0; i<write_size; i++)
writebuf[i] = i;
@@ -632,8 +632,8 @@ static int onewrite_allread_interlaced(int numprocs, int rank, int write_size)
int amode, i;
MPI_Datatype filetype;
MPI_Status Status;
- int* writebuf = (int*) malloc(numprocs*write_size*sizeof(int)); /* Upper bound, not all used */
- int* readbuf = (int*)malloc (write_size*sizeof(int));
+ int* writebuf = (int*) HDmalloc(numprocs*write_size*sizeof(int)); /* Upper bound, not all used */
+ int* readbuf = (int*)HDmalloc (write_size*sizeof(int));
amode = MPI_MODE_CREATE | MPI_MODE_RDWR;
diff --git a/tools/h5copy/h5copygentest.c b/tools/h5copy/h5copygentest.c
index 8fc7144..e696b1b 100644
--- a/tools/h5copy/h5copygentest.c
+++ b/tools/h5copy/h5copygentest.c
@@ -240,10 +240,10 @@ static void gent_named_vl(hid_t loc_id)
/* allocate and initialize VL dataset to write */
buf[0].len = 1;
- buf[0].p = malloc( 1 * sizeof(int));
+ buf[0].p = HDmalloc( 1 * sizeof(int));
((int *)buf[0].p)[0]=1;
buf[1].len = 2;
- buf[1].p = malloc( 2 * sizeof(int));
+ buf[1].p = HDmalloc( 2 * sizeof(int));
((int *)buf[1].p)[0]=2;
((int *)buf[1].p)[1]=3;
@@ -286,16 +286,16 @@ static void gent_nested_vl(hid_t loc_id)
/* allocate and initialize VL dataset to write */
buf[0].len = 1;
- buf[0].p = malloc( 1 * sizeof(hvl_t));
+ buf[0].p = HDmalloc( 1 * sizeof(hvl_t));
tvl = (hvl_t *)buf[0].p;
- tvl->p = malloc( 1 * sizeof(int) );
+ tvl->p = HDmalloc( 1 * sizeof(int) );
tvl->len = 1;
((int *)tvl->p)[0]=1;
buf[1].len = 1;
- buf[1].p = malloc( 1 * sizeof(hvl_t));
+ buf[1].p = HDmalloc( 1 * sizeof(hvl_t));
tvl = (hvl_t *)buf[1].p;
- tvl->p = malloc( 2 * sizeof(int) );
+ tvl->p = HDmalloc( 2 * sizeof(int) );
tvl->len = 2;
((int *)tvl->p)[0]=2;
((int *)tvl->p)[1]=3;
diff --git a/tools/h5copy/testh5copy.sh.in b/tools/h5copy/testh5copy.sh.in
index bec3bfc..77c64c4 100644
--- a/tools/h5copy/testh5copy.sh.in
+++ b/tools/h5copy/testh5copy.sh.in
@@ -67,6 +67,8 @@ H5DIFF_BIN=`pwd`/../h5diff/$H5DIFF # The path of the h5diff tool binary
H5LS=h5ls # The h5ls tool name
H5LS_ARGS=-Svr # Arguments to the h5ls tool
H5LS_BIN=`pwd`/../h5ls/$H5LS # The path of the h5ls tool binary
+
+RM='rm -rf'
CMP='cmp -s'
DIFF='diff -c'
CP='cp'
@@ -121,6 +123,19 @@ COPY_TESTFILES_TO_TESTDIR()
done
}
+CLEAN_TESTFILES_AND_TESTDIR()
+{
+ # skip rm if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $RM $TESTDIR
+ fi
+}
+
# Print a "SKIP" message
SKIP() {
@@ -578,6 +593,8 @@ COPY_REFERENCES
COPY_EXT_LINKS
TEST_MISC
+# Clean up temporary files/directories
+CLEAN_TESTFILES_AND_TESTDIR
if test $nerrors -eq 0 ; then
echo "All $TESTNAME tests passed."
diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c
index cf46e74..59cab0d 100644
--- a/tools/h5diff/h5diff_common.c
+++ b/tools/h5diff/h5diff_common.c
@@ -174,7 +174,7 @@ void parse_command_line(int argc,
options->exclude_path = 1;
/* create linked list of excluding objects */
- if( (exclude_node = (struct exclude_path_list*) malloc(sizeof(struct exclude_path_list))) == NULL)
+ if( (exclude_node = (struct exclude_path_list*) HDmalloc(sizeof(struct exclude_path_list))) == NULL)
{
printf("Error: lack of memory!\n");
h5diff_exit(EXIT_FAILURE);
diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c
index 517f496..a31f423 100644
--- a/tools/h5diff/h5diffgentest.c
+++ b/tools/h5diff/h5diffgentest.c
@@ -4576,7 +4576,7 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a
for(i=0; i<SDIM_DSET; i++)
{
wdata[i].i1 = i;
- wdata[i].vl.p = malloc((i+1)*sizeof(cmpd2_t));
+ wdata[i].vl.p = HDmalloc((i+1)*sizeof(cmpd2_t));
wdata[i].vl.len = i+1;
for(j=0; j<(i+1); j++)
{
@@ -4701,7 +4701,7 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch
for(j=0; j < SDIM_CMPD_ARRAY; j++)
{
wdata[i].cmpd2[j].i2 = j*10;
- wdata[i].cmpd2[j].vl.p = malloc((j+1)*sizeof(cmpd3_t));
+ wdata[i].cmpd2[j].vl.p = HDmalloc((j+1)*sizeof(cmpd3_t));
wdata[i].cmpd2[j].vl.len = j+1;
for(k=0; k<(j+1); k++)
{
@@ -4845,7 +4845,7 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch
{
/* compound 1 data */
wdata[i].i1 = i;
- wdata[i].vl.p = malloc((i+1)*sizeof(cmpd2_t));
+ wdata[i].vl.p = HDmalloc((i+1)*sizeof(cmpd2_t));
wdata[i].vl.len = i+1;
for(j=0; j<(i+1); j++)
{
@@ -5557,10 +5557,10 @@ void write_attr_in(hid_t loc_id,
/* Allocate and initialize VL dataset to write */
buf5[0].len = 1;
- buf5[0].p = malloc( 1 * sizeof(int));
+ buf5[0].p = HDmalloc( 1 * sizeof(int));
((int *)buf5[0].p)[0]=1;
buf5[1].len = 2;
- buf5[1].p = malloc( 2 * sizeof(int));
+ buf5[1].p = HDmalloc( 2 * sizeof(int));
((int *)buf5[1].p)[0]=2;
((int *)buf5[1].p)[1]=3;
@@ -5844,7 +5844,7 @@ void write_attr_in(hid_t loc_id,
n=0;
for (i = 0; i < 3; i++) {
for (j = 0; j < 2; j++) {
- buf52[i][j].p = malloc((i + 1) * sizeof(int));
+ buf52[i][j].p = HDmalloc((i + 1) * sizeof(int));
buf52[i][j].len = i + 1;
for (l = 0; l < i + 1; l++)
if (make_diffs)((int *)buf52[i][j].p)[l] = 0;
@@ -6260,7 +6260,7 @@ void write_attr_in(hid_t loc_id,
for (i = 0; i < 4; i++) {
for (j = 0; j < 3; j++) {
for (k = 0; k < 2; k++) {
- buf53[i][j][k].p = malloc((i + 1) * sizeof(int));
+ buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int));
buf53[i][j][k].len = i + 1;
for (l = 0; l < i + 1; l++)
if (make_diffs)((int *)buf53[i][j][k].p)[l] = 0;
@@ -6591,10 +6591,10 @@ void write_dset_in(hid_t loc_id,
/* Allocate and initialize VL dataset to write */
buf5[0].len = 1;
- buf5[0].p = malloc( 1 * sizeof(int));
+ buf5[0].p = HDmalloc( 1 * sizeof(int));
((int *)buf5[0].p)[0]=1;
buf5[1].len = 2;
- buf5[1].p = malloc( 2 * sizeof(int));
+ buf5[1].p = HDmalloc( 2 * sizeof(int));
((int *)buf5[1].p)[0]=2;
((int *)buf5[1].p)[1]=3;
@@ -6804,7 +6804,7 @@ void write_dset_in(hid_t loc_id,
{
for(j = 0; j < 2; j++)
{
- buf52[i][j].p = malloc((i + 1) * sizeof(int));
+ buf52[i][j].p = HDmalloc((i + 1) * sizeof(int));
buf52[i][j].len = i + 1;
for(l = 0; l < i + 1; l++)
{
@@ -7017,7 +7017,7 @@ void write_dset_in(hid_t loc_id,
{
for(k = 0; k < 2; k++)
{
- buf53[i][j][k].p = malloc((i + 1) * sizeof(int));
+ buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int));
buf53[i][j][k].len = i + 1;
for(l = 0; l < i + 1; l++)
{
diff --git a/tools/h5diff/testh5diff.sh.in b/tools/h5diff/testh5diff.sh.in
index 3455287..549da49 100644
--- a/tools/h5diff/testh5diff.sh.in
+++ b/tools/h5diff/testh5diff.sh.in
@@ -38,6 +38,7 @@ EXIT_FAILURE=1
H5DIFF=h5diff # The tool name
H5DIFF_BIN=`pwd`/$H5DIFF # The path of the tool binary
+RM='rm -rf'
CMP='cmp -s'
DIFF='diff -c'
CP='cp'
@@ -336,6 +337,19 @@ COPY_TESTFILES_TO_TESTDIR()
done
}
+CLEAN_TESTFILES_AND_TESTDIR()
+{
+ # skip rm if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $RM $TESTDIR
+ fi
+}
+
# Parse option
# -p run ph5diff tests
# -h print help page
@@ -1096,6 +1110,9 @@ TOOLTEST h5diff_646.txt -v --use-system-epsilon -p 0.05 h5diff_basic1.h5 h5diff_
# # END
# ##############################################################################
+# Clean up temporary files/directories
+CLEAN_TESTFILES_AND_TESTDIR
+
if test $nerrors -eq 0 ; then
echo "All $TESTNAME tests passed."
exit $EXIT_SUCCESS
diff --git a/tools/h5dump/CMakeTests.cmake b/tools/h5dump/CMakeTests.cmake
index c88495d..6edc9e4 100644
--- a/tools/h5dump/CMakeTests.cmake
+++ b/tools/h5dump/CMakeTests.cmake
@@ -57,6 +57,8 @@
${HDF5_TOOLS_SRC_DIR}/testfiles/tchar1.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tchunked.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tcmpdattrintsize.ddl
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tcmpdintarray.ddl
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tcmpdints.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tcmpdintsize.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tcomp-1.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tcomp-2.ddl
@@ -202,6 +204,8 @@
${HDF5_TOOLS_SRC_DIR}/testfiles/tbinary.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tchar.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tcmpdattrintsize.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tcmpdintarray.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tcmpdints.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tcmpdintsize.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound_complex.h5
@@ -809,6 +813,10 @@
tchunked.out.err
tcmpdattrintsize.out
tcmpdattrintsize.out.err
+ tcmpdintarray.out
+ tcmpdintarray.out.err
+ tcmpdints.out
+ tcmpdints.out.err
tcmpdintsize.out
tcmpdintsize.out.err
tcomp-1.out
@@ -1058,6 +1066,8 @@
# test for signed/unsigned datasets
ADD_H5_TEST (packedbits 0 --enable-error-stack packedbits.h5)
# test for compound signed/unsigned datasets
+ ADD_H5_TEST (tcmpdintarray 0 --enable-error-stack tcmpdintarray.h5)
+ ADD_H5_TEST (tcmpdints 0 --enable-error-stack tcmpdints.h5)
ADD_H5_TEST (tcmpdintsize 0 --enable-error-stack tcmpdintsize.h5)
# test for signed/unsigned scalar datasets
ADD_H5_TEST (tscalarintsize 0 --enable-error-stack tscalarintsize.h5)
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index 76426c2..f3a78fc 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -106,6 +106,8 @@
#define FILE73 "tscalarintsize.h5"
#define FILE74 "tscalarattrintsize.h5"
#define FILE75 "tscalarstring.h5"
+#define FILE76 "tcmpdintarray.h5"
+#define FILE77 "tcmpdints.h5"
/*-------------------------------------------------------------------------
* prototypes
@@ -332,6 +334,30 @@ typedef struct s1_t {
#define F73_YDIM64 64
#define F73_DUMMYDBL "DummyDBL"
+/* "FILE76 and FILE77 */
+/* Name of dataset to create in datafile */
+#define F76_DATASETNAME "CompoundIntArray"
+#define F76_LENGTH 4
+#define F76_RANK 1
+#define F76_ARRAY_RANK 1
+#define F76_DATASETU08 "DU08BITS"
+#define F76_DATASETS08 "DS08BITS"
+#define F76_DIM8 8
+#define F76_DATASETU16 "DU16BITS"
+#define F76_DATASETS16 "DS16BITS"
+#define F76_DIM16 16
+#define F76_DATASETU32 "DU32BITS"
+#define F76_DATASETS32 "DS32BITS"
+#define F76_DIM32 32
+#define F76_DATASETU64 "DU64BITS"
+#define F76_DATASETS64 "DS64BITS"
+#define F76_DIM64 64
+#define F76_DUMMYDBL "DummyDBL"
+/* Name of dataset to create in datafile */
+#define F77_DATASETNAME1 "CompoundInts"
+#define F77_DATASETNAME2 "CompoundRInts"
+#define F77_LENGTH 64
+
static void
gent_group(void)
{
@@ -8665,6 +8691,479 @@ gent_string_scalars(void)
H5Fclose(fid);
}
+static void gent_compound_int_array(void) {
+ hid_t fid, dataset, space;
+ hsize_t dims[1];
+ uint8_t valu8bits;
+ uint16_t valu16bits;
+ uint32_t valu32bits;
+ uint64_t valu64bits;
+ int8_t val8bits;
+ int16_t val16bits;
+ int32_t val32bits;
+ int64_t val64bits;
+ hsize_t array_dim8[]={F76_DIM8}; /* Array dimensions */
+ hsize_t array_dim16[]={F76_DIM16}; /* Array dimensions */
+ hsize_t array_dim32[]={F76_DIM32}; /* Array dimensions */
+ hsize_t array_dim64[]={F76_DIM64}; /* Array dimensions */
+ hid_t arrayu8_tid; /* Array datatype handle */
+ hid_t arrayu16_tid; /* Array datatype handle */
+ hid_t arrayu32_tid; /* Array datatype handle */
+ hid_t arrayu64_tid; /* Array datatype handle */
+ hid_t array8_tid; /* Array datatype handle */
+ hid_t array16_tid; /* Array datatype handle */
+ hid_t array32_tid; /* Array datatype handle */
+ hid_t array64_tid; /* Array datatype handle */
+ hid_t arraydbl_tid; /* Array datatype handle */
+ /* Structure and array for compound types */
+ typedef struct Cmpd1Struct {
+ uint8_t dsetu8[F76_DIM8];
+ uint16_t dsetu16[F76_DIM16];
+ uint32_t dsetu32[F76_DIM32];
+ uint64_t dsetu64[F76_DIM64];
+ int8_t dset8[F76_DIM8];
+ int16_t dset16[F76_DIM16];
+ int32_t dset32[F76_DIM32];
+ int64_t dset64[F76_DIM64];
+ double dsetdbl[F76_DIM8];
+ } Cmpd1Struct;
+ Cmpd1Struct Cmpd1[F76_LENGTH];
+
+ hid_t Cmpd1Structid; /* File datatype identifier */
+ herr_t status; /* Error checking variable */
+ hsize_t dim[] = { F76_LENGTH }; /* Dataspace dimensions */
+
+ int m, n, o; /* Array init loop vars */
+
+ /* Initialize the data in the arrays/datastructure */
+ for (m = 0; m < F76_LENGTH; m++) {
+
+ /* Array of 8 bits unsigned int */
+ dims[0] = F76_DIM8;
+
+ valu8bits = (uint8_t) ~0u; /* all 1s */
+ for(n = 0; n < dims[0]; n++){
+ Cmpd1[m].dsetu8[n] = valu8bits;
+ valu8bits <<= 1;
+ }
+
+ /* Array of 16 bits unsigned int */
+ dims[0] = F76_DIM16;
+
+ valu16bits = (uint16_t) ~0u; /* all 1s */
+ for(n = 0; n < dims[0]; n++){
+ Cmpd1[m].dsetu16[n] = valu16bits;
+ valu16bits <<= 1;
+ }
+
+ /* Array of 32 bits unsigned int */
+ dims[0] = F76_DIM32;
+
+ valu32bits = (uint32_t) ~0u; /* all 1s */
+ for(n = 0; n < dims[0]; n++){
+ Cmpd1[m].dsetu32[n] = valu32bits;
+ valu32bits <<= 1;
+ }
+
+ /* Array of 64 bits unsigned int */
+ dims[0] = F76_DIM64;
+
+ valu64bits = (uint64_t) ~0Lu; /* all 1s */
+ for(n = 0; n < dims[0]; n++){
+ Cmpd1[m].dsetu64[n] = valu64bits;
+ valu64bits <<= 1;
+ }
+
+ /* Array of 8 bits signed int */
+ dims[0] = F76_DIM8;
+
+ val8bits = (int8_t) ~0; /* all 1s */
+ for(n = 0; n < dims[0]; n++){
+ Cmpd1[m].dset8[n] = val8bits;
+ val8bits <<= 1;
+ }
+
+ /* Array of 16 bits signed int */
+ dims[0] = F76_DIM16;
+
+ val16bits = (int16_t) ~0; /* all 1s */
+ for(n = 0; n < dims[0]; n++){
+ Cmpd1[m].dset16[n] = val16bits;
+ val16bits <<= 1;
+ }
+
+ /* Array of 32 bits signed int */
+ dims[0] = F76_DIM32;
+
+ val32bits = (int32_t) ~0; /* all 1s */
+ for(n = 0; n < dims[0]; n++){
+ Cmpd1[m].dset32[n] = val32bits;
+ val32bits <<= 1;
+ }
+
+ /* Array of 64 bits signed int */
+ dims[0] = F76_DIM64;
+
+ val64bits = (int64_t) ~0L; /* all 1s */
+ for(n = 0; n < dims[0]; n++){
+ Cmpd1[m].dset64[n] = val64bits;
+ val64bits <<= 1;
+ }
+
+ /* Double Dummy set for failure tests */
+ dims[0] = F76_DIM8;
+
+ for(n = 0; n < dims[0]; n++)
+ Cmpd1[m].dsetdbl[n] = 0.0001 + n;
+ }
+
+ /* Create the array data type for the 8 bits signed int array */
+ array8_tid = H5Tarray_create2(H5T_NATIVE_SCHAR, F76_ARRAY_RANK, array_dim8);
+ HDassert(array8_tid >= 0);
+
+ /* Create the array data type for the 16 bits signed int array */
+ array16_tid = H5Tarray_create2(H5T_NATIVE_SHORT, F76_ARRAY_RANK, array_dim16);
+ HDassert(array16_tid >= 0);
+
+ /* Create the array data type for the 32 bits signed int array */
+ array32_tid = H5Tarray_create2(H5T_NATIVE_INT, F76_ARRAY_RANK, array_dim32);
+ HDassert(array32_tid >= 0);
+
+ /* Create the array data type for the 64 bits signed int array */
+ array64_tid = H5Tarray_create2(H5T_NATIVE_LONG, F76_ARRAY_RANK, array_dim64);
+ HDassert(array64_tid >= 0);
+
+ /* Create the array data type for the 8 bits signed int array */
+ arrayu8_tid = H5Tarray_create2(H5T_NATIVE_UCHAR, F76_ARRAY_RANK, array_dim8);
+ HDassert(arrayu8_tid >= 0);
+
+ /* Create the array data type for the 16 bits signed int array */
+ arrayu16_tid = H5Tarray_create2(H5T_NATIVE_USHORT, F76_ARRAY_RANK, array_dim16);
+ HDassert(arrayu16_tid >= 0);
+
+ /* Create the array data type for the 32 bits signed int array */
+ arrayu32_tid = H5Tarray_create2(H5T_NATIVE_UINT, F76_ARRAY_RANK, array_dim32);
+ HDassert(arrayu32_tid >= 0);
+
+ /* Create the array data type for the 64 bits signed int array */
+ arrayu64_tid = H5Tarray_create2(H5T_NATIVE_ULONG, F76_ARRAY_RANK, array_dim64);
+ HDassert(arrayu64_tid >= 0);
+
+ /* Create the array data type for the 32 bits double array */
+ arraydbl_tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, F76_ARRAY_RANK, array_dim8);
+ HDassert(arraydbl_tid >= 0);
+
+ /* Create the dataspace */
+ space = H5Screate_simple(F76_RANK, dim, NULL);
+ HDassert(space >= 0);
+
+ /* Create the file */
+ fid = H5Fcreate(FILE76, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ HDassert(fid >= 0);
+
+ /* Create the memory data type */
+ Cmpd1Structid = H5Tcreate(H5T_COMPOUND, sizeof(Cmpd1Struct));
+ HDassert(Cmpd1Structid >= 0);
+
+ /* Insert the arrays and variables into the structure */
+ status = H5Tinsert(Cmpd1Structid, F76_DATASETU08, HOFFSET(Cmpd1Struct, dsetu8), arrayu8_tid);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd1Structid, F76_DATASETU16, HOFFSET(Cmpd1Struct, dsetu16), arrayu16_tid);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd1Structid, F76_DATASETU32, HOFFSET(Cmpd1Struct, dsetu32), arrayu32_tid);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd1Structid, F76_DATASETU64, HOFFSET(Cmpd1Struct, dsetu64), arrayu64_tid);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd1Structid, F76_DATASETS08, HOFFSET(Cmpd1Struct, dset8), array8_tid);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd1Structid, F76_DATASETS16, HOFFSET(Cmpd1Struct, dset16), array16_tid);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd1Structid, F76_DATASETS32, HOFFSET(Cmpd1Struct, dset32), array32_tid);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd1Structid, F76_DATASETS64, HOFFSET(Cmpd1Struct, dset64), array64_tid);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd1Structid, F76_DUMMYDBL, HOFFSET(Cmpd1Struct, dsetdbl), arraydbl_tid);
+ HDassert(status >= 0);
+
+ /* Create the dataset */
+ dataset = H5Dcreate2(fid, F76_DATASETNAME, Cmpd1Structid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+
+ /* Write data to the dataset */
+ status = H5Dwrite(dataset, Cmpd1Structid, H5S_ALL, H5S_ALL, H5P_DEFAULT, Cmpd1);
+ HDassert(status >= 0);
+
+ /* Release resources */
+ status = H5Tclose(Cmpd1Structid);
+ HDassert(status >= 0);
+
+ status = H5Tclose(arrayu8_tid);
+ HDassert(status >= 0);
+
+ status = H5Tclose(arrayu16_tid);
+ HDassert(status >= 0);
+
+ status = H5Tclose(arrayu32_tid);
+ HDassert(status >= 0);
+
+ status = H5Tclose(arrayu64_tid);
+ HDassert(status >= 0);
+
+ status = H5Tclose(array8_tid);
+ HDassert(status >= 0);
+
+ status = H5Tclose(array16_tid);
+ HDassert(status >= 0);
+
+ status = H5Tclose(array32_tid);
+ HDassert(status >= 0);
+
+ status = H5Tclose(array64_tid);
+ HDassert(status >= 0);
+
+ status = H5Tclose(arraydbl_tid);
+ HDassert(status >= 0);
+
+ status = H5Sclose(space);
+ HDassert(status >= 0);
+
+ status = H5Dclose(dataset);
+ HDassert(status >= 0);
+
+ status = H5Fclose(fid);
+ HDassert(status >= 0);
+}
+
+static void gent_compound_ints(void) {
+ hid_t fid, dataset, space;
+ hsize_t dims[1];
+ uint8_t valu8bits = (uint8_t) ~0u; /* all 1s */
+ uint16_t valu16bits = (uint16_t) ~0u; /* all 1s */
+ uint32_t valu32bits = (uint32_t) ~0u; /* all 1s */
+ uint64_t valu64bits = (uint64_t) ~0Lu; /* all 1s */
+ int8_t val8bits = (int8_t) ~0; /* all 1s */
+ int16_t val16bits = (int16_t) ~0; /* all 1s */
+ int32_t val32bits = (int32_t) ~0; /* all 1s */
+ int64_t val64bits = (int64_t) ~0L; /* all 1s */
+ /* Structure and array for compound types */
+ typedef struct Cmpd1Struct {
+ uint8_t dsetu8;
+ uint16_t dsetu16;
+ uint32_t dsetu32;
+ uint64_t dsetu64;
+ int8_t dset8;
+ int16_t dset16;
+ int32_t dset32;
+ int64_t dset64;
+ double dsetdbl;
+ } Cmpd1Struct;
+ Cmpd1Struct Cmpd1[F77_LENGTH];
+
+ typedef struct Cmpd2Struct {
+ uint64_t dsetu64;
+ uint32_t dsetu32;
+ uint16_t dsetu16;
+ uint8_t dsetu8;
+ int64_t dset64;
+ int32_t dset32;
+ int16_t dset16;
+ int8_t dset8;
+ double dsetdbl;
+ } Cmpd2Struct;
+ Cmpd2Struct Cmpd2[F77_LENGTH];
+
+ hid_t Cmpd1Structid; /* File datatype identifier */
+ hid_t Cmpd2Structid; /* File datatype identifier */
+ herr_t status; /* Error checking variable */
+ hsize_t dim[] = { F77_LENGTH }; /* Dataspace dimensions */
+
+ int m; /* Array init loop vars */
+
+ /* Initialize the data in the arrays/datastructure */
+ for (m = 0; m < F77_LENGTH; m++) {
+
+ /* Array of 8 bits unsigned int */
+ if((m % F76_DIM8) == 0)
+ valu8bits = (uint8_t) ~0u; /* all 1s */
+ Cmpd1[m].dsetu8 = valu8bits;
+ Cmpd2[m].dsetu8 = valu8bits;
+ valu8bits <<= 1;
+
+ /* Array of 16 bits unsigned int */
+ if((m % F76_DIM16) == 0)
+ valu16bits = (uint16_t) ~0u; /* all 1s */
+ Cmpd1[m].dsetu16 = valu16bits;
+ Cmpd2[m].dsetu16 = valu16bits;
+ valu16bits <<= 1;
+
+ /* Array of 32 bits unsigned int */
+ if((m % F76_DIM32) == 0)
+ valu32bits = (uint32_t) ~0u; /* all 1s */
+ Cmpd1[m].dsetu32 = valu32bits;
+ Cmpd2[m].dsetu32 = valu32bits;
+ valu32bits <<= 1;
+
+ /* Array of 64 bits unsigned int */
+ if((m % F76_DIM64) == 0)
+ valu64bits = (uint64_t) ~0Lu; /* all 1s */
+ Cmpd1[m].dsetu64 = valu64bits;
+ Cmpd2[m].dsetu64 = valu64bits;
+ valu64bits <<= 1;
+
+ /* Array of 8 bits signed int */
+ if((m % F76_DIM8) == 0)
+ val8bits = (int8_t) ~0; /* all 1s */
+ Cmpd1[m].dset8 = val8bits;
+ Cmpd2[m].dset8 = val8bits;
+ val8bits <<= 1;
+
+ /* Array of 16 bits signed int */
+ if((m % F76_DIM16) == 0)
+ val16bits = (int16_t) ~0; /* all 1s */
+ Cmpd1[m].dset16 = val16bits;
+ Cmpd2[m].dset16 = val16bits;
+ val16bits <<= 1;
+
+ /* Array of 32 bits signed int */
+ if((m % F76_DIM32) == 0)
+ val32bits = (int32_t) ~0; /* all 1s */
+ Cmpd1[m].dset32 = val32bits;
+ Cmpd2[m].dset32 = val32bits;
+ val32bits <<= 1;
+
+ /* Array of 64 bits signed int */
+ if((m % F76_DIM64) == 0)
+ val64bits = (int64_t) ~0L; /* all 1s */
+ Cmpd1[m].dset64 = val64bits;
+ Cmpd2[m].dset64 = val64bits;
+ val64bits <<= 1;
+
+ /* Double Dummy set for failure tests */
+ Cmpd1[m].dsetdbl = 0.0001 + m;
+ Cmpd2[m].dsetdbl = 0.0001 + m;
+ }
+
+ /* Create the dataspace */
+ space = H5Screate_simple(F76_RANK, dim, NULL);
+ HDassert(space >= 0);
+
+ /* Create the file */
+ fid = H5Fcreate(FILE77, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ HDassert(fid >= 0);
+
+ /* Create the memory data type */
+ Cmpd1Structid = H5Tcreate(H5T_COMPOUND, sizeof(Cmpd1Struct));
+ HDassert(Cmpd1Structid >= 0);
+
+ /* Insert the arrays and variables into the structure */
+ status = H5Tinsert(Cmpd1Structid, F76_DATASETU08, HOFFSET(Cmpd1Struct, dsetu8), H5T_NATIVE_UCHAR);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd1Structid, F76_DATASETU16, HOFFSET(Cmpd1Struct, dsetu16), H5T_NATIVE_USHORT);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd1Structid, F76_DATASETU32, HOFFSET(Cmpd1Struct, dsetu32), H5T_NATIVE_UINT);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd1Structid, F76_DATASETU64, HOFFSET(Cmpd1Struct, dsetu64), H5T_NATIVE_ULONG);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd1Structid, F76_DATASETS08, HOFFSET(Cmpd1Struct, dset8), H5T_NATIVE_SCHAR);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd1Structid, F76_DATASETS16, HOFFSET(Cmpd1Struct, dset16), H5T_NATIVE_SHORT);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd1Structid, F76_DATASETS32, HOFFSET(Cmpd1Struct, dset32), H5T_NATIVE_INT);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd1Structid, F76_DATASETS64, HOFFSET(Cmpd1Struct, dset64), H5T_NATIVE_LONG);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd1Structid, F76_DUMMYDBL, HOFFSET(Cmpd1Struct, dsetdbl), H5T_NATIVE_DOUBLE);
+ HDassert(status >= 0);
+
+ /* Create the dataset */
+ dataset = H5Dcreate2(fid, F77_DATASETNAME1, Cmpd1Structid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+
+ /* Write data to the dataset */
+ status = H5Dwrite(dataset, Cmpd1Structid, H5S_ALL, H5S_ALL, H5P_DEFAULT, Cmpd1);
+ HDassert(status >= 0);
+
+ /* Release resources */
+ status = H5Tclose(Cmpd1Structid);
+ HDassert(status >= 0);
+
+ status = H5Sclose(space);
+ HDassert(status >= 0);
+
+ status = H5Dclose(dataset);
+ HDassert(status >= 0);
+
+ /* Create the dataspace */
+ space = H5Screate_simple(F76_RANK, dim, NULL);
+ HDassert(space >= 0);
+
+ /* Create the memory data type */
+ Cmpd2Structid = H5Tcreate(H5T_COMPOUND, sizeof(Cmpd2Struct));
+ HDassert(Cmpd2Structid >= 0);
+
+ /* Insert the arrays and variables into the structure */
+ status = H5Tinsert(Cmpd2Structid, F76_DATASETU64, HOFFSET(Cmpd2Struct, dsetu64), H5T_NATIVE_ULONG);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd2Structid, F76_DATASETU32, HOFFSET(Cmpd2Struct, dsetu32), H5T_NATIVE_UINT);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd2Structid, F76_DATASETU16, HOFFSET(Cmpd2Struct, dsetu16), H5T_NATIVE_USHORT);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd2Structid, F76_DATASETU08, HOFFSET(Cmpd2Struct, dsetu8), H5T_NATIVE_UCHAR);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd2Structid, F76_DATASETS64, HOFFSET(Cmpd2Struct, dset64), H5T_NATIVE_LONG);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd2Structid, F76_DATASETS32, HOFFSET(Cmpd2Struct, dset32), H5T_NATIVE_INT);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd2Structid, F76_DATASETS16, HOFFSET(Cmpd2Struct, dset16), H5T_NATIVE_SHORT);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd2Structid, F76_DATASETS08, HOFFSET(Cmpd2Struct, dset8), H5T_NATIVE_SCHAR);
+ HDassert(status >= 0);
+
+ status = H5Tinsert(Cmpd2Structid, F76_DUMMYDBL, HOFFSET(Cmpd2Struct, dsetdbl), H5T_NATIVE_DOUBLE);
+ HDassert(status >= 0);
+
+ /* Create the dataset */
+ dataset = H5Dcreate2(fid, F77_DATASETNAME2, Cmpd2Structid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+
+ /* Write data to the dataset */
+ status = H5Dwrite(dataset, Cmpd2Structid, H5S_ALL, H5S_ALL, H5P_DEFAULT, Cmpd2);
+ HDassert(status >= 0);
+
+ /* Release resources */
+ status = H5Tclose(Cmpd2Structid);
+ HDassert(status >= 0);
+
+ status = H5Sclose(space);
+ HDassert(status >= 0);
+
+ status = H5Dclose(dataset);
+ HDassert(status >= 0);
+
+ status = H5Fclose(fid);
+ HDassert(status >= 0);
+}
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -8751,6 +9250,8 @@ int main(void)
gent_intscalars();
gent_attr_intscalars();
gent_string_scalars();
+ gent_compound_int_array();
+ gent_compound_ints();
return 0;
}
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in
index 1a0f189..dc52469 100644
--- a/tools/h5dump/testh5dump.sh.in
+++ b/tools/h5dump/testh5dump.sh.in
@@ -30,7 +30,7 @@ H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary
H5IMPORT=../h5import/h5import # The h5import tool name
H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary
-
+RM='rm -rf'
CMP='cmp'
DIFF='diff -c'
CP='cp'
@@ -396,6 +396,19 @@ COPY_TESTFILES_TO_TESTDIR()
done
}
+CLEAN_TESTFILES_AND_TESTDIR()
+{
+ # skip rm if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $RM $TESTDIR
+ fi
+}
+
# Print a line-line message left justified in a field of 70 characters
# beginning with the word "Testing".
#
@@ -1258,6 +1271,8 @@ TOOLTEST5 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
+# Clean up temporary files/directories
+CLEAN_TESTFILES_AND_TESTDIR
# Report test results and exit
if test $nerrors -eq 0 ; then
diff --git a/tools/h5dump/testh5dumppbits.sh.in b/tools/h5dump/testh5dumppbits.sh.in
index def687b..0f6503d 100644
--- a/tools/h5dump/testh5dumppbits.sh.in
+++ b/tools/h5dump/testh5dumppbits.sh.in
@@ -38,7 +38,7 @@ H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary
H5IMPORT=../h5import/h5import # The h5import tool name
H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary
-
+RM='rm -rf'
CMP='cmp -s'
DIFF='diff -c'
CP='cp'
@@ -189,6 +189,19 @@ COPY_TESTFILES_TO_TESTDIR()
done
}
+CLEAN_TESTFILES_AND_TESTDIR()
+{
+ # skip rm if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $RM $TESTDIR
+ fi
+}
+
# Print a line-line message left justified in a field of 70 characters
# beginning with the word "Testing".
#
@@ -576,6 +589,8 @@ TOOLTEST tpbitsLongLengthExceeded.ddl --enable-error-stack -d /DS32BITS -M 26,7
# Incomplete pair of packed bits request.
TOOLTEST tpbitsIncomplete.ddl --enable-error-stack -d /DS08BITS -M 0,2,2,1,0,2,2, packedbits.h5
+# Clean up temporary files/directories
+CLEAN_TESTFILES_AND_TESTDIR
# Report test results and exit
if test $nerrors -eq 0 ; then
diff --git a/tools/h5dump/testh5dumpxml.sh.in b/tools/h5dump/testh5dumpxml.sh.in
index 6e4efd1..4dad9cd 100644
--- a/tools/h5dump/testh5dumpxml.sh.in
+++ b/tools/h5dump/testh5dumpxml.sh.in
@@ -26,6 +26,7 @@ H5_LONE_COLON="@H5_LONE_COLON@"
DUMPER=h5dump # The tool name
DUMPER_BIN=`pwd`/$DUMPER # The path of the tool binary
+RM='rm -rf'
CMP='cmp -s'
DIFF='diff -c'
CP='cp'
@@ -217,6 +218,19 @@ COPY_TESTFILES_TO_TESTDIR()
done
}
+CLEAN_TESTFILES_AND_TESTDIR()
+{
+ # skip rm if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $RM $TESTDIR
+ fi
+}
+
# Print a line-line message left justified in a field of 70 characters
# beginning with the word "Testing".
#
@@ -372,6 +386,8 @@ TOOLTEST torderattr4.h5.xml --xml -H --sort_by=creation_order --sort_order=desce
# tests for floating point user defined printf format
TOOLTEST tfpformat.h5.xml -u -m %.7f tfpformat.h5
+# Clean up temporary files/directories
+CLEAN_TESTFILES_AND_TESTDIR
if test $nerrors -eq 0 ; then
echo "All $TESTNAME tests passed."
diff --git a/tools/h5import/CMakeTests.cmake b/tools/h5import/CMakeTests.cmake
index cb76204..96cca87 100644
--- a/tools/h5import/CMakeTests.cmake
+++ b/tools/h5import/CMakeTests.cmake
@@ -105,7 +105,7 @@
IF (HDF5_ENABLE_USING_MEMCHECKER)
ADD_TEST (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c ${conffile} -o ${testfile})
IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS ${last_test})
+ SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-h5importtest)
ENDIF (NOT "${last_test}" STREQUAL "")
ELSE (HDF5_ENABLE_USING_MEMCHECKER)
ADD_TEST (
@@ -118,6 +118,7 @@
${testfile}.out
${testfile}.out.err
)
+ SET_TESTS_PROPERTIES (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest)
ADD_TEST (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c ${conffile} -o ${testfile})
SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}-clear-objects)
@@ -167,6 +168,7 @@
d${testfile}.dff
d${testfile}.dff.err
)
+ SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest)
IF ("${ARGN}" STREQUAL "BINARY")
ADD_TEST (
@@ -407,10 +409,25 @@
SET (last_test "H5IMPORT-clear-objects")
ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
- ADD_TEST (NAME H5IMPORT-h5importtest COMMAND $<TARGET_FILE:h5importtest>)
+ ADD_TEST (
+ NAME H5IMPORT-h5importtest-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ binfp64.bin
+ binin8.bin
+ binin8w.bin
+ binin16.bin
+ binin32.bin
+ binuin16.bin
+ binuin32.bin
+ )
IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5IMPORT-h5importtest PROPERTIES DEPENDS ${last_test})
+ SET_TESTS_PROPERTIES (H5IMPORT-h5importtest-clear-objects PROPERTIES DEPENDS ${last_test})
ENDIF (NOT "${last_test}" STREQUAL "")
+ SET (last_test "H5IMPORT-clear-objects")
+
+ ADD_TEST (NAME H5IMPORT-h5importtest COMMAND $<TARGET_FILE:h5importtest>)
+ SET_TESTS_PROPERTIES (H5IMPORT-h5importtest PROPERTIES DEPENDS H5IMPORT-h5importtest-clear-objects)
# ----- TESTING "ASCII I32 rank 3 - Output BE " ;
ADD_H5_TEST (ASCII_I32 testfiles/txtin32.txt testfiles/txtin32.conf txtin32.h5)
diff --git a/tools/h5import/Makefile.am b/tools/h5import/Makefile.am
index 167dbc9..6d18e25 100644
--- a/tools/h5import/Makefile.am
+++ b/tools/h5import/Makefile.am
@@ -40,4 +40,7 @@ h5import_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
# All programs depend on the main hdf5 library and the tools library
LDADD=$(LIBH5TOOLS) $(LIBHDF5)
+# Temporary files from h5importtest
+CHECK_CLEANFILES+=*.bin
+
include $(top_srcdir)/config/conclude.am
diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in
index bfb777a..94910af 100644
--- a/tools/h5import/Makefile.in
+++ b/tools/h5import/Makefile.in
@@ -428,7 +428,9 @@ TRACE = perl $(top_srcdir)/bin/trace
# .chkexe files are used to mark tests that have run successfully.
# .chklog files are output from those tests.
# *.clog are from the MPE option.
-CHECK_CLEANFILES = *.chkexe *.chklog *.clog
+
+# Temporary files from h5importtest
+CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.bin
# Include src and tools/lib directories
INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/tools/lib
diff --git a/tools/h5import/h5importtestutil.sh.in b/tools/h5import/h5importtestutil.sh.in
index fd21dc1..e50ddac 100644
--- a/tools/h5import/h5importtestutil.sh.in
+++ b/tools/h5import/h5importtestutil.sh.in
@@ -25,6 +25,7 @@ TESTNAME=h5import
EXIT_SUCCESS=0
EXIT_FAILURE=1
+RM='rm -rf'
CP='cp'
DIRNAME='dirname'
LS='ls'
@@ -147,6 +148,19 @@ COPY_TESTFILES_TO_TESTDIR()
done
}
+CLEAN_TESTFILES_AND_TESTDIR()
+{
+ # skip rm if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $RM $TESTDIR
+ fi
+}
+
TESTING() {
SPACES=" "
echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012'
@@ -350,6 +364,9 @@ else
nerrors="` expr $nerrors + 1 `";
fi
+# Clean up temporary files/directories
+CLEAN_TESTFILES_AND_TESTDIR
+
#
# Check errors result
if test $nerrors -eq 0 ; then
diff --git a/tools/h5jam/Makefile.am b/tools/h5jam/Makefile.am
index c6ccebf..62a5ba7 100644
--- a/tools/h5jam/Makefile.am
+++ b/tools/h5jam/Makefile.am
@@ -39,7 +39,7 @@ LDADD=$(LIBH5TOOLS) $(LIBHDF5)
# Temporary files. *.h5 are generated by jamgentest. They should
# copied to the testfiles/ directory if update is required.
-CHECK_CLEANFILES+=*.h5
+CHECK_CLEANFILES+=*.h5 testfiles/h5jam-*-sav testfiles/h5unjam-*-sav
DISTCLEANFILES=testh5jam.sh
include $(top_srcdir)/config/conclude.am
diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in
index 7256d6e..c16c300 100644
--- a/tools/h5jam/Makefile.in
+++ b/tools/h5jam/Makefile.in
@@ -445,7 +445,8 @@ TRACE = perl $(top_srcdir)/bin/trace
# Temporary files. *.h5 are generated by jamgentest. They should
# copied to the testfiles/ directory if update is required.
-CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5
+CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 testfiles/h5jam-*-sav \
+ testfiles/h5unjam-*-sav
# Include src and tools/lib directories
INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/tools/lib
diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c
index d84f7f2..3aff2b4 100644
--- a/tools/h5jam/getub.c
+++ b/tools/h5jam/getub.c
@@ -165,7 +165,7 @@ main (int argc, const char *argv[])
if (res < (long)size)
{
if (buf)
- free (buf);
+ HDfree (buf);
HDclose (fd);
exit (EXIT_FAILURE);
}
@@ -173,7 +173,7 @@ main (int argc, const char *argv[])
HDwrite (1, buf, (unsigned)size);
if (buf)
- free (buf);
+ HDfree (buf);
HDclose (fd);
return (EXIT_SUCCESS);
}
diff --git a/tools/h5jam/testh5jam.sh.in b/tools/h5jam/testh5jam.sh.in
index 86edbee..36f0657 100644
--- a/tools/h5jam/testh5jam.sh.in
+++ b/tools/h5jam/testh5jam.sh.in
@@ -34,6 +34,7 @@ UNJAM=h5unjam # Tool to test
JAM_BIN="$RUNSERIAL "`pwd` # The path of the jam binary
UNJAM_BIN=`pwd` # The path of the jam binary
+RM='rm -rf'
CMP='cmp -s'
DIFF='diff -c'
AWK='awk'
@@ -122,6 +123,19 @@ COPY_TESTFILES_TO_TESTDIR()
done
}
+CLEAN_TESTFILES_AND_TESTDIR()
+{
+ # skip rm if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $RM $TESTDIR
+ fi
+}
+
# Print a line-line message left justified in a field of 70 characters
# beginning with the word "Testing".
#
@@ -497,10 +511,10 @@ TOOLTEST_OUTPUT() {
# Create the expect file if it doesn't yet exist.
echo " CREATED"
cp $actual $expect
- rm -f $actual $actual_err
+ rm -f $actual $actual_sav $actual_err $actual_err_sav
elif $CMP $expect $actual; then
echo " PASSED"
- rm -f $actual $actual_err
+ rm -f $actual $actual_sav $actual_err $actual_err_sav
else
echo "*FAILED*"
echo " Expected result differs from actual result"
@@ -675,7 +689,8 @@ UNJAMTEST taj3.h5 --delete tac3.h5
CHECKFILE $TESTDIR/tall.h5 tac3.h5
CLEANUP tac3.h5 taj3.h5
-
+# Clean up temporary files/directories
+CLEAN_TESTFILES_AND_TESTDIR
if test $nerrors -eq 0 ; then
echo "All $TESTNAME tests passed."
diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in
index 1e3acc8..68b317c 100644
--- a/tools/h5ls/testh5ls.sh.in
+++ b/tools/h5ls/testh5ls.sh.in
@@ -24,6 +24,7 @@ EXIT_FAILURE=1
H5LS=h5ls # The tool name
H5LS_BIN=`pwd`/$H5LS # The path of the tool binary
+RM='rm -rf'
CMP='cmp -s'
DIFF='diff -c'
CP='cp'
@@ -191,6 +192,19 @@ COPY_TESTFILES_TO_TESTDIR()
done
}
+CLEAN_TESTFILES_AND_TESTDIR()
+{
+ # skip rm if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $RM $TESTDIR
+ fi
+}
+
# Print a line-line message left justified in a field of 70 characters
# beginning with the word "Testing".
TESTING() {
@@ -409,6 +423,8 @@ fi
# test for file with datasets that use Fixed Array chunk indices
echo "***skip testing tdset_idx.h5"
#TOOLTEST tdset_idx.ls 0 -w80 -d tdset_idx.h5
+# Clean up temporary files/directories
+CLEAN_TESTFILES_AND_TESTDIR
if test $nerrors -eq 0 ; then
echo "All $TESTNAME tests passed."
diff --git a/tools/h5repack/Makefile.am b/tools/h5repack/Makefile.am
index 663e501..eae296d 100644
--- a/tools/h5repack/Makefile.am
+++ b/tools/h5repack/Makefile.am
@@ -72,7 +72,7 @@ endif
# Temporary files. *.h5 are generated by h5repack. They should
# copied to the testfiles/ directory if update is required.
-CHECK_CLEANFILES+=*.h5 *.bin
+CHECK_CLEANFILES+=*.h5 *.bin testfiles/h5diff_attr1.h5 testfiles/tfamily*.h5
DISTCLEANFILES=h5repack.sh h5repack_plugin.sh
include $(top_srcdir)/config/conclude.am
diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in
index fc37649..9f0e6f1 100644
--- a/tools/h5repack/Makefile.in
+++ b/tools/h5repack/Makefile.in
@@ -481,7 +481,8 @@ TRACE = perl $(top_srcdir)/bin/trace
# Temporary files. *.h5 are generated by h5repack. They should
# copied to the testfiles/ directory if update is required.
-CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 *.bin
+CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 *.bin \
+ testfiles/h5diff_attr1.h5 testfiles/tfamily*.h5
# Include src, test, and tools/lib directories
INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/test -I$(top_srcdir)/tools/lib
diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in
index 583b6ef..045aebf 100644
--- a/tools/h5repack/h5repack.sh.in
+++ b/tools/h5repack/h5repack.sh.in
@@ -42,6 +42,7 @@ H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary
H5DUMP=../h5dump/h5dump # The h5dump tool name
H5DUMP_BIN=`pwd`/$H5DUMP # The path of the h5dump tool binary
+RM='rm -rf'
GREP='grep'
CP='cp'
DIRNAME='dirname'
@@ -161,6 +162,19 @@ COPY_TESTFILES_TO_TESTDIR()
done
}
+CLEAN_TESTFILES_AND_TESTDIR()
+{
+ # skip rm if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $RM $TESTDIR
+ fi
+}
+
# Print a $* message left justified in a field of 70 characters
#
MESSAGE() {
@@ -1088,6 +1102,9 @@ TOOLTEST HDFFV-7840 h5diff_attr1.h5
TOOLTEST_META meta_short h5repack_layout.h5 -M 8192
TOOLTEST_META meta_long h5repack_layout.h5 --metadata_block_size=8192
+# Clean up temporary files/directories
+CLEAN_TESTFILES_AND_TESTDIR
+
if test $nerrors -eq 0 ; then
echo "All $TESTNAME tests passed."
exit $EXIT_SUCCESS
diff --git a/tools/h5repack/h5repack_plugin.sh.in b/tools/h5repack/h5repack_plugin.sh.in
index a45d1fe..df4b374 100644
--- a/tools/h5repack/h5repack_plugin.sh.in
+++ b/tools/h5repack/h5repack_plugin.sh.in
@@ -35,7 +35,7 @@ TEST_NAME=ud_plugin
FROM_DIR=`pwd`/.libs
PLUGIN_LIB="$FROM_DIR/libdynlibadd.*"
PLUGIN_LIBDIR=testdir3
-RM="rm -rf"
+RM='rm -rf'
GREP='grep'
CP='cp'
@@ -118,6 +118,19 @@ COPY_TESTFILES_TO_TESTDIR()
done
}
+CLEAN_TESTFILES_AND_TESTDIR()
+{
+ # skip rm if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $RM $TESTDIR
+ fi
+}
+
# Print a $* message left justified in a field of 70 characters
#
MESSAGE() {
@@ -233,6 +246,10 @@ else
exit_code=$EXIT_SUCCESS
fi
+# Clean up temporary files/directories
+CLEAN_TESTFILES_AND_TESTDIR
+
# Clean up temporary files/directories and leave
$RM $PLUGIN_LIBDIR
+
exit $exit_code
diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c
index cc4e063..4b6a00b 100644
--- a/tools/h5repack/h5repacktst.c
+++ b/tools/h5repack/h5repacktst.c
@@ -3382,7 +3382,7 @@ int make_big(hid_t loc_id)
goto out;
/* initialize buffer to 0 */
- buf=(signed char *) calloc( nelmts, size);
+ buf=(signed char *) HDcalloc( nelmts, size);
if (H5Sselect_hyperslab (f_sid,H5S_SELECT_SET,hs_start,NULL,hs_size, NULL) < 0)
goto out;
@@ -3863,10 +3863,10 @@ int write_dset_in(hid_t loc_id,
/* Allocate and initialize VL dataset to write */
buf5[0].len = 1;
- buf5[0].p = malloc( 1 * sizeof(int));
+ buf5[0].p = HDmalloc( 1 * sizeof(int));
((int *)buf5[0].p)[0]=1;
buf5[1].len = 2;
- buf5[1].p = malloc( 2 * sizeof(int));
+ buf5[1].p = HDmalloc( 2 * sizeof(int));
((int *)buf5[1].p)[0] = 2;
((int *)buf5[1].p)[1] = 3;
@@ -3925,7 +3925,7 @@ int write_dset_in(hid_t loc_id,
/* allocate and initialize array data to write */
size = ( TEST_BUFSIZE / sizeof(double) + 1 ) * sizeof(double);
- dbuf = (double*)malloc( size );
+ dbuf = (double*)HDmalloc( size );
if (NULL == dbuf)
{
printf ("\nError: Cannot allocate memory for \"arrayd\" data buffer size %dMB.\n", (int) size / 1000000 );
@@ -4099,7 +4099,7 @@ int write_dset_in(hid_t loc_id,
{
int l;
- buf52[i][j].p = malloc((i + 1) * sizeof(int));
+ buf52[i][j].p = HDmalloc((i + 1) * sizeof(int));
buf52[i][j].len = (size_t)(i + 1);
for(l = 0; l < i + 1; l++)
{
@@ -4320,7 +4320,7 @@ int write_dset_in(hid_t loc_id,
{
int l;
- buf53[i][j][k].p = malloc((i + 1) * sizeof(int));
+ buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int));
buf53[i][j][k].len = (size_t)(i + 1);
for(l = 0; l < i + 1; l++)
{
@@ -4450,8 +4450,8 @@ int make_dset_reg_ref(hid_t loc_id)
int retval = -1; /* return value */
/* Allocate write & read buffers */
- wbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1);
- dwbuf = (int *)malloc(sizeof(int) * SPACE2_DIM1 * SPACE2_DIM2);
+ wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1);
+ dwbuf = (int *)HDmalloc(sizeof(int) * SPACE2_DIM1 * SPACE2_DIM2);
/* Create dataspace for datasets */
if ((sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL)) < 0)
@@ -4791,10 +4791,10 @@ int write_attr_in(hid_t loc_id,
/* Allocate and initialize VL dataset to write */
buf5[0].len = 1;
- buf5[0].p = malloc( 1 * sizeof(int));
+ buf5[0].p = HDmalloc( 1 * sizeof(int));
((int *)buf5[0].p)[0]=1;
buf5[1].len = 2;
- buf5[1].p = malloc(2 * sizeof(int));
+ buf5[1].p = HDmalloc(2 * sizeof(int));
((int *)buf5[1].p)[0] = 2;
((int *)buf5[1].p)[1] = 3;
@@ -5111,7 +5111,7 @@ int write_attr_in(hid_t loc_id,
for (j = 0; j < 2; j++)
{
int l;
- buf52[i][j].p = malloc((i + 1) * sizeof(int));
+ buf52[i][j].p = HDmalloc((i + 1) * sizeof(int));
buf52[i][j].len = (size_t)(i + 1);
for (l = 0; l < i + 1; l++)
if (make_diffs)((int *)buf52[i][j].p)[l] = 0;
@@ -5577,7 +5577,7 @@ int write_attr_in(hid_t loc_id,
for (k = 0; k < 2; k++)
{
int l;
- buf53[i][j][k].p = malloc((i + 1) * sizeof(int));
+ buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int));
buf53[i][j][k].len = (size_t)i + 1;
for (l = 0; l < i + 1; l++)
if (make_diffs)
@@ -6803,11 +6803,11 @@ static herr_t make_complex_attr_references(hid_t loc_id)
* prepare vlen data
*/
vlen_objref_data[0].len = LEN0_VLEN_OBJREF;
- vlen_objref_data[0].p = malloc (vlen_objref_data[0].len * sizeof(hobj_ref_t));
+ vlen_objref_data[0].p = HDmalloc (vlen_objref_data[0].len * sizeof(hobj_ref_t));
vlen_objref_data[1].len = LEN1_VLEN_OBJREF;
- vlen_objref_data[1].p = malloc (vlen_objref_data[1].len * sizeof(hobj_ref_t));
+ vlen_objref_data[1].p = HDmalloc (vlen_objref_data[1].len * sizeof(hobj_ref_t));
vlen_objref_data[2].len = LEN2_VLEN_OBJREF;
- vlen_objref_data[2].p = malloc (vlen_objref_data[2].len * sizeof(hobj_ref_t));
+ vlen_objref_data[2].p = HDmalloc (vlen_objref_data[2].len * sizeof(hobj_ref_t));
/*
* create obj references
@@ -6872,7 +6872,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
* prepare vlen data
*/
vlen_regref_data[0].len = LEN0_VLEN_REGREF;
- vlen_regref_data[0].p = malloc (vlen_regref_data[0].len * sizeof(hdset_reg_ref_t));
+ vlen_regref_data[0].p = HDmalloc (vlen_regref_data[0].len * sizeof(hdset_reg_ref_t));
/*
* create region reference
diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c
index a5d7eef..e9fa0fa 100644
--- a/tools/h5stat/h5stat.c
+++ b/tools/h5stat/h5stat.c
@@ -823,7 +823,7 @@ freespace_stats(hid_t fid, iter_t *iter)
} /* end for */
if(sect_info)
- free(sect_info);
+ HDfree(sect_info);
return 0;
} /* end freespace_stats() */
@@ -1756,9 +1756,9 @@ main(int argc, const char *argv[])
iter.free_hdr = finfo.free.meta_size;
} /* end else */
- iter.num_small_groups = (unsigned long *)calloc((size_t)sgroups_threshold, sizeof(unsigned long));
- iter.num_small_attrs = (unsigned long *)calloc((size_t)(sattrs_threshold+1), sizeof(unsigned long));
- iter.small_dset_dims = (unsigned long *)calloc((size_t)sdsets_threshold, sizeof(unsigned long));
+ iter.num_small_groups = (unsigned long *)HDcalloc((size_t)sgroups_threshold, sizeof(unsigned long));
+ iter.num_small_attrs = (unsigned long *)HDcalloc((size_t)(sattrs_threshold+1), sizeof(unsigned long));
+ iter.small_dset_dims = (unsigned long *)HDcalloc((size_t)sdsets_threshold, sizeof(unsigned long));
if(iter.num_small_groups == NULL || iter.num_small_attrs == NULL || iter.small_dset_dims == NULL) {
error_msg("Unable to allocate memory for tracking small groups/datasets/attributes\n");
diff --git a/tools/h5stat/testh5stat.sh.in b/tools/h5stat/testh5stat.sh.in
index 91b9c3d..85cc1d4 100644
--- a/tools/h5stat/testh5stat.sh.in
+++ b/tools/h5stat/testh5stat.sh.in
@@ -37,6 +37,7 @@ EXIT_FAILURE=1
STAT=h5stat # The tool name
STAT_BIN=`pwd`/$STAT # The path of the tool binary
+RM='rm -rf'
CMP='cmp -s'
DIFF='diff -c'
CP='cp'
@@ -149,6 +150,19 @@ COPY_TESTFILES_TO_TESTDIR()
done
}
+CLEAN_TESTFILES_AND_TESTDIR()
+{
+ # skip rm if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $RM $TESTDIR
+ fi
+}
+
# Print a line-line message left justified in a field of 70 characters
# beginning with the word "Testing".
#
@@ -298,6 +312,9 @@ TOOLTEST h5stat_numattrs3.ddl -A --numattrs=25 h5stat_threshold.h5
TOOLTEST h5stat_numattrs4.ddl -A -a 100 h5stat_newgrat.h5
#
+# Clean up temporary files/directories
+CLEAN_TESTFILES_AND_TESTDIR
+
if test $nerrors -eq 0 ; then
echo "All $TESTNAME tests passed."
exit $EXIT_SUCCESS
diff --git a/tools/misc/h5repart.c b/tools/misc/h5repart.c
index 07f6bfd..ffd52e8 100644
--- a/tools/misc/h5repart.c
+++ b/tools/misc/h5repart.c
@@ -290,7 +290,7 @@ main (int argc, char *argv[])
if (argno<argc) usage (prog_name);
/* Now the real work, split the file */
- buf = malloc (blk_size);
+ buf = HDmalloc (blk_size);
while (src_offset<src_size) {
/* Read a block. The amount to read is the minimum of:
@@ -498,6 +498,6 @@ main (int argc, char *argv[])
}
/* Free resources and return */
- free (buf);
+ HDfree (buf);
return EXIT_SUCCESS;
}
diff --git a/tools/misc/talign.c b/tools/misc/talign.c
index 017eb55..66318bf 100644
--- a/tools/misc/talign.c
+++ b/tools/misc/talign.c
@@ -126,7 +126,7 @@ int main(void)
H5Dclose(set);
/* Now open the set, and read it back in */
- data = (char *)malloc(H5Tget_size(fix));
+ data = (char *)HDmalloc(H5Tget_size(fix));
if(!data) {
perror("malloc() failed");
@@ -152,7 +152,7 @@ out:
mname ? mname : "(null)", (int)H5Tget_member_offset(fix,0),
string5, (char *)(data + H5Tget_member_offset(fix, 0)));
if(mname)
- free(mname);
+ HDfree(mname);
fptr = (float *)(data + H5Tget_member_offset(fix, 1));
mname = H5Tget_member_name(fix, 1);
@@ -163,7 +163,7 @@ out:
(double)fok[0], (double)fptr[0],
(double)fok[1], (double)fptr[1]);
if(mname)
- free(mname);
+ HDfree(mname);
fptr = (float *)(data + H5Tget_member_offset(fix, 2));
mname = H5Tget_member_name(fix, 2);
@@ -173,7 +173,7 @@ out:
(double)fnok[0], (double)fptr[0],
(double)fnok[1], (double)fptr[1]);
if(mname)
- free(mname);
+ HDfree(mname);
fptr = (float *)(data + H5Tget_member_offset(fix, 1));
printf("\n"
@@ -192,7 +192,7 @@ out:
}
if(data)
- free(data);
+ HDfree(data);
H5Sclose(spc);
H5Tclose(cmp);
H5Tclose(cmp1);
diff --git a/tools/misc/testh5mkgrp.sh.in b/tools/misc/testh5mkgrp.sh.in
index 5ec1a28..85205a8 100644
--- a/tools/misc/testh5mkgrp.sh.in
+++ b/tools/misc/testh5mkgrp.sh.in
@@ -31,6 +31,7 @@ H5LS=h5ls # The h5ls tool name
H5LS_ARGS=-vr # Arguments to the h5ls tool
H5LS_BIN=`pwd`/../h5ls/$H5LS # The path of the h5ls tool binary
+RM='rm -rf'
CMP='cmp'
DIFF='diff -c'
CP='cp'
@@ -111,6 +112,19 @@ COPY_TESTFILES_TO_TESTDIR()
done
}
+CLEAN_TESTFILES_AND_TESTDIR()
+{
+ # skip rm if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $RM $TESTDIR
+ fi
+}
+
# Print a line-line message left justified in a field of 70 characters
# beginning with the word "Testing".
TESTING()
@@ -299,6 +313,8 @@ RUNTEST h5mkgrp_nested_lp.h5 "-lp" /one/two
RUNTEST h5mkgrp_nested_mult_p.h5 "-p" /one/two /three/four
RUNTEST h5mkgrp_nested_mult_lp.h5 "-lp" /one/two /three/four
+# Clean up temporary files/directories
+CLEAN_TESTFILES_AND_TESTDIR
if test $nerrors -eq 0 ; then
echo "All $TESTNAME tests passed."
diff --git a/tools/testfiles/tcmpdintarray.ddl b/tools/testfiles/tcmpdintarray.ddl
new file mode 100644
index 0000000..ef21cd2
--- /dev/null
+++ b/tools/testfiles/tcmpdintarray.ddl
@@ -0,0 +1,64 @@
+HDF5 "tcmpdintarray.h5" {
+GROUP "/" {
+ DATASET "CompoundIntArray" {
+ DATATYPE H5T_COMPOUND {
+ H5T_ARRAY { [8] H5T_STD_U8LE } "DU08BITS";
+ H5T_ARRAY { [16] H5T_STD_U16LE } "DU16BITS";
+ H5T_ARRAY { [32] H5T_STD_U32LE } "DU32BITS";
+ H5T_ARRAY { [64] H5T_STD_U64LE } "DU64BITS";
+ H5T_ARRAY { [8] H5T_STD_I8LE } "DS08BITS";
+ H5T_ARRAY { [16] H5T_STD_I16LE } "DS16BITS";
+ H5T_ARRAY { [32] H5T_STD_I32LE } "DS32BITS";
+ H5T_ARRAY { [64] H5T_STD_I64LE } "DS64BITS";
+ H5T_ARRAY { [8] H5T_IEEE_F64LE } "DummyDBL";
+ }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+ DATA {
+ (0): {
+ [ 255, 254, 252, 248, 240, 224, 192, 128 ],
+ [ 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768 ],
+ [ 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, 2147483648 ],
+ [ 18446744073709551615, 18446744073709551614, 18446744073709551612, 18446744073709551608, 18446744073709551600, 18446744073709551584, 18446744073709551552, 18446744073709551488, 18446744073709551360, 18446744073709551104, 18446744073709550592, 18446744073709549568, 18446744073709547520, 18446744073709543424, 18446744073709535232, 18446744073709518848, 18446744073709486080, 18446744073709420544, 18446744073709289472, 18446744073709027328, 18446744073708503040, 18446744073707454464, 18446744073705357312, 18446744073701163008, 18446744073692774400, 18446744073675997184, 18446744073642442752, 18446744073575333888, 18446744073441116160, 18446744073172680704, 18446744072635809792, 18446744071562067968, 18446744069414584320, 18446744065119617024, 18446744056529682432, 18446744039349813248, 18446744004990074880, 18446743936270598144, 18446743798831644672, 18446743523953737728, 18446742974197923840, 18446741874686296064, 18446739675663040512, 18446735277616529408, 18446726481523507200, 18446708889337462784, 18446673704965373952, 18446603336221196288, 18446462598732840960, 18446181123756130304, 18445618173802708992, 18444492273895866368, 18442240474082181120, 18437736874454810624, 18428729675200069632, 18410715276690587648, 18374686479671623680, 18302628885633695744, 18158513697557839872, 17870283321406128128, 17293822569102704640, 16140901064495857664, 13835058055282163712, 9223372036854775808 ],
+ [ -1, -2, -4, -8, -16, -32, -64, -128 ],
+ [ -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768 ],
+ [ -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648 ],
+ [ -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, -68719476736, -137438953472, -274877906944, -549755813888, -1099511627776, -2199023255552, -4398046511104, -8796093022208, -17592186044416, -35184372088832, -70368744177664, -140737488355328, -281474976710656, -562949953421312, -1125899906842624, -2251799813685248, -4503599627370496, -9007199254740992, -18014398509481984, -36028797018963968, -72057594037927936, -144115188075855872, -288230376151711744, -576460752303423488, -1152921504606846976, -2305843009213693952, -4611686018427387904, -9223372036854775808 ],
+ [ 0.0001, 1.0001, 2.0001, 3.0001, 4.0001, 5.0001, 6.0001, 7.0001 ]
+ },
+ (1): {
+ [ 255, 254, 252, 248, 240, 224, 192, 128 ],
+ [ 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768 ],
+ [ 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, 2147483648 ],
+ [ 18446744073709551615, 18446744073709551614, 18446744073709551612, 18446744073709551608, 18446744073709551600, 18446744073709551584, 18446744073709551552, 18446744073709551488, 18446744073709551360, 18446744073709551104, 18446744073709550592, 18446744073709549568, 18446744073709547520, 18446744073709543424, 18446744073709535232, 18446744073709518848, 18446744073709486080, 18446744073709420544, 18446744073709289472, 18446744073709027328, 18446744073708503040, 18446744073707454464, 18446744073705357312, 18446744073701163008, 18446744073692774400, 18446744073675997184, 18446744073642442752, 18446744073575333888, 18446744073441116160, 18446744073172680704, 18446744072635809792, 18446744071562067968, 18446744069414584320, 18446744065119617024, 18446744056529682432, 18446744039349813248, 18446744004990074880, 18446743936270598144, 18446743798831644672, 18446743523953737728, 18446742974197923840, 18446741874686296064, 18446739675663040512, 18446735277616529408, 18446726481523507200, 18446708889337462784, 18446673704965373952, 18446603336221196288, 18446462598732840960, 18446181123756130304, 18445618173802708992, 18444492273895866368, 18442240474082181120, 18437736874454810624, 18428729675200069632, 18410715276690587648, 18374686479671623680, 18302628885633695744, 18158513697557839872, 17870283321406128128, 17293822569102704640, 16140901064495857664, 13835058055282163712, 9223372036854775808 ],
+ [ -1, -2, -4, -8, -16, -32, -64, -128 ],
+ [ -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768 ],
+ [ -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648 ],
+ [ -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, -68719476736, -137438953472, -274877906944, -549755813888, -1099511627776, -2199023255552, -4398046511104, -8796093022208, -17592186044416, -35184372088832, -70368744177664, -140737488355328, -281474976710656, -562949953421312, -1125899906842624, -2251799813685248, -4503599627370496, -9007199254740992, -18014398509481984, -36028797018963968, -72057594037927936, -144115188075855872, -288230376151711744, -576460752303423488, -1152921504606846976, -2305843009213693952, -4611686018427387904, -9223372036854775808 ],
+ [ 0.0001, 1.0001, 2.0001, 3.0001, 4.0001, 5.0001, 6.0001, 7.0001 ]
+ },
+ (2): {
+ [ 255, 254, 252, 248, 240, 224, 192, 128 ],
+ [ 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768 ],
+ [ 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, 2147483648 ],
+ [ 18446744073709551615, 18446744073709551614, 18446744073709551612, 18446744073709551608, 18446744073709551600, 18446744073709551584, 18446744073709551552, 18446744073709551488, 18446744073709551360, 18446744073709551104, 18446744073709550592, 18446744073709549568, 18446744073709547520, 18446744073709543424, 18446744073709535232, 18446744073709518848, 18446744073709486080, 18446744073709420544, 18446744073709289472, 18446744073709027328, 18446744073708503040, 18446744073707454464, 18446744073705357312, 18446744073701163008, 18446744073692774400, 18446744073675997184, 18446744073642442752, 18446744073575333888, 18446744073441116160, 18446744073172680704, 18446744072635809792, 18446744071562067968, 18446744069414584320, 18446744065119617024, 18446744056529682432, 18446744039349813248, 18446744004990074880, 18446743936270598144, 18446743798831644672, 18446743523953737728, 18446742974197923840, 18446741874686296064, 18446739675663040512, 18446735277616529408, 18446726481523507200, 18446708889337462784, 18446673704965373952, 18446603336221196288, 18446462598732840960, 18446181123756130304, 18445618173802708992, 18444492273895866368, 18442240474082181120, 18437736874454810624, 18428729675200069632, 18410715276690587648, 18374686479671623680, 18302628885633695744, 18158513697557839872, 17870283321406128128, 17293822569102704640, 16140901064495857664, 13835058055282163712, 9223372036854775808 ],
+ [ -1, -2, -4, -8, -16, -32, -64, -128 ],
+ [ -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768 ],
+ [ -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648 ],
+ [ -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, -68719476736, -137438953472, -274877906944, -549755813888, -1099511627776, -2199023255552, -4398046511104, -8796093022208, -17592186044416, -35184372088832, -70368744177664, -140737488355328, -281474976710656, -562949953421312, -1125899906842624, -2251799813685248, -4503599627370496, -9007199254740992, -18014398509481984, -36028797018963968, -72057594037927936, -144115188075855872, -288230376151711744, -576460752303423488, -1152921504606846976, -2305843009213693952, -4611686018427387904, -9223372036854775808 ],
+ [ 0.0001, 1.0001, 2.0001, 3.0001, 4.0001, 5.0001, 6.0001, 7.0001 ]
+ },
+ (3): {
+ [ 255, 254, 252, 248, 240, 224, 192, 128 ],
+ [ 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768 ],
+ [ 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, 2147483648 ],
+ [ 18446744073709551615, 18446744073709551614, 18446744073709551612, 18446744073709551608, 18446744073709551600, 18446744073709551584, 18446744073709551552, 18446744073709551488, 18446744073709551360, 18446744073709551104, 18446744073709550592, 18446744073709549568, 18446744073709547520, 18446744073709543424, 18446744073709535232, 18446744073709518848, 18446744073709486080, 18446744073709420544, 18446744073709289472, 18446744073709027328, 18446744073708503040, 18446744073707454464, 18446744073705357312, 18446744073701163008, 18446744073692774400, 18446744073675997184, 18446744073642442752, 18446744073575333888, 18446744073441116160, 18446744073172680704, 18446744072635809792, 18446744071562067968, 18446744069414584320, 18446744065119617024, 18446744056529682432, 18446744039349813248, 18446744004990074880, 18446743936270598144, 18446743798831644672, 18446743523953737728, 18446742974197923840, 18446741874686296064, 18446739675663040512, 18446735277616529408, 18446726481523507200, 18446708889337462784, 18446673704965373952, 18446603336221196288, 18446462598732840960, 18446181123756130304, 18445618173802708992, 18444492273895866368, 18442240474082181120, 18437736874454810624, 18428729675200069632, 18410715276690587648, 18374686479671623680, 18302628885633695744, 18158513697557839872, 17870283321406128128, 17293822569102704640, 16140901064495857664, 13835058055282163712, 9223372036854775808 ],
+ [ -1, -2, -4, -8, -16, -32, -64, -128 ],
+ [ -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768 ],
+ [ -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648 ],
+ [ -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, -68719476736, -137438953472, -274877906944, -549755813888, -1099511627776, -2199023255552, -4398046511104, -8796093022208, -17592186044416, -35184372088832, -70368744177664, -140737488355328, -281474976710656, -562949953421312, -1125899906842624, -2251799813685248, -4503599627370496, -9007199254740992, -18014398509481984, -36028797018963968, -72057594037927936, -144115188075855872, -288230376151711744, -576460752303423488, -1152921504606846976, -2305843009213693952, -4611686018427387904, -9223372036854775808 ],
+ [ 0.0001, 1.0001, 2.0001, 3.0001, 4.0001, 5.0001, 6.0001, 7.0001 ]
+ }
+ }
+ }
+}
+}
diff --git a/tools/testfiles/tcmpdintarray.h5 b/tools/testfiles/tcmpdintarray.h5
new file mode 100644
index 0000000..17798fe
--- /dev/null
+++ b/tools/testfiles/tcmpdintarray.h5
Binary files differ
diff --git a/tools/testfiles/tcmpdints.ddl b/tools/testfiles/tcmpdints.ddl
new file mode 100644
index 0000000..f2986f3
--- /dev/null
+++ b/tools/testfiles/tcmpdints.ddl
@@ -0,0 +1,1444 @@
+HDF5 "tcmpdints.h5" {
+GROUP "/" {
+ DATASET "CompoundInts" {
+ DATATYPE H5T_COMPOUND {
+ H5T_STD_U8LE "DU08BITS";
+ H5T_STD_U16LE "DU16BITS";
+ H5T_STD_U32LE "DU32BITS";
+ H5T_STD_U64LE "DU64BITS";
+ H5T_STD_I8LE "DS08BITS";
+ H5T_STD_I16LE "DS16BITS";
+ H5T_STD_I32LE "DS32BITS";
+ H5T_STD_I64LE "DS64BITS";
+ H5T_IEEE_F64LE "DummyDBL";
+ }
+ DATASPACE SIMPLE { ( 64 ) / ( 64 ) }
+ DATA {
+ (0): {
+ 255,
+ 65535,
+ 4294967295,
+ 18446744073709551615,
+ -1,
+ -1,
+ -1,
+ -1,
+ 0.0001
+ },
+ (1): {
+ 254,
+ 65534,
+ 4294967294,
+ 18446744073709551614,
+ -2,
+ -2,
+ -2,
+ -2,
+ 1.0001
+ },
+ (2): {
+ 252,
+ 65532,
+ 4294967292,
+ 18446744073709551612,
+ -4,
+ -4,
+ -4,
+ -4,
+ 2.0001
+ },
+ (3): {
+ 248,
+ 65528,
+ 4294967288,
+ 18446744073709551608,
+ -8,
+ -8,
+ -8,
+ -8,
+ 3.0001
+ },
+ (4): {
+ 240,
+ 65520,
+ 4294967280,
+ 18446744073709551600,
+ -16,
+ -16,
+ -16,
+ -16,
+ 4.0001
+ },
+ (5): {
+ 224,
+ 65504,
+ 4294967264,
+ 18446744073709551584,
+ -32,
+ -32,
+ -32,
+ -32,
+ 5.0001
+ },
+ (6): {
+ 192,
+ 65472,
+ 4294967232,
+ 18446744073709551552,
+ -64,
+ -64,
+ -64,
+ -64,
+ 6.0001
+ },
+ (7): {
+ 128,
+ 65408,
+ 4294967168,
+ 18446744073709551488,
+ -128,
+ -128,
+ -128,
+ -128,
+ 7.0001
+ },
+ (8): {
+ 255,
+ 65280,
+ 4294967040,
+ 18446744073709551360,
+ -1,
+ -256,
+ -256,
+ -256,
+ 8.0001
+ },
+ (9): {
+ 254,
+ 65024,
+ 4294966784,
+ 18446744073709551104,
+ -2,
+ -512,
+ -512,
+ -512,
+ 9.0001
+ },
+ (10): {
+ 252,
+ 64512,
+ 4294966272,
+ 18446744073709550592,
+ -4,
+ -1024,
+ -1024,
+ -1024,
+ 10.0001
+ },
+ (11): {
+ 248,
+ 63488,
+ 4294965248,
+ 18446744073709549568,
+ -8,
+ -2048,
+ -2048,
+ -2048,
+ 11.0001
+ },
+ (12): {
+ 240,
+ 61440,
+ 4294963200,
+ 18446744073709547520,
+ -16,
+ -4096,
+ -4096,
+ -4096,
+ 12.0001
+ },
+ (13): {
+ 224,
+ 57344,
+ 4294959104,
+ 18446744073709543424,
+ -32,
+ -8192,
+ -8192,
+ -8192,
+ 13.0001
+ },
+ (14): {
+ 192,
+ 49152,
+ 4294950912,
+ 18446744073709535232,
+ -64,
+ -16384,
+ -16384,
+ -16384,
+ 14.0001
+ },
+ (15): {
+ 128,
+ 32768,
+ 4294934528,
+ 18446744073709518848,
+ -128,
+ -32768,
+ -32768,
+ -32768,
+ 15.0001
+ },
+ (16): {
+ 255,
+ 65535,
+ 4294901760,
+ 18446744073709486080,
+ -1,
+ -1,
+ -65536,
+ -65536,
+ 16.0001
+ },
+ (17): {
+ 254,
+ 65534,
+ 4294836224,
+ 18446744073709420544,
+ -2,
+ -2,
+ -131072,
+ -131072,
+ 17.0001
+ },
+ (18): {
+ 252,
+ 65532,
+ 4294705152,
+ 18446744073709289472,
+ -4,
+ -4,
+ -262144,
+ -262144,
+ 18.0001
+ },
+ (19): {
+ 248,
+ 65528,
+ 4294443008,
+ 18446744073709027328,
+ -8,
+ -8,
+ -524288,
+ -524288,
+ 19.0001
+ },
+ (20): {
+ 240,
+ 65520,
+ 4293918720,
+ 18446744073708503040,
+ -16,
+ -16,
+ -1048576,
+ -1048576,
+ 20.0001
+ },
+ (21): {
+ 224,
+ 65504,
+ 4292870144,
+ 18446744073707454464,
+ -32,
+ -32,
+ -2097152,
+ -2097152,
+ 21.0001
+ },
+ (22): {
+ 192,
+ 65472,
+ 4290772992,
+ 18446744073705357312,
+ -64,
+ -64,
+ -4194304,
+ -4194304,
+ 22.0001
+ },
+ (23): {
+ 128,
+ 65408,
+ 4286578688,
+ 18446744073701163008,
+ -128,
+ -128,
+ -8388608,
+ -8388608,
+ 23.0001
+ },
+ (24): {
+ 255,
+ 65280,
+ 4278190080,
+ 18446744073692774400,
+ -1,
+ -256,
+ -16777216,
+ -16777216,
+ 24.0001
+ },
+ (25): {
+ 254,
+ 65024,
+ 4261412864,
+ 18446744073675997184,
+ -2,
+ -512,
+ -33554432,
+ -33554432,
+ 25.0001
+ },
+ (26): {
+ 252,
+ 64512,
+ 4227858432,
+ 18446744073642442752,
+ -4,
+ -1024,
+ -67108864,
+ -67108864,
+ 26.0001
+ },
+ (27): {
+ 248,
+ 63488,
+ 4160749568,
+ 18446744073575333888,
+ -8,
+ -2048,
+ -134217728,
+ -134217728,
+ 27.0001
+ },
+ (28): {
+ 240,
+ 61440,
+ 4026531840,
+ 18446744073441116160,
+ -16,
+ -4096,
+ -268435456,
+ -268435456,
+ 28.0001
+ },
+ (29): {
+ 224,
+ 57344,
+ 3758096384,
+ 18446744073172680704,
+ -32,
+ -8192,
+ -536870912,
+ -536870912,
+ 29.0001
+ },
+ (30): {
+ 192,
+ 49152,
+ 3221225472,
+ 18446744072635809792,
+ -64,
+ -16384,
+ -1073741824,
+ -1073741824,
+ 30.0001
+ },
+ (31): {
+ 128,
+ 32768,
+ 2147483648,
+ 18446744071562067968,
+ -128,
+ -32768,
+ -2147483648,
+ -2147483648,
+ 31.0001
+ },
+ (32): {
+ 255,
+ 65535,
+ 4294967295,
+ 18446744069414584320,
+ -1,
+ -1,
+ -1,
+ -4294967296,
+ 32.0001
+ },
+ (33): {
+ 254,
+ 65534,
+ 4294967294,
+ 18446744065119617024,
+ -2,
+ -2,
+ -2,
+ -8589934592,
+ 33.0001
+ },
+ (34): {
+ 252,
+ 65532,
+ 4294967292,
+ 18446744056529682432,
+ -4,
+ -4,
+ -4,
+ -17179869184,
+ 34.0001
+ },
+ (35): {
+ 248,
+ 65528,
+ 4294967288,
+ 18446744039349813248,
+ -8,
+ -8,
+ -8,
+ -34359738368,
+ 35.0001
+ },
+ (36): {
+ 240,
+ 65520,
+ 4294967280,
+ 18446744004990074880,
+ -16,
+ -16,
+ -16,
+ -68719476736,
+ 36.0001
+ },
+ (37): {
+ 224,
+ 65504,
+ 4294967264,
+ 18446743936270598144,
+ -32,
+ -32,
+ -32,
+ -137438953472,
+ 37.0001
+ },
+ (38): {
+ 192,
+ 65472,
+ 4294967232,
+ 18446743798831644672,
+ -64,
+ -64,
+ -64,
+ -274877906944,
+ 38.0001
+ },
+ (39): {
+ 128,
+ 65408,
+ 4294967168,
+ 18446743523953737728,
+ -128,
+ -128,
+ -128,
+ -549755813888,
+ 39.0001
+ },
+ (40): {
+ 255,
+ 65280,
+ 4294967040,
+ 18446742974197923840,
+ -1,
+ -256,
+ -256,
+ -1099511627776,
+ 40.0001
+ },
+ (41): {
+ 254,
+ 65024,
+ 4294966784,
+ 18446741874686296064,
+ -2,
+ -512,
+ -512,
+ -2199023255552,
+ 41.0001
+ },
+ (42): {
+ 252,
+ 64512,
+ 4294966272,
+ 18446739675663040512,
+ -4,
+ -1024,
+ -1024,
+ -4398046511104,
+ 42.0001
+ },
+ (43): {
+ 248,
+ 63488,
+ 4294965248,
+ 18446735277616529408,
+ -8,
+ -2048,
+ -2048,
+ -8796093022208,
+ 43.0001
+ },
+ (44): {
+ 240,
+ 61440,
+ 4294963200,
+ 18446726481523507200,
+ -16,
+ -4096,
+ -4096,
+ -17592186044416,
+ 44.0001
+ },
+ (45): {
+ 224,
+ 57344,
+ 4294959104,
+ 18446708889337462784,
+ -32,
+ -8192,
+ -8192,
+ -35184372088832,
+ 45.0001
+ },
+ (46): {
+ 192,
+ 49152,
+ 4294950912,
+ 18446673704965373952,
+ -64,
+ -16384,
+ -16384,
+ -70368744177664,
+ 46.0001
+ },
+ (47): {
+ 128,
+ 32768,
+ 4294934528,
+ 18446603336221196288,
+ -128,
+ -32768,
+ -32768,
+ -140737488355328,
+ 47.0001
+ },
+ (48): {
+ 255,
+ 65535,
+ 4294901760,
+ 18446462598732840960,
+ -1,
+ -1,
+ -65536,
+ -281474976710656,
+ 48.0001
+ },
+ (49): {
+ 254,
+ 65534,
+ 4294836224,
+ 18446181123756130304,
+ -2,
+ -2,
+ -131072,
+ -562949953421312,
+ 49.0001
+ },
+ (50): {
+ 252,
+ 65532,
+ 4294705152,
+ 18445618173802708992,
+ -4,
+ -4,
+ -262144,
+ -1125899906842624,
+ 50.0001
+ },
+ (51): {
+ 248,
+ 65528,
+ 4294443008,
+ 18444492273895866368,
+ -8,
+ -8,
+ -524288,
+ -2251799813685248,
+ 51.0001
+ },
+ (52): {
+ 240,
+ 65520,
+ 4293918720,
+ 18442240474082181120,
+ -16,
+ -16,
+ -1048576,
+ -4503599627370496,
+ 52.0001
+ },
+ (53): {
+ 224,
+ 65504,
+ 4292870144,
+ 18437736874454810624,
+ -32,
+ -32,
+ -2097152,
+ -9007199254740992,
+ 53.0001
+ },
+ (54): {
+ 192,
+ 65472,
+ 4290772992,
+ 18428729675200069632,
+ -64,
+ -64,
+ -4194304,
+ -18014398509481984,
+ 54.0001
+ },
+ (55): {
+ 128,
+ 65408,
+ 4286578688,
+ 18410715276690587648,
+ -128,
+ -128,
+ -8388608,
+ -36028797018963968,
+ 55.0001
+ },
+ (56): {
+ 255,
+ 65280,
+ 4278190080,
+ 18374686479671623680,
+ -1,
+ -256,
+ -16777216,
+ -72057594037927936,
+ 56.0001
+ },
+ (57): {
+ 254,
+ 65024,
+ 4261412864,
+ 18302628885633695744,
+ -2,
+ -512,
+ -33554432,
+ -144115188075855872,
+ 57.0001
+ },
+ (58): {
+ 252,
+ 64512,
+ 4227858432,
+ 18158513697557839872,
+ -4,
+ -1024,
+ -67108864,
+ -288230376151711744,
+ 58.0001
+ },
+ (59): {
+ 248,
+ 63488,
+ 4160749568,
+ 17870283321406128128,
+ -8,
+ -2048,
+ -134217728,
+ -576460752303423488,
+ 59.0001
+ },
+ (60): {
+ 240,
+ 61440,
+ 4026531840,
+ 17293822569102704640,
+ -16,
+ -4096,
+ -268435456,
+ -1152921504606846976,
+ 60.0001
+ },
+ (61): {
+ 224,
+ 57344,
+ 3758096384,
+ 16140901064495857664,
+ -32,
+ -8192,
+ -536870912,
+ -2305843009213693952,
+ 61.0001
+ },
+ (62): {
+ 192,
+ 49152,
+ 3221225472,
+ 13835058055282163712,
+ -64,
+ -16384,
+ -1073741824,
+ -4611686018427387904,
+ 62.0001
+ },
+ (63): {
+ 128,
+ 32768,
+ 2147483648,
+ 9223372036854775808,
+ -128,
+ -32768,
+ -2147483648,
+ -9223372036854775808,
+ 63.0001
+ }
+ }
+ }
+ DATASET "CompoundRInts" {
+ DATATYPE H5T_COMPOUND {
+ H5T_STD_U64LE "DU64BITS";
+ H5T_STD_U32LE "DU32BITS";
+ H5T_STD_U16LE "DU16BITS";
+ H5T_STD_U8LE "DU08BITS";
+ H5T_STD_I64LE "DS64BITS";
+ H5T_STD_I32LE "DS32BITS";
+ H5T_STD_I16LE "DS16BITS";
+ H5T_STD_I8LE "DS08BITS";
+ H5T_IEEE_F64LE "DummyDBL";
+ }
+ DATASPACE SIMPLE { ( 64 ) / ( 64 ) }
+ DATA {
+ (0): {
+ 18446744073709551615,
+ 4294967295,
+ 65535,
+ 255,
+ -1,
+ -1,
+ -1,
+ -1,
+ 0.0001
+ },
+ (1): {
+ 18446744073709551614,
+ 4294967294,
+ 65534,
+ 254,
+ -2,
+ -2,
+ -2,
+ -2,
+ 1.0001
+ },
+ (2): {
+ 18446744073709551612,
+ 4294967292,
+ 65532,
+ 252,
+ -4,
+ -4,
+ -4,
+ -4,
+ 2.0001
+ },
+ (3): {
+ 18446744073709551608,
+ 4294967288,
+ 65528,
+ 248,
+ -8,
+ -8,
+ -8,
+ -8,
+ 3.0001
+ },
+ (4): {
+ 18446744073709551600,
+ 4294967280,
+ 65520,
+ 240,
+ -16,
+ -16,
+ -16,
+ -16,
+ 4.0001
+ },
+ (5): {
+ 18446744073709551584,
+ 4294967264,
+ 65504,
+ 224,
+ -32,
+ -32,
+ -32,
+ -32,
+ 5.0001
+ },
+ (6): {
+ 18446744073709551552,
+ 4294967232,
+ 65472,
+ 192,
+ -64,
+ -64,
+ -64,
+ -64,
+ 6.0001
+ },
+ (7): {
+ 18446744073709551488,
+ 4294967168,
+ 65408,
+ 128,
+ -128,
+ -128,
+ -128,
+ -128,
+ 7.0001
+ },
+ (8): {
+ 18446744073709551360,
+ 4294967040,
+ 65280,
+ 255,
+ -256,
+ -256,
+ -256,
+ -1,
+ 8.0001
+ },
+ (9): {
+ 18446744073709551104,
+ 4294966784,
+ 65024,
+ 254,
+ -512,
+ -512,
+ -512,
+ -2,
+ 9.0001
+ },
+ (10): {
+ 18446744073709550592,
+ 4294966272,
+ 64512,
+ 252,
+ -1024,
+ -1024,
+ -1024,
+ -4,
+ 10.0001
+ },
+ (11): {
+ 18446744073709549568,
+ 4294965248,
+ 63488,
+ 248,
+ -2048,
+ -2048,
+ -2048,
+ -8,
+ 11.0001
+ },
+ (12): {
+ 18446744073709547520,
+ 4294963200,
+ 61440,
+ 240,
+ -4096,
+ -4096,
+ -4096,
+ -16,
+ 12.0001
+ },
+ (13): {
+ 18446744073709543424,
+ 4294959104,
+ 57344,
+ 224,
+ -8192,
+ -8192,
+ -8192,
+ -32,
+ 13.0001
+ },
+ (14): {
+ 18446744073709535232,
+ 4294950912,
+ 49152,
+ 192,
+ -16384,
+ -16384,
+ -16384,
+ -64,
+ 14.0001
+ },
+ (15): {
+ 18446744073709518848,
+ 4294934528,
+ 32768,
+ 128,
+ -32768,
+ -32768,
+ -32768,
+ -128,
+ 15.0001
+ },
+ (16): {
+ 18446744073709486080,
+ 4294901760,
+ 65535,
+ 255,
+ -65536,
+ -65536,
+ -1,
+ -1,
+ 16.0001
+ },
+ (17): {
+ 18446744073709420544,
+ 4294836224,
+ 65534,
+ 254,
+ -131072,
+ -131072,
+ -2,
+ -2,
+ 17.0001
+ },
+ (18): {
+ 18446744073709289472,
+ 4294705152,
+ 65532,
+ 252,
+ -262144,
+ -262144,
+ -4,
+ -4,
+ 18.0001
+ },
+ (19): {
+ 18446744073709027328,
+ 4294443008,
+ 65528,
+ 248,
+ -524288,
+ -524288,
+ -8,
+ -8,
+ 19.0001
+ },
+ (20): {
+ 18446744073708503040,
+ 4293918720,
+ 65520,
+ 240,
+ -1048576,
+ -1048576,
+ -16,
+ -16,
+ 20.0001
+ },
+ (21): {
+ 18446744073707454464,
+ 4292870144,
+ 65504,
+ 224,
+ -2097152,
+ -2097152,
+ -32,
+ -32,
+ 21.0001
+ },
+ (22): {
+ 18446744073705357312,
+ 4290772992,
+ 65472,
+ 192,
+ -4194304,
+ -4194304,
+ -64,
+ -64,
+ 22.0001
+ },
+ (23): {
+ 18446744073701163008,
+ 4286578688,
+ 65408,
+ 128,
+ -8388608,
+ -8388608,
+ -128,
+ -128,
+ 23.0001
+ },
+ (24): {
+ 18446744073692774400,
+ 4278190080,
+ 65280,
+ 255,
+ -16777216,
+ -16777216,
+ -256,
+ -1,
+ 24.0001
+ },
+ (25): {
+ 18446744073675997184,
+ 4261412864,
+ 65024,
+ 254,
+ -33554432,
+ -33554432,
+ -512,
+ -2,
+ 25.0001
+ },
+ (26): {
+ 18446744073642442752,
+ 4227858432,
+ 64512,
+ 252,
+ -67108864,
+ -67108864,
+ -1024,
+ -4,
+ 26.0001
+ },
+ (27): {
+ 18446744073575333888,
+ 4160749568,
+ 63488,
+ 248,
+ -134217728,
+ -134217728,
+ -2048,
+ -8,
+ 27.0001
+ },
+ (28): {
+ 18446744073441116160,
+ 4026531840,
+ 61440,
+ 240,
+ -268435456,
+ -268435456,
+ -4096,
+ -16,
+ 28.0001
+ },
+ (29): {
+ 18446744073172680704,
+ 3758096384,
+ 57344,
+ 224,
+ -536870912,
+ -536870912,
+ -8192,
+ -32,
+ 29.0001
+ },
+ (30): {
+ 18446744072635809792,
+ 3221225472,
+ 49152,
+ 192,
+ -1073741824,
+ -1073741824,
+ -16384,
+ -64,
+ 30.0001
+ },
+ (31): {
+ 18446744071562067968,
+ 2147483648,
+ 32768,
+ 128,
+ -2147483648,
+ -2147483648,
+ -32768,
+ -128,
+ 31.0001
+ },
+ (32): {
+ 18446744069414584320,
+ 4294967295,
+ 65535,
+ 255,
+ -4294967296,
+ -1,
+ -1,
+ -1,
+ 32.0001
+ },
+ (33): {
+ 18446744065119617024,
+ 4294967294,
+ 65534,
+ 254,
+ -8589934592,
+ -2,
+ -2,
+ -2,
+ 33.0001
+ },
+ (34): {
+ 18446744056529682432,
+ 4294967292,
+ 65532,
+ 252,
+ -17179869184,
+ -4,
+ -4,
+ -4,
+ 34.0001
+ },
+ (35): {
+ 18446744039349813248,
+ 4294967288,
+ 65528,
+ 248,
+ -34359738368,
+ -8,
+ -8,
+ -8,
+ 35.0001
+ },
+ (36): {
+ 18446744004990074880,
+ 4294967280,
+ 65520,
+ 240,
+ -68719476736,
+ -16,
+ -16,
+ -16,
+ 36.0001
+ },
+ (37): {
+ 18446743936270598144,
+ 4294967264,
+ 65504,
+ 224,
+ -137438953472,
+ -32,
+ -32,
+ -32,
+ 37.0001
+ },
+ (38): {
+ 18446743798831644672,
+ 4294967232,
+ 65472,
+ 192,
+ -274877906944,
+ -64,
+ -64,
+ -64,
+ 38.0001
+ },
+ (39): {
+ 18446743523953737728,
+ 4294967168,
+ 65408,
+ 128,
+ -549755813888,
+ -128,
+ -128,
+ -128,
+ 39.0001
+ },
+ (40): {
+ 18446742974197923840,
+ 4294967040,
+ 65280,
+ 255,
+ -1099511627776,
+ -256,
+ -256,
+ -1,
+ 40.0001
+ },
+ (41): {
+ 18446741874686296064,
+ 4294966784,
+ 65024,
+ 254,
+ -2199023255552,
+ -512,
+ -512,
+ -2,
+ 41.0001
+ },
+ (42): {
+ 18446739675663040512,
+ 4294966272,
+ 64512,
+ 252,
+ -4398046511104,
+ -1024,
+ -1024,
+ -4,
+ 42.0001
+ },
+ (43): {
+ 18446735277616529408,
+ 4294965248,
+ 63488,
+ 248,
+ -8796093022208,
+ -2048,
+ -2048,
+ -8,
+ 43.0001
+ },
+ (44): {
+ 18446726481523507200,
+ 4294963200,
+ 61440,
+ 240,
+ -17592186044416,
+ -4096,
+ -4096,
+ -16,
+ 44.0001
+ },
+ (45): {
+ 18446708889337462784,
+ 4294959104,
+ 57344,
+ 224,
+ -35184372088832,
+ -8192,
+ -8192,
+ -32,
+ 45.0001
+ },
+ (46): {
+ 18446673704965373952,
+ 4294950912,
+ 49152,
+ 192,
+ -70368744177664,
+ -16384,
+ -16384,
+ -64,
+ 46.0001
+ },
+ (47): {
+ 18446603336221196288,
+ 4294934528,
+ 32768,
+ 128,
+ -140737488355328,
+ -32768,
+ -32768,
+ -128,
+ 47.0001
+ },
+ (48): {
+ 18446462598732840960,
+ 4294901760,
+ 65535,
+ 255,
+ -281474976710656,
+ -65536,
+ -1,
+ -1,
+ 48.0001
+ },
+ (49): {
+ 18446181123756130304,
+ 4294836224,
+ 65534,
+ 254,
+ -562949953421312,
+ -131072,
+ -2,
+ -2,
+ 49.0001
+ },
+ (50): {
+ 18445618173802708992,
+ 4294705152,
+ 65532,
+ 252,
+ -1125899906842624,
+ -262144,
+ -4,
+ -4,
+ 50.0001
+ },
+ (51): {
+ 18444492273895866368,
+ 4294443008,
+ 65528,
+ 248,
+ -2251799813685248,
+ -524288,
+ -8,
+ -8,
+ 51.0001
+ },
+ (52): {
+ 18442240474082181120,
+ 4293918720,
+ 65520,
+ 240,
+ -4503599627370496,
+ -1048576,
+ -16,
+ -16,
+ 52.0001
+ },
+ (53): {
+ 18437736874454810624,
+ 4292870144,
+ 65504,
+ 224,
+ -9007199254740992,
+ -2097152,
+ -32,
+ -32,
+ 53.0001
+ },
+ (54): {
+ 18428729675200069632,
+ 4290772992,
+ 65472,
+ 192,
+ -18014398509481984,
+ -4194304,
+ -64,
+ -64,
+ 54.0001
+ },
+ (55): {
+ 18410715276690587648,
+ 4286578688,
+ 65408,
+ 128,
+ -36028797018963968,
+ -8388608,
+ -128,
+ -128,
+ 55.0001
+ },
+ (56): {
+ 18374686479671623680,
+ 4278190080,
+ 65280,
+ 255,
+ -72057594037927936,
+ -16777216,
+ -256,
+ -1,
+ 56.0001
+ },
+ (57): {
+ 18302628885633695744,
+ 4261412864,
+ 65024,
+ 254,
+ -144115188075855872,
+ -33554432,
+ -512,
+ -2,
+ 57.0001
+ },
+ (58): {
+ 18158513697557839872,
+ 4227858432,
+ 64512,
+ 252,
+ -288230376151711744,
+ -67108864,
+ -1024,
+ -4,
+ 58.0001
+ },
+ (59): {
+ 17870283321406128128,
+ 4160749568,
+ 63488,
+ 248,
+ -576460752303423488,
+ -134217728,
+ -2048,
+ -8,
+ 59.0001
+ },
+ (60): {
+ 17293822569102704640,
+ 4026531840,
+ 61440,
+ 240,
+ -1152921504606846976,
+ -268435456,
+ -4096,
+ -16,
+ 60.0001
+ },
+ (61): {
+ 16140901064495857664,
+ 3758096384,
+ 57344,
+ 224,
+ -2305843009213693952,
+ -536870912,
+ -8192,
+ -32,
+ 61.0001
+ },
+ (62): {
+ 13835058055282163712,
+ 3221225472,
+ 49152,
+ 192,
+ -4611686018427387904,
+ -1073741824,
+ -16384,
+ -64,
+ 62.0001
+ },
+ (63): {
+ 9223372036854775808,
+ 2147483648,
+ 32768,
+ 128,
+ -9223372036854775808,
+ -2147483648,
+ -32768,
+ -128,
+ 63.0001
+ }
+ }
+ }
+}
+}
diff --git a/tools/testfiles/tcmpdints.h5 b/tools/testfiles/tcmpdints.h5
new file mode 100644
index 0000000..d4af1c4
--- /dev/null
+++ b/tools/testfiles/tcmpdints.h5
Binary files differ
diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h
index 6da8068..a9d84bf 100644
--- a/vms/src/h5pubconf.h
+++ b/vms/src/h5pubconf.h
@@ -511,7 +511,7 @@
#define H5_PACKAGE_NAME "HDF5"
/* Define to the full name and version of this package. */
-#define H5_PACKAGE_STRING "HDF5 1.9.167-swmr0"
+#define H5_PACKAGE_STRING "HDF5 1.9.169-swmr0"
/* Define to the one symbol short name of this package. */
#define H5_PACKAGE_TARNAME "hdf5"
@@ -520,7 +520,7 @@
#define H5_PACKAGE_URL ""
/* Define to the version of this package. */
-#define H5_PACKAGE_VERSION "1.9.167-swmr0"
+#define H5_PACKAGE_VERSION "1.9.169-swmr0"
/* Width for printf() for type `long long' or `__int64', use `ll' */
#define H5_PRINTF_LL_WIDTH "ll"
@@ -683,7 +683,7 @@
/* #undef H5_USING_MEMCHECKER */
/* Version number of package */
-#define H5_VERSION "1.9.167-swmr0"
+#define H5_VERSION "1.9.169-swmr0"
/* Define if vsnprintf() returns the correct value for formatted strings that
don't fit into size allowed */