From 11e0151645566c9c94f11eca1556af6a316bd335 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 6 Aug 2019 12:59:22 -0500 Subject: Merge mostly CMake changes from develop and file cleanup --- CTestConfig.cmake | 2 +- MANIFEST | 5 +- bin/make_err | 4 +- bin/output_filter.sh | 20 +- c++/test/CMakeVFDTests.cmake | 80 +- config/cmake/HDFCompilerFlags.cmake | 17 +- config/cmake/scripts/HDF5config.cmake | 359 +++---- config/conclude.am | 9 +- fortran/src/CMakeLists.txt | 50 + src/H5Edefin.h | 240 ++--- src/H5Einit.h | 768 +++++++-------- src/H5Epubgen.h | 438 ++++----- src/H5Eterm.h | 240 ++--- test/big.c | 9 + test/dtypes.c | 198 ++-- test/error_test.c | 9 + test/external.c | 7 +- test/fheap.c | 113 ++- test/file_image.c | 9 + test/gheap.c | 324 +++--- test/h5test.c | 479 ++++++--- test/h5test.h | 22 +- test/lheap.c | 2 +- test/mf.c | 6 +- test/objcopy.c | 1560 ++++++++++++++--------------- test/ohdr.c | 139 ++- test/set_extent.c | 1748 ++++++++++++--------------------- 27 files changed, 3367 insertions(+), 3490 deletions(-) diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 3a0b031..a1b7297 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -50,5 +50,5 @@ set (CTEST_TEST_TIMEOUT 1200 CACHE STRING set (DART_TESTING_TIMEOUT 1200 CACHE STRING "Maximum time allowed before CTest will kill the test." FORCE) -SET(CTEST_SUBMIT_RETRY_DELAY 20 CACHE STRING +set (CTEST_SUBMIT_RETRY_DELAY 20 CACHE STRING "How long to wait between timed-out CTest submissions.") diff --git a/MANIFEST b/MANIFEST index 29283e2..def26c0 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2393,6 +2393,7 @@ ./c++/src/CMakeLists.txt ./c++/test/CMakeLists.txt ./c++/test/CMakeTests.cmake +./c++/test/CMakeVFDTests.cmake ./examples/CMakeLists.txt ./examples/CMakeTests.cmake ./examples/run-all-ex.sh @@ -2432,6 +2433,7 @@ ./test/CMakeVFDTests.cmake ./testpar/CMakeLists.txt ./testpar/CMakeTests.cmake +./testpar/CMakeVFDTests.cmake ./tools/CMakeLists.txt ./tools/h5copy/CMakeLists.txt ./tools/h5copy/CMakeTests.cmake @@ -2441,6 +2443,7 @@ ./tools/h5dump/CMakeTests.cmake ./tools/h5dump/CMakeTestsPBITS.cmake ./tools/h5dump/CMakeTestsXML.cmake +./tools/h5dump/CMakeVFDTests.cmake ./tools/h5import/CMakeLists.txt ./tools/h5import/CMakeTests.cmake ./tools/h5jam/CMakeLists.txt @@ -2449,11 +2452,11 @@ ./tools/h5ls/CMakeTests.cmake ./tools/h5repack/CMakeLists.txt ./tools/h5repack/CMakeTests.cmake +./tools/h5repack/CMakeVFDTests.cmake ./tools/h5stat/CMakeLists.txt ./tools/h5stat/CMakeTests.cmake ./tools/lib/CMakeLists.txt ./tools/misc/CMakeLists.txt -./tools/misc/CMakeTests.cmake ./tools/misc/CMakeTestsMkgrp.cmake ./tools/misc/CMakeTestsRepart.cmake ./tools/perform/CMakeLists.txt diff --git a/bin/make_err b/bin/make_err index bfe8861..a6461d4 100755 --- a/bin/make_err +++ b/bin/make_err @@ -244,7 +244,7 @@ sub create_init ($) { print HEADER "/* Major error codes */\n"; print HEADER "/*********************/\n\n"; foreach $name (keys %major) { - print HEADER " "x(0*$indent),"assert(${name}_g==(-1));\n"; + print HEADER " "x(0*$indent),"HDassert(${name}_g==(-1));\n"; print HEADER " "x(0*$indent),"if((msg = H5E_create_msg(cls, H5E_MAJOR, \"${major{$name}}\"))==NULL)\n"; print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, \"error message initialization failed\")\n"; print HEADER " "x(0*$indent),"if((${name}_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)\n"; @@ -260,7 +260,7 @@ sub create_init ($) { # Iterate over all the minor errors in each section for $name ( @{$section_list{$sect_name}}) { - print HEADER " "x(0*$indent),"assert(${name}_g==(-1));\n"; + print HEADER " "x(0*$indent),"HDassert(${name}_g==(-1));\n"; print HEADER " "x(0*$indent),"if((msg = H5E_create_msg(cls, H5E_MINOR, \"${minor{$name}}\"))==NULL)\n"; print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, \"error message initialization failed\")\n"; print HEADER " "x(0*$indent),"if((${name}_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)\n"; diff --git a/bin/output_filter.sh b/bin/output_filter.sh index a080b55..fb59dfd 100644 --- a/bin/output_filter.sh +++ b/bin/output_filter.sh @@ -3,10 +3,10 @@ ## ## This file is part of HDF5. The full HDF5 copyright notice, including ## terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. +## the COPYING file, which can be found at the root of the source code +## distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +## If you do not have access to either file, you may request a copy from +## help@hdfgroup.org. # This contains function definitions of output filtering. # This file should only be sourced in by another shell script. @@ -16,15 +16,15 @@ # Comment added to address HDFFV-8270: -# As I understand it, the purpose of this file is to remove extraneous messages -# that appear in stdout and stderr on some machines that have been tested outside -# of the HDF Group realm. The purpose of this script is to filter those +# As I understand it, the purpose of this file is to remove extraneous messages +# that appear in stdout and stderr on some machines that have been tested outside +# of the HDF Group realm. The purpose of this script is to filter those # extraneous messages from stdout and stderr so that when the output files are -# compared to the expected output, the extra messages will not cause failures in +# compared to the expected output, the extra messages will not cause failures in # the tests. The system messages in the comments below are out of date, meaning -# I suppose that while the script code to filter messages on the system was +# I suppose that while the script code to filter messages on the system was # correct correct when last used, the output in the comments doesn't match the -# script code that follows. I don't currently have access to any of these +# script code that follows. I don't currently have access to any of these # systems to see the current output and the effect of the script code. If using # this file in the future, please update the comments to match the scripts in use. # Larry Knox 2017/3/15 diff --git a/c++/test/CMakeVFDTests.cmake b/c++/test/CMakeVFDTests.cmake index b26165a..8a44767 100644 --- a/c++/test/CMakeVFDTests.cmake +++ b/c++/test/CMakeVFDTests.cmake @@ -15,36 +15,42 @@ ### T E S T I N G ### ############################################################################## ############################################################################## - set (VFD_LIST - sec2 - stdio - core - split - multi - family - ) - if (DIRECT_VFD) - set (VFD_LIST ${VFD_LIST} direct) - endif () +set (VFD_LIST + sec2 + stdio + core + split + multi + family +) + +if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) +endif () + +############################################################################## +############################################################################## +### T H E T E S T S M A C R O S ### +############################################################################## +############################################################################## - macro (ADD_VFD_TEST vfdname resultcode) - if (NOT HDF5_ENABLE_USING_MEMCHECKER) - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}") - add_test ( - NAME CPP_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 - titerate.h5 - WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${vfdname} - ) - add_test ( +macro (ADD_VFD_TEST vfdname resultcode) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}") + add_test ( + NAME CPP_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 + titerate.h5 + WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${vfdname} + ) + add_test ( NAME CPP_VFD-${vfdname}-cpp_testhdf5 COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" @@ -55,13 +61,13 @@ -D "TEST_OUTPUT=${vfdname}-cpp_testhdf5.out" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects) - set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES TIMEOUT ${CTEST_SHORT_TIMEOUT}) - endif () - endmacro () + ) + set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects) + set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES TIMEOUT ${CTEST_SHORT_TIMEOUT}) + endif () +endmacro () - # Run test with different Virtual File Driver - foreach (vfd ${VFD_LIST}) - ADD_VFD_TEST (${vfd} 0) - endforeach () +# Run test with different Virtual File Driver +foreach (vfd ${VFD_LIST}) + ADD_VFD_TEST (${vfd} 0) +endforeach () diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 0a39568..82d63af 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -195,7 +195,22 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) # Append more extra warning flags that only gcc 6.x+ know about if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0) - set (H5_CFLAGS4 "${H5_CFLAGS4} -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa") + set (H5_CFLAGS4 "${H5_CFLAGS4} -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa -Wnormalized") + endif () + + # Append more extra warning flags that only gcc 7.x+ know about + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0) + set (H5_CFLAGS4 "${H5_CFLAGS4} -Walloc-zero -Walloca -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wrestrict") + endif () + + # Append more extra warning flags that only gcc 8.x+ know about + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.0) + set (H5_CFLAGS4 "${H5_CFLAGS4} -Wattribute-alias -Wcast-align=strict -Wshift-overflow=2 -Wno-suggest-attribute=cold -Wno-suggest-attribute=malloc") + endif () + + # Append more extra warning flags that only gcc 9.x+ know about + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.0) + set (H5_CFLAGS4 "${H5_CFLAGS4} Wattribute-alias=2 -Wmissing-profile") endif () endif () diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index d8196b1..973c726 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -60,185 +60,192 @@ endif () # build generator must be defined if (NOT DEFINED BUILD_GENERATOR) message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") -endif () - -################################################################### -### Following Line is one of [Release, RelWithDebInfo, Debug] ##### +endif () + +################################################################### +### Following Line is one of [Release, RelWithDebInfo, Debug] ##### ### (default use command line -C value) -set (CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") -################################################################### - -if (NOT DEFINED INSTALLDIR) - if (WIN32) - set (INSTALLDIR "C:/Program Files/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") - else () - set (INSTALLDIR "${CTEST_SCRIPT_DIRECTORY}/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") - endif () -endif () -if (NOT DEFINED CTEST_CONFIGURATION_TYPE) - set (CTEST_CONFIGURATION_TYPE "Release") -endif () -if (NOT DEFINED CTEST_SOURCE_NAME) - set (CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") -endif () - -set (CTEST_BINARY_NAME "build") -set (CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") -if (WIN32) - set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") - set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") -else () - set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") - set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") -endif () - -################################################################### -######### Following describes compiler ############ -if (WIN32) - set (SITE_OS_NAME "Windows") - set (SITE_OS_VERSION "WIN7") - if (${BUILD_GENERATOR} STREQUAL "VS201764") - set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017 Win64") - set (SITE_OS_BITS "64") - set (SITE_COMPILER_NAME "vs2017") - set (SITE_COMPILER_VERSION "15") - elseif (${BUILD_GENERATOR} STREQUAL "VS2017") - set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017") - set (SITE_OS_BITS "32") - set (SITE_COMPILER_NAME "vs2017") - set (SITE_COMPILER_VERSION "15") - elseif (${BUILD_GENERATOR} STREQUAL "VS201564") - set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") - set (SITE_OS_BITS "64") - set (SITE_COMPILER_NAME "vs2015") - set (SITE_COMPILER_VERSION "14") - elseif (${BUILD_GENERATOR} STREQUAL "VS2015") - set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") - set (SITE_OS_BITS "32") - set (SITE_COMPILER_NAME "vs2015") - set (SITE_COMPILER_VERSION "14") - elseif (${BUILD_GENERATOR} STREQUAL "VS201364") - set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") - set (SITE_OS_BITS "64") - set (SITE_COMPILER_NAME "vs2013") - set (SITE_COMPILER_VERSION "12") - elseif (${BUILD_GENERATOR} STREQUAL "VS2013") - set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") - set (SITE_OS_BITS "32") - set (SITE_COMPILER_NAME "vs2013") - set (SITE_COMPILER_VERSION "12") - elseif (${BUILD_GENERATOR} STREQUAL "VS201264") - set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") - set (SITE_OS_BITS "64") - set (SITE_COMPILER_NAME "vs2012") - set (SITE_COMPILER_VERSION "11") - elseif (${BUILD_GENERATOR} STREQUAL "VS2012") - set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") - set (SITE_OS_BITS "32") - set (SITE_COMPILER_NAME "vs2012") - set (SITE_COMPILER_VERSION "11") +set (CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") +################################################################### + +if (NOT DEFINED INSTALLDIR) + if (WIN32) + set (INSTALLDIR "C:/Program Files/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") else () - message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") + set (INSTALLDIR "${CTEST_SCRIPT_DIRECTORY}/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") endif () -## Set the following to unique id your computer ## - set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") -else () - set (CTEST_CMAKE_GENERATOR "Unix Makefiles") -## Set the following to unique id your computer ## - if (APPLE) - set (CTEST_SITE "MAC.XXXX") - else () - set (CTEST_SITE "LINUX.XXXX") - endif () - if (APPLE) - execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set (ENV{CC} "${XCODE_CC}") - set (ENV{CXX} "${XCODE_CXX}") - set (CTEST_USE_LAUNCHERS 1) - set (RR_WARNINGS_COMMON "-Wno-format-nonliteral -Wno-cast-align -Wno-unused -Wno-unused-variable -Wno-unused-function -Wno-self-assign -Wno-unused-parameter -Wno-sign-compare") - set (RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations -Wno-uninitialized") - set (RR_WARNINGS_CXX "${RR_WARNINGS_COMMON} -Woverloaded-virtual -Wshadow -Wwrite-strings -Wc++11-compat") - set (RR_FLAGS_COMMON "-g -O0 -fstack-protector-all -D_FORTIFY_SOURCE=2") - set (RR_FLAGS_C "${RR_FLAGS_COMMON}") - set (RR_FLAGS_CXX "${RR_FLAGS_COMMON}") - set (ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}") - set (ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}") - endif () -endif () -################################################################### - -################################################################### -######### Following is for submission to CDash ############ -################################################################### +endif () +if (NOT DEFINED CTEST_CONFIGURATION_TYPE) + set (CTEST_CONFIGURATION_TYPE "Release") +endif () +if (NOT DEFINED CTEST_SOURCE_NAME) + set (CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") +endif () + +set (CTEST_BINARY_NAME "build") +set (CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") +if (WIN32 AND NOT MINGW) + set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") + set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") +else () + set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") + set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") +endif () + +################################################################### +######### Following describes compiler ############ + if (NOT DEFINED BUILD_GENERATOR) + message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") + endif () + if (WIN32 AND NOT MINGW) + set (SITE_OS_NAME "Windows") + set (SITE_OS_VERSION "WIN7") + if (BUILD_GENERATOR STREQUAL "VS201764") + set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2017") + set (SITE_COMPILER_VERSION "15") + elseif (BUILD_GENERATOR STREQUAL "VS2017") + set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2017") + set (SITE_COMPILER_VERSION "15") + elseif (BUILD_GENERATOR STREQUAL "VS201564") + set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2015") + set (SITE_COMPILER_VERSION "14") + elseif (BUILD_GENERATOR STREQUAL "VS2015") + set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2015") + set (SITE_COMPILER_VERSION "14") + elseif (BUILD_GENERATOR STREQUAL "VS201364") + set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2013") + set (SITE_COMPILER_VERSION "12") + elseif (BUILD_GENERATOR STREQUAL "VS2013") + set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2013") + set (SITE_COMPILER_VERSION "12") + elseif (BUILD_GENERATOR STREQUAL "VS201264") + set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2012") + set (SITE_COMPILER_VERSION "11") + elseif (BUILD_GENERATOR STREQUAL "VS2012") + set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2012") + set (SITE_COMPILER_VERSION "11") + else () + message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") + endif () + ## Set the following to unique id your computer ## + set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") + else () + set (CTEST_CMAKE_GENERATOR "Unix Makefiles") + ## Set the following to unique id your computer ## + if (APPLE) + set (CTEST_SITE "MAC.XXXX") + else () + set (CTEST_SITE "LINUX.XXXX") + endif () + if (APPLE) + execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set (ENV{CC} "${XCODE_CC}") + set (ENV{CXX} "${XCODE_CXX}") + set (CTEST_USE_LAUNCHERS 1) + set (RR_WARNINGS_COMMON "-Wno-format-nonliteral -Wno-cast-align -Wno-unused -Wno-unused-variable -Wno-unused-function -Wno-self-assign -Wno-unused-parameter -Wno-sign-compare") + set (RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations -Wno-uninitialized") + set (RR_WARNINGS_CXX "${RR_WARNINGS_COMMON} -Woverloaded-virtual -Wshadow -Wwrite-strings -Wc++11-compat") + set (RR_FLAGS_COMMON "-g -O0 -fstack-protector-all -D_FORTIFY_SOURCE=2") + set (RR_FLAGS_C "${RR_FLAGS_COMMON}") + set (RR_FLAGS_CXX "${RR_FLAGS_COMMON}") + set (ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}") + set (ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}") + endif () + endif () +################################################################### + +################################################################### +######### Following is for submission to CDash ############ +################################################################### if (NOT DEFINED MODEL) set (MODEL "Experimental") endif () -################################################################### - -################################################################### -##### Following controls CDash submission ##### -#set (LOCAL_SUBMIT "TRUE") -##### Following controls test process ##### -#set (LOCAL_SKIP_TEST "TRUE") -#set (LOCAL_MEMCHECK_TEST "TRUE") -#set (LOCAL_COVERAGE_TEST "TRUE") -##### Following controls cpack command ##### -#set (LOCAL_NO_PACKAGE "TRUE") -##### Following controls source update ##### -#set (LOCAL_UPDATE "TRUE") -set (REPOSITORY_URL "https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git") -set (REPOSITORY_BRANCH "hdf5_1_8_22") - -#uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows -#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}") -################################################################### - - -################################################################### - -if (WIN32 AND NOT MINGW) - set (BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}") - include (${CTEST_SCRIPT_DIRECTORY}\\HDF5options.cmake) - include (${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) - if (EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe") - file (COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - if (EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi") - file (COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - if (EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip") - file (COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () -else () - set (BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") - include (${CTEST_SCRIPT_DIRECTORY}/HDF5options.cmake) - include (${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) - if (APPLE) - if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg") - file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz") - file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh") - file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - else () - if (CYGWIN) - if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh") - file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz") - file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - else () - if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh") - file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz") - file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - endif () - endif () -endif () + +################################################################### + +################################################################### +##### Following controls CDash submission ##### +#set (LOCAL_SUBMIT "TRUE") +##### Following controls test process ##### +#set (LOCAL_SKIP_TEST "TRUE") +#set (LOCAL_MEMCHECK_TEST "TRUE") +#set (LOCAL_COVERAGE_TEST "TRUE") +##### Following controls cpack command ##### +#set (LOCAL_NO_PACKAGE "TRUE") +##### Following controls source update ##### +#set (LOCAL_UPDATE "TRUE") +set (REPOSITORY_URL "https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git") +set (REPOSITORY_BRANCH "hdf5_1_10_6") + +#uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows +#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}") +################################################################### + + +################################################################### + +if (WIN32 AND NOT MINGW) + set (BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}") + include (${CTEST_SCRIPT_DIRECTORY}\\HDF5options.cmake) + include (${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) + if (EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe") + file (COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if (EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi") + file (COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if (EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip") + file (COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () +else () + set (BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") + include (${CTEST_SCRIPT_DIRECTORY}/HDF5options.cmake) + if (DEFINED HPC) + include (${CTEST_SOURCE_DIRECTORY}/config/cmake/scripts/HPC/${HPC}-HDF5options.cmake) + endif () + include (${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) + if (APPLE) + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + else () + if (CYGWIN) + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + else () + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz") + file (COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + endif () + endif () +endif () diff --git a/config/conclude.am b/config/conclude.am index e6635d0..6e96ba2 100644 --- a/config/conclude.am +++ b/config/conclude.am @@ -16,11 +16,11 @@ ## Textually included at the end of most HDF5 Makefiles.am. ## Contains build rules. -# Automake needs to be taught how to build lib, dyn, progs, and tests targets. +# Automake needs to be taught how to build lib, progs and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to -# be built at certain times. +# be built at certain times. LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ @@ -32,6 +32,7 @@ TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = REALTIMEOUTPUT = $(realtimeOutput) + # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. build-lib: $(LIB) @@ -67,7 +68,7 @@ all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS) # make install-doc doesn't do anything outside of doc directory, but # Makefiles should recognize it. # UPDATE: docs no longer reside in this build tree, so this target -# is depreciated. +# is deprecated. install-doc uninstall-doc: @echo "Nothing to be done." @@ -233,7 +234,7 @@ build-check-p: $(LIB) $(PROGS) $(chk_TESTS) echo "**** Hint ****"; \ echo "Parallel test files reside in the current directory" \ "by default."; \ - echo "Set HDF5_PARAPREFIX to use another directory. E.g.,"; \ + echo "Set HDF5_PARAPREFIX to use another directory. e.g.,"; \ echo " HDF5_PARAPREFIX=/PFS/user/me"; \ echo " export HDF5_PARAPREFIX"; \ echo " make check"; \ diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 148f1a8..cf37f25 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -570,3 +570,53 @@ if (HDF5_EXPORTED_TARGETS) INCLUDES DESTINATION include ) endif () + +#----------------------------------------------------------------------------- +# Create pkgconfig files +#----------------------------------------------------------------------------- +set (_PKG_CONFIG_PREFIX ${CMAKE_INSTALL_PREFIX}) +set (_PKG_CONFIG_EXEC_PREFIX \${prefix}) +set (_PKG_CONFIG_LIBDIR \${exec_prefix}/lib) +set (_PKG_CONFIG_INCLUDEDIR \${prefix}/include) +set (_PKG_CONFIG_LIBNAME "${HDF5_F90_LIB_CORENAME}") +set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}") + +set (_PKG_CONFIG_LIBS_PRIVATE) + +if (NOT ONLY_SHARED_LIBS) + set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_F90_LIB_CORENAME}") +endif () +if (BUILD_SHARED_LIBS) + set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_F90_LIB_CORENAME}") +endif () + +set (_PKG_CONFIG_REQUIRES "${HDF5_LIB_CORENAME}") +set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_LIB_CORENAME}") + +configure_file ( + ${HDF_RESOURCES_DIR}/libhdf5.pc.in + ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_F90_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc + @ONLY +) +install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_F90_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc + DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig + COMPONENT fortlibraries +) + +if (NOT WIN32 AND NOT MINGW) + set (_PKG_CONFIG_COMPILER ${CMAKE_Fortran_COMPILER}) + configure_file ( + ${HDF_RESOURCES_DIR}/libh5cc.in + ${HDF5_BINARY_DIR}/CMakeFiles/h5fc + @ONLY + ) + install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5fc + DESTINATION ${HDF5_INSTALL_BIN_DIR} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + COMPONENT fortlibraries + ) +endif () + + diff --git a/src/H5Edefin.h b/src/H5Edefin.h index 1b17898..8442781 100644 --- a/src/H5Edefin.h +++ b/src/H5Edefin.h @@ -19,54 +19,59 @@ #define _H5Edefin_H /* Major error IDs */ -hid_t H5E_PLIST_g = FAIL; /* Property lists */ -hid_t H5E_INTERNAL_g = FAIL; /* Internal error (too specific to document in detail) */ -hid_t H5E_LINK_g = FAIL; /* Links */ -hid_t H5E_STORAGE_g = FAIL; /* Data storage */ -hid_t H5E_BTREE_g = FAIL; /* B-Tree node */ -hid_t H5E_FUNC_g = FAIL; /* Function entry/exit */ +hid_t H5E_ATTR_g = FAIL; /* Attribute */ +hid_t H5E_NONE_MAJOR_g = FAIL; /* No error */ +hid_t H5E_PLINE_g = FAIL; /* Data filters */ +hid_t H5E_FSPACE_g = FAIL; /* Free Space Manager */ +hid_t H5E_RS_g = FAIL; /* Reference Counted Strings */ +hid_t H5E_DATATYPE_g = FAIL; /* Datatype */ +hid_t H5E_FILE_g = FAIL; /* File accessibilty */ +hid_t H5E_PLUGIN_g = FAIL; /* Plugin for dynamically loaded library */ hid_t H5E_DATASET_g = FAIL; /* Dataset */ -hid_t H5E_HEAP_g = FAIL; /* Heap */ +hid_t H5E_OHDR_g = FAIL; /* Object header */ +hid_t H5E_SLIST_g = FAIL; /* Skip Lists */ +hid_t H5E_LINK_g = FAIL; /* Links */ hid_t H5E_RESOURCE_g = FAIL; /* Resource unavailable */ -hid_t H5E_DATASPACE_g = FAIL; /* Dataspace */ hid_t H5E_ERROR_g = FAIL; /* Error API */ +hid_t H5E_INTERNAL_g = FAIL; /* Internal error (too specific to document in detail) */ +hid_t H5E_TST_g = FAIL; /* Ternary Search Trees */ +hid_t H5E_CACHE_g = FAIL; /* Object cache */ hid_t H5E_EFL_g = FAIL; /* External file list */ -hid_t H5E_NONE_MAJOR_g = FAIL; /* No error */ -hid_t H5E_PLINE_g = FAIL; /* Data filters */ -hid_t H5E_OHDR_g = FAIL; /* Object header */ -hid_t H5E_PLUGIN_g = FAIL; /* Plugin for dynamically loaded library */ -hid_t H5E_IO_g = FAIL; /* Low-level I/O */ +hid_t H5E_SYM_g = FAIL; /* Symbol table */ +hid_t H5E_HEAP_g = FAIL; /* Heap */ +hid_t H5E_REFERENCE_g = FAIL; /* References */ +hid_t H5E_FUNC_g = FAIL; /* Function entry/exit */ +hid_t H5E_STORAGE_g = FAIL; /* Data storage */ +hid_t H5E_VFL_g = FAIL; /* Virtual File Layer */ hid_t H5E_SOHM_g = FAIL; /* Shared Object Header Messages */ -hid_t H5E_TST_g = FAIL; /* Ternary Search Trees */ hid_t H5E_ATOM_g = FAIL; /* Object atom */ -hid_t H5E_ATTR_g = FAIL; /* Attribute */ hid_t H5E_ARGS_g = FAIL; /* Invalid arguments to routine */ -hid_t H5E_FILE_g = FAIL; /* File accessibilty */ -hid_t H5E_FSPACE_g = FAIL; /* Free Space Manager */ -hid_t H5E_SLIST_g = FAIL; /* Skip Lists */ -hid_t H5E_SYM_g = FAIL; /* Symbol table */ -hid_t H5E_DATATYPE_g = FAIL; /* Datatype */ -hid_t H5E_CACHE_g = FAIL; /* Object cache */ -hid_t H5E_RS_g = FAIL; /* Reference Counted Strings */ -hid_t H5E_VFL_g = FAIL; /* Virtual File Layer */ -hid_t H5E_REFERENCE_g = FAIL; /* References */ +hid_t H5E_BTREE_g = FAIL; /* B-Tree node */ +hid_t H5E_IO_g = FAIL; /* Low-level I/O */ +hid_t H5E_PLIST_g = FAIL; /* Property lists */ +hid_t H5E_DATASPACE_g = FAIL; /* Dataspace */ /* Minor error IDs */ -/* Generic low-level file I/O errors */ -hid_t H5E_SEEKERROR_g = FAIL; /* Seek failed */ -hid_t H5E_READERROR_g = FAIL; /* Read failed */ -hid_t H5E_WRITEERROR_g = FAIL; /* Write failed */ -hid_t H5E_CLOSEERROR_g = FAIL; /* Close failed */ -hid_t H5E_OVERFLOW_g = FAIL; /* Address overflowed */ -hid_t H5E_FCNTL_g = FAIL; /* File control (fcntl) failed */ +/* Argument errors */ +hid_t H5E_UNINITIALIZED_g = FAIL; /* Information is uinitialized */ +hid_t H5E_UNSUPPORTED_g = FAIL; /* Feature is unsupported */ +hid_t H5E_BADTYPE_g = FAIL; /* Inappropriate type */ +hid_t H5E_BADRANGE_g = FAIL; /* Out of range */ +hid_t H5E_BADVALUE_g = FAIL; /* Bad value */ -/* Link related errors */ -hid_t H5E_TRAVERSE_g = FAIL; /* Link traversal failure */ -hid_t H5E_NLINKS_g = FAIL; /* Too many soft links in path */ -hid_t H5E_NOTREGISTERED_g = FAIL; /* Link class not registered */ -hid_t H5E_CANTMOVE_g = FAIL; /* Can't move object */ -hid_t H5E_CANTSORT_g = FAIL; /* Can't sort objects */ +/* Object atom related errors */ +hid_t H5E_BADATOM_g = FAIL; /* Unable to find atom information (already closed?) */ +hid_t H5E_BADGROUP_g = FAIL; /* Unable to find ID group information */ +hid_t H5E_CANTREGISTER_g = FAIL; /* Unable to register new atom */ +hid_t H5E_CANTINC_g = FAIL; /* Unable to increment reference count */ +hid_t H5E_CANTDEC_g = FAIL; /* Unable to decrement reference count */ +hid_t H5E_NOIDS_g = FAIL; /* Out of IDs for group */ + +/* Function entry/exit interface errors */ +hid_t H5E_CANTINIT_g = FAIL; /* Unable to initialize object */ +hid_t H5E_ALREADYINIT_g = FAIL; /* Object already initialized */ +hid_t H5E_CANTRELEASE_g = FAIL; /* Unable to release object */ /* Property list errors */ hid_t H5E_CANTGET_g = FAIL; /* Can't get value */ @@ -74,40 +79,13 @@ hid_t H5E_CANTSET_g = FAIL; /* Can't set value */ hid_t H5E_DUPCLASS_g = FAIL; /* Duplicate class name in parent class */ hid_t H5E_SETDISALLOWED_g = FAIL; /* Disallowed operation */ -/* Cache related errors */ -hid_t H5E_CANTFLUSH_g = FAIL; /* Unable to flush data from cache */ -hid_t H5E_CANTSERIALIZE_g = FAIL; /* Unable to serialize data from cache */ -hid_t H5E_CANTLOAD_g = FAIL; /* Unable to load metadata into cache */ -hid_t H5E_PROTECT_g = FAIL; /* Protected metadata error */ -hid_t H5E_NOTCACHED_g = FAIL; /* Metadata not currently cached */ -hid_t H5E_SYSTEM_g = FAIL; /* Internal error detected */ -hid_t H5E_CANTINS_g = FAIL; /* Unable to insert metadata into cache */ -hid_t H5E_CANTPROTECT_g = FAIL; /* Unable to protect metadata */ -hid_t H5E_CANTUNPROTECT_g = FAIL; /* Unable to unprotect metadata */ -hid_t H5E_CANTPIN_g = FAIL; /* Unable to pin cache entry */ -hid_t H5E_CANTUNPIN_g = FAIL; /* Unable to un-pin cache entry */ -hid_t H5E_CANTMARKDIRTY_g = FAIL; /* Unable to mark a pinned entry as dirty */ -hid_t H5E_CANTDIRTY_g = FAIL; /* Unable to mark metadata as dirty */ -hid_t H5E_CANTEXPUNGE_g = FAIL; /* Unable to expunge a metadata cache entry */ -hid_t H5E_CANTRESIZE_g = FAIL; /* Unable to resize a metadata cache entry */ - -/* Heap errors */ -hid_t H5E_CANTRESTORE_g = FAIL; /* Can't restore condition */ -hid_t H5E_CANTCOMPUTE_g = FAIL; /* Can't compute value */ -hid_t H5E_CANTEXTEND_g = FAIL; /* Can't extend heap's space */ -hid_t H5E_CANTATTACH_g = FAIL; /* Can't attach object */ -hid_t H5E_CANTUPDATE_g = FAIL; /* Can't update object */ -hid_t H5E_CANTOPERATE_g = FAIL; /* Can't operate on object */ - -/* Function entry/exit interface errors */ -hid_t H5E_CANTINIT_g = FAIL; /* Unable to initialize object */ -hid_t H5E_ALREADYINIT_g = FAIL; /* Object already initialized */ -hid_t H5E_CANTRELEASE_g = FAIL; /* Unable to release object */ - -/* Parallel MPI errors */ -hid_t H5E_MPI_g = FAIL; /* Some MPI function failed */ -hid_t H5E_MPIERRSTR_g = FAIL; /* MPI Error String */ -hid_t H5E_CANTRECV_g = FAIL; /* Can't receive data */ +/* Generic low-level file I/O errors */ +hid_t H5E_SEEKERROR_g = FAIL; /* Seek failed */ +hid_t H5E_READERROR_g = FAIL; /* Read failed */ +hid_t H5E_WRITEERROR_g = FAIL; /* Write failed */ +hid_t H5E_CLOSEERROR_g = FAIL; /* Close failed */ +hid_t H5E_OVERFLOW_g = FAIL; /* Address overflowed */ +hid_t H5E_FCNTL_g = FAIL; /* File control (fcntl) failed */ /* Resource errors */ hid_t H5E_NOSPACE_g = FAIL; /* No space available for allocation */ @@ -121,15 +99,22 @@ hid_t H5E_CANTGC_g = FAIL; /* Unable to garbage collect */ hid_t H5E_CANTGETSIZE_g = FAIL; /* Unable to compute size */ hid_t H5E_OBJOPEN_g = FAIL; /* Object is already open */ -/* System level errors */ -hid_t H5E_SYSERRSTR_g = FAIL; /* System error message */ +/* Datatype conversion errors */ +hid_t H5E_CANTCONVERT_g = FAIL; /* Can't convert datatypes */ +hid_t H5E_BADSIZE_g = FAIL; /* Bad size for object */ -/* Argument errors */ -hid_t H5E_UNINITIALIZED_g = FAIL; /* Information is uinitialized */ -hid_t H5E_UNSUPPORTED_g = FAIL; /* Feature is unsupported */ -hid_t H5E_BADTYPE_g = FAIL; /* Inappropriate type */ -hid_t H5E_BADRANGE_g = FAIL; /* Out of range */ -hid_t H5E_BADVALUE_g = FAIL; /* Bad value */ +/* Heap errors */ +hid_t H5E_CANTRESTORE_g = FAIL; /* Can't restore condition */ +hid_t H5E_CANTCOMPUTE_g = FAIL; /* Can't compute value */ +hid_t H5E_CANTEXTEND_g = FAIL; /* Can't extend heap's space */ +hid_t H5E_CANTATTACH_g = FAIL; /* Can't attach object */ +hid_t H5E_CANTUPDATE_g = FAIL; /* Can't update object */ +hid_t H5E_CANTOPERATE_g = FAIL; /* Can't operate on object */ + +/* Parallel MPI errors */ +hid_t H5E_MPI_g = FAIL; /* Some MPI function failed */ +hid_t H5E_MPIERRSTR_g = FAIL; /* MPI Error String */ +hid_t H5E_CANTRECV_g = FAIL; /* Can't receive data */ /* B-tree related errors */ hid_t H5E_NOTFOUND_g = FAIL; /* Object not found */ @@ -144,22 +129,31 @@ hid_t H5E_CANTLIST_g = FAIL; /* Unable to list node */ hid_t H5E_CANTMODIFY_g = FAIL; /* Unable to modify record */ hid_t H5E_CANTREMOVE_g = FAIL; /* Unable to remove object */ -/* No error */ -hid_t H5E_NONE_MINOR_g = FAIL; /* No error */ +/* Group related errors */ +hid_t H5E_CANTOPENOBJ_g = FAIL; /* Can't open object */ +hid_t H5E_CANTCLOSEOBJ_g = FAIL; /* Can't close object */ +hid_t H5E_COMPLEN_g = FAIL; /* Name component is too long */ +hid_t H5E_PATH_g = FAIL; /* Problem with path to object */ -/* Object header related errors */ -hid_t H5E_LINKCOUNT_g = FAIL; /* Bad object header link count */ -hid_t H5E_VERSION_g = FAIL; /* Wrong version number */ -hid_t H5E_ALIGNMENT_g = FAIL; /* Alignment error */ -hid_t H5E_BADMESG_g = FAIL; /* Unrecognized message */ -hid_t H5E_CANTDELETE_g = FAIL; /* Can't delete message */ -hid_t H5E_BADITER_g = FAIL; /* Iteration failed */ -hid_t H5E_CANTPACK_g = FAIL; /* Can't pack messages */ -hid_t H5E_CANTRESET_g = FAIL; /* Can't reset object */ -hid_t H5E_CANTRENAME_g = FAIL; /* Unable to rename object */ +/* Free space errors */ +hid_t H5E_CANTMERGE_g = FAIL; /* Can't merge objects */ +hid_t H5E_CANTREVIVE_g = FAIL; /* Can't revive object */ +hid_t H5E_CANTSHRINK_g = FAIL; /* Can't shrink container */ -/* Plugin errors */ -hid_t H5E_OPENERROR_g = FAIL; /* Can't open directory or file */ +/* I/O pipeline errors */ +hid_t H5E_NOFILTER_g = FAIL; /* Requested filter is not available */ +hid_t H5E_CALLBACK_g = FAIL; /* Callback failed */ +hid_t H5E_CANAPPLY_g = FAIL; /* Error from filter 'can apply' callback */ +hid_t H5E_SETLOCAL_g = FAIL; /* Error from filter 'set local' callback */ +hid_t H5E_NOENCODER_g = FAIL; /* Filter present but encoding disabled */ +hid_t H5E_CANTFILTER_g = FAIL; /* Filter operation failed */ + +/* Link related errors */ +hid_t H5E_TRAVERSE_g = FAIL; /* Link traversal failure */ +hid_t H5E_NLINKS_g = FAIL; /* Too many soft links in path */ +hid_t H5E_NOTREGISTERED_g = FAIL; /* Link class not registered */ +hid_t H5E_CANTMOVE_g = FAIL; /* Can't move object */ +hid_t H5E_CANTSORT_g = FAIL; /* Can't sort objects */ /* File accessibilty errors */ hid_t H5E_FILEEXISTS_g = FAIL; /* File already exists */ @@ -172,30 +166,28 @@ hid_t H5E_BADFILE_g = FAIL; /* Bad file ID accessed */ hid_t H5E_TRUNCATED_g = FAIL; /* File has been truncated */ hid_t H5E_MOUNT_g = FAIL; /* File mount error */ -/* I/O pipeline errors */ -hid_t H5E_NOFILTER_g = FAIL; /* Requested filter is not available */ -hid_t H5E_CALLBACK_g = FAIL; /* Callback failed */ -hid_t H5E_CANAPPLY_g = FAIL; /* Error from filter 'can apply' callback */ -hid_t H5E_SETLOCAL_g = FAIL; /* Error from filter 'set local' callback */ -hid_t H5E_NOENCODER_g = FAIL; /* Filter present but encoding disabled */ -hid_t H5E_CANTFILTER_g = FAIL; /* Filter operation failed */ - -/* Datatype conversion errors */ -hid_t H5E_CANTCONVERT_g = FAIL; /* Can't convert datatypes */ -hid_t H5E_BADSIZE_g = FAIL; /* Bad size for object */ +/* Cache related errors */ +hid_t H5E_CANTFLUSH_g = FAIL; /* Unable to flush data from cache */ +hid_t H5E_CANTSERIALIZE_g = FAIL; /* Unable to serialize data from cache */ +hid_t H5E_CANTLOAD_g = FAIL; /* Unable to load metadata into cache */ +hid_t H5E_PROTECT_g = FAIL; /* Protected metadata error */ +hid_t H5E_NOTCACHED_g = FAIL; /* Metadata not currently cached */ +hid_t H5E_SYSTEM_g = FAIL; /* Internal error detected */ +hid_t H5E_CANTINS_g = FAIL; /* Unable to insert metadata into cache */ +hid_t H5E_CANTPROTECT_g = FAIL; /* Unable to protect metadata */ +hid_t H5E_CANTUNPROTECT_g = FAIL; /* Unable to unprotect metadata */ +hid_t H5E_CANTPIN_g = FAIL; /* Unable to pin cache entry */ +hid_t H5E_CANTUNPIN_g = FAIL; /* Unable to un-pin cache entry */ +hid_t H5E_CANTMARKDIRTY_g = FAIL; /* Unable to mark a pinned entry as dirty */ +hid_t H5E_CANTDIRTY_g = FAIL; /* Unable to mark metadata as dirty */ +hid_t H5E_CANTEXPUNGE_g = FAIL; /* Unable to expunge a metadata cache entry */ +hid_t H5E_CANTRESIZE_g = FAIL; /* Unable to resize a metadata cache entry */ -/* Free space errors */ -hid_t H5E_CANTMERGE_g = FAIL; /* Can't merge objects */ -hid_t H5E_CANTREVIVE_g = FAIL; /* Can't revive object */ -hid_t H5E_CANTSHRINK_g = FAIL; /* Can't shrink container */ +/* System level errors */ +hid_t H5E_SYSERRSTR_g = FAIL; /* System error message */ -/* Object atom related errors */ -hid_t H5E_BADATOM_g = FAIL; /* Unable to find atom information (already closed?) */ -hid_t H5E_BADGROUP_g = FAIL; /* Unable to find ID group information */ -hid_t H5E_CANTREGISTER_g = FAIL; /* Unable to register new atom */ -hid_t H5E_CANTINC_g = FAIL; /* Unable to increment reference count */ -hid_t H5E_CANTDEC_g = FAIL; /* Unable to decrement reference count */ -hid_t H5E_NOIDS_g = FAIL; /* Out of IDs for group */ +/* No error */ +hid_t H5E_NONE_MINOR_g = FAIL; /* No error */ /* Dataspace errors */ hid_t H5E_CANTCLIP_g = FAIL; /* Can't clip hyperslab region */ @@ -205,10 +197,18 @@ hid_t H5E_CANTNEXT_g = FAIL; /* Can't move to next iterator location hid_t H5E_BADSELECT_g = FAIL; /* Invalid selection */ hid_t H5E_CANTCOMPARE_g = FAIL; /* Can't compare objects */ -/* Group related errors */ -hid_t H5E_CANTOPENOBJ_g = FAIL; /* Can't open object */ -hid_t H5E_CANTCLOSEOBJ_g = FAIL; /* Can't close object */ -hid_t H5E_COMPLEN_g = FAIL; /* Name component is too long */ -hid_t H5E_PATH_g = FAIL; /* Problem with path to object */ +/* Object header related errors */ +hid_t H5E_LINKCOUNT_g = FAIL; /* Bad object header link count */ +hid_t H5E_VERSION_g = FAIL; /* Wrong version number */ +hid_t H5E_ALIGNMENT_g = FAIL; /* Alignment error */ +hid_t H5E_BADMESG_g = FAIL; /* Unrecognized message */ +hid_t H5E_CANTDELETE_g = FAIL; /* Can't delete message */ +hid_t H5E_BADITER_g = FAIL; /* Iteration failed */ +hid_t H5E_CANTPACK_g = FAIL; /* Can't pack messages */ +hid_t H5E_CANTRESET_g = FAIL; /* Can't reset object */ +hid_t H5E_CANTRENAME_g = FAIL; /* Unable to rename object */ + +/* Plugin errors */ +hid_t H5E_OPENERROR_g = FAIL; /* Can't open directory or file */ #endif /* H5Edefin_H */ diff --git a/src/H5Einit.h b/src/H5Einit.h index c70a5c3..3c0c095 100644 --- a/src/H5Einit.h +++ b/src/H5Einit.h @@ -22,224 +22,241 @@ /* Major error codes */ /*********************/ -assert(H5E_PLIST_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Property lists"))==NULL) +assert(H5E_ATTR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Attribute"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_PLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_ATTR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_INTERNAL_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Internal error (too specific to document in detail)"))==NULL) +assert(H5E_NONE_MAJOR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "No error"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_INTERNAL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_NONE_MAJOR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_LINK_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Links"))==NULL) +assert(H5E_PLINE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Data filters"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_LINK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_PLINE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_STORAGE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Data storage"))==NULL) +assert(H5E_FSPACE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Free Space Manager"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_STORAGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_FSPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_BTREE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "B-Tree node"))==NULL) +assert(H5E_RS_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Reference Counted Strings"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BTREE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_RS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_FUNC_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Function entry/exit"))==NULL) +assert(H5E_DATATYPE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Datatype"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_FUNC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_DATATYPE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_FILE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "File accessibilty"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_FILE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_PLUGIN_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Plugin for dynamically loaded library"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_PLUGIN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_DATASET_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Dataset"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_DATASET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_HEAP_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Heap"))==NULL) +assert(H5E_OHDR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object header"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_HEAP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_OHDR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_SLIST_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Skip Lists"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_SLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_LINK_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Links"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_LINK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_RESOURCE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Resource unavailable"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_RESOURCE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_DATASPACE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Dataspace"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_DATASPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_ERROR_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Error API"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_ERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_INTERNAL_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Internal error (too specific to document in detail)"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_INTERNAL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_TST_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Ternary Search Trees"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_TST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_CACHE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object cache"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CACHE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_EFL_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "External file list"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_EFL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_NONE_MAJOR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "No error"))==NULL) +assert(H5E_SYM_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Symbol table"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NONE_MAJOR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_SYM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_PLINE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Data filters"))==NULL) +assert(H5E_HEAP_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Heap"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_PLINE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_HEAP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_OHDR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object header"))==NULL) +assert(H5E_REFERENCE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "References"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_OHDR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_REFERENCE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_PLUGIN_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Plugin for dynamically loaded library"))==NULL) +assert(H5E_FUNC_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Function entry/exit"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_PLUGIN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_FUNC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_IO_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Low-level I/O"))==NULL) +assert(H5E_STORAGE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Data storage"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_IO_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_STORAGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_VFL_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Virtual File Layer"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_VFL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_SOHM_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Shared Object Header Messages"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_SOHM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_TST_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Ternary Search Trees"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_TST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_ATOM_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object atom"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_ATOM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_ATTR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Attribute"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ATTR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_ARGS_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Invalid arguments to routine"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_ARGS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_FILE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "File accessibilty"))==NULL) +assert(H5E_BTREE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "B-Tree node"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_FILE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_BTREE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_FSPACE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Free Space Manager"))==NULL) +assert(H5E_IO_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Low-level I/O"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_FSPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_IO_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_SLIST_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Skip Lists"))==NULL) +assert(H5E_PLIST_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Property lists"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_PLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_SYM_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Symbol table"))==NULL) +assert(H5E_DATASPACE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Dataspace"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SYM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_DATASPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_DATATYPE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Datatype"))==NULL) + +/*********************/ +/* Minor error codes */ +/*********************/ + + +/* Argument errors */ +assert(H5E_UNINITIALIZED_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Information is uinitialized"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_DATATYPE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_UNINITIALIZED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CACHE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object cache"))==NULL) +assert(H5E_UNSUPPORTED_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Feature is unsupported"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CACHE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_UNSUPPORTED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_RS_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Reference Counted Strings"))==NULL) +assert(H5E_BADTYPE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Inappropriate type"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_RS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_BADTYPE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_VFL_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Virtual File Layer"))==NULL) +assert(H5E_BADRANGE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Out of range"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_VFL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_BADRANGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_REFERENCE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "References"))==NULL) +assert(H5E_BADVALUE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad value"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_REFERENCE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_BADVALUE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/*********************/ -/* Minor error codes */ -/*********************/ - - -/* Generic low-level file I/O errors */ -assert(H5E_SEEKERROR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Seek failed"))==NULL) +/* Object atom related errors */ +assert(H5E_BADATOM_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to find atom information (already closed?)"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SEEKERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_BADATOM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_READERROR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Read failed"))==NULL) +assert(H5E_BADGROUP_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to find ID group information"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_READERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_BADGROUP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_WRITEERROR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Write failed"))==NULL) +assert(H5E_CANTREGISTER_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to register new atom"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_WRITEERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTREGISTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CLOSEERROR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Close failed"))==NULL) +assert(H5E_CANTINC_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to increment reference count"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CLOSEERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTINC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_OVERFLOW_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Address overflowed"))==NULL) +assert(H5E_CANTDEC_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to decrement reference count"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_OVERFLOW_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTDEC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_FCNTL_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "File control (fcntl) failed"))==NULL) +assert(H5E_NOIDS_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Out of IDs for group"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_FCNTL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_NOIDS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* Link related errors */ -assert(H5E_TRAVERSE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Link traversal failure"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_TRAVERSE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_NLINKS_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Too many soft links in path"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NLINKS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_NOTREGISTERED_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Link class not registered"))==NULL) +/* Function entry/exit interface errors */ +assert(H5E_CANTINIT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to initialize object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOTREGISTERED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTINIT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTMOVE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't move object"))==NULL) +assert(H5E_ALREADYINIT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Object already initialized"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTMOVE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_ALREADYINIT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTSORT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't sort objects"))==NULL) +assert(H5E_CANTRELEASE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to release object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTSORT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTRELEASE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Property list errors */ @@ -264,81 +281,100 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Disallowed operation"))==NULL) if((H5E_SETDISALLOWED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* Cache related errors */ -assert(H5E_CANTFLUSH_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to flush data from cache"))==NULL) +/* Generic low-level file I/O errors */ +assert(H5E_SEEKERROR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Seek failed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTFLUSH_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_SEEKERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTSERIALIZE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to serialize data from cache"))==NULL) +assert(H5E_READERROR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Read failed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTSERIALIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_READERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTLOAD_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to load metadata into cache"))==NULL) +assert(H5E_WRITEERROR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Write failed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTLOAD_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_WRITEERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_PROTECT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Protected metadata error"))==NULL) +assert(H5E_CLOSEERROR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Close failed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_PROTECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CLOSEERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_NOTCACHED_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Metadata not currently cached"))==NULL) +assert(H5E_OVERFLOW_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Address overflowed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOTCACHED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_OVERFLOW_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_SYSTEM_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Internal error detected"))==NULL) +assert(H5E_FCNTL_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "File control (fcntl) failed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SYSTEM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_FCNTL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTINS_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to insert metadata into cache"))==NULL) + +/* Resource errors */ +assert(H5E_NOSPACE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "No space available for allocation"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTINS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_NOSPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTPROTECT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to protect metadata"))==NULL) +assert(H5E_CANTALLOC_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't allocate space"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTPROTECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTALLOC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTUNPROTECT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to unprotect metadata"))==NULL) +assert(H5E_CANTCOPY_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to copy object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTUNPROTECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTCOPY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTPIN_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to pin cache entry"))==NULL) +assert(H5E_CANTFREE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to free object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTPIN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTFREE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTUNPIN_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to un-pin cache entry"))==NULL) +assert(H5E_ALREADYEXISTS_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Object already exists"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTUNPIN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_ALREADYEXISTS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTMARKDIRTY_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to mark a pinned entry as dirty"))==NULL) +assert(H5E_CANTLOCK_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to lock object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTMARKDIRTY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTLOCK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTDIRTY_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to mark metadata as dirty"))==NULL) +assert(H5E_CANTUNLOCK_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to unlock object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTDIRTY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTUNLOCK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTEXPUNGE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to expunge a metadata cache entry"))==NULL) +assert(H5E_CANTGC_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to garbage collect"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTEXPUNGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTGC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTRESIZE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to resize a metadata cache entry"))==NULL) +assert(H5E_CANTGETSIZE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to compute size"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTRESIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTGETSIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_OBJOPEN_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Object is already open"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_OBJOPEN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") + +/* Datatype conversion errors */ +assert(H5E_CANTCONVERT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't convert datatypes"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTCONVERT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_BADSIZE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad size for object"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_BADSIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Heap errors */ @@ -373,23 +409,6 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't operate on object"))==NULL) if((H5E_CANTOPERATE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* Function entry/exit interface errors */ -assert(H5E_CANTINIT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to initialize object"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTINIT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_ALREADYINIT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Object already initialized"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ALREADYINIT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTRELEASE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to release object"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTRELEASE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - /* Parallel MPI errors */ assert(H5E_MPI_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Some MPI function failed"))==NULL) @@ -407,92 +426,6 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't receive data"))==NULL) if((H5E_CANTRECV_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* Resource errors */ -assert(H5E_NOSPACE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "No space available for allocation"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOSPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTALLOC_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't allocate space"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTALLOC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTCOPY_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to copy object"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCOPY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTFREE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to free object"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTFREE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_ALREADYEXISTS_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Object already exists"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ALREADYEXISTS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTLOCK_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to lock object"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTLOCK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTUNLOCK_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to unlock object"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTUNLOCK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTGC_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to garbage collect"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTGC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTGETSIZE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to compute size"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTGETSIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_OBJOPEN_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Object is already open"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_OBJOPEN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - -/* System level errors */ -assert(H5E_SYSERRSTR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "System error message"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SYSERRSTR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - -/* Argument errors */ -assert(H5E_UNINITIALIZED_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Information is uinitialized"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_UNINITIALIZED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_UNSUPPORTED_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Feature is unsupported"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_UNSUPPORTED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_BADTYPE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Inappropriate type"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADTYPE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_BADRANGE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Out of range"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADRANGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_BADVALUE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad value"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADVALUE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - /* B-tree related errors */ assert(H5E_NOTFOUND_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Object not found"))==NULL) @@ -542,73 +475,110 @@ if((H5E_CANTLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) assert(H5E_CANTMODIFY_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to modify record"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTMODIFY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTMODIFY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_CANTREMOVE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to remove object"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTREMOVE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") + +/* Group related errors */ +assert(H5E_CANTOPENOBJ_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't open object"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTOPENOBJ_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_CANTCLOSEOBJ_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't close object"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTCLOSEOBJ_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_COMPLEN_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Name component is too long"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_COMPLEN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_PATH_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Problem with path to object"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_PATH_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") + +/* Free space errors */ +assert(H5E_CANTMERGE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't merge objects"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTMERGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_CANTREVIVE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't revive object"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTREVIVE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTREMOVE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to remove object"))==NULL) +assert(H5E_CANTSHRINK_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't shrink container"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTREMOVE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTSHRINK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* No error */ -assert(H5E_NONE_MINOR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "No error"))==NULL) +/* I/O pipeline errors */ +assert(H5E_NOFILTER_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Requested filter is not available"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NONE_MINOR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_NOFILTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - -/* Object header related errors */ -assert(H5E_LINKCOUNT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad object header link count"))==NULL) +assert(H5E_CALLBACK_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Callback failed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_LINKCOUNT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CALLBACK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_VERSION_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Wrong version number"))==NULL) +assert(H5E_CANAPPLY_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Error from filter 'can apply' callback"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_VERSION_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANAPPLY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_ALIGNMENT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Alignment error"))==NULL) +assert(H5E_SETLOCAL_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Error from filter 'set local' callback"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ALIGNMENT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_SETLOCAL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_BADMESG_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unrecognized message"))==NULL) +assert(H5E_NOENCODER_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Filter present but encoding disabled"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADMESG_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_NOENCODER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTDELETE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't delete message"))==NULL) +assert(H5E_CANTFILTER_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Filter operation failed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTDELETE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTFILTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_BADITER_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Iteration failed"))==NULL) + +/* Link related errors */ +assert(H5E_TRAVERSE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Link traversal failure"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADITER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_TRAVERSE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTPACK_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't pack messages"))==NULL) +assert(H5E_NLINKS_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Too many soft links in path"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTPACK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_NLINKS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTRESET_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't reset object"))==NULL) +assert(H5E_NOTREGISTERED_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Link class not registered"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTRESET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_NOTREGISTERED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTRENAME_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to rename object"))==NULL) +assert(H5E_CANTMOVE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't move object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTRENAME_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTMOVE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - -/* Plugin errors */ -assert(H5E_OPENERROR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't open directory or file"))==NULL) +assert(H5E_CANTSORT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't sort objects"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_OPENERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTSORT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* File accessibilty errors */ @@ -658,97 +628,95 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "File mount error"))==NULL) if((H5E_MOUNT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* I/O pipeline errors */ -assert(H5E_NOFILTER_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Requested filter is not available"))==NULL) +/* Cache related errors */ +assert(H5E_CANTFLUSH_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to flush data from cache"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOFILTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTFLUSH_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CALLBACK_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Callback failed"))==NULL) +assert(H5E_CANTSERIALIZE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to serialize data from cache"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CALLBACK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTSERIALIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANAPPLY_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Error from filter 'can apply' callback"))==NULL) +assert(H5E_CANTLOAD_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to load metadata into cache"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANAPPLY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTLOAD_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_SETLOCAL_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Error from filter 'set local' callback"))==NULL) +assert(H5E_PROTECT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Protected metadata error"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SETLOCAL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_PROTECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_NOENCODER_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Filter present but encoding disabled"))==NULL) +assert(H5E_NOTCACHED_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Metadata not currently cached"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOENCODER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_NOTCACHED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTFILTER_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Filter operation failed"))==NULL) +assert(H5E_SYSTEM_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Internal error detected"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTFILTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_SYSTEM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - -/* Datatype conversion errors */ -assert(H5E_CANTCONVERT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't convert datatypes"))==NULL) +assert(H5E_CANTINS_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to insert metadata into cache"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCONVERT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTINS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_BADSIZE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad size for object"))==NULL) +assert(H5E_CANTPROTECT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to protect metadata"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADSIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTPROTECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - -/* Free space errors */ -assert(H5E_CANTMERGE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't merge objects"))==NULL) +assert(H5E_CANTUNPROTECT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to unprotect metadata"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTMERGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTUNPROTECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTREVIVE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't revive object"))==NULL) +assert(H5E_CANTPIN_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to pin cache entry"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTREVIVE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTPIN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTSHRINK_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't shrink container"))==NULL) +assert(H5E_CANTUNPIN_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to un-pin cache entry"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTSHRINK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTUNPIN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - -/* Object atom related errors */ -assert(H5E_BADATOM_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to find atom information (already closed?)"))==NULL) +assert(H5E_CANTMARKDIRTY_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to mark a pinned entry as dirty"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADATOM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTMARKDIRTY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_BADGROUP_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to find ID group information"))==NULL) +assert(H5E_CANTDIRTY_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to mark metadata as dirty"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADGROUP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTDIRTY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTREGISTER_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to register new atom"))==NULL) +assert(H5E_CANTEXPUNGE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to expunge a metadata cache entry"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTREGISTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTEXPUNGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTINC_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to increment reference count"))==NULL) +assert(H5E_CANTRESIZE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to resize a metadata cache entry"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTINC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTRESIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTDEC_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to decrement reference count"))==NULL) + +/* System level errors */ +assert(H5E_SYSERRSTR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "System error message"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTDEC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_SYSERRSTR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_NOIDS_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Out of IDs for group"))==NULL) + +/* No error */ +assert(H5E_NONE_MINOR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "No error"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOIDS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_NONE_MINOR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Dataspace errors */ @@ -783,26 +751,58 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't compare objects"))==NULL) if((H5E_CANTCOMPARE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* Group related errors */ -assert(H5E_CANTOPENOBJ_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't open object"))==NULL) +/* Object header related errors */ +assert(H5E_LINKCOUNT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad object header link count"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTOPENOBJ_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_LINKCOUNT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTCLOSEOBJ_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't close object"))==NULL) +assert(H5E_VERSION_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Wrong version number"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCLOSEOBJ_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_VERSION_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_COMPLEN_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Name component is too long"))==NULL) +assert(H5E_ALIGNMENT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Alignment error"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_COMPLEN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_ALIGNMENT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_PATH_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Problem with path to object"))==NULL) +assert(H5E_BADMESG_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unrecognized message"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_PATH_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_BADMESG_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_CANTDELETE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't delete message"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTDELETE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_BADITER_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Iteration failed"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_BADITER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_CANTPACK_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't pack messages"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTPACK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_CANTRESET_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't reset object"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTRESET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_CANTRENAME_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to rename object"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTRENAME_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") + +/* Plugin errors */ +assert(H5E_OPENERROR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't open directory or file"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_OPENERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") #endif /* H5Einit_H */ diff --git a/src/H5Epubgen.h b/src/H5Epubgen.h index 9c2f1fd..17659b1 100644 --- a/src/H5Epubgen.h +++ b/src/H5Epubgen.h @@ -26,73 +26,117 @@ extern "C" { /* Major error codes */ /*********************/ -#define H5E_PLIST (H5OPEN H5E_PLIST_g) -#define H5E_INTERNAL (H5OPEN H5E_INTERNAL_g) -#define H5E_LINK (H5OPEN H5E_LINK_g) -#define H5E_STORAGE (H5OPEN H5E_STORAGE_g) -#define H5E_BTREE (H5OPEN H5E_BTREE_g) -#define H5E_FUNC (H5OPEN H5E_FUNC_g) +#define H5E_ATTR (H5OPEN H5E_ATTR_g) +#define H5E_NONE_MAJOR (H5OPEN H5E_NONE_MAJOR_g) +#define H5E_PLINE (H5OPEN H5E_PLINE_g) +#define H5E_FSPACE (H5OPEN H5E_FSPACE_g) +#define H5E_RS (H5OPEN H5E_RS_g) +#define H5E_DATATYPE (H5OPEN H5E_DATATYPE_g) +#define H5E_FILE (H5OPEN H5E_FILE_g) +#define H5E_PLUGIN (H5OPEN H5E_PLUGIN_g) #define H5E_DATASET (H5OPEN H5E_DATASET_g) -#define H5E_HEAP (H5OPEN H5E_HEAP_g) +#define H5E_OHDR (H5OPEN H5E_OHDR_g) +#define H5E_SLIST (H5OPEN H5E_SLIST_g) +#define H5E_LINK (H5OPEN H5E_LINK_g) #define H5E_RESOURCE (H5OPEN H5E_RESOURCE_g) -#define H5E_DATASPACE (H5OPEN H5E_DATASPACE_g) #define H5E_ERROR (H5OPEN H5E_ERROR_g) +#define H5E_INTERNAL (H5OPEN H5E_INTERNAL_g) +#define H5E_TST (H5OPEN H5E_TST_g) +#define H5E_CACHE (H5OPEN H5E_CACHE_g) #define H5E_EFL (H5OPEN H5E_EFL_g) -#define H5E_NONE_MAJOR (H5OPEN H5E_NONE_MAJOR_g) -#define H5E_PLINE (H5OPEN H5E_PLINE_g) -#define H5E_OHDR (H5OPEN H5E_OHDR_g) -#define H5E_PLUGIN (H5OPEN H5E_PLUGIN_g) -#define H5E_IO (H5OPEN H5E_IO_g) +#define H5E_SYM (H5OPEN H5E_SYM_g) +#define H5E_HEAP (H5OPEN H5E_HEAP_g) +#define H5E_REFERENCE (H5OPEN H5E_REFERENCE_g) +#define H5E_FUNC (H5OPEN H5E_FUNC_g) +#define H5E_STORAGE (H5OPEN H5E_STORAGE_g) +#define H5E_VFL (H5OPEN H5E_VFL_g) #define H5E_SOHM (H5OPEN H5E_SOHM_g) -#define H5E_TST (H5OPEN H5E_TST_g) #define H5E_ATOM (H5OPEN H5E_ATOM_g) -#define H5E_ATTR (H5OPEN H5E_ATTR_g) #define H5E_ARGS (H5OPEN H5E_ARGS_g) -#define H5E_FILE (H5OPEN H5E_FILE_g) -#define H5E_FSPACE (H5OPEN H5E_FSPACE_g) -#define H5E_SLIST (H5OPEN H5E_SLIST_g) -#define H5E_SYM (H5OPEN H5E_SYM_g) -#define H5E_DATATYPE (H5OPEN H5E_DATATYPE_g) -#define H5E_CACHE (H5OPEN H5E_CACHE_g) -#define H5E_RS (H5OPEN H5E_RS_g) -#define H5E_VFL (H5OPEN H5E_VFL_g) -#define H5E_REFERENCE (H5OPEN H5E_REFERENCE_g) -H5_DLLVAR hid_t H5E_PLIST_g; /* Property lists */ -H5_DLLVAR hid_t H5E_INTERNAL_g; /* Internal error (too specific to document in detail) */ -H5_DLLVAR hid_t H5E_LINK_g; /* Links */ -H5_DLLVAR hid_t H5E_STORAGE_g; /* Data storage */ -H5_DLLVAR hid_t H5E_BTREE_g; /* B-Tree node */ -H5_DLLVAR hid_t H5E_FUNC_g; /* Function entry/exit */ +#define H5E_BTREE (H5OPEN H5E_BTREE_g) +#define H5E_IO (H5OPEN H5E_IO_g) +#define H5E_PLIST (H5OPEN H5E_PLIST_g) +#define H5E_DATASPACE (H5OPEN H5E_DATASPACE_g) +H5_DLLVAR hid_t H5E_ATTR_g; /* Attribute */ +H5_DLLVAR hid_t H5E_NONE_MAJOR_g; /* No error */ +H5_DLLVAR hid_t H5E_PLINE_g; /* Data filters */ +H5_DLLVAR hid_t H5E_FSPACE_g; /* Free Space Manager */ +H5_DLLVAR hid_t H5E_RS_g; /* Reference Counted Strings */ +H5_DLLVAR hid_t H5E_DATATYPE_g; /* Datatype */ +H5_DLLVAR hid_t H5E_FILE_g; /* File accessibilty */ +H5_DLLVAR hid_t H5E_PLUGIN_g; /* Plugin for dynamically loaded library */ H5_DLLVAR hid_t H5E_DATASET_g; /* Dataset */ -H5_DLLVAR hid_t H5E_HEAP_g; /* Heap */ +H5_DLLVAR hid_t H5E_OHDR_g; /* Object header */ +H5_DLLVAR hid_t H5E_SLIST_g; /* Skip Lists */ +H5_DLLVAR hid_t H5E_LINK_g; /* Links */ H5_DLLVAR hid_t H5E_RESOURCE_g; /* Resource unavailable */ -H5_DLLVAR hid_t H5E_DATASPACE_g; /* Dataspace */ H5_DLLVAR hid_t H5E_ERROR_g; /* Error API */ +H5_DLLVAR hid_t H5E_INTERNAL_g; /* Internal error (too specific to document in detail) */ +H5_DLLVAR hid_t H5E_TST_g; /* Ternary Search Trees */ +H5_DLLVAR hid_t H5E_CACHE_g; /* Object cache */ H5_DLLVAR hid_t H5E_EFL_g; /* External file list */ -H5_DLLVAR hid_t H5E_NONE_MAJOR_g; /* No error */ -H5_DLLVAR hid_t H5E_PLINE_g; /* Data filters */ -H5_DLLVAR hid_t H5E_OHDR_g; /* Object header */ -H5_DLLVAR hid_t H5E_PLUGIN_g; /* Plugin for dynamically loaded library */ -H5_DLLVAR hid_t H5E_IO_g; /* Low-level I/O */ +H5_DLLVAR hid_t H5E_SYM_g; /* Symbol table */ +H5_DLLVAR hid_t H5E_HEAP_g; /* Heap */ +H5_DLLVAR hid_t H5E_REFERENCE_g; /* References */ +H5_DLLVAR hid_t H5E_FUNC_g; /* Function entry/exit */ +H5_DLLVAR hid_t H5E_STORAGE_g; /* Data storage */ +H5_DLLVAR hid_t H5E_VFL_g; /* Virtual File Layer */ H5_DLLVAR hid_t H5E_SOHM_g; /* Shared Object Header Messages */ -H5_DLLVAR hid_t H5E_TST_g; /* Ternary Search Trees */ H5_DLLVAR hid_t H5E_ATOM_g; /* Object atom */ -H5_DLLVAR hid_t H5E_ATTR_g; /* Attribute */ H5_DLLVAR hid_t H5E_ARGS_g; /* Invalid arguments to routine */ -H5_DLLVAR hid_t H5E_FILE_g; /* File accessibilty */ -H5_DLLVAR hid_t H5E_FSPACE_g; /* Free Space Manager */ -H5_DLLVAR hid_t H5E_SLIST_g; /* Skip Lists */ -H5_DLLVAR hid_t H5E_SYM_g; /* Symbol table */ -H5_DLLVAR hid_t H5E_DATATYPE_g; /* Datatype */ -H5_DLLVAR hid_t H5E_CACHE_g; /* Object cache */ -H5_DLLVAR hid_t H5E_RS_g; /* Reference Counted Strings */ -H5_DLLVAR hid_t H5E_VFL_g; /* Virtual File Layer */ -H5_DLLVAR hid_t H5E_REFERENCE_g; /* References */ +H5_DLLVAR hid_t H5E_BTREE_g; /* B-Tree node */ +H5_DLLVAR hid_t H5E_IO_g; /* Low-level I/O */ +H5_DLLVAR hid_t H5E_PLIST_g; /* Property lists */ +H5_DLLVAR hid_t H5E_DATASPACE_g; /* Dataspace */ /*********************/ /* Minor error codes */ /*********************/ +/* Argument errors */ +#define H5E_UNINITIALIZED (H5OPEN H5E_UNINITIALIZED_g) +#define H5E_UNSUPPORTED (H5OPEN H5E_UNSUPPORTED_g) +#define H5E_BADTYPE (H5OPEN H5E_BADTYPE_g) +#define H5E_BADRANGE (H5OPEN H5E_BADRANGE_g) +#define H5E_BADVALUE (H5OPEN H5E_BADVALUE_g) +H5_DLLVAR hid_t H5E_UNINITIALIZED_g; /* Information is uinitialized */ +H5_DLLVAR hid_t H5E_UNSUPPORTED_g; /* Feature is unsupported */ +H5_DLLVAR hid_t H5E_BADTYPE_g; /* Inappropriate type */ +H5_DLLVAR hid_t H5E_BADRANGE_g; /* Out of range */ +H5_DLLVAR hid_t H5E_BADVALUE_g; /* Bad value */ + +/* Object atom related errors */ +#define H5E_BADATOM (H5OPEN H5E_BADATOM_g) +#define H5E_BADGROUP (H5OPEN H5E_BADGROUP_g) +#define H5E_CANTREGISTER (H5OPEN H5E_CANTREGISTER_g) +#define H5E_CANTINC (H5OPEN H5E_CANTINC_g) +#define H5E_CANTDEC (H5OPEN H5E_CANTDEC_g) +#define H5E_NOIDS (H5OPEN H5E_NOIDS_g) +H5_DLLVAR hid_t H5E_BADATOM_g; /* Unable to find atom information (already closed?) */ +H5_DLLVAR hid_t H5E_BADGROUP_g; /* Unable to find ID group information */ +H5_DLLVAR hid_t H5E_CANTREGISTER_g; /* Unable to register new atom */ +H5_DLLVAR hid_t H5E_CANTINC_g; /* Unable to increment reference count */ +H5_DLLVAR hid_t H5E_CANTDEC_g; /* Unable to decrement reference count */ +H5_DLLVAR hid_t H5E_NOIDS_g; /* Out of IDs for group */ + +/* Function entry/exit interface errors */ +#define H5E_CANTINIT (H5OPEN H5E_CANTINIT_g) +#define H5E_ALREADYINIT (H5OPEN H5E_ALREADYINIT_g) +#define H5E_CANTRELEASE (H5OPEN H5E_CANTRELEASE_g) +H5_DLLVAR hid_t H5E_CANTINIT_g; /* Unable to initialize object */ +H5_DLLVAR hid_t H5E_ALREADYINIT_g; /* Object already initialized */ +H5_DLLVAR hid_t H5E_CANTRELEASE_g; /* Unable to release object */ + +/* Property list errors */ +#define H5E_CANTGET (H5OPEN H5E_CANTGET_g) +#define H5E_CANTSET (H5OPEN H5E_CANTSET_g) +#define H5E_DUPCLASS (H5OPEN H5E_DUPCLASS_g) +#define H5E_SETDISALLOWED (H5OPEN H5E_SETDISALLOWED_g) +H5_DLLVAR hid_t H5E_CANTGET_g; /* Can't get value */ +H5_DLLVAR hid_t H5E_CANTSET_g; /* Can't set value */ +H5_DLLVAR hid_t H5E_DUPCLASS_g; /* Duplicate class name in parent class */ +H5_DLLVAR hid_t H5E_SETDISALLOWED_g; /* Disallowed operation */ + /* Generic low-level file I/O errors */ #define H5E_SEEKERROR (H5OPEN H5E_SEEKERROR_g) #define H5E_READERROR (H5OPEN H5E_READERROR_g) @@ -107,90 +151,6 @@ H5_DLLVAR hid_t H5E_CLOSEERROR_g; /* Close failed */ H5_DLLVAR hid_t H5E_OVERFLOW_g; /* Address overflowed */ H5_DLLVAR hid_t H5E_FCNTL_g; /* File control (fcntl) failed */ -/* Link related errors */ -#define H5E_TRAVERSE (H5OPEN H5E_TRAVERSE_g) -#define H5E_NLINKS (H5OPEN H5E_NLINKS_g) -#define H5E_NOTREGISTERED (H5OPEN H5E_NOTREGISTERED_g) -#define H5E_CANTMOVE (H5OPEN H5E_CANTMOVE_g) -#define H5E_CANTSORT (H5OPEN H5E_CANTSORT_g) -H5_DLLVAR hid_t H5E_TRAVERSE_g; /* Link traversal failure */ -H5_DLLVAR hid_t H5E_NLINKS_g; /* Too many soft links in path */ -H5_DLLVAR hid_t H5E_NOTREGISTERED_g; /* Link class not registered */ -H5_DLLVAR hid_t H5E_CANTMOVE_g; /* Can't move object */ -H5_DLLVAR hid_t H5E_CANTSORT_g; /* Can't sort objects */ - -/* Property list errors */ -#define H5E_CANTGET (H5OPEN H5E_CANTGET_g) -#define H5E_CANTSET (H5OPEN H5E_CANTSET_g) -#define H5E_DUPCLASS (H5OPEN H5E_DUPCLASS_g) -#define H5E_SETDISALLOWED (H5OPEN H5E_SETDISALLOWED_g) -H5_DLLVAR hid_t H5E_CANTGET_g; /* Can't get value */ -H5_DLLVAR hid_t H5E_CANTSET_g; /* Can't set value */ -H5_DLLVAR hid_t H5E_DUPCLASS_g; /* Duplicate class name in parent class */ -H5_DLLVAR hid_t H5E_SETDISALLOWED_g; /* Disallowed operation */ - -/* Cache related errors */ -#define H5E_CANTFLUSH (H5OPEN H5E_CANTFLUSH_g) -#define H5E_CANTSERIALIZE (H5OPEN H5E_CANTSERIALIZE_g) -#define H5E_CANTLOAD (H5OPEN H5E_CANTLOAD_g) -#define H5E_PROTECT (H5OPEN H5E_PROTECT_g) -#define H5E_NOTCACHED (H5OPEN H5E_NOTCACHED_g) -#define H5E_SYSTEM (H5OPEN H5E_SYSTEM_g) -#define H5E_CANTINS (H5OPEN H5E_CANTINS_g) -#define H5E_CANTPROTECT (H5OPEN H5E_CANTPROTECT_g) -#define H5E_CANTUNPROTECT (H5OPEN H5E_CANTUNPROTECT_g) -#define H5E_CANTPIN (H5OPEN H5E_CANTPIN_g) -#define H5E_CANTUNPIN (H5OPEN H5E_CANTUNPIN_g) -#define H5E_CANTMARKDIRTY (H5OPEN H5E_CANTMARKDIRTY_g) -#define H5E_CANTDIRTY (H5OPEN H5E_CANTDIRTY_g) -#define H5E_CANTEXPUNGE (H5OPEN H5E_CANTEXPUNGE_g) -#define H5E_CANTRESIZE (H5OPEN H5E_CANTRESIZE_g) -H5_DLLVAR hid_t H5E_CANTFLUSH_g; /* Unable to flush data from cache */ -H5_DLLVAR hid_t H5E_CANTSERIALIZE_g; /* Unable to serialize data from cache */ -H5_DLLVAR hid_t H5E_CANTLOAD_g; /* Unable to load metadata into cache */ -H5_DLLVAR hid_t H5E_PROTECT_g; /* Protected metadata error */ -H5_DLLVAR hid_t H5E_NOTCACHED_g; /* Metadata not currently cached */ -H5_DLLVAR hid_t H5E_SYSTEM_g; /* Internal error detected */ -H5_DLLVAR hid_t H5E_CANTINS_g; /* Unable to insert metadata into cache */ -H5_DLLVAR hid_t H5E_CANTPROTECT_g; /* Unable to protect metadata */ -H5_DLLVAR hid_t H5E_CANTUNPROTECT_g; /* Unable to unprotect metadata */ -H5_DLLVAR hid_t H5E_CANTPIN_g; /* Unable to pin cache entry */ -H5_DLLVAR hid_t H5E_CANTUNPIN_g; /* Unable to un-pin cache entry */ -H5_DLLVAR hid_t H5E_CANTMARKDIRTY_g; /* Unable to mark a pinned entry as dirty */ -H5_DLLVAR hid_t H5E_CANTDIRTY_g; /* Unable to mark metadata as dirty */ -H5_DLLVAR hid_t H5E_CANTEXPUNGE_g; /* Unable to expunge a metadata cache entry */ -H5_DLLVAR hid_t H5E_CANTRESIZE_g; /* Unable to resize a metadata cache entry */ - -/* Heap errors */ -#define H5E_CANTRESTORE (H5OPEN H5E_CANTRESTORE_g) -#define H5E_CANTCOMPUTE (H5OPEN H5E_CANTCOMPUTE_g) -#define H5E_CANTEXTEND (H5OPEN H5E_CANTEXTEND_g) -#define H5E_CANTATTACH (H5OPEN H5E_CANTATTACH_g) -#define H5E_CANTUPDATE (H5OPEN H5E_CANTUPDATE_g) -#define H5E_CANTOPERATE (H5OPEN H5E_CANTOPERATE_g) -H5_DLLVAR hid_t H5E_CANTRESTORE_g; /* Can't restore condition */ -H5_DLLVAR hid_t H5E_CANTCOMPUTE_g; /* Can't compute value */ -H5_DLLVAR hid_t H5E_CANTEXTEND_g; /* Can't extend heap's space */ -H5_DLLVAR hid_t H5E_CANTATTACH_g; /* Can't attach object */ -H5_DLLVAR hid_t H5E_CANTUPDATE_g; /* Can't update object */ -H5_DLLVAR hid_t H5E_CANTOPERATE_g; /* Can't operate on object */ - -/* Function entry/exit interface errors */ -#define H5E_CANTINIT (H5OPEN H5E_CANTINIT_g) -#define H5E_ALREADYINIT (H5OPEN H5E_ALREADYINIT_g) -#define H5E_CANTRELEASE (H5OPEN H5E_CANTRELEASE_g) -H5_DLLVAR hid_t H5E_CANTINIT_g; /* Unable to initialize object */ -H5_DLLVAR hid_t H5E_ALREADYINIT_g; /* Object already initialized */ -H5_DLLVAR hid_t H5E_CANTRELEASE_g; /* Unable to release object */ - -/* Parallel MPI errors */ -#define H5E_MPI (H5OPEN H5E_MPI_g) -#define H5E_MPIERRSTR (H5OPEN H5E_MPIERRSTR_g) -#define H5E_CANTRECV (H5OPEN H5E_CANTRECV_g) -H5_DLLVAR hid_t H5E_MPI_g; /* Some MPI function failed */ -H5_DLLVAR hid_t H5E_MPIERRSTR_g; /* MPI Error String */ -H5_DLLVAR hid_t H5E_CANTRECV_g; /* Can't receive data */ - /* Resource errors */ #define H5E_NOSPACE (H5OPEN H5E_NOSPACE_g) #define H5E_CANTALLOC (H5OPEN H5E_CANTALLOC_g) @@ -213,21 +173,33 @@ H5_DLLVAR hid_t H5E_CANTGC_g; /* Unable to garbage collect */ H5_DLLVAR hid_t H5E_CANTGETSIZE_g; /* Unable to compute size */ H5_DLLVAR hid_t H5E_OBJOPEN_g; /* Object is already open */ -/* System level errors */ -#define H5E_SYSERRSTR (H5OPEN H5E_SYSERRSTR_g) -H5_DLLVAR hid_t H5E_SYSERRSTR_g; /* System error message */ +/* Datatype conversion errors */ +#define H5E_CANTCONVERT (H5OPEN H5E_CANTCONVERT_g) +#define H5E_BADSIZE (H5OPEN H5E_BADSIZE_g) +H5_DLLVAR hid_t H5E_CANTCONVERT_g; /* Can't convert datatypes */ +H5_DLLVAR hid_t H5E_BADSIZE_g; /* Bad size for object */ -/* Argument errors */ -#define H5E_UNINITIALIZED (H5OPEN H5E_UNINITIALIZED_g) -#define H5E_UNSUPPORTED (H5OPEN H5E_UNSUPPORTED_g) -#define H5E_BADTYPE (H5OPEN H5E_BADTYPE_g) -#define H5E_BADRANGE (H5OPEN H5E_BADRANGE_g) -#define H5E_BADVALUE (H5OPEN H5E_BADVALUE_g) -H5_DLLVAR hid_t H5E_UNINITIALIZED_g; /* Information is uinitialized */ -H5_DLLVAR hid_t H5E_UNSUPPORTED_g; /* Feature is unsupported */ -H5_DLLVAR hid_t H5E_BADTYPE_g; /* Inappropriate type */ -H5_DLLVAR hid_t H5E_BADRANGE_g; /* Out of range */ -H5_DLLVAR hid_t H5E_BADVALUE_g; /* Bad value */ +/* Heap errors */ +#define H5E_CANTRESTORE (H5OPEN H5E_CANTRESTORE_g) +#define H5E_CANTCOMPUTE (H5OPEN H5E_CANTCOMPUTE_g) +#define H5E_CANTEXTEND (H5OPEN H5E_CANTEXTEND_g) +#define H5E_CANTATTACH (H5OPEN H5E_CANTATTACH_g) +#define H5E_CANTUPDATE (H5OPEN H5E_CANTUPDATE_g) +#define H5E_CANTOPERATE (H5OPEN H5E_CANTOPERATE_g) +H5_DLLVAR hid_t H5E_CANTRESTORE_g; /* Can't restore condition */ +H5_DLLVAR hid_t H5E_CANTCOMPUTE_g; /* Can't compute value */ +H5_DLLVAR hid_t H5E_CANTEXTEND_g; /* Can't extend heap's space */ +H5_DLLVAR hid_t H5E_CANTATTACH_g; /* Can't attach object */ +H5_DLLVAR hid_t H5E_CANTUPDATE_g; /* Can't update object */ +H5_DLLVAR hid_t H5E_CANTOPERATE_g; /* Can't operate on object */ + +/* Parallel MPI errors */ +#define H5E_MPI (H5OPEN H5E_MPI_g) +#define H5E_MPIERRSTR (H5OPEN H5E_MPIERRSTR_g) +#define H5E_CANTRECV (H5OPEN H5E_CANTRECV_g) +H5_DLLVAR hid_t H5E_MPI_g; /* Some MPI function failed */ +H5_DLLVAR hid_t H5E_MPIERRSTR_g; /* MPI Error String */ +H5_DLLVAR hid_t H5E_CANTRECV_g; /* Can't receive data */ /* B-tree related errors */ #define H5E_NOTFOUND (H5OPEN H5E_NOTFOUND_g) @@ -253,33 +225,49 @@ H5_DLLVAR hid_t H5E_CANTLIST_g; /* Unable to list node */ H5_DLLVAR hid_t H5E_CANTMODIFY_g; /* Unable to modify record */ H5_DLLVAR hid_t H5E_CANTREMOVE_g; /* Unable to remove object */ -/* No error */ -#define H5E_NONE_MINOR (H5OPEN H5E_NONE_MINOR_g) -H5_DLLVAR hid_t H5E_NONE_MINOR_g; /* No error */ +/* Group related errors */ +#define H5E_CANTOPENOBJ (H5OPEN H5E_CANTOPENOBJ_g) +#define H5E_CANTCLOSEOBJ (H5OPEN H5E_CANTCLOSEOBJ_g) +#define H5E_COMPLEN (H5OPEN H5E_COMPLEN_g) +#define H5E_PATH (H5OPEN H5E_PATH_g) +H5_DLLVAR hid_t H5E_CANTOPENOBJ_g; /* Can't open object */ +H5_DLLVAR hid_t H5E_CANTCLOSEOBJ_g; /* Can't close object */ +H5_DLLVAR hid_t H5E_COMPLEN_g; /* Name component is too long */ +H5_DLLVAR hid_t H5E_PATH_g; /* Problem with path to object */ -/* Object header related errors */ -#define H5E_LINKCOUNT (H5OPEN H5E_LINKCOUNT_g) -#define H5E_VERSION (H5OPEN H5E_VERSION_g) -#define H5E_ALIGNMENT (H5OPEN H5E_ALIGNMENT_g) -#define H5E_BADMESG (H5OPEN H5E_BADMESG_g) -#define H5E_CANTDELETE (H5OPEN H5E_CANTDELETE_g) -#define H5E_BADITER (H5OPEN H5E_BADITER_g) -#define H5E_CANTPACK (H5OPEN H5E_CANTPACK_g) -#define H5E_CANTRESET (H5OPEN H5E_CANTRESET_g) -#define H5E_CANTRENAME (H5OPEN H5E_CANTRENAME_g) -H5_DLLVAR hid_t H5E_LINKCOUNT_g; /* Bad object header link count */ -H5_DLLVAR hid_t H5E_VERSION_g; /* Wrong version number */ -H5_DLLVAR hid_t H5E_ALIGNMENT_g; /* Alignment error */ -H5_DLLVAR hid_t H5E_BADMESG_g; /* Unrecognized message */ -H5_DLLVAR hid_t H5E_CANTDELETE_g; /* Can't delete message */ -H5_DLLVAR hid_t H5E_BADITER_g; /* Iteration failed */ -H5_DLLVAR hid_t H5E_CANTPACK_g; /* Can't pack messages */ -H5_DLLVAR hid_t H5E_CANTRESET_g; /* Can't reset object */ -H5_DLLVAR hid_t H5E_CANTRENAME_g; /* Unable to rename object */ +/* Free space errors */ +#define H5E_CANTMERGE (H5OPEN H5E_CANTMERGE_g) +#define H5E_CANTREVIVE (H5OPEN H5E_CANTREVIVE_g) +#define H5E_CANTSHRINK (H5OPEN H5E_CANTSHRINK_g) +H5_DLLVAR hid_t H5E_CANTMERGE_g; /* Can't merge objects */ +H5_DLLVAR hid_t H5E_CANTREVIVE_g; /* Can't revive object */ +H5_DLLVAR hid_t H5E_CANTSHRINK_g; /* Can't shrink container */ -/* Plugin errors */ -#define H5E_OPENERROR (H5OPEN H5E_OPENERROR_g) -H5_DLLVAR hid_t H5E_OPENERROR_g; /* Can't open directory or file */ +/* I/O pipeline errors */ +#define H5E_NOFILTER (H5OPEN H5E_NOFILTER_g) +#define H5E_CALLBACK (H5OPEN H5E_CALLBACK_g) +#define H5E_CANAPPLY (H5OPEN H5E_CANAPPLY_g) +#define H5E_SETLOCAL (H5OPEN H5E_SETLOCAL_g) +#define H5E_NOENCODER (H5OPEN H5E_NOENCODER_g) +#define H5E_CANTFILTER (H5OPEN H5E_CANTFILTER_g) +H5_DLLVAR hid_t H5E_NOFILTER_g; /* Requested filter is not available */ +H5_DLLVAR hid_t H5E_CALLBACK_g; /* Callback failed */ +H5_DLLVAR hid_t H5E_CANAPPLY_g; /* Error from filter 'can apply' callback */ +H5_DLLVAR hid_t H5E_SETLOCAL_g; /* Error from filter 'set local' callback */ +H5_DLLVAR hid_t H5E_NOENCODER_g; /* Filter present but encoding disabled */ +H5_DLLVAR hid_t H5E_CANTFILTER_g; /* Filter operation failed */ + +/* Link related errors */ +#define H5E_TRAVERSE (H5OPEN H5E_TRAVERSE_g) +#define H5E_NLINKS (H5OPEN H5E_NLINKS_g) +#define H5E_NOTREGISTERED (H5OPEN H5E_NOTREGISTERED_g) +#define H5E_CANTMOVE (H5OPEN H5E_CANTMOVE_g) +#define H5E_CANTSORT (H5OPEN H5E_CANTSORT_g) +H5_DLLVAR hid_t H5E_TRAVERSE_g; /* Link traversal failure */ +H5_DLLVAR hid_t H5E_NLINKS_g; /* Too many soft links in path */ +H5_DLLVAR hid_t H5E_NOTREGISTERED_g; /* Link class not registered */ +H5_DLLVAR hid_t H5E_CANTMOVE_g; /* Can't move object */ +H5_DLLVAR hid_t H5E_CANTSORT_g; /* Can't sort objects */ /* File accessibilty errors */ #define H5E_FILEEXISTS (H5OPEN H5E_FILEEXISTS_g) @@ -301,47 +289,45 @@ H5_DLLVAR hid_t H5E_BADFILE_g; /* Bad file ID accessed */ H5_DLLVAR hid_t H5E_TRUNCATED_g; /* File has been truncated */ H5_DLLVAR hid_t H5E_MOUNT_g; /* File mount error */ -/* I/O pipeline errors */ -#define H5E_NOFILTER (H5OPEN H5E_NOFILTER_g) -#define H5E_CALLBACK (H5OPEN H5E_CALLBACK_g) -#define H5E_CANAPPLY (H5OPEN H5E_CANAPPLY_g) -#define H5E_SETLOCAL (H5OPEN H5E_SETLOCAL_g) -#define H5E_NOENCODER (H5OPEN H5E_NOENCODER_g) -#define H5E_CANTFILTER (H5OPEN H5E_CANTFILTER_g) -H5_DLLVAR hid_t H5E_NOFILTER_g; /* Requested filter is not available */ -H5_DLLVAR hid_t H5E_CALLBACK_g; /* Callback failed */ -H5_DLLVAR hid_t H5E_CANAPPLY_g; /* Error from filter 'can apply' callback */ -H5_DLLVAR hid_t H5E_SETLOCAL_g; /* Error from filter 'set local' callback */ -H5_DLLVAR hid_t H5E_NOENCODER_g; /* Filter present but encoding disabled */ -H5_DLLVAR hid_t H5E_CANTFILTER_g; /* Filter operation failed */ - -/* Datatype conversion errors */ -#define H5E_CANTCONVERT (H5OPEN H5E_CANTCONVERT_g) -#define H5E_BADSIZE (H5OPEN H5E_BADSIZE_g) -H5_DLLVAR hid_t H5E_CANTCONVERT_g; /* Can't convert datatypes */ -H5_DLLVAR hid_t H5E_BADSIZE_g; /* Bad size for object */ +/* Cache related errors */ +#define H5E_CANTFLUSH (H5OPEN H5E_CANTFLUSH_g) +#define H5E_CANTSERIALIZE (H5OPEN H5E_CANTSERIALIZE_g) +#define H5E_CANTLOAD (H5OPEN H5E_CANTLOAD_g) +#define H5E_PROTECT (H5OPEN H5E_PROTECT_g) +#define H5E_NOTCACHED (H5OPEN H5E_NOTCACHED_g) +#define H5E_SYSTEM (H5OPEN H5E_SYSTEM_g) +#define H5E_CANTINS (H5OPEN H5E_CANTINS_g) +#define H5E_CANTPROTECT (H5OPEN H5E_CANTPROTECT_g) +#define H5E_CANTUNPROTECT (H5OPEN H5E_CANTUNPROTECT_g) +#define H5E_CANTPIN (H5OPEN H5E_CANTPIN_g) +#define H5E_CANTUNPIN (H5OPEN H5E_CANTUNPIN_g) +#define H5E_CANTMARKDIRTY (H5OPEN H5E_CANTMARKDIRTY_g) +#define H5E_CANTDIRTY (H5OPEN H5E_CANTDIRTY_g) +#define H5E_CANTEXPUNGE (H5OPEN H5E_CANTEXPUNGE_g) +#define H5E_CANTRESIZE (H5OPEN H5E_CANTRESIZE_g) +H5_DLLVAR hid_t H5E_CANTFLUSH_g; /* Unable to flush data from cache */ +H5_DLLVAR hid_t H5E_CANTSERIALIZE_g; /* Unable to serialize data from cache */ +H5_DLLVAR hid_t H5E_CANTLOAD_g; /* Unable to load metadata into cache */ +H5_DLLVAR hid_t H5E_PROTECT_g; /* Protected metadata error */ +H5_DLLVAR hid_t H5E_NOTCACHED_g; /* Metadata not currently cached */ +H5_DLLVAR hid_t H5E_SYSTEM_g; /* Internal error detected */ +H5_DLLVAR hid_t H5E_CANTINS_g; /* Unable to insert metadata into cache */ +H5_DLLVAR hid_t H5E_CANTPROTECT_g; /* Unable to protect metadata */ +H5_DLLVAR hid_t H5E_CANTUNPROTECT_g; /* Unable to unprotect metadata */ +H5_DLLVAR hid_t H5E_CANTPIN_g; /* Unable to pin cache entry */ +H5_DLLVAR hid_t H5E_CANTUNPIN_g; /* Unable to un-pin cache entry */ +H5_DLLVAR hid_t H5E_CANTMARKDIRTY_g; /* Unable to mark a pinned entry as dirty */ +H5_DLLVAR hid_t H5E_CANTDIRTY_g; /* Unable to mark metadata as dirty */ +H5_DLLVAR hid_t H5E_CANTEXPUNGE_g; /* Unable to expunge a metadata cache entry */ +H5_DLLVAR hid_t H5E_CANTRESIZE_g; /* Unable to resize a metadata cache entry */ -/* Free space errors */ -#define H5E_CANTMERGE (H5OPEN H5E_CANTMERGE_g) -#define H5E_CANTREVIVE (H5OPEN H5E_CANTREVIVE_g) -#define H5E_CANTSHRINK (H5OPEN H5E_CANTSHRINK_g) -H5_DLLVAR hid_t H5E_CANTMERGE_g; /* Can't merge objects */ -H5_DLLVAR hid_t H5E_CANTREVIVE_g; /* Can't revive object */ -H5_DLLVAR hid_t H5E_CANTSHRINK_g; /* Can't shrink container */ +/* System level errors */ +#define H5E_SYSERRSTR (H5OPEN H5E_SYSERRSTR_g) +H5_DLLVAR hid_t H5E_SYSERRSTR_g; /* System error message */ -/* Object atom related errors */ -#define H5E_BADATOM (H5OPEN H5E_BADATOM_g) -#define H5E_BADGROUP (H5OPEN H5E_BADGROUP_g) -#define H5E_CANTREGISTER (H5OPEN H5E_CANTREGISTER_g) -#define H5E_CANTINC (H5OPEN H5E_CANTINC_g) -#define H5E_CANTDEC (H5OPEN H5E_CANTDEC_g) -#define H5E_NOIDS (H5OPEN H5E_NOIDS_g) -H5_DLLVAR hid_t H5E_BADATOM_g; /* Unable to find atom information (already closed?) */ -H5_DLLVAR hid_t H5E_BADGROUP_g; /* Unable to find ID group information */ -H5_DLLVAR hid_t H5E_CANTREGISTER_g; /* Unable to register new atom */ -H5_DLLVAR hid_t H5E_CANTINC_g; /* Unable to increment reference count */ -H5_DLLVAR hid_t H5E_CANTDEC_g; /* Unable to decrement reference count */ -H5_DLLVAR hid_t H5E_NOIDS_g; /* Out of IDs for group */ +/* No error */ +#define H5E_NONE_MINOR (H5OPEN H5E_NONE_MINOR_g) +H5_DLLVAR hid_t H5E_NONE_MINOR_g; /* No error */ /* Dataspace errors */ #define H5E_CANTCLIP (H5OPEN H5E_CANTCLIP_g) @@ -357,15 +343,29 @@ H5_DLLVAR hid_t H5E_CANTNEXT_g; /* Can't move to next iterator location */ H5_DLLVAR hid_t H5E_BADSELECT_g; /* Invalid selection */ H5_DLLVAR hid_t H5E_CANTCOMPARE_g; /* Can't compare objects */ -/* Group related errors */ -#define H5E_CANTOPENOBJ (H5OPEN H5E_CANTOPENOBJ_g) -#define H5E_CANTCLOSEOBJ (H5OPEN H5E_CANTCLOSEOBJ_g) -#define H5E_COMPLEN (H5OPEN H5E_COMPLEN_g) -#define H5E_PATH (H5OPEN H5E_PATH_g) -H5_DLLVAR hid_t H5E_CANTOPENOBJ_g; /* Can't open object */ -H5_DLLVAR hid_t H5E_CANTCLOSEOBJ_g; /* Can't close object */ -H5_DLLVAR hid_t H5E_COMPLEN_g; /* Name component is too long */ -H5_DLLVAR hid_t H5E_PATH_g; /* Problem with path to object */ +/* Object header related errors */ +#define H5E_LINKCOUNT (H5OPEN H5E_LINKCOUNT_g) +#define H5E_VERSION (H5OPEN H5E_VERSION_g) +#define H5E_ALIGNMENT (H5OPEN H5E_ALIGNMENT_g) +#define H5E_BADMESG (H5OPEN H5E_BADMESG_g) +#define H5E_CANTDELETE (H5OPEN H5E_CANTDELETE_g) +#define H5E_BADITER (H5OPEN H5E_BADITER_g) +#define H5E_CANTPACK (H5OPEN H5E_CANTPACK_g) +#define H5E_CANTRESET (H5OPEN H5E_CANTRESET_g) +#define H5E_CANTRENAME (H5OPEN H5E_CANTRENAME_g) +H5_DLLVAR hid_t H5E_LINKCOUNT_g; /* Bad object header link count */ +H5_DLLVAR hid_t H5E_VERSION_g; /* Wrong version number */ +H5_DLLVAR hid_t H5E_ALIGNMENT_g; /* Alignment error */ +H5_DLLVAR hid_t H5E_BADMESG_g; /* Unrecognized message */ +H5_DLLVAR hid_t H5E_CANTDELETE_g; /* Can't delete message */ +H5_DLLVAR hid_t H5E_BADITER_g; /* Iteration failed */ +H5_DLLVAR hid_t H5E_CANTPACK_g; /* Can't pack messages */ +H5_DLLVAR hid_t H5E_CANTRESET_g; /* Can't reset object */ +H5_DLLVAR hid_t H5E_CANTRENAME_g; /* Unable to rename object */ + +/* Plugin errors */ +#define H5E_OPENERROR (H5OPEN H5E_OPENERROR_g) +H5_DLLVAR hid_t H5E_OPENERROR_g; /* Can't open directory or file */ #ifdef __cplusplus } diff --git a/src/H5Eterm.h b/src/H5Eterm.h index dd353a7..36fda92 100644 --- a/src/H5Eterm.h +++ b/src/H5Eterm.h @@ -20,55 +20,60 @@ /* Reset major error IDs */ -H5E_PLIST_g= -H5E_INTERNAL_g= -H5E_LINK_g= -H5E_STORAGE_g= -H5E_BTREE_g= -H5E_FUNC_g= +H5E_ATTR_g= +H5E_NONE_MAJOR_g= +H5E_PLINE_g= +H5E_FSPACE_g= +H5E_RS_g= +H5E_DATATYPE_g= +H5E_FILE_g= +H5E_PLUGIN_g= H5E_DATASET_g= -H5E_HEAP_g= +H5E_OHDR_g= +H5E_SLIST_g= +H5E_LINK_g= H5E_RESOURCE_g= -H5E_DATASPACE_g= H5E_ERROR_g= +H5E_INTERNAL_g= +H5E_TST_g= +H5E_CACHE_g= H5E_EFL_g= -H5E_NONE_MAJOR_g= -H5E_PLINE_g= -H5E_OHDR_g= -H5E_PLUGIN_g= -H5E_IO_g= +H5E_SYM_g= +H5E_HEAP_g= +H5E_REFERENCE_g= +H5E_FUNC_g= +H5E_STORAGE_g= +H5E_VFL_g= H5E_SOHM_g= -H5E_TST_g= H5E_ATOM_g= -H5E_ATTR_g= H5E_ARGS_g= -H5E_FILE_g= -H5E_FSPACE_g= -H5E_SLIST_g= -H5E_SYM_g= -H5E_DATATYPE_g= -H5E_CACHE_g= -H5E_RS_g= -H5E_VFL_g= -H5E_REFERENCE_g= (-1); +H5E_BTREE_g= +H5E_IO_g= +H5E_PLIST_g= +H5E_DATASPACE_g= (-1); /* Reset minor error IDs */ -/* Generic low-level file I/O errors */ -H5E_SEEKERROR_g= -H5E_READERROR_g= -H5E_WRITEERROR_g= -H5E_CLOSEERROR_g= -H5E_OVERFLOW_g= -H5E_FCNTL_g= +/* Argument errors */ +H5E_UNINITIALIZED_g= +H5E_UNSUPPORTED_g= +H5E_BADTYPE_g= +H5E_BADRANGE_g= +H5E_BADVALUE_g= -/* Link related errors */ -H5E_TRAVERSE_g= -H5E_NLINKS_g= -H5E_NOTREGISTERED_g= -H5E_CANTMOVE_g= -H5E_CANTSORT_g= +/* Object atom related errors */ +H5E_BADATOM_g= +H5E_BADGROUP_g= +H5E_CANTREGISTER_g= +H5E_CANTINC_g= +H5E_CANTDEC_g= +H5E_NOIDS_g= + +/* Function entry/exit interface errors */ +H5E_CANTINIT_g= +H5E_ALREADYINIT_g= +H5E_CANTRELEASE_g= /* Property list errors */ H5E_CANTGET_g= @@ -76,40 +81,13 @@ H5E_CANTSET_g= H5E_DUPCLASS_g= H5E_SETDISALLOWED_g= -/* Cache related errors */ -H5E_CANTFLUSH_g= -H5E_CANTSERIALIZE_g= -H5E_CANTLOAD_g= -H5E_PROTECT_g= -H5E_NOTCACHED_g= -H5E_SYSTEM_g= -H5E_CANTINS_g= -H5E_CANTPROTECT_g= -H5E_CANTUNPROTECT_g= -H5E_CANTPIN_g= -H5E_CANTUNPIN_g= -H5E_CANTMARKDIRTY_g= -H5E_CANTDIRTY_g= -H5E_CANTEXPUNGE_g= -H5E_CANTRESIZE_g= - -/* Heap errors */ -H5E_CANTRESTORE_g= -H5E_CANTCOMPUTE_g= -H5E_CANTEXTEND_g= -H5E_CANTATTACH_g= -H5E_CANTUPDATE_g= -H5E_CANTOPERATE_g= - -/* Function entry/exit interface errors */ -H5E_CANTINIT_g= -H5E_ALREADYINIT_g= -H5E_CANTRELEASE_g= - -/* Parallel MPI errors */ -H5E_MPI_g= -H5E_MPIERRSTR_g= -H5E_CANTRECV_g= +/* Generic low-level file I/O errors */ +H5E_SEEKERROR_g= +H5E_READERROR_g= +H5E_WRITEERROR_g= +H5E_CLOSEERROR_g= +H5E_OVERFLOW_g= +H5E_FCNTL_g= /* Resource errors */ H5E_NOSPACE_g= @@ -123,15 +101,22 @@ H5E_CANTGC_g= H5E_CANTGETSIZE_g= H5E_OBJOPEN_g= -/* System level errors */ -H5E_SYSERRSTR_g= +/* Datatype conversion errors */ +H5E_CANTCONVERT_g= +H5E_BADSIZE_g= -/* Argument errors */ -H5E_UNINITIALIZED_g= -H5E_UNSUPPORTED_g= -H5E_BADTYPE_g= -H5E_BADRANGE_g= -H5E_BADVALUE_g= +/* Heap errors */ +H5E_CANTRESTORE_g= +H5E_CANTCOMPUTE_g= +H5E_CANTEXTEND_g= +H5E_CANTATTACH_g= +H5E_CANTUPDATE_g= +H5E_CANTOPERATE_g= + +/* Parallel MPI errors */ +H5E_MPI_g= +H5E_MPIERRSTR_g= +H5E_CANTRECV_g= /* B-tree related errors */ H5E_NOTFOUND_g= @@ -146,22 +131,31 @@ H5E_CANTLIST_g= H5E_CANTMODIFY_g= H5E_CANTREMOVE_g= -/* No error */ -H5E_NONE_MINOR_g= +/* Group related errors */ +H5E_CANTOPENOBJ_g= +H5E_CANTCLOSEOBJ_g= +H5E_COMPLEN_g= +H5E_PATH_g= -/* Object header related errors */ -H5E_LINKCOUNT_g= -H5E_VERSION_g= -H5E_ALIGNMENT_g= -H5E_BADMESG_g= -H5E_CANTDELETE_g= -H5E_BADITER_g= -H5E_CANTPACK_g= -H5E_CANTRESET_g= -H5E_CANTRENAME_g= +/* Free space errors */ +H5E_CANTMERGE_g= +H5E_CANTREVIVE_g= +H5E_CANTSHRINK_g= -/* Plugin errors */ -H5E_OPENERROR_g= +/* I/O pipeline errors */ +H5E_NOFILTER_g= +H5E_CALLBACK_g= +H5E_CANAPPLY_g= +H5E_SETLOCAL_g= +H5E_NOENCODER_g= +H5E_CANTFILTER_g= + +/* Link related errors */ +H5E_TRAVERSE_g= +H5E_NLINKS_g= +H5E_NOTREGISTERED_g= +H5E_CANTMOVE_g= +H5E_CANTSORT_g= /* File accessibilty errors */ H5E_FILEEXISTS_g= @@ -174,30 +168,28 @@ H5E_BADFILE_g= H5E_TRUNCATED_g= H5E_MOUNT_g= -/* I/O pipeline errors */ -H5E_NOFILTER_g= -H5E_CALLBACK_g= -H5E_CANAPPLY_g= -H5E_SETLOCAL_g= -H5E_NOENCODER_g= -H5E_CANTFILTER_g= - -/* Datatype conversion errors */ -H5E_CANTCONVERT_g= -H5E_BADSIZE_g= +/* Cache related errors */ +H5E_CANTFLUSH_g= +H5E_CANTSERIALIZE_g= +H5E_CANTLOAD_g= +H5E_PROTECT_g= +H5E_NOTCACHED_g= +H5E_SYSTEM_g= +H5E_CANTINS_g= +H5E_CANTPROTECT_g= +H5E_CANTUNPROTECT_g= +H5E_CANTPIN_g= +H5E_CANTUNPIN_g= +H5E_CANTMARKDIRTY_g= +H5E_CANTDIRTY_g= +H5E_CANTEXPUNGE_g= +H5E_CANTRESIZE_g= -/* Free space errors */ -H5E_CANTMERGE_g= -H5E_CANTREVIVE_g= -H5E_CANTSHRINK_g= +/* System level errors */ +H5E_SYSERRSTR_g= -/* Object atom related errors */ -H5E_BADATOM_g= -H5E_BADGROUP_g= -H5E_CANTREGISTER_g= -H5E_CANTINC_g= -H5E_CANTDEC_g= -H5E_NOIDS_g= +/* No error */ +H5E_NONE_MINOR_g= /* Dataspace errors */ H5E_CANTCLIP_g= @@ -207,10 +199,18 @@ H5E_CANTNEXT_g= H5E_BADSELECT_g= H5E_CANTCOMPARE_g= -/* Group related errors */ -H5E_CANTOPENOBJ_g= -H5E_CANTCLOSEOBJ_g= -H5E_COMPLEN_g= -H5E_PATH_g= (-1); +/* Object header related errors */ +H5E_LINKCOUNT_g= +H5E_VERSION_g= +H5E_ALIGNMENT_g= +H5E_BADMESG_g= +H5E_CANTDELETE_g= +H5E_BADITER_g= +H5E_CANTPACK_g= +H5E_CANTRESET_g= +H5E_CANTRENAME_g= + +/* Plugin errors */ +H5E_OPENERROR_g= (-1); #endif /* H5Eterm_H */ diff --git a/test/big.c b/test/big.c index 30b715e..f5ee4ec 100644 --- a/test/big.c +++ b/test/big.c @@ -275,6 +275,14 @@ error: * *------------------------------------------------------------------------- */ +/* Disable warning for "format not a string literal" here -QAK */ +/* + * This pragma only needs to surround the snprintf() calls with + * 'name' in the code below, but early (4.4.7, at least) gcc only + * allows diagnostic pragmas to be toggled outside of functions. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" static int enough_room(hid_t fapl) { @@ -315,6 +323,7 @@ done: return ret_value; } +#pragma GCC diagnostic pop /*------------------------------------------------------------------------- diff --git a/test/dtypes.c b/test/dtypes.c index 3514de4..25cc890 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -18,7 +18,7 @@ * Purpose: Tests the datatype interface (H5T) */ -#include "h5test.h" +#include "testhdf5.h" #include "H5srcdir.h" #include "H5Iprivate.h" /* For checking that datatype id's don't leak */ @@ -698,7 +698,7 @@ test_compound_2(void) 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 = ((struct st*)((void *)orig)) + i; s_ptr->a = i*8+0; s_ptr->b = i*8+1; s_ptr->c[0] = i*8+2; @@ -736,8 +736,8 @@ test_compound_2(void) /* Compare results */ for (i=0; i<(int)nelmts; i++) { - s_ptr = ((struct st*)orig) + i; - d_ptr = ((struct dt*)buf) + i; + s_ptr = ((struct st*)((void *)orig)) + i; + d_ptr = ((struct dt*)((void *)buf)) + i; if (s_ptr->a != d_ptr->a || s_ptr->b != d_ptr->b || s_ptr->c[0] != d_ptr->c[0] || @@ -829,7 +829,7 @@ test_compound_3(void) 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 = ((struct st*)((void *)orig)) + i; s_ptr->a = i*8+0; s_ptr->b = i*8+1; s_ptr->c[0] = i*8+2; @@ -866,8 +866,8 @@ test_compound_3(void) /* Compare results */ for (i=0; i<(int)nelmts; i++) { - s_ptr = ((struct st*)orig) + i; - d_ptr = ((struct dt*)buf) + i; + s_ptr = ((struct st*)((void *)orig)) + i; + d_ptr = ((struct dt*)((void *)buf)) + i; if (s_ptr->a != d_ptr->a || s_ptr->c[0] != d_ptr->c[0] || s_ptr->c[1] != d_ptr->c[1] || @@ -960,7 +960,7 @@ test_compound_4(void) 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 = ((struct st*)((void *)orig)) + i; s_ptr->a = i*8+0; s_ptr->b = (i*8+1) & 0x7fff; s_ptr->c[0] = i*8+2; @@ -999,8 +999,8 @@ test_compound_4(void) /* Compare results */ for (i=0; i<(int)nelmts; i++) { - s_ptr = ((struct st*)orig) + i; - d_ptr = ((struct dt*)buf) + i; + s_ptr = ((struct st*)((void *)orig)) + i; + d_ptr = ((struct dt*)((void *)buf)) + i; if (s_ptr->a != d_ptr->a || s_ptr->b != d_ptr->b || s_ptr->c[0] != d_ptr->c[0] || @@ -1197,7 +1197,7 @@ test_compound_6(void) 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 = ((struct st*)((void *)orig)) + i; s_ptr->b = (i*8+1) & 0x7fff; s_ptr->d = (i*8+6) & 0x7fff; } @@ -1226,8 +1226,8 @@ test_compound_6(void) /* Compare results */ for (i=0; i<(int)nelmts; i++) { - s_ptr = ((struct st*)orig) + i; - d_ptr = ((struct dt*)buf) + i; + s_ptr = ((struct st*)((void *)orig)) + i; + d_ptr = ((struct dt*)((void *)buf)) + i; if (s_ptr->b != d_ptr->b || s_ptr->d != d_ptr->d) { H5_FAILED(); @@ -1678,7 +1678,7 @@ test_compound_9(void) { typedef struct cmpd_struct { int i1; - char* str; + const char* str; int i2; } cmpd_struct; @@ -1785,6 +1785,13 @@ test_compound_9(void) goto error; } /* end if */ + if(H5Dvlen_reclaim(dup_tid, space_id, H5P_DEFAULT, &rdata) < 0) { + H5_FAILED(); AT(); + printf("Can't reclaim read data\n"); + goto error; + } /* end if */ + rdata.str = NULL; + if(H5Dclose(dset_id) < 0) goto error; if(H5Tclose(cmpd_tid) < 0) @@ -1811,6 +1818,12 @@ test_compound_9(void) goto error; } /* end if */ + if((space_id = H5Dget_space(dset_id)) < 0) { + H5_FAILED(); AT(); + printf("Can't get space\n"); + goto error; + } /* end if */ + if((cmpd_tid = H5Dget_type(dset_id)) < 0) { H5_FAILED(); AT(); printf("cannot open dataset\n"); @@ -1838,10 +1851,19 @@ test_compound_9(void) goto error; } /* end if */ + if(H5Dvlen_reclaim(dup_tid, space_id, H5P_DEFAULT, &rdata) < 0) { + H5_FAILED(); AT(); + printf("Can't read data\n"); + goto error; + } /* end if */ + rdata.str = NULL; + if(rdata.str) HDfree(rdata.str); if(H5Dclose(dset_id) < 0) goto error; + if(H5Sclose(space_id) < 0) + goto error; if(H5Tclose(cmpd_tid) < 0) goto error; if(H5Tclose(dup_tid) < 0) @@ -1901,12 +1923,12 @@ test_compound_10(void) for(i=0; i 0); + HDassert(tid > 0); /* Attempt to create file with compound datatype that has no fields */ /* Create File */ @@ -3229,7 +3308,7 @@ test_compound_18(void) /* Create a dataspace to use */ sid = H5Screate_simple(1, &dim, NULL); - assert(sid > 0); + HDassert(sid > 0); /* Create a dataset with the bad compound datatype */ H5E_BEGIN_TRY { @@ -3242,7 +3321,7 @@ test_compound_18(void) /* Create a group */ gid = H5Gcreate2(file, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(gid > 0); + HDassert(gid > 0); /* Create an attribute with the bad compound datatype */ H5E_BEGIN_TRY { @@ -4593,7 +4672,7 @@ test_conv_enum_2(void) /* Destination enum type */ dsttype = H5Tenum_create(H5T_NATIVE_INT); - assert(H5Tget_size(dsttype) > H5Tget_size(srctype)); + HDassert(H5Tget_size(dsttype) > H5Tget_size(srctype)); for (i=0; i<8; i++) H5Tenum_insert(dsttype, mname[i], &i); @@ -6032,7 +6111,7 @@ test_int_float_except(void) /* Check the buffer after conversion, as floats */ for(u = 0; u < CONVERT_SIZE; u++) { floatp = (float *)&buf[u]; - if(*floatp != buf_float[u]) TEST_ERROR + if(!H5_FLT_ABS_EQUAL(*floatp, buf_float[u])) TEST_ERROR } /* end for */ /* Check for proper exceptions */ @@ -6053,7 +6132,7 @@ test_int_float_except(void) /* Check the buffer after conversion, as floats */ for(u = 0; u < CONVERT_SIZE; u++) { floatp = (float *)&buf2[u]; - if(*floatp != buf2_float[u]) TEST_ERROR + if(!H5_FLT_ABS_EQUAL(*floatp, buf2_float[u])) TEST_ERROR } /* end for */ /* Check for proper exceptions */ @@ -6746,89 +6825,89 @@ static void create_del_obj_named_test_file(const char *filename, hid_t fapl, /* Make copy of FAPL */ my_fapl = H5Pcopy(fapl); - assert(my_fapl > 0); + HDassert(my_fapl > 0); if(new_format) { /* Use latest version of file format */ status = H5Pset_libver_bounds(my_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); - assert(status >= 0); + HDassert(status >= 0); } /* end if */ /* Create a file creation property list (used for the root group's creation property list) */ fcpl = H5Pcreate(H5P_FILE_CREATE); - assert(fcpl > 0); + HDassert(fcpl > 0); if(new_format) { /* Use dense link storage for all links in root group */ status = H5Pset_link_phase_change(fcpl, 0, 0); - assert(status >= 0); + HDassert(status >= 0); } /* end if */ /* Create file with attribute that uses committed datatype */ file = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, my_fapl); - assert(file > 0); + HDassert(file > 0); /* Close FCPL */ status = H5Pclose(fcpl); - assert(status >= 0); + HDassert(status >= 0); /* Close FAPL */ status = H5Pclose(my_fapl); - assert(status >= 0); + HDassert(status >= 0); /* Create datatype to commit */ type = H5Tvlen_create(H5T_NATIVE_INT); - assert(type > 0); + HDassert(type > 0); /* Commit datatype */ status = H5Tcommit2(file, DEL_OBJ_NAMED_NAMED_DTYPE, type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(status >= 0); + HDassert(status >= 0); /* Create scalar dataspace */ space = H5Screate(H5S_SCALAR); - assert(space > 0); + HDassert(space > 0); /* Create a dataset creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - assert(dcpl > 0); + HDassert(dcpl > 0); if(new_format) { /* Use dense attribute storage for all attributes on dataset */ status = H5Pset_attr_phase_change(dcpl, 0, 0); - assert(status >= 0); + HDassert(status >= 0); } /* end if */ /* Create dataset */ dset = H5Dcreate2(file, DEL_OBJ_NAMED_DATASET, type, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); - assert(dset > 0); + HDassert(dset > 0); /* Close DCPL */ status = H5Pclose(dcpl); - assert(status >= 0); + HDassert(status >= 0); /* Close dataset */ status = H5Dclose(dset); - assert(status >= 0); + HDassert(status >= 0); /* Create attribute */ attr = H5Acreate_by_name(file, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(attr > 0); + HDassert(attr > 0); /* Close dataspace */ status = H5Sclose(space); - assert(status >= 0); + HDassert(status >= 0); /* Close datatype */ status = H5Tclose(type); - assert(status >= 0); + HDassert(status >= 0); /* Close attribute */ status = H5Aclose(attr); - assert(status >= 0); + HDassert(status >= 0); /* Close file */ status = H5Fclose(file); - assert(status >= 0); + HDassert(status >= 0); } /* end create_del_obj_named_test_file() */ @@ -7461,7 +7540,7 @@ int main(void) { long nerrors = 0; - hid_t fapl = -1; + hid_t fapl = -1; /* Set the random # seed */ HDsrandom((unsigned)HDtime(NULL)); @@ -7478,7 +7557,6 @@ main(void) nerrors += test_detect(); nerrors += test_compound_1(); nerrors += test_query(); - nerrors += test_transient(fapl); nerrors += test_named(fapl); nerrors += test_encode(); @@ -7528,7 +7606,7 @@ main(void) if(nerrors) { printf("***** %lu FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); - HDexit(1); + HDexit(EXIT_FAILURE); } printf("All datatype tests passed.\n"); diff --git a/test/error_test.c b/test/error_test.c index 580234a..1de9065 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -320,6 +320,14 @@ long_desc_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *clie * *------------------------------------------------------------------------- */ +/* Disable warning for "format not a string literal" here -QAK */ +/* + * This pragma only needs to surround the snprintf() calls with + * 'full_desc' in the code below, but early (4.4.7, at least) gcc only + * allows diagnostic pragmas to be toggled outside of functions. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" static herr_t test_long_desc(void) { @@ -374,6 +382,7 @@ error: return -1; } /* end test_long_desc() */ +#pragma GCC diagnostic pop /*------------------------------------------------------------------------- diff --git a/test/external.c b/test/external.c index ad8e7b6..ff33605 100644 --- a/test/external.c +++ b/test/external.c @@ -1445,11 +1445,11 @@ main(void) /* Set the fapl for different file formats */ if(latest_format) { - puts("\nTesting with the latest file format:"); + HDputs("\nTesting with the latest file format:"); current_fapl_id = fapl_id_new; } /* end if */ else { - puts("Testing with the default file format:"); + HDputs("Testing with the default file format:"); current_fapl_id = fapl_id_old; } /* end else */ @@ -1522,7 +1522,6 @@ error: H5Gclose(gid); } H5E_END_TRY; nerrors = MAX(1, nerrors); - printf ("%d TEST%s FAILED.\n", nerrors, 1==nerrors?"":"s"); + HDprintf("%d TEST%s FAILED.\n", nerrors, 1 == nerrors ? "" : "s"); return EXIT_FAILURE; } /* end main() */ - diff --git a/test/fheap.c b/test/fheap.c index fa0b0d7..b326248 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -529,6 +529,14 @@ get_fill_size(const fheap_test_param_t *tparam) * *------------------------------------------------------------------------- */ +/* Disable warning for "format not a string literal" here -QAK */ +/* + * This pragma only needs to surround the snprintf() calls with + * test_desc in the code below, but early (4.4.7, at least) gcc only + * allows diagnostic pragmas to be toggled outside of functions. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" static int begin_test(fheap_test_param_t *tparam, const char *base_desc, fheap_heap_ids_t *keep_ids, size_t *fill_size) @@ -542,7 +550,7 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc, del_str = get_del_string(tparam); HDassert(del_str); test_desc = H5MM_malloc(HDstrlen(del_str) + HDstrlen(base_desc)); - sprintf(test_desc, base_desc, del_str); + HDsprintf(test_desc, base_desc, del_str); TESTING(test_desc); H5MM_xfree(del_str); H5MM_xfree(test_desc); @@ -557,6 +565,7 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc, /* Success */ return(0); } /* end begin_test() */ +#pragma GCC diagnostic pop /*------------------------------------------------------------------------- @@ -582,10 +591,13 @@ reopen_file(hid_t *file, H5F_t **f, const char *filename, hid_t fapl, hid_t dxpl /* Close heap */ if(H5HF_close(*fh, dxpl) < 0) FAIL_STACK_ERROR + *fh = NULL; /* Close file */ if(H5Fclose(*file) < 0) FAIL_STACK_ERROR + *file = (-1); + *f = NULL; /* Re-open the file */ if((*file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) @@ -662,6 +674,7 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam, /* Close (empty) heap */ if(H5HF_close(*fh, dxpl) < 0) FAIL_STACK_ERROR + *fh = NULL; } /* end if */ /* Close file */ @@ -734,6 +747,7 @@ reopen_heap(H5F_t *f, hid_t dxpl, H5HF_t **fh, haddr_t fh_addr, /* Close (empty) heap */ if(H5HF_close(*fh, dxpl) < 0) FAIL_STACK_ERROR + *fh = NULL; /* Re-open heap */ if(NULL == (*fh = H5HF_open(f, dxpl, fh_addr))) @@ -741,10 +755,10 @@ reopen_heap(H5F_t *f, hid_t dxpl, H5HF_t **fh, haddr_t fh_addr, } /* end if */ /* Success */ - return(0); + return 0; error: - return(-1); + return -1; } /* end reopen_heap() */ @@ -1802,7 +1816,6 @@ error: * Purpose: Create fractal heap * * Return: Success: 0 - * * Failure: 1 * * Programmer: Quincey Koziol @@ -1878,6 +1891,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t H5_ATTR_UNUSED /* Close the fractal heap */ if(H5HF_close(fh, H5P_DATASET_XFER_DEFAULT) < 0) FAIL_STACK_ERROR + fh = NULL; /* Delete heap */ if(H5HF_delete(f, H5P_DATASET_XFER_DEFAULT, fh_addr) < 0) @@ -1898,15 +1912,15 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t H5_ATTR_UNUSED /* All tests passed */ PASSED() - return(0); + return 0; error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh, H5P_DATASET_XFER_DEFAULT); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; - return(1); + return 1; } /* test_create() */ @@ -1916,7 +1930,6 @@ error: * Purpose: Create & reopen a fractal heap * * Return: Success: 0 - * * Failure: 1 * * Programmer: Quincey Koziol @@ -1971,6 +1984,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t H5_ATTR_UNUSED /* Close the fractal heap */ if(H5HF_close(fh, H5P_DATASET_XFER_DEFAULT) < 0) FAIL_STACK_ERROR + fh = NULL; /* Re-open the heap */ if(NULL == (fh = H5HF_open(f, H5P_DATASET_XFER_DEFAULT, fh_addr))) @@ -2001,7 +2015,7 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh, H5P_DATASET_XFER_DEFAULT); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_reopen() */ @@ -2126,7 +2140,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t H5_ATTR_UN /* All tests passed */ PASSED() - return(0); + return 0; error: H5E_BEGIN_TRY { @@ -2134,10 +2148,11 @@ error: H5HF_close(fh, H5P_DATASET_XFER_DEFAULT); if(fh2) H5HF_close(fh2, H5P_DATASET_XFER_DEFAULT); - H5Fclose(file); - H5Fclose(file2); + H5Fclose(file); + H5Fclose(file2); } H5E_END_TRY; - return(1); + + return 1; } /* test_open_twice() */ @@ -2237,6 +2252,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t H5_ATTR_U if(fh2) { /* Close opened heap */ H5HF_close(fh2, H5P_DATASET_XFER_DEFAULT); + fh2 = NULL; /* Indicate error */ TEST_ERROR @@ -2247,20 +2263,6 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t H5_ATTR_U FAIL_STACK_ERROR fh = NULL; -#ifdef QAK - /* Try re-opening the heap again (should fail, as heap is now deleted) */ - H5E_BEGIN_TRY { - fh = H5HF_open(f, H5P_DATASET_XFER_DEFAULT, fh_addr); - } H5E_END_TRY; - if(fh) { - /* Close opened heap */ - H5HF_close(fh, H5P_DATASET_XFER_DEFAULT); - - /* Indicate error */ - TEST_ERROR - } /* end if */ -#endif /* QAK */ - /* Close the file */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -2276,7 +2278,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t H5_ATTR_U /* All tests passed */ PASSED() - return(0); + return 0; error: H5E_BEGIN_TRY { @@ -2284,9 +2286,9 @@ error: H5HF_close(fh, H5P_DATASET_XFER_DEFAULT); if(fh2) H5HF_close(fh2, H5P_DATASET_XFER_DEFAULT); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; - return(1); + return 1; } /* test_delete_open() */ @@ -2619,15 +2621,15 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam) /* All tests passed */ PASSED() - return(0); + return 0; error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh, dxpl); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; - return(1); + return 1; } /* test_id_limits() */ @@ -2721,6 +2723,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam) /* Close the fractal heap */ if(H5HF_close(fh, H5P_DATASET_XFER_DEFAULT) < 0) FAIL_STACK_ERROR + fh = NULL; /* Close the file */ @@ -2734,15 +2737,15 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam) /* All tests passed */ PASSED() - return(0); + return 0; error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh, dxpl); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; - return(1); + return 1; } /* test_filtered_create() */ @@ -2858,7 +2861,7 @@ test_size(hid_t fapl, H5HF_create_t *cparam) /* Close the fractal heap */ if(H5HF_close(fh, H5P_DATASET_XFER_DEFAULT) < 0) FAIL_STACK_ERROR - + fh = NULL; /* Close the file */ if(H5Fclose(file) < 0) @@ -2867,15 +2870,15 @@ test_size(hid_t fapl, H5HF_create_t *cparam) /* All tests passed */ PASSED() - return(0); + return 0; error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh, dxpl); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; - return(1); + return 1; } /* test_size() */ @@ -6341,7 +6344,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara /* Initialize the buffer for objects to insert */ for(u = 0; u < sizeof(obj); u++) - obj[u] = u; + obj[u] = (unsigned char)u; /* Insert object into heap */ if(H5HF_insert(fh, dxpl, sizeof(obj), obj, &heap_id) < 0) @@ -6378,6 +6381,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara /* Close the fractal heap */ if(H5HF_close(fh, dxpl) < 0) TEST_ERROR + fh = NULL; /* Close the file */ if(H5Fclose(file) < 0) @@ -6497,7 +6501,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara /* Initialize the buffer for objects to insert */ for(u = 0; u < sizeof(obj); u++) - obj[u] = u; + obj[u] = (unsigned char)u; /* Insert first object into heap */ if(H5HF_insert(fh, dxpl, sizeof(obj), obj, &heap_id1) < 0) @@ -6562,6 +6566,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara /* Close the fractal heap */ if(H5HF_close(fh, dxpl) < 0) TEST_ERROR + fh = NULL; /* Close the file */ if(H5Fclose(file) < 0) @@ -6722,6 +6727,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t /* Close the fractal heap */ if(H5HF_close(fh, dxpl) < 0) FAIL_STACK_ERROR + fh = NULL; /* Close the file */ if(H5Fclose(file) < 0) @@ -6953,6 +6959,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t /* Close the fractal heap */ if(H5HF_close(fh, dxpl) < 0) TEST_ERROR + fh = NULL; /* Close the file */ if(H5Fclose(file) < 0) @@ -7248,6 +7255,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param /* Close the fractal heap */ if(H5HF_close(fh, dxpl) < 0) TEST_ERROR + fh = NULL; /* Close the file */ if(H5Fclose(file) < 0) @@ -7342,14 +7350,14 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ */ TESTING("incremental object insertion and removal") + HDmemset(&obj1, 0, sizeof(obj1)); + HDmemset(&obj2, 0, sizeof(obj2)); for(i = 0; i < 100; i++) { - sprintf(obj1.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", i); - for(j = 0; j < i; j++) { - sprintf(obj2.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", j); - if(H5HF_remove(fh, dxpl, heap_id[j]) < 0) FAIL_STACK_ERROR + + HDsprintf(obj2.b, "%s%2d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", j); if(H5HF_insert(fh, dxpl, (sizeof(obj2)), &obj2, heap_id[j]) < 0) FAIL_STACK_ERROR } /* end for */ @@ -7360,6 +7368,7 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ /* Insert object */ HDmemset(heap_id[i], 0, id_len); + HDsprintf(obj1.b, "%s%2d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", i); if(H5HF_insert(fh, dxpl, (sizeof(obj1)), &obj1, heap_id[i]) < 0) FAIL_STACK_ERROR } /* end for */ @@ -13606,7 +13615,7 @@ error: H5MM_xfree(heap_id); if(fh) H5HF_close(fh, dxpl); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_filtered_huge() */ @@ -15294,7 +15303,7 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh, dxpl); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_random() */ @@ -15998,7 +16007,7 @@ main(void) fapl = h5_fileaccess(); ExpressMode = GetTestExpress(); if(ExpressMode > 1) - printf("***Express test mode on. Some tests may be skipped\n"); + HDprintf("***Express test mode on. Some tests may be skipped\n"); /* Initialize heap creation parameters */ init_small_cparam(&small_cparam); @@ -16460,7 +16469,7 @@ HDfprintf(stderr, "Uncomment tests!\n"); if(nerrors) goto error; - puts("All fractal heap tests passed."); + HDputs("All fractal heap tests passed."); /* Release space for the shared objects */ H5MM_xfree(shared_wobj_g); @@ -16479,14 +16488,14 @@ HDfprintf(stderr, "Uncomment cleanup!\n"); return 0; error: - puts("*** TESTS FAILED ***"); + HDputs("*** TESTS FAILED ***"); H5E_BEGIN_TRY { H5MM_xfree(shared_wobj_g); H5MM_xfree(shared_robj_g); H5MM_xfree(shared_ids_g); H5MM_xfree(shared_lens_g); H5MM_xfree(shared_offs_g); - H5Pclose(fapl); + H5Pclose(fapl); } H5E_END_TRY; return 1; } /* end main() */ diff --git a/test/file_image.c b/test/file_image.c index 2018973..7859626 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -666,6 +666,14 @@ error: * ****************************************************************************** */ +/* Disable warning for "format not a string literal" here -QAK */ +/* + * This pragma only needs to surround the snprintf() calls with + * 'member_file_name' in the code below, but early (4.4.7, at least) gcc only + * allows diagnostic pragmas to be toggled outside of functions. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" static int test_get_file_image(const char * test_banner, const int file_name_num, @@ -906,6 +914,7 @@ test_get_file_image(const char * test_banner, error: return 1; } /* end test_get_file_image() */ +#pragma GCC diagnostic pop /****************************************************************************** diff --git a/test/gheap.c b/test/gheap.c index 393b4d2..7ddbd37 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -15,9 +15,9 @@ * Programmer: Robb Matzke * Tuesday, March 31, 1998 * - * Purpose: Tests the global heap. The global heap is the set of all - * collections but the collections are not related to one - * another by anything that appears in the file format. + * Purpose: Tests the global heap. The global heap is the set of all + * collections but the collections are not related to one + * another by anything that appears in the file format. */ #include "h5test.h" #include "H5private.h" @@ -59,33 +59,31 @@ const char *FILENAME[] = { /*------------------------------------------------------------------------- * Function: test_1 * - * Purpose: Writes a sequence of objects to the global heap where each - * object is larger than the one before. + * Purpose: Writes a sequence of objects to the global heap where each + * object is larger than the one before. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * * Programmer: Robb Matzke * Tuesday, March 31, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int test_1 (hid_t fapl) { - hid_t file = -1; - H5F_t *f = NULL; - H5HG_t *obj = NULL; - uint8_t out[GHEAP_TEST_NOBJS]; - uint8_t in[GHEAP_TEST_NOBJS]; - size_t u; - size_t size; - herr_t status; - int nerrors = 0; - char filename[1024]; + hid_t file = H5I_INVALID_HID; + H5F_t *f = NULL; + H5HG_t *obj = NULL; + uint8_t out[GHEAP_TEST_NOBJS]; + uint8_t in[GHEAP_TEST_NOBJS]; + size_t u; + size_t size; + herr_t status; + int nerrors = 0; + char filename[1024]; TESTING("monotonically increasing lengths"); @@ -96,10 +94,10 @@ test_1 (hid_t fapl) /* Open a clean file */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); - puts(" Unable to create file"); + HDputs(" Unable to create file"); goto error; } @@ -115,11 +113,12 @@ test_1 (hid_t fapl) status = H5HG_insert(f, H5P_DATASET_XFER_DEFAULT, size, out, obj + u); if(status < 0) { H5_FAILED(); - puts(" Unable to insert object into global heap"); + HDputs(" Unable to insert object into global heap"); nerrors++; - } else if(u && H5F_addr_gt(obj[u - 1].addr, obj[u].addr)) { + } + else if(u && H5F_addr_gt(obj[u - 1].addr, obj[u].addr)) { H5_FAILED(); - puts(" Collection addresses are not monotonically increasing"); + HDputs(" Collection addresses are not monotonically increasing"); nerrors++; } } @@ -133,11 +132,12 @@ test_1 (hid_t fapl) H5Eclear2(H5E_DEFAULT); if(NULL == H5HG_read(f, H5P_DATASET_XFER_DEFAULT, obj + u, in, NULL)) { H5_FAILED(); - puts(" Unable to read object"); + HDputs(" Unable to read object"); nerrors++; - } else if(HDmemcmp(in, out, size)) { + } + else if(HDmemcmp(in, out, size)) { H5_FAILED(); - puts(" Value read doesn't match value written"); + HDputs(" Value read doesn't match value written"); nerrors++; } } @@ -146,15 +146,17 @@ test_1 (hid_t fapl) HDfree(obj); obj = NULL; - if(H5Fclose(file) < 0) goto error; - if(nerrors) goto error; + if(H5Fclose(file) < 0) + goto error; + if(nerrors) + goto error; PASSED(); return 0; error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(obj) HDfree(obj); @@ -165,32 +167,30 @@ error: /*------------------------------------------------------------------------- * Function: test_2 * - * Purpose: Writes a sequence of objects to the global heap where each - * object is smaller than the one before. + * Purpose: Writes a sequence of objects to the global heap where each + * object is smaller than the one before. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int test_2 (hid_t fapl) { - hid_t file = -1; - H5F_t *f = NULL; - H5HG_t *obj = NULL; - uint8_t out[GHEAP_TEST_NOBJS]; - uint8_t in[GHEAP_TEST_NOBJS]; - size_t u; - size_t size; - int nerrors = 0; - char filename[1024]; + hid_t file = H5I_INVALID_HID; + H5F_t *f = NULL; + H5HG_t *obj = NULL; + uint8_t out[GHEAP_TEST_NOBJS]; + uint8_t in[GHEAP_TEST_NOBJS]; + size_t u; + size_t size; + int nerrors = 0; + char filename[1024]; TESTING("monotonically decreasing lengths"); @@ -201,10 +201,10 @@ test_2 (hid_t fapl) /* Open a clean file */ h5_fixname(FILENAME[1], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); - puts(" Unable to create file"); + HDputs(" Unable to create file"); goto error; } @@ -217,7 +217,7 @@ test_2 (hid_t fapl) H5Eclear2(H5E_DEFAULT); if (H5HG_insert (f, H5P_DATASET_XFER_DEFAULT, size, out, obj + u) < 0) { H5_FAILED(); - puts(" Unable to insert object into global heap"); + HDputs(" Unable to insert object into global heap"); nerrors++; } } @@ -231,11 +231,12 @@ test_2 (hid_t fapl) H5Eclear2(H5E_DEFAULT); if(NULL == H5HG_read(f, H5P_DATASET_XFER_DEFAULT, obj + u, in, NULL)) { H5_FAILED(); - puts(" Unable to read object"); + HDputs(" Unable to read object"); nerrors++; - } else if (memcmp (in, out, size)) { + } + else if (memcmp (in, out, size)) { H5_FAILED(); - puts(" Value read doesn't match value written"); + HDputs(" Value read doesn't match value written"); nerrors++; } } @@ -244,15 +245,17 @@ test_2 (hid_t fapl) HDfree(obj); obj = NULL; - if (H5Fclose(file)<0) goto error; - if (nerrors) goto error; + if(H5Fclose(file) < 0) + goto error; + if(nerrors) + goto error; PASSED(); return 0; error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(obj) HDfree(obj); @@ -263,32 +266,30 @@ test_2 (hid_t fapl) /*------------------------------------------------------------------------- * Function: test_3 * - * Purpose: Creates a few global heap objects and then removes them all. - * The collection should also be removed. + * Purpose: Creates a few global heap objects and then removes them all. + * The collection should also be removed. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * * Programmer: Robb Matzke * Tuesday, March 31, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int test_3 (hid_t fapl) { - hid_t file = -1; - H5F_t *f = NULL; - H5HG_t *obj = NULL; - uint8_t out[GHEAP_TEST_NOBJS]; - size_t u; - size_t size; - herr_t status; - int nerrors = 0; - char filename[1024]; + hid_t file = H5I_INVALID_HID; + H5F_t *f = NULL; + H5HG_t *obj = NULL; + uint8_t out[GHEAP_TEST_NOBJS]; + size_t u; + size_t size; + herr_t status; + int nerrors = 0; + char filename[1024]; TESTING("complete object removal"); @@ -299,11 +300,11 @@ test_3 (hid_t fapl) /* Open a clean file */ h5_fixname(FILENAME[2], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; if(NULL == (f = (H5F_t *)H5I_object(file))) { - H5_FAILED(); - puts(" Unable to create file"); - goto error; + H5_FAILED(); + HDputs(" Unable to create file"); + goto error; } /* Create some stuff */ @@ -314,7 +315,7 @@ test_3 (hid_t fapl) status = H5HG_insert(f, H5P_DATASET_XFER_DEFAULT, size, out, obj + u); if (status<0) { H5_FAILED(); - puts(" Unable to insert object into global heap"); + HDputs(" Unable to insert object into global heap"); nerrors++; } } @@ -324,7 +325,7 @@ test_3 (hid_t fapl) status = H5HG_remove(f, H5P_DATASET_XFER_DEFAULT, obj + u); if (status<0) { H5_FAILED(); - puts(" Unable to remove object"); + HDputs(" Unable to remove object"); nerrors++; } } @@ -333,15 +334,17 @@ test_3 (hid_t fapl) HDfree(obj); obj = NULL; - if (H5Fclose(file)<0) goto error; - if (nerrors) goto error; + if(H5Fclose(file) < 0) + goto error; + if(nerrors) + goto error; PASSED(); return 0; error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(obj) HDfree(obj); @@ -352,33 +355,31 @@ test_3 (hid_t fapl) /*------------------------------------------------------------------------- * Function: test_4 * - * Purpose: Tests the H5HG_remove() feature by writing lots of objects - * and occassionally removing some. When we're done they're all - * removed. + * Purpose: Tests the H5HG_remove() feature by writing lots of objects + * and occassionally removing some. When we're done they're all + * removed. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * * Programmer: Robb Matzke * Tuesday, March 31, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int test_4 (hid_t fapl) { - hid_t file = -1; - H5F_t *f = NULL; - H5HG_t *obj = NULL; - uint8_t out[GHEAP_TEST_NOBJS]; - size_t u; - size_t size; - herr_t status; - int nerrors = 0; - char filename[1024]; + hid_t file = H5I_INVALID_HID; + H5F_t *f = NULL; + H5HG_t *obj = NULL; + uint8_t out[GHEAP_TEST_NOBJS]; + size_t u; + size_t size; + herr_t status; + int nerrors = 0; + char filename[1024]; TESTING("partial object removal"); @@ -389,10 +390,10 @@ test_4 (hid_t fapl) /* Open a clean file */ h5_fixname(FILENAME[3], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); - puts(" Unable to create file"); + HDputs(" Unable to create file"); goto error; } @@ -404,21 +405,20 @@ test_4 (hid_t fapl) status = H5HG_insert(f, H5P_DATASET_XFER_DEFAULT, size, out, obj + u); if (status<0) { H5_FAILED(); - puts(" Unable to insert object into global heap"); + HDputs(" Unable to insert object into global heap"); nerrors++; } - /* - * Remove every third one beginning with the second, but after the - * next one has already been inserted. That is, insert A, B, C; - * remove B, insert D, E, F; remove E; etc. - */ + /* Remove every third one beginning with the second, but after the + * next one has already been inserted. That is, insert A, B, C; + * remove B, insert D, E, F; remove E; etc. + */ if(1 == (u % 3)) { H5Eclear2(H5E_DEFAULT); status = H5HG_remove(f, H5P_DATASET_XFER_DEFAULT, obj + u - 1); if (status<0) { H5_FAILED(); - puts(" Unable to remove object"); + HDputs(" Unable to remove object"); nerrors++; } HDmemset(obj + u - 1, 0, sizeof *obj); @@ -429,15 +429,17 @@ test_4 (hid_t fapl) HDfree(obj); obj = NULL; - if (H5Fclose(file)<0) goto error; - if (nerrors) goto error; + if(H5Fclose(file) < 0) + goto error; + if(nerrors) + goto error; PASSED(); return 0; error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(obj) HDfree(obj); @@ -448,32 +450,30 @@ test_4 (hid_t fapl) /*------------------------------------------------------------------------- * Function: test_ooo_indices * - * Purpose: Tests that indices can be stored out of order. This can + * Purpose: Tests that indices can be stored out of order. This can * happen when the indices "wrap around" due to many * insertions and deletions (for example, from rewriting a * VL dataset). * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * * Programmer: Neil Fortner * Monday, October 26, 2009 * - * Modifications: - * *------------------------------------------------------------------------- */ static int test_ooo_indices(hid_t fapl) { - hid_t file = -1; - H5F_t *f = NULL; + hid_t file = H5I_INVALID_HID; + H5F_t *f = NULL; unsigned i, j; - H5HG_t *obj = NULL; - herr_t status; - int nerrors=0; - char filename[1024]; + H5HG_t *obj = NULL; + herr_t status; + int nerrors = 0; + char filename[1024]; TESTING("out of order indices"); @@ -486,16 +486,18 @@ test_ooo_indices(hid_t fapl) goto error; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); - puts(" Unable to create file"); + HDputs(" Unable to create file"); goto error; - } /* end if */ + } /* Alternately insert 1000 entries and remove the previous group of 1000 - * entries, until the indices wrap around */ - for(i=0; i<66; i++) { + * entries, until the indices wrap around. + */ + for(i = 0; i < 66; i++) { /* Insert 1000 entries. The index into the obj array will alternate up * and down by 1000 so the previous set of insertions is preserved and - * can be deleted. */ + * can be deleted. + */ for(j=1000*((~i&1)); j<1000*((~i&1)+1); j++) { H5Eclear2(H5E_DEFAULT); status = H5HG_insert(f, H5P_DATASET_XFER_DEFAULT, sizeof(j), &j, &obj[j]); @@ -505,7 +507,7 @@ test_ooo_indices(hid_t fapl) /* Check that the index is as expected */ if(obj[j].idx != ((1000 * i) + j - (1000 * ((~i & 1)))) % ((1u << 16) - 1) + 1) GHEAP_REPEATED_ERR(" Unexpected global heap index"); - } /* end for */ + } /* Remove the previous 1000 entries */ if(i>0) @@ -514,20 +516,21 @@ test_ooo_indices(hid_t fapl) status = H5HG_remove(f, H5P_DATASET_XFER_DEFAULT, &obj[j]); if (status<0) GHEAP_REPEATED_ERR(" Unable to remove object from global heap"); - } /* end for */ - } /* end for */ + } + } /* The indices should have "wrapped around" on the last iteration */ HDassert(obj[534].idx == 65535); HDassert(obj[535].idx == 1); /* Reopen the file */ - if (H5Fclose(file)<0) goto error; + if (H5Fclose(file) < 0) + goto error; if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) goto error; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); - puts(" Unable to open file"); + HDputs(" Unable to open file"); goto error; } /* end if */ @@ -537,14 +540,15 @@ test_ooo_indices(hid_t fapl) goto error; if(i != j) { H5_FAILED(); - puts(" Incorrect read value"); + HDputs(" Incorrect read value"); goto error; - } /* end if */ - } /* end for */ - - if (H5Fclose(file)<0) goto error; - if (nerrors) goto error; + } + } + if(H5Fclose(file) < 0) + goto error; + if(nerrors) + goto error; HDfree(obj); obj = NULL; @@ -553,7 +557,7 @@ test_ooo_indices(hid_t fapl) error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(obj) HDfree(obj); @@ -562,47 +566,47 @@ test_ooo_indices(hid_t fapl) /*------------------------------------------------------------------------- - * Function: main - * - * Purpose: Tests global heap. + * Function: main * - * Return: Success: zero + * Purpose: Tests global heap. * - * Failure: non-zero - * - * Programmer: Robb Matzke - * Tuesday, March 31, 1998 - * - * Modifications: + * Return: EXIT_SUCCESS/EXIT_FAILURE * *------------------------------------------------------------------------- */ int main (void) { - int nerrors=0; - hid_t fapl; + int nerrors = 0; + hid_t fapl_id = H5I_INVALID_HID; h5_reset(); - fapl = h5_fileaccess(); + if ((fapl_id = h5_fileaccess()) < 0) + goto error; - nerrors += test_1(fapl); - nerrors += test_2(fapl); - nerrors += test_3(fapl); - nerrors += test_4(fapl); - nerrors += test_ooo_indices(fapl); + nerrors += test_1(fapl_id); + nerrors += test_2(fapl_id); + nerrors += test_3(fapl_id); + nerrors += test_4(fapl_id); + nerrors += test_ooo_indices(fapl_id); /* Verify symbol table messages are cached */ - nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); + nerrors += (h5_verify_cached_stabs(FILENAME, fapl_id) < 0 ? 1 : 0); if (nerrors) goto error; - puts("All global heap tests passed."); - h5_cleanup(FILENAME, fapl); - return 0; + + HDputs("All global heap tests passed."); + + h5_cleanup(FILENAME, fapl_id); + HDexit(EXIT_SUCCESS); error: - puts("*** TESTS FAILED ***"); - return 1; -} + H5E_BEGIN_TRY { + H5Pclose(fapl_id); + } H5E_END_TRY; + + HDputs("*** TESTS FAILED ***"); + HDexit(EXIT_FAILURE); +} /* end main() */ diff --git a/test/h5test.c b/test/h5test.c index fb582ff..e370c6d 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -42,7 +42,10 @@ * use for HDF5 file access. The first word in the * value is the name of the driver and subsequent data * is interpreted according to the driver. See - * h5_fileaccess() for details. + * h5_get_vfd_fapl() for details. + * + * HDF5_LIBVER_BOUNDS: This string describes what library version bounds to + * use for HDF5 file access. See h5_get_libver_fapl() for details. * * HDF5_PREFIX: A string to add to the beginning of all serial test * file names. This can be used to run tests in a @@ -95,9 +98,10 @@ static const char *multi_letters = "msbrglo"; static H5E_auto2_t err_func = NULL; static herr_t h5_errors(hid_t estack, void *client_data); -static char * h5_fixname_real(const char *base_name, hid_t fapl, const char *suffix, +static char *h5_fixname_real(const char *base_name, hid_t fapl, const char *suffix, char *fullname, size_t size); + /*------------------------------------------------------------------------- * Function: h5_errors @@ -143,47 +147,8 @@ h5_clean_files(const char *base_name[], hid_t fapl) int i; for(i = 0; base_name[i]; i++) { - char filename[1024]; - char temp[2048]; - hid_t driver; - - if(NULL == h5_fixname(base_name[i], fapl, filename, sizeof(filename))) - continue; - - driver = H5Pget_driver(fapl); - - if(driver == H5FD_FAMILY) { - int j; - - for(j = 0; /*void*/; j++) { - HDsnprintf(temp, sizeof temp, filename, j); - - if(HDaccess(temp, F_OK) < 0) - break; - - HDremove(temp); - } /* end for */ - } else if(driver == H5FD_CORE) { - hbool_t backing; /* Whether the core file has backing store */ - - H5Pget_fapl_core(fapl, NULL, &backing); - - /* If the file was stored to disk with bacing store, remove it */ - if(backing) - HDremove(filename); - } else if (driver == H5FD_MULTI) { - H5FD_mem_t mt; - - HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); - - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { - HDsnprintf(temp, sizeof temp, "%s-%c.h5", filename, multi_letters[mt]); - HDremove(temp); /*don't care if it fails*/ - } /* end for */ - } else { - HDremove(filename); - } - } /* end for */ + h5_delete_test_file(base_name[i], fapl); + } /* Close the FAPL used to access the file */ H5Pclose(fapl); @@ -209,6 +174,14 @@ h5_clean_files(const char *base_name[], hid_t fapl) * *------------------------------------------------------------------------- */ +/* Disable warning for "format not a string literal" here -QAK */ +/* + * This pragma only needs to surround the snprintf() calls with + * sub_filename in the code below, but early (4.4.7, at least) gcc only + * allows diagnostic pragmas to be toggled outside of functions. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" void h5_delete_test_file(const char *base_name, hid_t fapl) { @@ -251,13 +224,14 @@ h5_delete_test_file(const char *base_name, hid_t fapl) for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { HDsnprintf(sub_filename, sizeof(sub_filename), "%s-%c.h5", filename, multi_letters[mt]); HDremove(sub_filename); - } /* end for */ + } } else { HDremove(filename); - } /* end if */ + } /* end driver selection tree */ return; } /* end h5_delete_test_file() */ +#pragma GCC diagnostic pop /*------------------------------------------------------------------------- @@ -327,6 +301,35 @@ h5_cleanup(const char *base_name[], hid_t fapl) /*------------------------------------------------------------------------- + * Function: h5_test_shutdown + * + * Purpose: Performs any special test cleanup required before the test + * ends. + * + * NOTE: This function should normally only be called once + * in a given test, usually just before leaving main(). It + * is intended for use in the single-file unit tests, not + * testhdf5. + * + * Return: void + * + * Programmer: Dana Robinson + * February 2016 + * + *------------------------------------------------------------------------- + */ +void +h5_test_shutdown(void) +{ + + /* Restore the original error reporting routine */ + h5_restore_err(); + + return; +} /* end h5_test_shutdown() */ + + +/*------------------------------------------------------------------------- * Function: h5_restore_err * * Purpose: Restore the default error handler. @@ -404,6 +407,39 @@ h5_reset(void) /*------------------------------------------------------------------------- + * Function: h5_test_init + * + * Purpose: Performs any special actions before the test begins. + * + * NOTE: This function should normally only be called once + * in a given test, usually at the beginning of main(). It + * is intended for use in the single-file unit tests, not + * testhdf5. + * + * Return: void + * + * Programmer: Dana Robinson + * February 2016 + * + *------------------------------------------------------------------------- + */ +void +h5_test_init(void) +{ + HDfflush(stdout); + HDfflush(stderr); + H5close(); + + /* Save current error stack reporting routine and redirect to our local one */ + HDassert(err_func == NULL); + H5Eget_auto2(H5E_DEFAULT, &err_func, NULL); + H5Eset_auto2(H5E_DEFAULT, h5_errors, NULL); + + return; +} /* end h5_test_init() */ + + +/*------------------------------------------------------------------------- * Function: h5_fixname * * Purpose: Create a file name from a file base name like `test' and @@ -431,6 +467,7 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) return (h5_fixname_real(base_name, fapl, ".h5", fullname, size)); } + /*------------------------------------------------------------------------- * Function: h5_fixname_no_suffix @@ -451,6 +488,7 @@ h5_fixname_no_suffix(const char *base_name, hid_t fapl, char *fullname, size_t s return (h5_fixname_real(base_name, fapl, NULL, fullname, size)); } + /*------------------------------------------------------------------------- * Function: h5_fixname_real @@ -475,10 +513,11 @@ h5_fixname_no_suffix(const char *base_name, hid_t fapl, char *fullname, size_t s *------------------------------------------------------------------------- */ static char * -h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, +h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fullname, size_t size) { const char *prefix = NULL; + const char *env = NULL; /* HDF5_DRIVER environment variable */ char *ptr, last = '\0'; const char *suffix = _suffix; size_t i, j; @@ -506,7 +545,7 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, /* Must first check fapl is not H5P_DEFAULT (-1) because H5FD_XXX * could be of value -1 if it is not defined. */ - isppdriver = H5P_DEFAULT != fapl && (H5FD_MPIO==driver); + isppdriver = H5P_DEFAULT != fapl && (H5FD_MPIO == driver); /* Check HDF5_NOCLEANUP environment setting. * (The #ifdef is needed to prevent compile failure in case MPI is not @@ -701,8 +740,8 @@ h5_rmprefix(const char *filename) * but with a file driver set according to the constant or * environment variable HDF5_DRIVER * - * Return: Success: A file access property list - * Failure: -1 + * Return: Success: A file access property list + * Failure: H5I_INVALID_HID * * Programmer: Robb Matzke * Thursday, November 19, 1998 @@ -712,125 +751,270 @@ h5_rmprefix(const char *filename) hid_t h5_fileaccess(void) { - const char *val = NULL; - const char *name; - char s[1024]; - hid_t fapl = -1; + hid_t fapl_id = H5I_INVALID_HID; + + if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + /* Attempt to set up a file driver first */ + if(h5_get_vfd_fapl(fapl_id) < 0) + goto error; + + /* Finally, check for libver bounds */ + if(h5_get_libver_fapl(fapl_id) < 0) + goto error; + + return fapl_id; + +error: + if(fapl_id != H5I_INVALID_HID) + H5Pclose(fapl_id); + return H5I_INVALID_HID; +} /* end h5_fileaccess() */ + + +/*------------------------------------------------------------------------- + * Function: h5_fileaccess_flags + * + * Purpose: Returns a file access template which is the default template + * but with a file driver, VOL connector, or libver bound set + * according to a constant or environment variable + * + * Return: Success: A file access property list + * Failure: H5I_INVALID_HID + * + * Programmer: Robb Matzke + * Thursday, November 19, 1998 + * + *------------------------------------------------------------------------- + */ +hid_t +h5_fileaccess_flags(unsigned flags) +{ + hid_t fapl_id = H5I_INVALID_HID; - /* First use the environment variable, then the constant */ - val = HDgetenv("HDF5_DRIVER"); + if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + /* Attempt to set up a file driver first */ + if((flags & H5_FILEACCESS_VFD) && h5_get_vfd_fapl(fapl_id) < 0) + goto error; + + /* Finally, check for libver bounds */ + if((flags & H5_FILEACCESS_LIBVER) && h5_get_libver_fapl(fapl_id) < 0) + goto error; + + return fapl_id; + +error: + if(fapl_id != H5I_INVALID_HID) + H5Pclose(fapl_id); + return H5I_INVALID_HID; +} /* end h5_fileaccess_flags() */ + + +/*------------------------------------------------------------------------- + * Function: h5_get_vfd_fapl + * + * Purpose: Sets the file driver for a FAPL according to the value specified + * in the constant or environment variable "HDF5_DRIVER". + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Dana Robinson + * February 2016 + * + *------------------------------------------------------------------------- + */ +herr_t +h5_get_vfd_fapl(hid_t fapl) +{ + const char *env = NULL; /* HDF5_DRIVER environment variable */ + const char *tok = NULL; /* strtok pointer */ + char *lasts = NULL; /* Context pointer for strtok_r() call */ + char buf[1024]; /* buffer for tokenizing HDF5_DRIVER */ + + /* Get the environment variable, if it exists */ + env = HDgetenv("HDF5_DRIVER"); #ifdef HDF5_DRIVER - if(!val) - val = HDF5_DRIVER; + /* Use the environment variable, then the compile-time constant */ + if(!env) + env = HDF5_DRIVER; #endif - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - return -1; - if(!val || !*val) - return fapl; /* use default */ - - HDstrncpy(s, val, sizeof s); - s[sizeof(s)-1] = '\0'; - if(NULL == (name = HDstrtok(s, " \t\n\r"))) - return fapl; - - if(!HDstrcmp(name, "sec2")) { - /* Unix read() and write() system calls */ - if (H5Pset_fapl_sec2(fapl) < 0) - return -1; - } - else if(!HDstrcmp(name, "stdio")) { + /* If the environment variable was not set, just return + * without modifying the FAPL. + */ + if(!env || !*env) + goto done; + + /* Get the first 'word' of the environment variable. + * If it's nothing (environment variable was whitespace) + * just return the default fapl. + */ + HDstrncpy(buf, env, sizeof(buf)); + buf[sizeof(buf) - 1] = '\0'; + if(NULL == (tok = HDstrtok_r(buf, " \t\n\r", &lasts))) + goto done; + + if(!HDstrcmp(tok, "sec2")) { + /* POSIX (section 2) read() and write() system calls */ + if(H5Pset_fapl_sec2(fapl) < 0) + goto error; + } else if(!HDstrcmp(tok, "stdio")) { /* Standard C fread() and fwrite() system calls */ - if (H5Pset_fapl_stdio(fapl) < 0) - return -1; - } - else if(!HDstrcmp(name, "core")) { + if(H5Pset_fapl_stdio(fapl) < 0) + goto error; + } else if(!HDstrcmp(tok, "core")) { /* In-memory driver settings (backing store on, 1 MB increment) */ - if(H5Pset_fapl_core(fapl, (size_t)1, TRUE) < 0) - return -1; - } - else if(!HDstrcmp(name, "core_paged")) { + if(H5Pset_fapl_core(fapl, (size_t)H5_MB, TRUE) < 0) + goto error; + } else if(!HDstrcmp(tok, "core_paged")) { /* In-memory driver with write tracking and paging on */ - if(H5Pset_fapl_core(fapl, (size_t)1, TRUE) < 0) - return -1; + if(H5Pset_fapl_core(fapl, (size_t)H5_MB, TRUE) < 0) + goto error; if(H5Pset_core_write_tracking(fapl, TRUE, (size_t)4096) < 0) - return -1; - } - else if(!HDstrcmp(name, "split")) { + goto error; + } else if(!HDstrcmp(tok, "split")) { /* Split meta data and raw data each using default driver */ - if(H5Pset_fapl_split(fapl, - "-m.h5", H5P_DEFAULT, - "-r.h5", H5P_DEFAULT) < 0) - return -1; - } - else if(!HDstrcmp(name, "multi")) { + if(H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT) < 0) + goto error; + } else if(!HDstrcmp(tok, "multi")) { /* Multi-file driver, general case of the split driver */ - H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; - hid_t memb_fapl[H5FD_MEM_NTYPES]; - const char *memb_name[H5FD_MEM_NTYPES]; - char *sv[H5FD_MEM_NTYPES]; - haddr_t memb_addr[H5FD_MEM_NTYPES]; + H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; + hid_t memb_fapl[H5FD_MEM_NTYPES]; + const char *memb_name[H5FD_MEM_NTYPES]; + char *sv[H5FD_MEM_NTYPES]; + haddr_t memb_addr[H5FD_MEM_NTYPES]; H5FD_mem_t mt; - HDmemset(memb_map, 0, sizeof memb_map); - HDmemset(memb_fapl, 0, sizeof memb_fapl); - HDmemset(memb_name, 0, sizeof memb_name); - HDmemset(memb_addr, 0, sizeof memb_addr); + HDmemset(memb_map, 0, sizeof(memb_map)); + HDmemset(memb_fapl, 0, sizeof(memb_fapl)); + HDmemset(memb_name, 0, sizeof(memb_name)); + HDmemset(memb_addr, 0, sizeof(memb_addr)); - HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); + HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) { memb_fapl[mt] = H5P_DEFAULT; - if(NULL == (sv[mt] = (char *)HDmalloc(H5TEST_MULTI_FILENAME_LEN))) - return -1; + sv[mt] = (char *)HDmalloc(H5TEST_MULTI_FILENAME_LEN); + HDassert(sv[mt]); HDsprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]); memb_name[mt] = sv[mt]; memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10); } /* end for */ if(H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, FALSE) < 0) - return -1; + goto error; for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) HDfree(sv[mt]); - } - else if(!HDstrcmp(name, "family")) { - hsize_t fam_size = 100*1024*1024; /*100 MB*/ - + } else if(!HDstrcmp(tok, "family")) { /* Family of files, each 1MB and using the default driver */ - if((val = HDstrtok(NULL, " \t\n\r"))) - fam_size = (hsize_t)(HDstrtod(val, NULL) * 1024*1024); - if(H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT)<0) - return -1; - } - else if(!HDstrcmp(name, "log")) { - unsigned log_flags = H5FD_LOG_LOC_IO | H5FD_LOG_ALLOC; + hsize_t fam_size = 100 * 1024 * 1024; /* 100 MB */ + /* Was a family size specified in the environment variable? */ + if((tok = HDstrtok_r(NULL, " \t\n\r", &lasts))) + fam_size = (hsize_t)(HDstrtod(tok, NULL) * 1024 * 1024); + if(H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT) < 0) + goto error; + } else if(!HDstrcmp(tok, "log")) { /* Log file access */ - if((val = HDstrtok(NULL, " \t\n\r"))) - log_flags = (unsigned)HDstrtol(val, NULL, 0); + unsigned log_flags = H5FD_LOG_LOC_IO | H5FD_LOG_ALLOC; + + /* Were special log file flags specified in the environment variable? */ + if((tok = HDstrtok_r(NULL, " \t\n\r", &lasts))) + log_flags = (unsigned)HDstrtol(tok, NULL, 0); + if(H5Pset_fapl_log(fapl, NULL, log_flags, (size_t)0) < 0) - return -1; - } - else if(!HDstrcmp(name, "direct")) { + goto error; #ifdef H5_HAVE_DIRECT - /* Linux direct read() and write() system calls. Set memory boundary, file block size, - * and copy buffer size to the default values. */ + } else if(!HDstrcmp(tok, "direct")) { + /* Linux direct read() and write() system calls. Set memory boundary, + * file block size, and copy buffer size to the default values. + */ if(H5Pset_fapl_direct(fapl, 1024, 4096, 8 * 4096) < 0) - return -1; + goto error; #endif - } - else if(!HDstrcmp(name, "latest")) { + } else if(!HDstrcmp(tok, "latest")) { /* use the latest format */ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - return -1; + goto error; } else { /* Unknown driver */ - return -1; - } + goto error; + } /* end if */ - return fapl; -} +done: + return 0; + +error: + return -1; +} /* end h5_get_vfd_fapl() */ + + +/*------------------------------------------------------------------------- + * Function: h5_get_libver_fapl + * + * Purpose: Sets the library version bounds for a FAPL according to the + * value in the constant or environment variable "HDF5_LIBVER_BOUNDS". + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Quincey Koziol + * November 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +h5_get_libver_fapl(hid_t fapl) +{ + const char *env = NULL; /* HDF5_DRIVER environment variable */ + const char *tok = NULL; /* strtok pointer */ + char *lasts = NULL; /* Context pointer for strtok_r() call */ + char buf[1024]; /* buffer for tokenizing HDF5_DRIVER */ + + /* Get the environment variable, if it exists */ + env = HDgetenv("HDF5_LIBVER_BOUNDS"); +#ifdef HDF5_LIBVER_BOUNDS + /* Use the environment variable, then the compile-time constant */ + if(!env) + env = HDF5_LIBVER_BOUNDS; +#endif + + /* If the environment variable was not set, just return + * without modifying the FAPL. + */ + if(!env || !*env) + goto done; + + /* Get the first 'word' of the environment variable. + * If it's nothing (environment variable was whitespace) + * just return the default fapl. + */ + HDstrncpy(buf, env, sizeof(buf)); + buf[sizeof(buf) - 1] = '\0'; + if(NULL == (tok = HDstrtok_r(buf, " \t\n\r", &lasts))) + goto done; + + if(!HDstrcmp(tok, "latest")) { + /* use the latest format */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto error; + } /* end if */ + else { + /* Unknown setting */ + goto error; + } /* end else */ + +done: + return 0; + +error: + return -1; +} /* end h5_get_libver_fapl() */ /*------------------------------------------------------------------------- @@ -954,7 +1138,7 @@ h5_set_info_object(void) int ret_value=0; /* handle any MPI INFO hints via $HDF5_MPI_INFO */ - if ((envp = getenv("HDF5_MPI_INFO")) != NULL){ + if ((envp = HDgetenv("HDF5_MPI_INFO")) != NULL){ char *next, *valp; valp = envp = next = HDstrdup(envp); @@ -1016,7 +1200,7 @@ h5_set_info_object(void) /* actually set the darned thing */ if (MPI_SUCCESS != MPI_Info_set(h5_io_info_g, namep, valp)) { - printf("MPI_Info_set failed\n"); + HDprintf("MPI_Info_set failed\n"); ret_value = -1; } } @@ -1079,6 +1263,14 @@ h5_dump_info_object(MPI_Info info) * *------------------------------------------------------------------------- */ +/* Disable warning for "format not a string literal" here -QAK */ +/* + * This pragma only needs to surround the snprintf() calls with + * temp in the code below, but early (4.4.7, at least) gcc only + * allows diagnostic pragmas to be toggled outside of functions. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" h5_stat_size_t h5_get_file_size(const char *filename, hid_t fapl) { @@ -1180,6 +1372,7 @@ h5_get_file_size(const char *filename, hid_t fapl) return(-1); } /* end get_file_size() */ +#pragma GCC diagnostic pop /* * This routine is designed to provide equivalent functionality to 'printf' @@ -1192,9 +1385,9 @@ print_func(const char *format, ...) va_list arglist; int ret_value; - va_start(arglist, format); + HDva_start(arglist, format); ret_value = vprintf(format, arglist); - va_end(arglist); + HDva_end(arglist); return ret_value; } @@ -1279,7 +1472,7 @@ getenv_all(MPI_Comm comm, int root, const char* name) int len; static char* env = NULL; - assert(name); + HDassert(name); MPI_Initialized(&mpi_initialized); MPI_Finalized(&mpi_finalized); @@ -1287,7 +1480,7 @@ getenv_all(MPI_Comm comm, int root, const char* name) if(mpi_initialized && !mpi_finalized) { MPI_Comm_rank(comm, &mpi_rank); MPI_Comm_size(comm, &mpi_size); - assert(root < mpi_size); + HDassert(root < mpi_size); /* The root task does the getenv call * and sends the result to the other tasks */ @@ -1377,7 +1570,7 @@ h5_make_local_copy(const char *origfilename, const char *local_copy_name) while((nread = HDread(fd_old, buf, (size_t)READ_BUF_SIZE)) > 0) if(HDwrite(fd_new, buf, (size_t)nread) < 0) goto error; - + /* Close files */ if(HDclose(fd_old) < 0) goto error; @@ -1405,15 +1598,11 @@ error: * * Purpose: Callback function for h5_verify_cached_stabs. * - * Return: Success: 0 - * - * Failure: -1 + * Return: SUCCEED/FAIL * * Programmer: Neil Fortner * Tuesday, April 12, 2011 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -1421,9 +1610,9 @@ h5_verify_cached_stabs_cb(hid_t oid, const char H5_ATTR_UNUSED *name, const H5O_info_t *oinfo, void H5_ATTR_UNUSED *udata) { if(oinfo->type == H5O_TYPE_GROUP) - return(H5G__verify_cached_stabs_test(oid)); + return H5G__verify_cached_stabs_test(oid); else - return(0); + return SUCCEED; } /* end h5_verify_cached_stabs_cb() */ diff --git a/test/h5test.h b/test/h5test.h index b331044..a2606dd 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -102,7 +102,7 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ * the H5_FAILED() macro is invoked automatically when an API function fails. */ #define TESTING(WHAT) {printf("Testing %-62s",WHAT); fflush(stdout);} -#define TESTING_2(WHAT) {printf(" Testing %-62s",WHAT); fflush(stdout);} +#define TESTING_2(WHAT) {printf(" Testing %-60s",WHAT); fflush(stdout);} #define PASSED() {puts(" PASSED");fflush(stdout);} #define H5_FAILED() {puts("*FAILED*");fflush(stdout);} #define H5_WARNING() {puts("*WARNING*");fflush(stdout);} @@ -121,6 +121,10 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ #define ALARM_ON TestAlarmOn() #define ALARM_OFF HDalarm(0) +/* Flags for h5_fileaccess_flags() */ +#define H5_FILEACCESS_VFD 0x01 +#define H5_FILEACCESS_LIBVER 0x02 + /* * The methods to compare the equality of floating-point values: * 1. XXX_ABS_EQUAL - check if the difference is smaller than the @@ -150,6 +154,7 @@ H5TEST_DLL char *h5_fixname(const char *base_name, hid_t fapl, char *fullname, s H5TEST_DLL char *h5_fixname_no_suffix(const char *base_name, hid_t fapl, char *fullname, size_t size); H5TEST_DLL char *h5_fixname_printf(const char *base_name, hid_t fapl, char *fullname, size_t size); H5TEST_DLL hid_t h5_fileaccess(void); +H5TEST_DLL hid_t h5_fileaccess_flags(unsigned flags); H5TEST_DLL void h5_no_hwconv(void); H5TEST_DLL const char *h5_rmprefix(const char *filename); H5TEST_DLL void h5_reset(void); @@ -160,15 +165,20 @@ H5TEST_DLL int print_func(const char *format, ...); H5TEST_DLL int h5_make_local_copy(const char *origfilename, const char *local_copy_name); H5TEST_DLL herr_t h5_verify_cached_stabs(const char *base_name[], hid_t fapl); -/* Functions that will replace VFD-dependent functions that violate - * the single responsibility principle. Unlike their predecessors, - * these new functions do not have hidden side effects. - */ -/* h5_fileaccess() replacement */ +/* Functions that will replace components of a FAPL */ +H5TEST_DLL herr_t h5_get_vfd_fapl(hid_t fapl_id); +H5TEST_DLL herr_t h5_get_libver_fapl(hid_t fapl_id); + /* h5_clean_files() replacements */ H5TEST_DLL void h5_delete_test_file(const char *base_name, hid_t fapl); H5TEST_DLL void h5_delete_all_test_files(const char *base_name[], hid_t fapl); +/* h5_reset() replacement */ +H5TEST_DLL void h5_test_init(void); + +/* h5_cleanup() replacement */ +H5TEST_DLL void h5_test_shutdown(void); + /* Routines for operating on the list of tests (for the "all in one" tests) */ H5TEST_DLL void TestUsage(void); H5TEST_DLL void AddTest(const char *TheName, void (*TheCall) (void), diff --git a/test/lheap.c b/test/lheap.c index 4b851e8..d3e165e 100644 --- a/test/lheap.c +++ b/test/lheap.c @@ -91,7 +91,7 @@ main(void) for(i = 0; i < NOBJS; i++) { sprintf(buf, "%03d-", i); for(j = 4; j < i; j++) - buf[j] = '0' + j % 10; + buf[j] = (char)('0' + j % 10); if(j > 4) buf[j] = '\0'; diff --git a/test/mf.c b/test/mf.c index 7703ef4..5b979d3 100644 --- a/test/mf.c +++ b/test/mf.c @@ -35,7 +35,7 @@ #include "H5Iprivate.h" #include "H5VMprivate.h" -#define FILENAME_LEN 1024 +#define FILENAME_LEN 1024 #define TEST_BLOCK_SIZE5 5 #define TEST_BLOCK_SIZE20 20 @@ -52,8 +52,8 @@ #define TEST_BLOCK_SIZE8000 8000 #define TEST_BLOCK_SIZE2048 2048 -#define TEST_BLOCK_ADDR70 70 -#define TEST_BLOCK_ADDR100 100 +#define TEST_BLOCK_ADDR70 70 +#define TEST_BLOCK_ADDR100 100 #define TEST_ALIGN1024 1024 #define TEST_ALIGN4096 4096 diff --git a/test/objcopy.c b/test/objcopy.c index e679007..ad9656f 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -57,61 +57,61 @@ const char *FILENAME[] = { #define CONFIG_DENSE 16 #define MAX_CONFIGURATION 31 -#define FILE_EXT "objcopy_ext.dat" +#define FILE_EXT "objcopy_ext.dat" /* The fill_old.h5 is generated from gen_old_fill.c in HDF5 'test' directory * for version 1.4(after 1.4.3). To get this data file, simply compile * gen_old_fill.c with HDF5 library (before v1.5) and run it. */ #define FILE_OLD_LAYOUT "fill_old.h5" -#define NAME_DATATYPE_SIMPLE "H5T_NATIVE_INT" -#define NAME_DATATYPE_SIMPLE2 "H5T_NATIVE_INT-2" -#define NAME_DATATYPE_VL "vlen of int" -#define NAME_DATATYPE_VL_VL "vlen of vlen of int" -#define NAME_DATASET_SIMPLE "dataset_simple" +#define NAME_DATATYPE_SIMPLE "H5T_NATIVE_INT" +#define NAME_DATATYPE_SIMPLE2 "H5T_NATIVE_INT-2" +#define NAME_DATATYPE_VL "vlen of int" +#define NAME_DATATYPE_VL_VL "vlen of vlen of int" +#define NAME_DATASET_SIMPLE "dataset_simple" #define NAME_DATASET_SIMPLE2 "dataset_simple_copy" #define NAME_DATASET_SIMPLE3 "dataset_simple_another_copy" -#define NAME_DATASET_COMPOUND "dataset_compound" -#define NAME_DATASET_CHUNKED "dataset_chunked" -#define NAME_DATASET_CHUNKED2 "dataset_chunked2" -#define NAME_DATASET_COMPACT "dataset_compact" -#define NAME_DATASET_EXTERNAL "dataset_ext" -#define NAME_DATASET_NAMED_DTYPE "dataset_named_dtype" -#define NAME_DATASET_NAMED_DTYPE2 "dataset_named_dtype2" -#define NAME_DATASET_MULTI_OHDR "dataset_multi_ohdr" -#define NAME_DATASET_MULTI_OHDR2 "dataset_multi_ohdr2" -#define NAME_DATASET_VL "dataset_vl" -#define NAME_DATASET_VL_VL "dataset_vl_vl" -#define NAME_DATASET_CMPD_VL "dataset_cmpd_vl" -#define NAME_DATASET_SUB_SUB "/g0/g00/g000/dataset_simple" -#define NAME_GROUP_UNCOPIED "/uncopied" -#define NAME_GROUP_EMPTY "/empty" -#define NAME_GROUP_TOP "/g0" +#define NAME_DATASET_COMPOUND "dataset_compound" +#define NAME_DATASET_CHUNKED "dataset_chunked" +#define NAME_DATASET_CHUNKED2 "dataset_chunked2" +#define NAME_DATASET_COMPACT "dataset_compact" +#define NAME_DATASET_EXTERNAL "dataset_ext" +#define NAME_DATASET_NAMED_DTYPE "dataset_named_dtype" +#define NAME_DATASET_NAMED_DTYPE2 "dataset_named_dtype2" +#define NAME_DATASET_MULTI_OHDR "dataset_multi_ohdr" +#define NAME_DATASET_MULTI_OHDR2 "dataset_multi_ohdr2" +#define NAME_DATASET_VL "dataset_vl" +#define NAME_DATASET_VL_VL "dataset_vl_vl" +#define NAME_DATASET_CMPD_VL "dataset_cmpd_vl" +#define NAME_DATASET_SUB_SUB "/g0/g00/g000/dataset_simple" +#define NAME_GROUP_UNCOPIED "/uncopied" +#define NAME_GROUP_EMPTY "/empty" +#define NAME_GROUP_TOP "/g0" #define NAME_GROUP_TOP2 "/g1" #define NAME_GROUP_TOP3 "/g2" #define NAME_GROUP_TOP4 "/g3" -#define NAME_GROUP_SUB "/g0/g00" -#define NAME_GROUP_SUB_2 "/g0/g01" -#define NAME_GROUP_SUB_SUB "/g0/g00/g000" -#define NAME_GROUP_SUB_SUB2 "g000" -#define NAME_GROUP_DATASET "/g0/dataset_simple" -#define NAME_GROUP_LINK "/g_links" -#define NAME_GROUP_LINK2 "/g_links2" -#define NAME_GROUP_LOOP "g_loop" -#define NAME_GROUP_LOOP2 "g_loop2" -#define NAME_GROUP_LOOP3 "g_loop3" -#define NAME_GROUP_REF "ref_grp" -#define NAME_LINK_DATASET "/g_links/dataset_simple" -#define NAME_LINK_HARD "/g_links/hard_link_to_dataset_simple" -#define NAME_LINK_SOFT "/g_links/soft_link_to_dataset_simple" -#define NAME_LINK_SOFT2 "/g_links2/soft_link_to_dataset_simple" -#define NAME_LINK_EXTERN "/g_links/external_link_to_dataset_simple" +#define NAME_GROUP_SUB "/g0/g00" +#define NAME_GROUP_SUB_2 "/g0/g01" +#define NAME_GROUP_SUB_SUB "/g0/g00/g000" +#define NAME_GROUP_SUB_SUB2 "g000" +#define NAME_GROUP_DATASET "/g0/dataset_simple" +#define NAME_GROUP_LINK "/g_links" +#define NAME_GROUP_LINK2 "/g_links2" +#define NAME_GROUP_LOOP "g_loop" +#define NAME_GROUP_LOOP2 "g_loop2" +#define NAME_GROUP_LOOP3 "g_loop3" +#define NAME_GROUP_REF "ref_grp" +#define NAME_LINK_DATASET "/g_links/dataset_simple" +#define NAME_LINK_HARD "/g_links/hard_link_to_dataset_simple" +#define NAME_LINK_SOFT "/g_links/soft_link_to_dataset_simple" +#define NAME_LINK_SOFT2 "/g_links2/soft_link_to_dataset_simple" +#define NAME_LINK_EXTERN "/g_links/external_link_to_dataset_simple" #define NAME_LINK_EXTERN2 "/g_links2/external_link_to_dataset_simple" -#define NAME_LINK_SOFT_DANGLE "/g_links/soft_link_to_nowhere" -#define NAME_LINK_SOFT_DANGLE2 "/g_links2/soft_link_to_nowhere" +#define NAME_LINK_SOFT_DANGLE "/g_links/soft_link_to_nowhere" +#define NAME_LINK_SOFT_DANGLE2 "/g_links2/soft_link_to_nowhere" #define NAME_LINK_EXTERN_DANGLE "/g_links/external_link_to_nowhere" #define NAME_LINK_EXTERN_DANGLE2 "/g_links2/external_link_to_nowhere" -#define NAME_OLD_FORMAT "/dset1" +#define NAME_OLD_FORMAT "/dset1" #define NAME_BUF_SIZE 1024 #define ATTR_NAME_LEN 80 @@ -151,7 +151,7 @@ attach_attribute_compound_vlstr(hid_t loc_id); static int compare_attribute_compound_vlstr(hid_t loc, hid_t loc2); - + /*------------------------------------------------------------------------- * Function: addr_insert * @@ -185,7 +185,7 @@ addr_insert(H5O_info_t *oi) idtab_g.obj[n] = oi->addr; } /* end addr_insert() */ - + /*------------------------------------------------------------------------- * Function: addr_lookup * @@ -214,7 +214,7 @@ addr_lookup(H5O_info_t *oi) return FALSE; } /* end addr_lookup() */ - + /*------------------------------------------------------------------------- * Function: addr_reset * @@ -236,7 +236,7 @@ addr_reset(void) idtab_g.nalloc = idtab_g.nobjs = 0; } /* end addr_reset() */ - + /*------------------------------------------------------------------------- * Function: attach_ref_attr * @@ -247,8 +247,6 @@ addr_reset(void) * Programmer: Peter Cao * Friday, August 4, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -297,7 +295,7 @@ error: return(-1); } - + /*------------------------------------------------------------------------- * Function: attach_reg_ref_attr * @@ -308,8 +306,6 @@ error: * Programmer: Peter Cao * Monday, March 5, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -374,7 +370,7 @@ error: return(-1); } - + /*------------------------------------------------------------------------- * Function: create_reg_ref_dataset * @@ -385,8 +381,6 @@ error: * Programmer: Peter Cao * Friday, August 4, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -469,7 +463,7 @@ error: return(-1); } - + /*------------------------------------------------------------------------- * Function: attach_attribute_vl * @@ -480,8 +474,6 @@ error: * Programmer: Peter Cao * Saturday, December 17, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -527,19 +519,17 @@ done: } /* end of attach_attribute_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_attach_attributes * * Purpose: Attach NUM_ATTRIBUTES attributes to the object to be copied * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Peter Cao * Friday, September 30, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -601,13 +591,13 @@ done: return ret_value; } - + /*------------------------------------------------------------------------- * Function: test_copy_attach_paired_attributes * * Purpose: Attach NUM_ATTRIBUTES attributes to a pair of objects to be copied * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Tuesday, November 1, 2005 @@ -670,7 +660,7 @@ done: return -1; } /* end test_copy_attach_paired_attributes() */ - + /*------------------------------------------------------------------------- * Function: compare_attribute * @@ -801,24 +791,20 @@ error: return FALSE; } /* end compare_attribute() */ - + /*------------------------------------------------------------------------- * Function: compare_std_attributes * * Purpose: Compare "standard" attributes on two objects to check that they are equal * - * Return: TRUE if objects have same attributes/FALSE if they are different + * Return: TRUE if objects have same attributes/FALSE if they are different * * Programmer: Quincey Koziol * Monday, October 31, 2005 * - * Note: This isn't very general, the attributes are assumed to be + * Note: This isn't very general, the attributes are assumed to be * those written in test_copy_attach_attributes(). * - * Modifier: Peter Cao - * Wednesday, March 21, 2007 - * Change to compare any attributes of two objects - * *------------------------------------------------------------------------- */ static int @@ -873,19 +859,19 @@ compare_std_attributes(hid_t oid, hid_t oid2, hid_t pid) error: H5E_BEGIN_TRY { - H5Aclose(aid2); - H5Aclose(aid); + H5Aclose(aid2); + H5Aclose(aid); } H5E_END_TRY; return FALSE; } /* end compare_std_attributes() */ - + /*------------------------------------------------------------------------- * Function: compare_data * * Purpose: Compare two buffers of data to check that they are equal * - * Return: TRUE if buffer are equal/FALSE if they are different + * Return: TRUE if buffer are equal/FALSE if they are different * * Programmer: Quincey Koziol * Monday, November 21, 2005 @@ -945,15 +931,15 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts, * for each */ for(elmt=0; elmtlen - != ((const hvl_t *)memb2)->len) + if(((const hvl_t *)((const void *)memb1))->len + != ((const hvl_t *)((const void *)memb2))->len) TEST_ERROR /* Check vlen data */ if(!compare_data(parent1, parent2, pid, base_id, - ((const hvl_t *)memb1)->len, - ((const hvl_t *)memb1)->p, - ((const hvl_t *)memb2)->p, obj_owner)) + ((const hvl_t *)((const void *)memb1))->len, + ((const hvl_t *)((const void *)memb1))->p, + ((const hvl_t *)((const void *)memb2))->p, obj_owner)) TEST_ERROR /* Update member pointers */ @@ -1146,13 +1132,13 @@ error: return FALSE; } /* end compare_data() */ - + /*------------------------------------------------------------------------- * Function: compare_datasets * * Purpose: Compare two datasets to check that they are equal * - * Return: TRUE if datasets are equal/FALSE if they are different + * Return: TRUE if datasets are equal/FALSE if they are different * * Programmer: Quincey Koziol * Tuesday, October 25, 2005 @@ -1173,8 +1159,8 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf) hssize_t nelmts; /* # of elements in dataspace */ void *rbuf = NULL; /* Buffer for reading raw data */ void *rbuf2 = NULL; /* Buffer for reading raw data */ - H5D_space_status_t space_status; /* Dataset's raw data space status */ - H5D_space_status_t space_status2; /* Dataset's raw data space status */ + H5D_space_status_t space_status; /* Dataset's raw dataspace status */ + H5D_space_status_t space_status2; /* Dataset's raw dataspace status */ /* Check the datatypes are equal */ @@ -1352,23 +1338,23 @@ error: HDfree(rbuf); if(rbuf2) HDfree(rbuf2); - H5Pclose(dcpl2); - H5Pclose(dcpl); - H5Sclose(sid2); - H5Sclose(sid); - H5Tclose(tid2); - H5Tclose(tid); + H5Pclose(dcpl2); + H5Pclose(dcpl); + H5Sclose(sid2); + H5Sclose(sid); + H5Tclose(tid2); + H5Tclose(tid); } H5E_END_TRY; return FALSE; } /* end compare_datasets() */ - + /*------------------------------------------------------------------------- * Function: compare_groups * * Purpose: Compare two groups to check that they are "equal" * - * Return: TRUE if group are equal/FALSE if they are different + * Return: TRUE if group are equal/FALSE if they are different * * Programmer: Quincey Koziol * Monday, October 31, 2005 @@ -1518,7 +1504,7 @@ error: return FALSE; } /* end compare_groups() */ - + /*------------------------------------------------------------------------- * Function: test_copy_named_datatype * @@ -1530,8 +1516,6 @@ error: * Programmer: Peter Cao * Friday, September 30, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1539,8 +1523,8 @@ test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - char src_filename[NAME_BUF_SIZE]; - char dst_filename[NAME_BUF_SIZE]; + char src_filename[NAME_BUF_SIZE]; + char dst_filename[NAME_BUF_SIZE]; TESTING("H5Ocopy(): named datatype"); @@ -1605,15 +1589,15 @@ test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d error: H5E_BEGIN_TRY { - H5Tclose(tid2); - H5Tclose(tid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid2); + H5Tclose(tid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_named_datatype */ - + /*------------------------------------------------------------------------- * Function: test_copy_named_datatype_vl * @@ -1632,8 +1616,8 @@ test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_ { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - char src_filename[NAME_BUF_SIZE]; - char dst_filename[NAME_BUF_SIZE]; + char src_filename[NAME_BUF_SIZE]; + char dst_filename[NAME_BUF_SIZE]; TESTING("H5Ocopy(): named vlen datatype"); @@ -1698,15 +1682,15 @@ test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_ error: H5E_BEGIN_TRY { - H5Tclose(tid2); - H5Tclose(tid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid2); + H5Tclose(tid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_named_datatype_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_named_datatype_vl_vl * @@ -1725,8 +1709,8 @@ test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - char src_filename[NAME_BUF_SIZE]; - char dst_filename[NAME_BUF_SIZE]; + char src_filename[NAME_BUF_SIZE]; + char dst_filename[NAME_BUF_SIZE]; TESTING("H5Ocopy(): named nested vlen datatype"); @@ -1797,15 +1781,15 @@ test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h error: H5E_BEGIN_TRY { - H5Tclose(tid2); - H5Tclose(tid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid2); + H5Tclose(tid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_named_datatype_vl_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_named_datatype_attr_self * @@ -1819,8 +1803,6 @@ error: * Programmer: Neil * Friday, March 11, 2011 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1948,7 +1930,7 @@ error: return 1; } /* end test_copy_named_datatype_attr_self */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_simple * @@ -1960,8 +1942,6 @@ error: * Programmer: Peter Cao * Friday, September 30, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2057,16 +2037,16 @@ test_copy_dataset_simple(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_simple */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_simple_samefile * @@ -2074,12 +2054,6 @@ error: * * Return: Success: 0 * Failure: number of errors - * - * Programmer: Neil Fortner - * Thursday, January 15, 2009 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2437,8 +2411,6 @@ error: * Programmer: Peter Cao * Friday, September 30, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2594,17 +2566,17 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked_empty * @@ -2756,12 +2728,12 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked_empty */ @@ -2952,17 +2924,17 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked_sparse */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compressed * @@ -3087,18 +3059,18 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid #ifdef H5_HAVE_FILTER_DEFLATE error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; #endif /* H5_HAVE_FILTER_DEFLATE */ } /* end test_copy_dataset_compressed */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compact * @@ -3137,7 +3109,7 @@ test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* set initial data values */ for (i=0; i 1) - printf("***Express test mode on. Some tests may be skipped\n"); + HDprintf("***Express test mode on. Some tests may be skipped\n"); /* Copy the file access property list */ if((fapl2 = H5Pcopy(fapl)) < 0) TEST_ERROR @@ -12835,52 +12836,52 @@ main(void) /* Test with and without shared messages */ if(configuration & CONFIG_SHARE_SRC) { - puts("\nTesting with shared src messages:"); + HDputs("\nTesting with shared src messages:"); fcpl_src = fcpl_shared; } else { - puts("\nTesting without shared src messages:"); + HDputs("\nTesting without shared src messages:"); fcpl_src = H5P_DEFAULT; } if(configuration & CONFIG_SHARE_DST) { - puts("Testing with shared dst messages:"); + HDputs("Testing with shared dst messages:"); fcpl_dst = fcpl_shared; same_file = FALSE; } else { - puts("Testing without shared dst messages:"); + HDputs("Testing without shared dst messages:"); fcpl_dst = H5P_DEFAULT; } /* Set the FAPL for the source file's type of format */ if(configuration & CONFIG_SRC_NEW_FORMAT) { - puts("Testing with latest format for source file:"); + HDputs("Testing with latest format for source file:"); src_fapl = fapl2; /* Test with and without dense attributes */ if(configuration & CONFIG_DENSE) { - puts("Testing with dense attributes:"); + HDputs("Testing with dense attributes:"); num_attributes_g = max_compact + 1; } else { - puts("Testing without dense attributes:"); + HDputs("Testing without dense attributes:"); num_attributes_g = MAX(min_dense, 2) - 2; } } /* end if */ else { - puts("Testing with oldest file format for source file:"); + HDputs("Testing with oldest file format for source file:"); src_fapl = fapl; num_attributes_g = 4; } /* end else */ /* Set the FAPL for the destination file's type of format */ if(configuration & CONFIG_DST_NEW_FORMAT) { - puts("Testing with latest format for destination file:"); + HDputs("Testing with latest format for destination file:"); dst_fapl = fapl2; same_file = FALSE; } /* end if */ else { - puts("Testing with oldest file format for destination file:"); + HDputs("Testing with oldest file format for destination file:"); dst_fapl = fapl; } /* end else */ @@ -12939,10 +12940,10 @@ main(void) FALSE, "H5Ocopy(): expand soft link"); nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, H5O_COPY_EXPAND_EXT_LINK_FLAG, - FALSE, "H5Ocopy: expand external link"); + FALSE, "H5Ocopy(): expand external link"); nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, H5O_COPY_EXPAND_SOFT_LINK_FLAG | H5O_COPY_EXPAND_EXT_LINK_FLAG, - FALSE, "H5Ocopy: expand soft and external links"); + FALSE, "H5Ocopy(): expand soft and external links"); nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, H5O_COPY_SHALLOW_HIERARCHY_FLAG, FALSE, "H5Ocopy(): shallow group copy"); @@ -13007,7 +13008,6 @@ main(void) nerrors += test_copy_dataset_compressed_named_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); nerrors += test_copy_dataset_compact_vl_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); - /* Test with dataset opened in the file or not */ nerrors += test_copy_dataset_contig_vl_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl, FALSE); nerrors += test_copy_dataset_contig_vl_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl, TRUE); @@ -13023,7 +13023,7 @@ main(void) nerrors += test_copy_dataset_compact_cmpd_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); nerrors += test_copy_same_file_named_datatype(fcpl_src, src_fapl); - + /* Test with dataset opened in the file or not */ nerrors += test_copy_old_layout(fcpl_dst, dst_fapl, FALSE); nerrors += test_copy_old_layout(fcpl_dst, dst_fapl, TRUE); @@ -13033,7 +13033,7 @@ main(void) nerrors += test_copy_null_ref_open(fcpl_src, fcpl_dst, src_fapl, dst_fapl); nerrors += test_copy_iterate(fcpl_src, fcpl_dst, src_fapl, dst_fapl); - } + } /* end if */ /* TODO: not implemented nerrors += test_copy_mount(src_fapl); @@ -13048,12 +13048,12 @@ main(void) /* Results */ if(nerrors) { - printf("***** %d OBJECT COPY TEST%s FAILED! *****\n", + HDprintf("***** %d OBJECT COPY TEST%s FAILED! *****\n", nerrors, (1 == nerrors ? "" : "S")); - exit(1); + exit(EXIT_FAILURE); } /* end if */ - puts ("All object copying tests passed."); + HDputs ("All object copying tests passed."); h5_cleanup(FILENAME, fapl); diff --git a/test/ohdr.c b/test/ohdr.c index 9c43774..9033bfd 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -45,24 +45,24 @@ const char *FILENAME[] = { /* * Verify that messages are moved forward into a "continuation message": - * Create an object header with several continuation chunks - * Remove a message in the last chunk - * The remaining message(s) in the last chunk should be moved forward into the continuation message - * The process will repeat when the continuation message is big enough to hold all the - * messages in the last chunk. - * Result: the number of chunks should be reduced + * Create an object header with several continuation chunks + * Remove a message in the last chunk + * The remaining message(s) in the last chunk should be moved forward into the continuation message + * The process will repeat when the continuation message is big enough to hold all the + * messages in the last chunk. + * Result: the number of chunks should be reduced */ static herr_t test_cont(char *filename, hid_t fapl) { - hid_t file=-1; - H5F_t *f = NULL; + hid_t file=-1; + H5F_t *f = NULL; H5O_hdr_info_t hdr_info; - H5O_loc_t oh_locA, oh_locB; - time_t time_new; - const char *short_name = "T"; - const char *long_name = "This is the message"; - size_t nchunks; + H5O_loc_t oh_locA, oh_locB; + time_t time_new; + const char *short_name = "T"; + const char *long_name = "This is the message"; + size_t nchunks; TESTING("object header continuation block"); @@ -82,58 +82,57 @@ test_cont(char *filename, hid_t fapl) time_new = 11111111; if(H5O_msg_create(&oh_locA, H5O_NAME_ID, 0, 0, &long_name, H5P_DATASET_XFER_DEFAULT) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5O_msg_create(&oh_locA, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT) < 0) FAIL_STACK_ERROR if(H5O_msg_create(&oh_locA, H5O_NAME_ID, 0, 0, &short_name, H5P_DATASET_XFER_DEFAULT) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(1 != H5O_link(&oh_locA, 1, H5P_DATASET_XFER_DEFAULT)) FAIL_STACK_ERROR if(1 != H5O_link(&oh_locB, 1, H5P_DATASET_XFER_DEFAULT)) FAIL_STACK_ERROR if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5O_expunge_chunks_test(&oh_locA, H5P_DATASET_XFER_DEFAULT) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5O_get_hdr_info(&oh_locA, H5P_DATASET_XFER_DEFAULT, &hdr_info) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR nchunks = hdr_info.nchunks; /* remove the 1st H5O_NAME_ID message */ if(H5O_msg_remove(&oh_locA, H5O_NAME_ID, 0, FALSE, H5P_DATASET_XFER_DEFAULT) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5O_get_hdr_info(&oh_locA, H5P_DATASET_XFER_DEFAULT, &hdr_info) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(hdr_info.nchunks >= nchunks) - TEST_ERROR + TEST_ERROR if(H5O_close(&oh_locA) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5O_close(&oh_locB) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5Fclose(file) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR PASSED(); - - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { @@ -142,8 +141,8 @@ error: H5Fclose(file); } H5E_END_TRY; - return -1; -} /* test_cont() */ + return FAIL; +} /* end test_cont() */ /* * Verify that object headers are held in the cache until they are linked @@ -156,15 +155,15 @@ error: static herr_t test_ohdr_cache(char *filename, hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = -1; /* File ID */ hid_t my_fapl; /* FAPL ID */ hid_t my_dxpl; /* DXPL ID */ H5AC_cache_config_t mdc_config; /* Metadata cache configuration info */ - H5F_t *f = NULL; /* File handle */ + H5F_t *f = NULL; /* File handle */ H5HL_t *lheap, *lheap2, *lheap3; /* Pointer to local heaps */ haddr_t lheap_addr, lheap_addr2, lheap_addr3; /* Local heap addresses */ - H5O_loc_t oh_loc; /* Object header location */ - time_t time_new; /* Time value for modification time message */ + H5O_loc_t oh_loc; /* Object header location */ + time_t time_new; /* Time value for modification time message */ unsigned rc; /* Refcount for object */ TESTING("object header creation in cache"); @@ -192,7 +191,7 @@ test_ohdr_cache(char *filename, hid_t fapl) if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) FAIL_STACK_ERROR if(H5Pclose(my_fapl) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR @@ -270,28 +269,28 @@ test_ohdr_cache(char *filename, hid_t fapl) FAIL_STACK_ERROR if(H5Pclose(my_dxpl) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5Fclose(file) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR PASSED(); - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { H5Fclose(file); } H5E_END_TRY; - return -1; + return FAIL; } /* test_ohdr_cache() */ /* * To test objects with unknown messages in a file with: - * a) H5O_BOGUS_VALID_ID: - * --the bogus_id is within the range of H5O_msg_class_g[] - * b) H5O_BOGUS_INVALID_ID: - * --the bogus_id is outside the range of H5O_msg_class_g[] + * a) H5O_BOGUS_VALID_ID: + * --the bogus_id is within the range of H5O_msg_class_g[] + * b) H5O_BOGUS_INVALID_ID: + * --the bogus_id is outside the range of H5O_msg_class_g[] * * The test file is FILE_BOGUS: "tbogus.h5" generated with gen_bogus.c * --objects that have unknown header messages with H5O_BOGUS_VALID_ID in "/" @@ -302,22 +301,22 @@ error: static herr_t test_unknown(unsigned bogus_id, char *filename, hid_t fapl) { - hid_t fid = -1; /* file ID */ - hid_t gid = -1; /* group ID */ - hid_t did = -1; /* Dataset ID */ + hid_t fid = -1; /* file ID */ + hid_t gid = -1; /* group ID */ + hid_t did = -1; /* Dataset ID */ hid_t sid = -1; /* Dataspace ID */ hid_t aid = -1; /* Attribute ID */ - hid_t loc = -1; /* location: file or group ID */ - hid_t fid_bogus = -1; /* bogus file ID */ - hid_t gid_bogus = -1; /* bogus group ID */ - hid_t loc_bogus = -1; /* location: bogus file or group ID */ + hid_t loc = -1; /* location: file or group ID */ + hid_t fid_bogus = -1; /* bogus file ID */ + hid_t gid_bogus = -1; /* bogus group ID */ + hid_t loc_bogus = -1; /* location: bogus file or group ID */ char testfile[256]; /* create a different name for a local copy of the data file to be opened with rd/wr file permissions in case build and test are done in the source directory. */ - HDstrncpy(testfile, FILE_BOGUS, strlen(FILE_BOGUS)); - testfile[strlen(FILE_BOGUS)]='\0'; + HDstrncpy(testfile, FILE_BOGUS, HDstrlen(FILE_BOGUS)); + testfile[HDstrlen(FILE_BOGUS)]='\0'; HDstrncat(testfile, ".copy", 5); /* Make a copy of the data file from svn. */ @@ -337,7 +336,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl) /* Set up location ID depending on bogus_id */ if(bogus_id == H5O_BOGUS_INVALID_ID) { /* Open "group" in FILE_BOGUS */ - if((gid_bogus = H5Gopen2(fid_bogus, "group", H5P_DEFAULT)) < 0) + if((gid_bogus = H5Gopen2(fid_bogus, "group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR loc_bogus = gid_bogus; @@ -402,7 +401,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl) /* Set up location ID depending on bogus_id */ if(bogus_id == H5O_BOGUS_INVALID_ID) { /* Open "group" in filename */ - if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0) + if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR loc = gid; } else @@ -436,7 +435,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl) /* Set up location ID depending on bogus_id */ if(bogus_id == H5O_BOGUS_INVALID_ID) { /* Open "group" in filename */ - if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0) + if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR loc = gid; } else @@ -482,7 +481,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl) /* Set up location ID depending on bogus_id */ if(bogus_id == H5O_BOGUS_INVALID_ID) { /* Open "group" in filename */ - if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0) + if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR loc = gid; } else @@ -500,7 +499,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl) if(H5Dclose(did) < 0) FAIL_STACK_ERROR - /* Closing: filename */ + /* Closing: filename */ if(bogus_id == H5O_BOGUS_INVALID_ID) if(H5Gclose(gid) < 0) FAIL_STACK_ERROR @@ -525,7 +524,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl) /* Set up location ID */ if(bogus_id == H5O_BOGUS_INVALID_ID) { /* Open "group" in FILE_BOGUS */ - if((gid_bogus = H5Gopen2(fid_bogus, "group", H5P_DEFAULT)) < 0) + if((gid_bogus = H5Gopen2(fid_bogus, "group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR loc_bogus = gid_bogus; } else @@ -548,7 +547,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl) /* Closing: FILE_BOGUS */ if(bogus_id == H5O_BOGUS_INVALID_ID) if(H5Gclose(gid_bogus) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5Fclose(fid_bogus) < 0) FAIL_STACK_ERROR @@ -572,14 +571,14 @@ error: /*------------------------------------------------------------------------- - * Function: main + * Function: main * * Purpose: Exercise private object header behavior and routines * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, November 24, 1998 * *------------------------------------------------------------------------- @@ -637,7 +636,6 @@ main(void) FAIL_STACK_ERROR PASSED(); - /* create a new message */ TESTING("message creation"); time_new = 11111111; @@ -655,7 +653,6 @@ main(void) TEST_ERROR PASSED(); - /* * Test modification of an existing message. */ @@ -954,16 +951,16 @@ main(void) /* Verify symbol table messages are cached */ if(h5_verify_cached_stabs(FILENAME, fapl) < 0) TEST_ERROR - puts("All object header tests passed."); + HDputs("All object header tests passed."); h5_cleanup(FILENAME, fapl); - return(0); + return 0; error: - puts("*** TESTS FAILED ***"); + HDputs("*** TESTS FAILED ***"); H5E_BEGIN_TRY { H5Fclose(file); } H5E_END_TRY; - return(1); + return 1; } /* end main() */ diff --git a/test/set_extent.c b/test/set_extent.c index 16a283d..39a100f 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -48,11 +48,11 @@ const char *FILENAME[] = { + CONFIG_EARLY_ALLOC) #define FILL_VALUE -1 #define DO_RANKS_PRINT_CONFIG(TEST) { \ - printf(" Config:\n"); \ - printf(" Test: %s\n", TEST); \ - printf(" Compression: %s\n", (config & CONFIG_COMPRESS ? "yes" : "no")); \ - printf(" Fill value: %s\n", (do_fillvalue ? "yes" : "no")); \ - printf(" Early allocation: %s\n", (config & CONFIG_EARLY_ALLOC ? "yes" \ + HDprintf(" Config:\n"); \ + HDprintf(" Test: %s\n", TEST); \ + HDprintf(" Compression: %s\n", (config & CONFIG_COMPRESS ? "yes" : "no")); \ + HDprintf(" Fill value: %s\n", (do_fillvalue ? "yes" : "no")); \ + HDprintf(" Early allocation: %s\n", (config & CONFIG_EARLY_ALLOC ? "yes" \ : "no")); \ } /* end DO_RANKS_PRINT_CONFIG */ @@ -141,17 +141,17 @@ int main( void ) for(chunk_cache = FALSE; chunk_cache <= TRUE; chunk_cache++) { /* Output message about the type of format */ if(new_format) - printf("Testing with new file format"); + HDprintf("Testing with new file format"); else - printf("Testing with old file format"); + HDprintf("Testing with old file format"); /* Set the FAPL for the chunk cache settings */ if(chunk_cache) { - puts(" and chunk cache enabled:"); + HDputs(" and chunk cache enabled:"); my_fapl = fapl; } /* end if */ else { - puts(" and chunk cache disabled:"); + HDputs(" and chunk cache disabled:"); my_fapl = fapl2; } /* end else */ @@ -190,13 +190,13 @@ int main( void ) if(nerrors) goto error; - puts("All H5Dset_extent tests passed."); + HDputs("All H5Dset_extent tests passed."); return 0; error: nerrors = MAX(1, nerrors); - printf("***** %d H5Dset_extent TEST%s FAILED! *****\n", + HDprintf("***** %d H5Dset_extent TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); return 1; } @@ -261,25 +261,25 @@ static int do_ranks( hid_t fapl ) if(test_rank1(fapl, dcpl, do_fillvalue, FALSE) < 0) { DO_RANKS_PRINT_CONFIG("Rank 1") - printf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET" + HDprintf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET" : "H5D_FILL_TIME_ALLOC")); goto error; } /* end if */ if(test_rank2(fapl, dcpl, do_fillvalue, FALSE) < 0) { DO_RANKS_PRINT_CONFIG("Rank 2") - printf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET" + HDprintf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET" : "H5D_FILL_TIME_ALLOC")); goto error; } /* end if */ if(test_rank3(fapl, dcpl, do_fillvalue, FALSE) < 0) { DO_RANKS_PRINT_CONFIG("Rank 3") - printf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET" + HDprintf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET" : "H5D_FILL_TIME_ALLOC")); goto error; } /* end if */ if(test_rank2(fapl, dcpl, do_fillvalue, TRUE) < 0) { DO_RANKS_PRINT_CONFIG("Rank 2 with non-default indexed storage B-tree") - printf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET" + HDprintf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET" : "H5D_FILL_TIME_ALLOC")); goto error; } /* end if */ @@ -396,468 +396,299 @@ static int test_rank1( hid_t fapl, int comp_value; char filename[NAME_BUF_SIZE]; - if ( do_fill_value ) - { + if(do_fill_value) comp_value = FILL_VALUE; - } else - { comp_value = 0; - } - - - for( i = 0; i < DIM0; i++ ) - { + for(i = 0; i < DIM0; i++ ) buf_o[i] = 2; - } /* create a file creation property list */ - if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - { + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR - } - if ( set_istore_k ) - { - /* set non-default indexed storage B-tree internal 'K' value */ - if (H5Pset_istore_k(fcpl,ISTORE_IK) < 0) - { + /* set non-default indexed storage B-tree internal 'K' value */ + if(set_istore_k) + if(H5Pset_istore_k(fcpl,ISTORE_IK) < 0) TEST_ERROR - } - } /* create a new file */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) - { + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) TEST_ERROR - } /* close property list */ if(H5Pclose(fcpl) < 0) - { TEST_ERROR - } /* create the data space with unlimited dimensions. */ - if ((sid = H5Screate_simple(RANK1, dims_o, maxdims)) < 0) - { + if((sid = H5Screate_simple(RANK1, dims_o, maxdims)) < 0) TEST_ERROR - } /* modify dataset creation properties, i.e. enable chunking. */ - if ((my_dcpl = H5Pcopy (dcpl)) < 0) - { + if((my_dcpl = H5Pcopy (dcpl)) < 0) TEST_ERROR - } - if (H5Pset_chunk(my_dcpl, RANK1, dims_c) < 0) - { + if(H5Pset_chunk(my_dcpl, RANK1, dims_c) < 0) TEST_ERROR - } /*------------------------------------------------------------------------- - * create, write dataset - *------------------------------------------------------------------------- - */ + * create, write dataset + *------------------------------------------------------------------------- + */ /* create a dataset */ - if ((did = H5Dcreate2(fid , "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) - { + if((did = H5Dcreate2(fid , "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) TEST_ERROR - } /* write */ - if (H5Dwrite(did , H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) - { + if(H5Dwrite(did , H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) TEST_ERROR - } - #if defined (H5_SET_EXTENT_DEBUG) - printf("\n"); + HDprintf("\n"); for (i = 0; i < (int)dims_o[0]; i++ ) - { - - printf("%d ", buf_o[i]); - - } - printf("\n"); + HDprintf("%d ", buf_o[i]); + HDprintf("\n"); #endif - - - if (H5Sclose(sid) < 0) - { + if(H5Sclose(sid) < 0) TEST_ERROR - } /*------------------------------------------------------------------------- - * set new dimensions for the array; expand it - *------------------------------------------------------------------------- - */ + * set new dimensions for the array; expand it + *------------------------------------------------------------------------- + */ /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_e) < 0) - { + if(H5Dset_extent(did , dims_e) < 0) TEST_ERROR - } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if((sid = H5Dget_space(did)) < 0) TEST_ERROR - } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if(H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) TEST_ERROR - } - if (H5Sclose(sid) < 0) - { + if(H5Sclose(sid) < 0) TEST_ERROR - } - /* check dimensions */ for( i = 0; i < RANK1; i++ ) - { if (dims_r[i] != dims_e[i]) TEST_ERROR - } /* read */ if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_e) < 0) TEST_ERROR - #if defined (H5_SET_EXTENT_DEBUG) - printf("\n"); + HDprintf("\n buf_e: "); for (i = 0; i < (int)dims_r[0]; i++ ) - { - - printf("%d ", buf_e[i]); - - } - printf("\n"); + HDprintf("%d ", buf_e[i]); + HDprintf("\n"); #endif - - - /* compare the read array with the expanded array */ for (i = 0; i < (int)dims_r[0]; i++ ) - { - - if ( i >= DIM0 ) - { - if(buf_e[i] != comp_value) - { - printf("buf_e[%d] = %d\n", i, buf_e[i]); - printf("value = %d\n", comp_value); + if(i >= DIM0) { + if(buf_e[i] != comp_value) { + HDprintf("buf_e[%d] = %d\n", i, buf_e[i]); + HDprintf("value = %d\n", comp_value); TEST_ERROR - } - } - else - { + } /* end if */ + } /* end if */ + else { if(buf_e[i] != buf_o[i]) TEST_ERROR - } - } - + } /* end else */ /*------------------------------------------------------------------------- - * shrink - * - *------------------------------------------------------------------------- - */ + * shrink + *------------------------------------------------------------------------- + */ /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_s) < 0) - { + if(H5Dset_extent(did , dims_s) < 0) TEST_ERROR - } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if((sid = H5Dget_space(did)) < 0) TEST_ERROR - } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if(H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) TEST_ERROR - } - if (H5Sclose(sid) < 0) - { + if(H5Sclose(sid) < 0) TEST_ERROR - } /* check dimensions */ for( i = 0; i < RANK1; i++ ) - { if (dims_r[i] != dims_s[i]) TEST_ERROR - } - - /* for this case we close and reopen file */ - if ( set_istore_k ) - { - - if (H5Dclose(did) < 0) - { + if(set_istore_k) { + if(H5Dclose(did) < 0) TEST_ERROR - } - if (H5Fclose(fid) < 0) - { + if(H5Fclose(fid) < 0) TEST_ERROR - } - if ((fid = H5Fopen( filename, H5F_ACC_RDWR, fapl ))<0) - { + if((fid = H5Fopen( filename, H5F_ACC_RDWR, fapl ))<0) TEST_ERROR - } - if ((did = H5Dopen2( fid , "dset1", H5P_DEFAULT ))<0) - { + if((did = H5Dopen2( fid , "dset1", H5P_DEFAULT ))<0) TEST_ERROR - } - - - - } + } /* end if */ /*------------------------------------------------------------------------- - * read - *------------------------------------------------------------------------- - */ + * read + *------------------------------------------------------------------------- + */ /* read */ - if (H5Dread( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_s ) < 0) - { + if(H5Dread( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_s ) < 0) TEST_ERROR - } #if defined (H5_SET_EXTENT_DEBUG) - printf("\n"); + HDprintf("\n"); for (i = 0; i < (int)dims_r[0]; i++ ) - { - - printf("%d ", buf_s[i]); - } - printf("\n"); - + HDprintf("%d ", buf_s[i]); + HDprintf("\n"); #endif - - - /* compare the read array with the shrinked array */ for( i = 0; i < (int)dims_r[0]; i++ ) - { - - if ( buf_s[i] != buf_o[i] ) - { - printf("buf_s[%d] = %d\n", i, buf_s[i]); - printf("buf_o[%d] = %d\n", i, buf_o[i]); + if(buf_s[i] != buf_o[i]) { + HDprintf("buf_s[%d] = %d\n", i, buf_s[i]); + HDprintf("buf_o[%d] = %d\n", i, buf_o[i]); TEST_ERROR - } - } - + } /* end if */ /*------------------------------------------------------------------------- - * expand it back to original size - *------------------------------------------------------------------------- - */ + * expand it back to original size + *------------------------------------------------------------------------- + */ /* set new dimensions for the array */ - if (H5Dset_extent(did, dims_o) < 0) - { + if(H5Dset_extent(did, dims_o) < 0) TEST_ERROR - } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if((sid = H5Dget_space(did)) < 0) TEST_ERROR - } /* get dimensions. */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if(H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) TEST_ERROR - } - if (H5Sclose(sid) < 0) - { + if(H5Sclose(sid) < 0) TEST_ERROR - } - /* check dimensions */ for( i = 0; i < RANK1; i++ ) - { if (dims_r[i] != dims_o[i]) TEST_ERROR - } - /* read */ - if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_r) < 0) + if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_r) < 0) TEST_ERROR #if defined (H5_SET_EXTENT_DEBUG) - printf("\n"); + HDprintf("\n"); for (i = 0; i < (int)dims_r[0]; i++ ) - { - - printf("%d ", buf_r[i]); - - } - printf("\n"); + HDprintf("%d ", buf_r[i]); + HDprintf("\n"); #endif - - /* compare the read array with the original array */ - for (i = 0; i < (int)dims_r[0]; i++ ) - { - - if (i >= DIMS0 ) - { - if(buf_r[i] != comp_value) - { - printf("buf_r[%d] = %d\n", i, buf_r[i] ); - printf("value = %d\n", comp_value); + for(i = 0; i < (int)dims_r[0]; i++ ) + if(i >= DIMS0 ) { + if(buf_r[i] != comp_value) { + HDprintf("buf_r[%d] = %d\n", i, buf_r[i] ); + HDprintf("value = %d\n", comp_value); TEST_ERROR - } - } - else - { + } /* end if */ + } /* end if */ + else { if(buf_r[i] != buf_o[i]) TEST_ERROR - } - } + } /* end else */ /*------------------------------------------------------------------------- - * shrink to 0 - * - *------------------------------------------------------------------------- - */ + * shrink to 0 + *------------------------------------------------------------------------- + */ dims_s[0] = 0; /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_s) < 0) - { + if(H5Dset_extent(did , dims_s) < 0) TEST_ERROR - } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if((sid = H5Dget_space(did)) < 0) TEST_ERROR - } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if(H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) TEST_ERROR - } - - if (H5Sclose(sid) < 0) - { + if(H5Sclose(sid) < 0) TEST_ERROR - } /* check dimensions */ for( i = 0; i < RANK1; i++ ) - { - if (dims_r[i] != dims_s[i]) + if(dims_r[i] != dims_s[i]) TEST_ERROR - } /*------------------------------------------------------------------------- - * close dataset - *------------------------------------------------------------------------- - */ + * close dataset + *------------------------------------------------------------------------- + */ - if (H5Dclose(did) < 0) - { + if(H5Dclose(did) < 0) TEST_ERROR - } - - - - - /*------------------------------------------------------------------------- - * test a dataset with non initialized chunks - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * test a dataset with non initialized chunks + *------------------------------------------------------------------------- + */ - if ((sid = H5Screate_simple(RANK1, dims_o, maxdims)) < 0) - { + if((sid = H5Screate_simple(RANK1, dims_o, maxdims)) < 0) TEST_ERROR - } - if ((did = H5Dcreate2(fid , "dset3", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) - { + if((did = H5Dcreate2(fid , "dset3", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) TEST_ERROR - } + /* set new dimensions for the array */ dims_o[ 0 ] = 0; - if (H5Dset_extent( did , dims_o ) < 0) - { + if(H5Dset_extent( did , dims_o ) < 0) TEST_ERROR - } - - - if (H5Dclose(did) < 0) - { + if(H5Dclose(did) < 0) TEST_ERROR - } - if (H5Sclose(sid) < 0) - { + if(H5Sclose(sid) < 0) TEST_ERROR - } - - - /*------------------------------------------------------------------------- - * close property list - *------------------------------------------------------------------------- - */ - - - if (H5Pclose(my_dcpl) < 0) - { + * close property list + *------------------------------------------------------------------------- + */ + if(H5Pclose(my_dcpl) < 0) TEST_ERROR - } - - if (H5Fclose( fid ) < 0) - { + if(H5Fclose(fid) < 0) TEST_ERROR - } - return 0; - - error: H5E_BEGIN_TRY @@ -870,67 +701,54 @@ error: } H5E_END_TRY; return -1; -} +} /* end test_rank1() */ /*------------------------------------------------------------------------- * test usage with a 2D rank *------------------------------------------------------------------------- */ -static int test_rank2( hid_t fapl, - hid_t dcpl, - hbool_t do_fill_value, - hbool_t set_istore_k) -{ - - hid_t fid=-1; - hid_t did=-1; - hid_t sid=-1; - hid_t my_dcpl=-1; - hid_t fcpl; - hsize_t dims_o[RANK2] = {DIM0,DIM1}; /* original dimensions */ - hsize_t dims_s[RANK2] = {DIMS0,DIMS1}; /* shrinking dimensions */ - hsize_t dims_e[RANK2] = {DIME0,DIME1}; /* extended dimensions */ - hsize_t dims_c[RANK2] = {2,2}; /* chunk dimensions */ - hsize_t dims_r[RANK2]; /* read dimensions */ - hsize_t maxdims[RANK2] = {H5S_UNLIMITED,H5S_UNLIMITED}; - int buf_o[DIM0][DIM1]; - int buf_s[DIMS0][DIMS1]; - int buf_e[DIME0][DIME1]; - int buf_r[DIM0][DIM1]; - int i, j; - int comp_value; - char filename[NAME_BUF_SIZE]; - - if ( do_fill_value ) - { +static int test_rank2(hid_t fapl, hid_t dcpl, hbool_t do_fill_value, hbool_t set_istore_k) { + + hid_t fid = -1; + hid_t did = -1; + hid_t sid = -1; + hid_t my_dcpl = -1; + hid_t fcpl; + hsize_t dims_o[RANK2] = { DIM0, DIM1 }; /* original dimensions */ + hsize_t dims_s[RANK2] = { DIMS0, DIMS1 }; /* shrinking dimensions */ + hsize_t dims_e[RANK2] = { DIME0, DIME1 }; /* extended dimensions */ + hsize_t dims_c[RANK2] = { 2, 2 }; /* chunk dimensions */ + hsize_t dims_r[RANK2]; /* read dimensions */ + hsize_t maxdims[RANK2] = { H5S_UNLIMITED, H5S_UNLIMITED }; + int buf_o[DIM0][DIM1]; + int buf_s[DIMS0][DIMS1]; + int buf_e[DIME0][DIME1]; + int buf_r[DIM0][DIM1]; + int i, j; + int comp_value; + char filename[NAME_BUF_SIZE]; + + if (do_fill_value) { comp_value = FILL_VALUE; - } - else - { + } else { comp_value = 0; } - - for( i = 0; i < DIM0; i++ ) - { - for( j = 0; j < DIM1; j++ ) - { + for (i = 0; i < DIM0; i++) { + for (j = 0; j < DIM1; j++) { buf_o[i][j] = 2; } } /* create a file creation property list */ - if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - { + if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { TEST_ERROR } - if ( set_istore_k ) - { + if (set_istore_k) { /* set non-default indexed storage B-tree internal 'K' value */ - if (H5Pset_istore_k(fcpl,ISTORE_IK) < 0) - { + if (H5Pset_istore_k(fcpl, ISTORE_IK) < 0) { TEST_ERROR } @@ -938,76 +756,62 @@ static int test_rank2( hid_t fapl, /* create a new file */ h5_fixname(FILENAME[1], fapl, filename, sizeof filename); - if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) - { + if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) { TEST_ERROR } - - /* create the data space with unlimited dimensions. */ - if ((sid = H5Screate_simple(RANK2, dims_o, maxdims)) < 0) - { + if ((sid = H5Screate_simple(RANK2, dims_o, maxdims)) < 0) { TEST_ERROR } /* modify dataset creation properties, i.e. enable chunking. */ - if ((my_dcpl = H5Pcopy (dcpl)) < 0) - { + if ((my_dcpl = H5Pcopy(dcpl)) < 0) { TEST_ERROR } - if (H5Pset_chunk(my_dcpl, RANK2, dims_c) < 0) - { + if (H5Pset_chunk(my_dcpl, RANK2, dims_c) < 0) { TEST_ERROR } - /*------------------------------------------------------------------------- - * Procedure 1 - * a. Write an array AxB. These are the dimensions for creating the dataset - * b. Define a greater array CxD where C > A and D > B - * c. Read data back - * d. Verify if new dimensions are C and D - * e. Verify if data from A to C and B to D is what it is to be expected - * - * original data is - * - * 2 2 2 2 - * 2 2 2 2 - * 2 2 2 2 - * 2 2 2 2 - * - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * Procedure 1 + * a. Write an array AxB. These are the dimensions for creating the dataset + * b. Define a greater array CxD where C > A and D > B + * c. Read data back + * d. Verify if new dimensions are C and D + * e. Verify if data from A to C and B to D is what it is to be expected + * + * original data is + * + * 2 2 2 2 + * 2 2 2 2 + * 2 2 2 2 + * 2 2 2 2 + * + *------------------------------------------------------------------------- + */ - /* create a dataset */ - if ((did = H5Dcreate2(fid , "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) - { + /* create a dataset */ + if ((did = H5Dcreate2(fid, "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) { TEST_ERROR } /* write */ - if (H5Dwrite(did , H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) - { + if (H5Dwrite(did, H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) { TEST_ERROR } - #if defined (H5_SET_EXTENT_DEBUG2) - printf("\n"); - for (i = 0; i < (int)dims_o[0]; i++ ) - { - for (j = 0; j < (int)dims_o[1]; j++ ) - { - printf("%d ", buf_o[i][j]); + HDprintf("\n"); + for (i = 0; i < (int)dims_o[0]; i++ ) { + for (j = 0; j < (int)dims_o[1]; j++ ) { + HDprintf("%d ", buf_o[i][j]); } - printf("\n"); + HDprintf("\n"); } #endif - - - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } @@ -1027,32 +831,26 @@ static int test_rank2( hid_t fapl, */ /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_e) < 0) - { + if (H5Dset_extent(did, dims_e) < 0) { TEST_ERROR } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } - /* check dimensions */ - for( i = 0; i < RANK2; i++ ) - { + for (i = 0; i < RANK2; i++) { if (dims_r[i] != dims_e[i]) TEST_ERROR } @@ -1061,55 +859,39 @@ static int test_rank2( hid_t fapl, if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_e) < 0) TEST_ERROR - - #if defined (H5_SET_EXTENT_DEBUG2) - printf("\n"); - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - printf("%d ", buf_e[i][j]); + HDprintf("\n"); + for (i = 0; i < (int)dims_r[0]; i++ ) { + for (j = 0; j < (int)dims_r[1]; j++ ) { + HDprintf("%d ", buf_e[i][j]); } - printf("\n"); + HDprintf("\n"); } #endif - - - - /* compare the read array with the expanded array */ - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - if ( i >= DIM0 || j >= DIM1 ) - { - if(buf_e[i][j] != comp_value) - { - printf("buf_e[%d][%d] = %d\n", i, j, buf_e[i][j]); - printf("value = %d\n", comp_value); + /* compare the read array with the expanded array */ + for (i = 0; i < (int) dims_r[0]; i++) { + for (j = 0; j < (int) dims_r[1]; j++) { + if (i >= DIM0 || j >= DIM1) { + if (buf_e[i][j] != comp_value) { + HDprintf("buf_e[%d][%d] = %d\n", i, j, buf_e[i][j]); + HDprintf("value = %d\n", comp_value); TEST_ERROR } - } - else - { - if(buf_e[i][j] != buf_o[i][j]) + } else { + if (buf_e[i][j] != buf_o[i][j]) TEST_ERROR } } } - - - /*------------------------------------------------------------------------- * * Procedure 2 - * a. Define a smaller array ExF where E < A and F < B - * b. Read data back - * c. Verify if new dimensions are E and F - * d. Verify if data up until E and F is what to be expected + * a. Define a smaller array ExF where E < A and F < B + * b. Read data back + * c. Verify if new dimensions are E and F + * d. Verify if data up until E and F is what to be expected * * data is now * @@ -1120,106 +902,81 @@ static int test_rank2( hid_t fapl, */ /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_s) < 0) - { + if (H5Dset_extent(did, dims_s) < 0) { TEST_ERROR } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } /* check dimensions */ - for( i = 0; i < RANK2; i++ ) - { + for (i = 0; i < RANK2; i++) { if (dims_r[i] != dims_s[i]) TEST_ERROR } - - /* for this case we close and reopen file */ - if ( set_istore_k ) - { + if (set_istore_k) { - if (H5Dclose(did) < 0) - { + if (H5Dclose(did) < 0) { TEST_ERROR } - if (H5Fclose(fid) < 0) - { + if (H5Fclose(fid) < 0) { TEST_ERROR } - if ((fid = H5Fopen( filename, H5F_ACC_RDWR, fapl ))<0) - { + if ((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) { TEST_ERROR } - if ((did = H5Dopen2( fid , "dset1", H5P_DEFAULT ))<0) - { + if ((did = H5Dopen2(fid, "dset1", H5P_DEFAULT)) < 0) { TEST_ERROR } - - } - /*------------------------------------------------------------------------- * read *------------------------------------------------------------------------- */ /* read */ - if (H5Dread( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_s ) < 0) - { + if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_s) < 0) { TEST_ERROR } #if defined (H5_SET_EXTENT_DEBUG2) - printf("\n"); - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - printf("%d ", buf_s[i][j]); + HDprintf("\n"); + for (i = 0; i < (int)dims_r[0]; i++ ) { + for (j = 0; j < (int)dims_r[1]; j++ ) { + HDprintf("%d ", buf_s[i][j]); } - printf("\n"); + HDprintf("\n"); } #endif - - - /* compare the read array with the shrinked array */ - for( i = 0; i < (int)dims_r[0]; i++ ) - { - for( j = 0; j < (int)dims_r[1]; j++ ) - { - if ( buf_s[i][j] != buf_o[i][j] ) - { - printf("buf_s[%d][%d] = %d\n", i, j, buf_s[i][j]); - printf("buf_o[%d][%d] = %d\n", i, j, buf_o[i][j]); + for (i = 0; i < (int) dims_r[0]; i++) { + for (j = 0; j < (int) dims_r[1]; j++) { + if (buf_s[i][j] != buf_o[i][j]) { + HDprintf("buf_s[%d][%d] = %d\n", i, j, buf_s[i][j]); + HDprintf("buf_o[%d][%d] = %d\n", i, j, buf_o[i][j]); TEST_ERROR } } } - /*------------------------------------------------------------------------- * set new dimensions for the array; expand it back to original size * data is now, extended space was initialized with fill value or default value @@ -1233,36 +990,30 @@ static int test_rank2( hid_t fapl, */ /* set new dimensions for the array */ - if (H5Dset_extent(did, dims_o) < 0) - { + if (H5Dset_extent(did, dims_o) < 0) { TEST_ERROR } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions. */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } /* check dimensions */ - for( i = 0; i < RANK2; i++ ) - { + for (i = 0; i < RANK2; i++) { if (dims_r[i] != dims_o[i]) TEST_ERROR } - /*------------------------------------------------------------------------- * read *------------------------------------------------------------------------- @@ -1273,36 +1024,26 @@ static int test_rank2( hid_t fapl, TEST_ERROR #if defined (H5_SET_EXTENT_DEBUG2) - printf("\n"); - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - printf("%d ", buf_r[i][j]); + HDprintf("\n"); + for (i = 0; i < (int)dims_r[0]; i++ ) { + for (j = 0; j < (int)dims_r[1]; j++ ) { + HDprintf("%d ", buf_r[i][j]); } - printf("\n"); + HDprintf("\n"); } #endif - - - /* compare the read array with the original array */ - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - if (i >= DIMS0 || j >= DIMS1) - { - if(buf_r[i][j] != comp_value) - { - printf("buf_r[%d][%d] = %d\n", i, j, buf_r[i][j]); - printf("value = %d\n", comp_value); + /* compare the read array with the original array */ + for (i = 0; i < (int) dims_r[0]; i++) { + for (j = 0; j < (int) dims_r[1]; j++) { + if (i >= DIMS0 || j >= DIMS1) { + if (buf_r[i][j] != comp_value) { + HDprintf("buf_r[%d][%d] = %d\n", i, j, buf_r[i][j]); + HDprintf("value = %d\n", comp_value); TEST_ERROR } - } - else - { - if(buf_r[i][j] != buf_o[i][j]) + } else { + if (buf_r[i][j] != buf_o[i][j]) TEST_ERROR } } @@ -1318,36 +1059,30 @@ static int test_rank2( hid_t fapl, dims_s[1] = 0; /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_s) < 0) - { + if (H5Dset_extent(did, dims_s) < 0) { TEST_ERROR } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } /* check dimensions */ - for( i = 0; i < RANK2; i++ ) - { + for (i = 0; i < RANK2; i++) { if (dims_r[i] != dims_s[i]) TEST_ERROR } - /*------------------------------------------------------------------------- * expand then shrink to 0 in dimension 1 while expanding again in * dimension 0 @@ -1355,10 +1090,8 @@ static int test_rank2( hid_t fapl, *------------------------------------------------------------------------- */ - /* expand to original dimensions for the array. */ - if (H5Dset_extent(did , dims_o) < 0) - { + if (H5Dset_extent(did, dims_o) < 0) { TEST_ERROR } @@ -1366,262 +1099,206 @@ static int test_rank2( hid_t fapl, dims_s[1] = 0; /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_s) < 0) - { + if (H5Dset_extent(did, dims_s) < 0) { TEST_ERROR } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } /* check dimensions */ - for( i = 0; i < RANK2; i++ ) - { + for (i = 0; i < RANK2; i++) { if (dims_r[i] != dims_s[i]) TEST_ERROR } - /*------------------------------------------------------------------------- * close dataset *------------------------------------------------------------------------- */ - if (H5Dclose(did) < 0) - { + if (H5Dclose(did) < 0) { TEST_ERROR } - - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * test a dataset with non initialized chunks *------------------------------------------------------------------------- */ - - if ((sid = H5Screate_simple(RANK2, dims_o, maxdims)) < 0) - { + if ((sid = H5Screate_simple(RANK2, dims_o, maxdims)) < 0) { TEST_ERROR } - if ((did = H5Dcreate2(fid , "dset3", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) - { + if ((did = H5Dcreate2(fid, "dset3", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) { TEST_ERROR } /* set new dimensions for the array */ - dims_o[ 0 ] = 0; - dims_o[ 1 ] = 0; - if (H5Dset_extent( did , dims_o ) < 0) - { + dims_o[0] = 0; + dims_o[1] = 0; + if (H5Dset_extent(did, dims_o) < 0) { TEST_ERROR } - - - if (H5Dclose(did) < 0) - { + if (H5Dclose(did) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } - - - /*------------------------------------------------------------------------- * close property list *------------------------------------------------------------------------- */ - - if (H5Pclose(my_dcpl) < 0) - { + if (H5Pclose(my_dcpl) < 0) { TEST_ERROR } /* close file creation property list */ - if(H5Pclose(fcpl) < 0) - { + if (H5Pclose(fcpl) < 0) { TEST_ERROR } - if (H5Fclose( fid ) < 0) - { + if (H5Fclose(fid) < 0) { TEST_ERROR } - return 0; - - -error: + error: H5E_BEGIN_TRY - { - H5Dclose( did ); - H5Sclose( sid ); - H5Pclose( my_dcpl ); - H5Pclose( fcpl ); - H5Fclose( fid ); - } H5E_END_TRY; + { + H5Dclose(did); + H5Sclose(sid); + H5Pclose(my_dcpl); + H5Pclose(fcpl); + H5Fclose(fid); + }H5E_END_TRY; return -1; } - - - /*------------------------------------------------------------------------- * test usage with a 3D rank *------------------------------------------------------------------------- */ -static int test_rank3( hid_t fapl, - hid_t dcpl, - hbool_t do_fill_value, - hbool_t set_istore_k) -{ - - hid_t fid=-1; - hid_t did=-1; - hid_t sid=-1; - hid_t my_dcpl=-1; - hid_t fcpl; - hsize_t dims_o[RANK3] = {DIM0,DIM1,DIM2}; /* original dimensions */ - hsize_t dims_s[RANK3] = {DIMS0,DIMS1,DIMS2}; /* shrinking dimensions */ - hsize_t dims_e[RANK3] = {DIME0,DIME1,DIME2}; /* extended dimensions */ - hsize_t dims_c[RANK3] = {2,2,2}; /* chunk dimensions */ - hsize_t dims_r[RANK3]; /* read dimensions */ - hsize_t maxdims[RANK3] = {H5S_UNLIMITED,H5S_UNLIMITED,H5S_UNLIMITED}; - int buf_o[DIM0][DIM1][DIM2]; - int buf_s[DIMS0][DIMS1][DIMS2]; - int buf_e[DIME0][DIME1][DIME2]; - int buf_r[DIM0][DIM1][DIM2]; - int i, j, k; - int comp_value; - char filename[NAME_BUF_SIZE]; - - if ( do_fill_value ) - { +static int test_rank3(hid_t fapl, hid_t dcpl, hbool_t do_fill_value, hbool_t set_istore_k) { + + hid_t fid = -1; + hid_t did = -1; + hid_t sid = -1; + hid_t my_dcpl = -1; + hid_t fcpl; + hsize_t dims_o[RANK3] = { DIM0, DIM1, DIM2 }; /* original dimensions */ + hsize_t dims_s[RANK3] = { DIMS0, DIMS1, DIMS2 }; /* shrinking dimensions */ + hsize_t dims_e[RANK3] = { DIME0, DIME1, DIME2 }; /* extended dimensions */ + hsize_t dims_c[RANK3] = { 2, 2, 2 }; /* chunk dimensions */ + hsize_t dims_r[RANK3]; /* read dimensions */ + hsize_t maxdims[RANK3] = { H5S_UNLIMITED, H5S_UNLIMITED, H5S_UNLIMITED }; + int buf_o[DIM0][DIM1][DIM2]; + int buf_s[DIMS0][DIMS1][DIMS2]; + int buf_e[DIME0][DIME1][DIME2]; + int buf_r[DIM0][DIM1][DIM2]; + int i, j, k; + int comp_value; + char filename[NAME_BUF_SIZE]; + + if (do_fill_value) { comp_value = FILL_VALUE; - } - else - { + } else { comp_value = 0; } - - for( i = 0; i < DIM0; i++ ) - { - for( j = 0; j < DIM1; j++ ) - { - for( k = 0; k < DIM2; k++ ) - { + for (i = 0; i < DIM0; i++) { + for (j = 0; j < DIM1; j++) { + for (k = 0; k < DIM2; k++) { buf_o[i][j][k] = 2; } } } /* create a file creation property list */ - if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - { + if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { TEST_ERROR } - if ( set_istore_k ) - { + if (set_istore_k) { /* set non-default indexed storage B-tree internal 'K' value */ - if (H5Pset_istore_k(fcpl,ISTORE_IK) < 0) - { + if (H5Pset_istore_k(fcpl, ISTORE_IK) < 0) { TEST_ERROR } } /* create a new file */ h5_fixname(FILENAME[2], fapl, filename, sizeof filename); - if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) - { + if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) { TEST_ERROR } /* close property list */ - if(H5Pclose(fcpl) < 0) - { + if (H5Pclose(fcpl) < 0) { TEST_ERROR } /* create the data space with unlimited dimensions. */ - if ((sid = H5Screate_simple(RANK3, dims_o, maxdims)) < 0) - { + if ((sid = H5Screate_simple(RANK3, dims_o, maxdims)) < 0) { TEST_ERROR } /* modify dataset creation properties, i.e. enable chunking. */ - if ((my_dcpl = H5Pcopy (dcpl)) < 0) - { + if ((my_dcpl = H5Pcopy(dcpl)) < 0) { TEST_ERROR } - if (H5Pset_chunk(my_dcpl, RANK3, dims_c) < 0) - { + if (H5Pset_chunk(my_dcpl, RANK3, dims_c) < 0) { TEST_ERROR } - /*------------------------------------------------------------------------- - * create, write array - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * create, write array + *------------------------------------------------------------------------- + */ - /* create a dataset */ - if ((did = H5Dcreate2(fid , "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) - { + /* create a dataset */ + if ((did = H5Dcreate2(fid, "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) { TEST_ERROR } /* write */ - if (H5Dwrite(did , H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) - { + if (H5Dwrite(did, H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) { TEST_ERROR } #if defined (H5_SET_EXTENT_DEBUG3) - printf("\n"); - for (i = 0; i < (int)dims_o[0]; i++ ) - { - for (j = 0; j < (int)dims_o[1]; j++ ) - { - for( k = 0; k < (int)dims_o[2]; k++ ) - { - printf("%d ", buf_o[i][j][k]); + HDprintf("\n"); + for (i = 0; i < (int)dims_o[0]; i++ ) { + for (j = 0; j < (int)dims_o[1]; j++ ) { + for( k = 0; k < (int)dims_o[2]; k++ ) { + HDprintf("%d ", buf_o[i][j][k]); } - printf("[%d] ", j); + HDprintf("[%d] ", j); } - printf("\n"); + HDprintf("\n"); } - printf("\n"); + HDprintf("\n"); #endif - - - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } @@ -1632,32 +1309,26 @@ static int test_rank3( hid_t fapl, */ /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_e) < 0) - { + if (H5Dset_extent(did, dims_e) < 0) { TEST_ERROR } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } - /* check dimensions */ - for( i = 0; i < RANK3; i++ ) - { + for (i = 0; i < RANK3; i++) { if (dims_r[i] != dims_e[i]) TEST_ERROR } @@ -1666,203 +1337,153 @@ static int test_rank3( hid_t fapl, if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_e) < 0) TEST_ERROR - - #if defined (H5_SET_EXTENT_DEBUG3) - printf("\n"); - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - for( k = 0; k < (int)dims_r[2]; k++ ) - { - printf("%d ", buf_e[i][j][k]); + HDprintf("\n"); + for (i = 0; i < (int)dims_r[0]; i++ ) { + for (j = 0; j < (int)dims_r[1]; j++ ) { + for( k = 0; k < (int)dims_r[2]; k++ ) { + HDprintf("%d ", buf_e[i][j][k]); } - printf("[%d] ", j); + HDprintf("[%d] ", j); } - printf("\n"); + HDprintf("\n"); } - printf("\n"); + HDprintf("\n"); #endif - - - - /* compare the read array with the expanded array */ - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - for( k = 0; k < (int)dims_r[2]; k++ ) - { - if ( i >= DIM0 || j >= DIM1 || k >= DIM2 ) - { - if(buf_e[i][j][k] != comp_value) - { - printf("buf_e[%d][%d][%d] = %d\n", i, j, k, buf_e[i][j][k] ); - printf("value = %d\n", comp_value); + /* compare the read array with the expanded array */ + for (i = 0; i < (int) dims_r[0]; i++) { + for (j = 0; j < (int) dims_r[1]; j++) { + for (k = 0; k < (int) dims_r[2]; k++) { + if (i >= DIM0 || j >= DIM1 || k >= DIM2) { + if (buf_e[i][j][k] != comp_value) { + HDprintf("buf_e[%d][%d][%d] = %d\n", i, j, k, buf_e[i][j][k]); + HDprintf("value = %d\n", comp_value); TEST_ERROR } - } - else - { - if(buf_e[i][j][k] != buf_o[i][j][k] ) + } else { + if (buf_e[i][j][k] != buf_o[i][j][k]) TEST_ERROR } } } } - - - /*------------------------------------------------------------------------- * shrink *------------------------------------------------------------------------- */ /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_s) < 0) - { + if (H5Dset_extent(did, dims_s) < 0) { TEST_ERROR } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } /* check dimensions */ - for( i = 0; i < RANK3; i++ ) - { + for (i = 0; i < RANK3; i++) { if (dims_r[i] != dims_s[i]) TEST_ERROR } - - /* for this case we close and reopen file */ - if ( set_istore_k ) - { + if (set_istore_k) { - if (H5Dclose(did) < 0) - { + if (H5Dclose(did) < 0) { TEST_ERROR } - if (H5Fclose(fid) < 0) - { + if (H5Fclose(fid) < 0) { TEST_ERROR } - if ((fid = H5Fopen( filename, H5F_ACC_RDWR, fapl ))<0) - { + if ((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) { TEST_ERROR } - if ((did = H5Dopen2( fid , "dset1", H5P_DEFAULT ))<0) - { + if ((did = H5Dopen2(fid, "dset1", H5P_DEFAULT)) < 0) { TEST_ERROR } - - } - /*------------------------------------------------------------------------- * read *------------------------------------------------------------------------- */ /* read */ - if (H5Dread( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_s ) < 0) - { + if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_s) < 0) { TEST_ERROR } #if defined (H5_SET_EXTENT_DEBUG3) - printf("\n"); - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - for( k = 0; k < (int)dims_r[2]; k++ ) - { - printf("%d ", buf_s[i][j][k]); + HDprintf("\n"); + for (i = 0; i < (int)dims_r[0]; i++ ) { + for (j = 0; j < (int)dims_r[1]; j++ ) { + for( k = 0; k < (int)dims_r[2]; k++ ) { + HDprintf("%d ", buf_s[i][j][k]); } - printf("[%d] ", j); + HDprintf("[%d] ", j); } - printf("\n"); + HDprintf("\n"); } - printf("\n"); + HDprintf("\n"); #endif - - - /* compare the read array with the shrinked array */ - for( i = 0; i < (int)dims_r[0]; i++ ) - { - for( j = 0; j < (int)dims_r[1]; j++ ) - { - for( k = 0; k < (int)dims_r[2]; k++ ) - { - if ( buf_s[i][j][k] != buf_o[i][j][k] ) - { - printf("buf_s[%d][%d][%d] = %d\n", i, j, k, buf_s[i][j][k] ); - printf("buf_o[%d][%d][%d] = %d\n", i, j, k, buf_o[i][j][k] ); + for (i = 0; i < (int) dims_r[0]; i++) { + for (j = 0; j < (int) dims_r[1]; j++) { + for (k = 0; k < (int) dims_r[2]; k++) { + if (buf_s[i][j][k] != buf_o[i][j][k]) { + HDprintf("buf_s[%d][%d][%d] = %d\n", i, j, k, buf_s[i][j][k]); + HDprintf("buf_o[%d][%d][%d] = %d\n", i, j, k, buf_o[i][j][k]); TEST_ERROR } } } } - /*------------------------------------------------------------------------- * set new dimensions for the array; expand it back to original size *------------------------------------------------------------------------- */ /* set new dimensions for the array */ - if (H5Dset_extent(did, dims_o) < 0) - { + if (H5Dset_extent(did, dims_o) < 0) { TEST_ERROR } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions. */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } /* check dimensions */ - for( i = 0; i < RANK3; i++ ) - { + for (i = 0; i < RANK3; i++) { if (dims_r[i] != dims_o[i]) TEST_ERROR } @@ -1872,52 +1493,39 @@ static int test_rank3( hid_t fapl, TEST_ERROR #if defined (H5_SET_EXTENT_DEBUG3) - printf("\n"); - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - for( k = 0; k < (int)dims_r[2]; k++ ) - { + HDprintf("\n"); + for (i = 0; i < (int)dims_r[0]; i++ ) { + for (j = 0; j < (int)dims_r[1]; j++ ) { + for( k = 0; k < (int)dims_r[2]; k++ ) { - printf("%d ", buf_r[i][j][k]); + HDprintf("%d ", buf_r[i][j][k]); } - printf("[%d] ", j); + HDprintf("[%d] ", j); } - printf("\n"); + HDprintf("\n"); } - printf("\n"); + HDprintf("\n"); #endif - - - /* compare the read array with the original array */ - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - for( k = 0; k < (int)dims_r[2]; k++ ) - { - if (i >= DIMS0 || j >= DIMS1 || k >= DIMS2 ) - { - if( buf_r[i][j][k] != comp_value ) - { - printf("buf_r[%d][%d][%d] = %d\n", i, j, k, buf_r[i][j][k] ); - printf("value = %d\n", comp_value); + /* compare the read array with the original array */ + for (i = 0; i < (int) dims_r[0]; i++) { + for (j = 0; j < (int) dims_r[1]; j++) { + for (k = 0; k < (int) dims_r[2]; k++) { + if (i >= DIMS0 || j >= DIMS1 || k >= DIMS2) { + if (buf_r[i][j][k] != comp_value) { + HDprintf("buf_r[%d][%d][%d] = %d\n", i, j, k, buf_r[i][j][k]); + HDprintf("value = %d\n", comp_value); TEST_ERROR } - } - else - { - if(buf_r[i][j][k] != buf_o[i][j][k]) + } else { + if (buf_r[i][j][k] != buf_o[i][j][k]) TEST_ERROR } } } } - /*------------------------------------------------------------------------- * shrink to 0 * @@ -1929,158 +1537,126 @@ static int test_rank3( hid_t fapl, dims_s[2] = 0; /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_s) < 0) - { + if (H5Dset_extent(did, dims_s) < 0) { TEST_ERROR } /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } /* check dimensions */ - for( i = 0; i < RANK3; i++ ) - { + for (i = 0; i < RANK3; i++) { if (dims_r[i] != dims_s[i]) TEST_ERROR } - - /*------------------------------------------------------------------------- * close dataset *------------------------------------------------------------------------- */ - if (H5Dclose(did) < 0) - { + if (H5Dclose(did) < 0) { TEST_ERROR } - /*------------------------------------------------------------------------- * test a dataset with non initialized chunks *------------------------------------------------------------------------- */ - - if ((sid = H5Screate_simple(RANK3, dims_o, maxdims)) < 0) - { + if ((sid = H5Screate_simple(RANK3, dims_o, maxdims)) < 0) { TEST_ERROR } - if ((did = H5Dcreate2(fid , "dset3", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) - { + if ((did = H5Dcreate2(fid, "dset3", H5T_NATIVE_INT, sid, H5P_DEFAULT, my_dcpl, H5P_DEFAULT)) < 0) { TEST_ERROR } /* set new dimensions for the array */ - dims_o[ 0 ] = 0; - dims_o[ 1 ] = 0; - dims_o[ 2 ] = 0; - if (H5Dset_extent( did , dims_o ) < 0) - { + dims_o[0] = 0; + dims_o[1] = 0; + dims_o[2] = 0; + if (H5Dset_extent(did, dims_o) < 0) { TEST_ERROR } - - - if (H5Dclose(did) < 0) - { + if (H5Dclose(did) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } - - - /*------------------------------------------------------------------------- * close property list *------------------------------------------------------------------------- */ - - if (H5Pclose(my_dcpl) < 0) - { + if (H5Pclose(my_dcpl) < 0) { TEST_ERROR } - if (H5Fclose( fid ) < 0) - { + if (H5Fclose(fid) < 0) { TEST_ERROR } - return 0; - - -error: + error: H5E_BEGIN_TRY - { - H5Dclose( did ); - H5Sclose( sid ); - H5Pclose( my_dcpl ); - H5Pclose( fcpl ); - H5Fclose( fid ); - } H5E_END_TRY; + { + H5Dclose(did); + H5Sclose(sid); + H5Pclose(my_dcpl); + H5Pclose(fcpl); + H5Fclose(fid); + }H5E_END_TRY; return -1; } - /*------------------------------------------------------------------------- * test usage with external storage *------------------------------------------------------------------------- */ -static int test_external( hid_t fapl ) -{ - - hid_t fid=-1; - hid_t did=-1; - hid_t sid=-1; - hid_t dcpl=-1; - hsize_t dims_o[RANK2] = {DIM0,DIM1}; /* original dimensions */ - hsize_t dims_s[RANK2] = {DIMS0,DIMS1}; /* shrinking dimensions */ - hsize_t dims_e[RANK2] = {DIME0,DIM1}; /* extended dimensions, dimension 1 is the original */ - hsize_t dims_r[RANK2]; /* read dimensions */ - hsize_t maxdims[RANK2] = {DIME0,DIM1}; /* only the first dimension can be extendible */ - int buf_o[DIM0][DIM1]; /* original buffer, for writing */ - int buf_s[DIMS0][DIMS1]; /* shrinked buffer, for reading */ - int buf_e[DIME0][DIM1]; /* extended buffer, for writing, dimension 1 is the original */ - int buf_ro[DIM0][DIM1]; /* original buffer for reading */ - int i, j; - int comp_value = 0; - char filename[NAME_BUF_SIZE]; - - - hsize_t size; /* number of bytes reserved in the file for the data */ +static int test_external(hid_t fapl) { + + hid_t fid = -1; + hid_t did = -1; + hid_t sid = -1; + hid_t dcpl = -1; + hsize_t dims_o[RANK2] = { DIM0, DIM1 }; /* original dimensions */ + hsize_t dims_s[RANK2] = { DIMS0, DIMS1 }; /* shrinking dimensions */ + hsize_t dims_e[RANK2] = { DIME0, DIM1 }; /* extended dimensions, dimension 1 is the original */ + hsize_t dims_r[RANK2]; /* read dimensions */ + hsize_t maxdims[RANK2] = { DIME0, DIM1 }; /* only the first dimension can be extendible */ + int buf_o[DIM0][DIM1]; /* original buffer, for writing */ + int buf_s[DIMS0][DIMS1]; /* shrinked buffer, for reading */ + int buf_e[DIME0][DIM1]; /* extended buffer, for writing, dimension 1 is the original */ + int buf_ro[DIM0][DIM1]; /* original buffer for reading */ + int i, j; + int comp_value = 0; + char filename[NAME_BUF_SIZE]; + + hsize_t size; /* number of bytes reserved in the file for the data */ hsize_t max_size[2]; max_size[0] = dims_e[0]; max_size[1] = dims_e[1]; size = max_size[0] * max_size[1] * sizeof(int) / 2; - - for( i = 0; i < DIM0; i++ ) - { - for( j = 0; j < DIM1; j++ ) - { + for (i = 0; i < DIM0; i++) { + for (j = 0; j < DIM1; j++) { buf_o[i][j] = 2; } } @@ -2092,30 +1668,27 @@ static int test_external( hid_t fapl ) if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR - /* modify dataset creation properties */ - if ((dcpl = H5Pcreate (H5P_DATASET_CREATE)) < 0) + /* modify dataset creation properties */ + if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR - if(H5Pset_external(dcpl, EXT_FILE_NAME1, (off_t)0, size) < 0) + if (H5Pset_external(dcpl, EXT_FILE_NAME1, (off_t) 0, size) < 0) FAIL_STACK_ERROR - if(H5Pset_external(dcpl, EXT_FILE_NAME2, (off_t)0, size) < 0) + if (H5Pset_external(dcpl, EXT_FILE_NAME2, (off_t) 0, size) < 0) FAIL_STACK_ERROR { - char name[256]; /*external file name */ - off_t file_offset; /*external file offset */ - hsize_t file_size; /*sizeof external file segment */ + char name[256]; /*external file name */ + off_t file_offset; /*external file offset */ + hsize_t file_size; /*sizeof external file segment */ - if(H5Pget_external(dcpl, 0, sizeof(name), name, &file_offset, - &file_size) < 0) + if (H5Pget_external(dcpl, 0, sizeof(name), name, &file_offset, &file_size) < 0) FAIL_STACK_ERROR } - - /*------------------------------------------------------------------------- * Write an array AxB. These are the dimensions for creating the dataset * @@ -2129,80 +1702,72 @@ static int test_external( hid_t fapl ) *------------------------------------------------------------------------- */ - /* create the data space with unlimited dimensions. */ if ((sid = H5Screate_simple(RANK2, dims_o, maxdims)) < 0) FAIL_STACK_ERROR - if ((did = H5Dcreate2(fid , "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + if ((did = H5Dcreate2(fid, "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if (H5Dwrite(did , H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) + if (H5Dwrite(did, H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) FAIL_STACK_ERROR if (H5Sclose(sid) < 0) FAIL_STACK_ERROR + /*------------------------------------------------------------------------- + * read + *------------------------------------------------------------------------- + */ - /*------------------------------------------------------------------------- - * read - *------------------------------------------------------------------------- - */ - - /* read */ + /* read */ if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_ro) < 0) FAIL_STACK_ERROR #if defined (H5_SET_EXTENT_DEBUG) - printf("\n"); - for (i = 0; i < (int)dims_o[0]; i++ ) - { - for (j = 0; j < (int)dims_o[1]; j++ ) - { - printf("%d ", buf_ro[i][j]); + HDprintf("\n"); + for (i = 0; i < (int)dims_o[0]; i++ ) { + for (j = 0; j < (int)dims_o[1]; j++ ) { + HDprintf("%d ", buf_ro[i][j]); } - printf("\n"); + HDprintf("\n"); } #endif - - - /*------------------------------------------------------------------------- - * expand - *------------------------------------------------------------------------- - */ - - /*------------------------------------------------------------------------- - * set new dimensions for the array; expand it - * data is now, extended space was initialized with default value - * - * 2 2 2 2 - * 2 2 2 2 - * 2 2 2 2 - * 2 2 2 2 - * 0 0 0 0 - * 0 0 0 0 - * 0 0 0 0 - * - *------------------------------------------------------------------------- - */ - - /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_e) < 0) + /*------------------------------------------------------------------------- + * expand + *------------------------------------------------------------------------- + */ + + /*------------------------------------------------------------------------- + * set new dimensions for the array; expand it + * data is now, extended space was initialized with default value + * + * 2 2 2 2 + * 2 2 2 2 + * 2 2 2 2 + * 2 2 2 2 + * 0 0 0 0 + * 0 0 0 0 + * 0 0 0 0 + * + *------------------------------------------------------------------------- + */ + + /* set new dimensions for the array. */ + if (H5Dset_extent(did, dims_e) < 0) FAIL_STACK_ERROR - /* get the space */ + /* get the space */ if ((sid = H5Dget_space(did)) < 0) FAIL_STACK_ERROR - /* get dimensions */ + /* get dimensions */ if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) FAIL_STACK_ERROR if (H5Sclose(sid) < 0) FAIL_STACK_ERROR - - /* check dimensions */ - for( i = 0; i < RANK2; i++ ) - { + /* check dimensions */ + for (i = 0; i < RANK2; i++) { if (dims_r[i] != dims_e[i]) TEST_ERROR } @@ -2211,48 +1776,33 @@ static int test_external( hid_t fapl ) if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_e) < 0) FAIL_STACK_ERROR - - #if defined (H5_SET_EXTENT_DEBUG) - printf("\n"); - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - printf("%d ", buf_e[i][j]); + HDprintf("\n"); + for (i = 0; i < (int)dims_r[0]; i++ ) { + for (j = 0; j < (int)dims_r[1]; j++ ) { + HDprintf("%d ", buf_e[i][j]); } - printf("\n"); + HDprintf("\n"); } #endif - - - - /* compare the read array with the expanded array */ - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - if ( i >= DIM0 || j >= DIM1 ) - { - if(buf_e[i][j] != comp_value) - { - printf("buf_e[%d][%d] = %d\n", i, j, buf_e[i][j]); - printf("value = %d\n", comp_value); + /* compare the read array with the expanded array */ + for (i = 0; i < (int) dims_r[0]; i++) { + for (j = 0; j < (int) dims_r[1]; j++) { + if (i >= DIM0 || j >= DIM1) { + if (buf_e[i][j] != comp_value) { + HDprintf("buf_e[%d][%d] = %d\n", i, j, buf_e[i][j]); + HDprintf("value = %d\n", comp_value); TEST_ERROR } - } - else - { - if(buf_e[i][j] != buf_o[i][j]) + } else { + if (buf_e[i][j] != buf_o[i][j]) TEST_ERROR } } } - - - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * shrink * * data is now @@ -2264,208 +1814,172 @@ static int test_external( hid_t fapl ) */ /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_s) < 0) + if (H5Dset_extent(did, dims_s) < 0) FAIL_STACK_ERROR - /* get the space */ + /* get the space */ if ((sid = H5Dget_space(did)) < 0) FAIL_STACK_ERROR - /* get dimensions */ + /* get dimensions */ if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) FAIL_STACK_ERROR if (H5Sclose(sid) < 0) FAIL_STACK_ERROR - /* check dimensions */ - for( i = 0; i < RANK2; i++ ) - { + /* check dimensions */ + for (i = 0; i < RANK2; i++) { if (dims_r[i] != dims_s[i]) TEST_ERROR } - - - /*------------------------------------------------------------------------- * read *------------------------------------------------------------------------- */ /* read */ - if (H5Dread( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_s ) < 0) + if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_s) < 0) FAIL_STACK_ERROR #if defined (H5_SET_EXTENT_DEBUG) - printf("\n"); - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - printf("%d ", buf_s[i][j]); + HDprintf("\n"); + for (i = 0; i < (int)dims_r[0]; i++ ) { + for (j = 0; j < (int)dims_r[1]; j++ ) { + HDprintf("%d ", buf_s[i][j]); } - printf("\n"); + HDprintf("\n"); } #endif - - - - /* compare the read array with the shrinked array */ - for( i = 0; i < (int)dims_r[0]; i++ ) - { - for( j = 0; j < (int)dims_r[1]; j++ ) - { - if ( buf_s[i][j] != buf_o[i][j] ) - { - printf("buf_s[%d][%d] = %d\n", i, j, buf_s[i][j]); - printf("buf_o[%d][%d] = %d\n", i, j, buf_o[i][j]); + /* compare the read array with the shrinked array */ + for (i = 0; i < (int) dims_r[0]; i++) { + for (j = 0; j < (int) dims_r[1]; j++) { + if (buf_s[i][j] != buf_o[i][j]) { + HDprintf("buf_s[%d][%d] = %d\n", i, j, buf_s[i][j]); + HDprintf("buf_o[%d][%d] = %d\n", i, j, buf_o[i][j]); TEST_ERROR } } } - /*------------------------------------------------------------------------- * negative test * try to extend dimension above maximum *------------------------------------------------------------------------- */ - dims_e[1] = DIME1; - H5E_BEGIN_TRY - { - - - /* set new dimensions for the array. */ - if (H5Dset_extent(did , dims_e) == SUCCEED) { - TEST_ERROR - } - - } H5E_END_TRY; + /* set new dimensions for the array. */ + if (H5Dset_extent(did, dims_e) == SUCCEED) { + TEST_ERROR + } + }H5E_END_TRY; /*------------------------------------------------------------------------- * close property list *------------------------------------------------------------------------- */ - if (H5Pclose(dcpl) < 0) FAIL_STACK_ERROR - if (H5Dclose( did ) < 0) + if (H5Dclose(did) < 0) FAIL_STACK_ERROR - if (H5Fclose( fid ) < 0) + if (H5Fclose(fid) < 0) FAIL_STACK_ERROR - PASSED(); + PASSED() + ; return 0; -error: + error: H5E_BEGIN_TRY - { - H5Dclose( did ); - H5Sclose( sid ); - H5Pclose( dcpl ); - H5Fclose( fid ); - } H5E_END_TRY; + { + H5Dclose(did); + H5Sclose(sid); + H5Pclose(dcpl); + H5Fclose(fid); + }H5E_END_TRY; return -1; } - /*------------------------------------------------------------------------- * test usage with layouts compact and contiguous *------------------------------------------------------------------------- */ -static int test_layouts( H5D_layout_t layout, hid_t fapl ) -{ - - hid_t fid=-1; - hid_t did=-1; - hid_t sid=-1; - hid_t dcpl=-1; - herr_t ret; - hsize_t dims_o[RANK2] = {DIM0,DIM1}; /* original dimensions */ - hsize_t dims_s[RANK2] = {DIMS0,DIMS1}; /* shrinking dimensions */ - hsize_t dims_e[RANK2] = {DIME0,DIME1}; /* extended dimensions */ - hsize_t dims_r[RANK2]; /* read dimensions */ - int buf_o[DIM0][DIM1]; - int buf_r[DIM0][DIM1]; - int i, j; - char filename[NAME_BUF_SIZE]; - - for( i = 0; i < DIM0; i++ ) - { - for( j = 0; j < DIM1; j++ ) - { +static int test_layouts(H5D_layout_t layout, hid_t fapl) { + + hid_t fid = -1; + hid_t did = -1; + hid_t sid = -1; + hid_t dcpl = -1; + herr_t ret; + hsize_t dims_o[RANK2] = { DIM0, DIM1 }; /* original dimensions */ + hsize_t dims_s[RANK2] = { DIMS0, DIMS1 }; /* shrinking dimensions */ + hsize_t dims_e[RANK2] = { DIME0, DIME1 }; /* extended dimensions */ + hsize_t dims_r[RANK2]; /* read dimensions */ + int buf_o[DIM0][DIM1]; + int buf_r[DIM0][DIM1]; + int i, j; + char filename[NAME_BUF_SIZE]; + + for (i = 0; i < DIM0; i++) { + for (j = 0; j < DIM1; j++) { buf_o[i][j] = 2; } } - /* create a new file */ h5_fixname(FILENAME[4], fapl, filename, sizeof filename); - if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - { + if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) { TEST_ERROR } /* create the data space with unlimited dimensions. */ - if ((sid = H5Screate_simple(RANK2, dims_o, NULL)) < 0) - { + if ((sid = H5Screate_simple(RANK2, dims_o, NULL)) < 0) { TEST_ERROR } /* modify dataset creation properties */ - if ((dcpl = H5Pcreate (H5P_DATASET_CREATE)) < 0) - { + if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) { TEST_ERROR } - if (H5Pset_layout (dcpl, layout) < 0) - { + if (H5Pset_layout(dcpl, layout) < 0) { TEST_ERROR } /* create a dataset */ - if ((did = H5Dcreate2(fid , "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - { + if ((did = H5Dcreate2(fid, "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { TEST_ERROR } /* write */ - if (H5Dwrite(did , H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) - { + if (H5Dwrite(did, H5T_NATIVE_INT, sid, H5S_ALL, H5P_DEFAULT, buf_o) < 0) { TEST_ERROR } - #if defined (H5_SET_EXTENT_DEBUG4) - printf("\n"); - for (i = 0; i < (int)dims_o[0]; i++ ) - { - for (j = 0; j < (int)dims_o[1]; j++ ) - { - printf("%d ", buf_o[i][j]); + HDprintf("\n"); + for (i = 0; i < (int)dims_o[0]; i++ ) { + for (j = 0; j < (int)dims_o[1]; j++ ) { + HDprintf("%d ", buf_o[i][j]); } - printf("\n"); + HDprintf("\n"); } #endif - - - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } @@ -2476,39 +1990,31 @@ static int test_layouts( H5D_layout_t layout, hid_t fapl ) */ H5E_BEGIN_TRY - { + { - ret = H5Dset_extent(did , dims_e); + ret = H5Dset_extent(did, dims_e); - } H5E_END_TRY; + }H5E_END_TRY; - if(ret >= 0) + if (ret >= 0) TEST_ERROR - - - - /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + /* get the space */ + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } - /* check dimensions */ - for( i = 0; i < RANK2; i++ ) - { + for (i = 0; i < RANK2; i++) { if (dims_r[i] != dims_o[i]) TEST_ERROR } @@ -2517,123 +2023,100 @@ static int test_layouts( H5D_layout_t layout, hid_t fapl ) if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_r) < 0) TEST_ERROR - - #if defined (H5_SET_EXTENT_DEBUG4) - printf("\n"); - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - printf("%d ", buf_r[i][j]); + HDprintf("\n"); + for (i = 0; i < (int)dims_r[0]; i++ ) { + for (j = 0; j < (int)dims_r[1]; j++ ) { + HDprintf("%d ", buf_r[i][j]); } - printf("\n"); + HDprintf("\n"); } #endif - - - /*------------------------------------------------------------------------- - * negative test - * try to shrink dimension - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * negative test + * try to shrink dimension + *------------------------------------------------------------------------- + */ H5E_BEGIN_TRY - { + { - ret = H5Dset_extent(did , dims_s); + ret = H5Dset_extent(did, dims_s); - } H5E_END_TRY; + }H5E_END_TRY; - if(ret >= 0) + if (ret >= 0) TEST_ERROR - - /* get the space */ - if ((sid = H5Dget_space(did)) < 0) - { + /* get the space */ + if ((sid = H5Dget_space(did)) < 0) { TEST_ERROR } /* get dimensions */ - if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) - { + if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0) { TEST_ERROR } - if (H5Sclose(sid) < 0) - { + if (H5Sclose(sid) < 0) { TEST_ERROR } /* check dimensions */ - for( i = 0; i < RANK2; i++ ) - { + for (i = 0; i < RANK2; i++) { if (dims_r[i] != dims_o[i]) TEST_ERROR } - /*------------------------------------------------------------------------- * read *------------------------------------------------------------------------- */ /* read */ - if (H5Dread( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_r ) < 0) - { + if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_r) < 0) { TEST_ERROR } #if defined (H5_SET_EXTENT_DEBUG4) - printf("\n"); - for (i = 0; i < (int)dims_r[0]; i++ ) - { - for (j = 0; j < (int)dims_r[1]; j++ ) - { - printf("%d ", buf_r[i][j]); + HDprintf("\n"); + for (i = 0; i < (int)dims_r[0]; i++ ) { + for (j = 0; j < (int)dims_r[1]; j++ ) { + HDprintf("%d ", buf_r[i][j]); } - printf("\n"); + HDprintf("\n"); } #endif - - /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ - if (H5Dclose(did) < 0) - { + if (H5Dclose(did) < 0) { TEST_ERROR } - if (H5Pclose(dcpl) < 0) - { + if (H5Pclose(dcpl) < 0) { TEST_ERROR } - if (H5Fclose( fid ) < 0) - { + if (H5Fclose(fid) < 0) { TEST_ERROR } - return 0; - - -error: + error: H5E_BEGIN_TRY - { - H5Dclose( did ); - H5Sclose( sid ); - H5Pclose( dcpl ); - H5Fclose( fid ); - } H5E_END_TRY; + { + H5Dclose(did); + H5Sclose(sid); + H5Pclose(dcpl); + H5Fclose(fid); + }H5E_END_TRY; return -1; } @@ -2829,16 +2312,15 @@ static void test_random_rank4_dump( unsigned ndim_sets, hsize_t dim_log[][4], { unsigned i; - printf(" Chunk dimensions: ( %u, %u, %u, %u )\n", (unsigned)cdims[0], + HDprintf(" Chunk dimensions: ( %u, %u, %u, %u )\n", (unsigned)cdims[0], (unsigned)cdims[1], (unsigned)cdims[2], (unsigned)cdims[3]); - printf(" Log of dataset dimensions (oldest first):\n"); + HDprintf(" Log of dataset dimensions (oldest first):\n"); for(i=0; i=0) - printf(" First incorrect value read: ( %d, %d, %d, %d )\n", j, k, l, - m); + HDprintf(" First incorrect value read: ( %d, %d, %d, %d )\n", j, k, l, m); return; } /* end test_random_rank4_dump */ -- cgit v0.12