summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJacob Smith <jake.smith@hdfgroup.org>2018-12-12 19:39:14 (GMT)
committerJacob Smith <jake.smith@hdfgroup.org>2018-12-12 23:26:08 (GMT)
commitea7332525010ef75e27ce5800cf65dd91ba43576 (patch)
tree19f440d677555c016dacc4a2cd28aaa80961e350 /test
parent496de6922fb13aa11a5c5efe56a3f8de157a77ad (diff)
parent6f52793adcd5a14aa63731e3c33c9737b5a04d16 (diff)
downloadhdf5-ea7332525010ef75e27ce5800cf65dd91ba43576.zip
hdf5-ea7332525010ef75e27ce5800cf65dd91ba43576.tar.gz
hdf5-ea7332525010ef75e27ce5800cf65dd91ba43576.tar.bz2
Merge branch 'develop' into dset_ohdr_minimize
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt37
-rw-r--r--test/CMakeTests.cmake117
-rw-r--r--test/Makefile.am18
-rw-r--r--test/accum.c55
-rw-r--r--test/accum_swmr_reader.c13
-rw-r--r--test/btree2.c32
-rw-r--r--test/cache_api.c4
-rw-r--r--test/cache_common.c117
-rw-r--r--test/cache_common.h1
-rw-r--r--test/cache_image.c20
-rw-r--r--test/cache_logging.c21
-rw-r--r--test/cache_tagging.c243
-rw-r--r--test/chunk_info.c150
-rw-r--r--test/cmpd_dset.c6
-rw-r--r--test/dangle.c3
-rw-r--r--test/dsets.c120
-rw-r--r--test/dtypes.c16
-rw-r--r--test/earray.c19
-rw-r--r--test/echo_vol.c127
-rw-r--r--test/efc.c13
-rw-r--r--test/enc_dec_plist_cross_platform.c4
-rw-r--r--test/err_compat.c2
-rw-r--r--test/evict_on_close.c59
-rw-r--r--test/farray.c415
-rw-r--r--test/fheap.c150
-rw-r--r--test/file_image.c3
-rw-r--r--test/fillval.c57
-rw-r--r--test/flush1.c2
-rw-r--r--test/flush2.c2
-rw-r--r--test/flushrefresh.c111
-rw-r--r--test/freespace.c61
-rw-r--r--test/genall5.c3208
-rw-r--r--test/gheap.c357
-rw-r--r--test/h5test.c424
-rw-r--r--test/h5test.h11
-rw-r--r--test/istore.c2
-rw-r--r--test/lheap.c17
-rw-r--r--test/links.c17
-rw-r--r--test/links_env.c5
-rw-r--r--test/mf.c249
-rw-r--r--test/objcopy.c16
-rw-r--r--test/ohdr.c67
-rw-r--r--test/page_buffer.c27
-rw-r--r--test/swmr.c185
-rw-r--r--test/swmr_check_compat_vfd.c2
-rw-r--r--test/swmr_generator.c4
-rw-r--r--test/tarray.c40
-rw-r--r--test/tattr.c1154
-rw-r--r--test/testfiles/err_compat_122
-rw-r--r--test/testfiles/error_test_119
-rw-r--r--test/testframe.c8
-rw-r--r--test/testhdf5.c4
-rw-r--r--test/tfile.c226
-rw-r--r--test/tgenprop.c12
-rw-r--r--test/th5s.c1
-rw-r--r--test/tmisc.c74
-rw-r--r--test/tsohm.c28
-rw-r--r--test/ttsafe_error.c35
-rw-r--r--test/tunicode.c8
-rw-r--r--test/tvlstr.c105
-rw-r--r--test/tvltypes.c22
-rw-r--r--test/unregister.c239
-rw-r--r--test/use.h2
-rw-r--r--test/use_append_chunk.c115
-rw-r--r--test/use_append_mchunks.c110
-rw-r--r--test/use_common.c142
-rw-r--r--test/vds_swmr_gen.c2
-rw-r--r--test/vds_swmr_reader.c10
-rw-r--r--test/vds_swmr_writer.c2
-rw-r--r--test/vfd.c43
-rw-r--r--test/vol.c1029
71 files changed, 5614 insertions, 4427 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 2a8a588..fcee7e8 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -62,6 +62,7 @@ endif ()
#################################################################################
# If filter plugin tests can be tested
#################################################################################
+if (BUILD_SHARED_LIBS)
# make plugins dir
file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/filter_plugin_dir1")
file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/filter_plugin_dir2")
@@ -128,6 +129,39 @@ endif ()
)
endforeach ()
+ #-----------------------------------------------------------------------------
+ # Define VOL Plugin Test Sources
+ #-----------------------------------------------------------------------------
+ set (VOL_PLUGIN_LIBS
+ echo_vol
+ )
+
+ foreach (vol_lib ${VOL_PLUGIN_LIBS})
+ set (HDF5_VOL_PLUGIN_LIB_CORENAME "${vol_lib}")
+ set (HDF5_VOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_VOL_PLUGIN_LIB_CORENAME}")
+ set (HDF5_VOL_PLUGIN_LIB_TARGET ${HDF5_VOL_PLUGIN_LIB_CORENAME})
+
+ add_library (${HDF5_VOL_PLUGIN_LIB_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${vol_lib}.c)
+ target_include_directories(${HDF5_VOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (${HDF5_VOL_PLUGIN_LIB_TARGET} SHARED)
+ target_link_libraries (${HDF5_VOL_PLUGIN_LIB_TARGET} PUBLIC ${HDF5_TEST_LIB_TARGET})
+ H5_SET_LIB_OPTIONS (${HDF5_VOL_PLUGIN_LIB_TARGET} ${HDF5_VOL_PLUGIN_LIB_NAME} SHARED "LIB")
+ set_target_properties (${HDF5_VOL_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN)
+
+ #-----------------------------------------------------------------------------
+ # Copy VOL plugin to a plugins folder
+ #-----------------------------------------------------------------------------
+ add_custom_command (
+ TARGET ${HDF5_VOL_PLUGIN_LIB_TARGET}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different
+ "$<TARGET_FILE:${HDF5_VOL_PLUGIN_LIB_TARGET}>"
+ "${CMAKE_BINARY_DIR}/vol/$<TARGET_FILE_NAME:${HDF5_VOL_PLUGIN_LIB_TARGET}>"
+ )
+ endforeach ()
+endif ()
+
#################################################################################
# Test program sources
#################################################################################
@@ -224,7 +258,7 @@ set (H5_TESTS
ntypes
dangle
dtransform
- reserved
+ # reserved disabled
cross_read
freespace
mf
@@ -235,6 +269,7 @@ set (H5_TESTS
cork
swmr
ohdr_mindset
+ vol
)
macro (ADD_H5_EXE file)
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index 44494e9..d0b6de5 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -441,14 +441,6 @@ set (test_CLEANFILES
tvlstr.h5
tvlstr2.h5
twriteorder.dat
- flush.h5
- flush-swmr.h5
- noflush.h5
- noflush-swmr.h5
- flush_extend.h5
- flush_extend-swmr.h5
- noflush_extend.h5
- noflush_extend-swmr.h5
enum1.h5
titerate.h5
ttsafe.h5
@@ -537,6 +529,7 @@ set (test_CLEANFILES
vds_swmr_src_*.h5
tmp/vds_src_2.h5
direct_chunk.h5
+ native_vol_test.h5
)
# Remove any output file left over from previous test run
@@ -553,6 +546,8 @@ set (H5TEST_SEPARATE_TESTS
testhdf5
cache
cache_image
+ flush1
+ flush2
)
foreach (test ${H5_TESTS})
if (NOT ${test} IN_LIST H5TEST_SEPARATE_TESTS)
@@ -589,7 +584,6 @@ foreach (test ${H5_TESTS})
endif ()
endforeach ()
-set_tests_properties (H5TEST-flush2 PROPERTIES DEPENDS H5TEST-flush1)
set_tests_properties (H5TEST-fheap PROPERTIES TIMEOUT 1800)
set_tests_properties (H5TEST-big PROPERTIES TIMEOUT 1800)
set_tests_properties (H5TEST-btree2 PROPERTIES TIMEOUT 1800)
@@ -632,7 +626,6 @@ if (BUILD_SHARED_LIBS)
endif ()
endforeach ()
- set_tests_properties (H5TEST-shared-flush2 PROPERTIES DEPENDS H5TEST-shared-flush1)
set_tests_properties (H5TEST-shared-fheap PROPERTIES TIMEOUT 1800)
set_tests_properties (H5TEST-shared-big PROPERTIES TIMEOUT 1800)
set_tests_properties (H5TEST-shared-btree2 PROPERTIES TIMEOUT 1800)
@@ -722,6 +715,54 @@ if (BUILD_SHARED_LIBS)
endif ()
endif ()
+#-- Adding test for flush1/2
+add_test (NAME H5TEST-clear-flush-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ flush.h5
+ flush-swmr.h5
+ noflush.h5
+ noflush-swmr.h5
+ flush_extend.h5
+ flush_extend-swmr.h5
+ noflush_extend.h5
+ noflush_extend-swmr.h5
+ WORKING_DIRECTORY
+ ${HDF5_TEST_BINARY_DIR}/H5TEST
+)
+if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME H5TEST-flush1 COMMAND $<TARGET_FILE:flush1>)
+else ()
+ add_test (NAME H5TEST-flush1 COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:flush1>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=flush1.txt"
+ -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+endif ()
+set_tests_properties (H5TEST-flush1 PROPERTIES
+ DEPENDS H5TEST-clear-flush-objects
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+)
+if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME H5TEST-flush2 COMMAND $<TARGET_FILE:flush2>)
+else ()
+ add_test (NAME H5TEST-flush2 COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:flush2>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=flush2.txt"
+ -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+endif ()
+set_tests_properties (H5TEST-flush2 PROPERTIES DEPENDS H5TEST-flush1)
+
#-- Adding test for tcheck_version
add_test (NAME H5TEST-tcheck_version-major COMMAND $<TARGET_FILE:tcheck_version> "-tM")
set_tests_properties (H5TEST-tcheck_version-major PROPERTIES
@@ -828,9 +869,10 @@ add_test (NAME H5TEST-clear-error_test-objects
set_tests_properties (H5TEST-clear-error_test-objects PROPERTIES FIXTURES_SETUP error_test_clear_objects)
if (HDF5_USE_16_API_DEFAULT)
add_test (
- NAME H5TEST-error_test-SKIPPED
+ NAME H5TEST-error_test
COMMAND ${CMAKE_COMMAND} -E echo "SKIP $<TARGET_FILE:error_test>"
)
+ set_property(TEST H5TEST-error_test PROPERTY DISABLED)
else ()
add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:error_test>"
@@ -927,9 +969,10 @@ if (BUILD_SHARED_LIBS)
set_tests_properties (H5TEST-shared-clear-error_test-objects PROPERTIES FIXTURES_SETUP shared_error_test_clear_objects)
if (HDF5_USE_16_API_DEFAULT)
add_test (
- NAME H5TEST-shared-error_test-SKIPPED
+ NAME H5TEST-shared-error_test
COMMAND ${CMAKE_COMMAND} -E echo "SKIP $<TARGET_FILE:error_test-shared>"
)
+ set_property(TEST H5TEST-shared-error_test PROPERTY DISABLED)
else ()
add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:error_test-shared>"
@@ -989,42 +1032,44 @@ endif ()
##############################################################################
### F I L T E R P L U G I N T E S T S
##############################################################################
-if (WIN32)
- set (CMAKE_SEP "\;")
- set (BIN_REL_PATH "../../")
-else ()
- set (CMAKE_SEP ":")
- set (BIN_REL_PATH "../")
-endif ()
+if (BUILD_SHARED_LIBS)
+ if (WIN32)
+ set (CMAKE_SEP "\;")
+ set (BIN_REL_PATH "../../")
+ else ()
+ set (CMAKE_SEP ":")
+ set (BIN_REL_PATH "../")
+ endif ()
-add_test (NAME H5PLUGIN-filter_plugin COMMAND $<TARGET_FILE:filter_plugin>)
-set_tests_properties (H5PLUGIN-filter_plugin PROPERTIES
- ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/filter_plugin_dir1${CMAKE_SEP}${CMAKE_BINARY_DIR}/filter_plugin_dir2;srcdir=${HDF5_TEST_BINARY_DIR}"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}
-)
+ add_test (NAME H5PLUGIN-filter_plugin COMMAND $<TARGET_FILE:filter_plugin>)
+ set_tests_properties (H5PLUGIN-filter_plugin PROPERTIES
+ ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/filter_plugin_dir1${CMAKE_SEP}${CMAKE_BINARY_DIR}/filter_plugin_dir2;srcdir=${HDF5_TEST_BINARY_DIR}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}
+ )
##############################################################################
# HDFFV-9655 relative plugin test disabled
#
-#add_test (NAME H5PLUGIN-pluginRelative COMMAND $<TARGET_FILE:plugin>)
-#set_tests_properties (H5PLUGIN-pluginRelative PROPERTIES
-# ENVIRONMENT "HDF5_PLUGIN_PATH=@/${BIN_REL_PATH}testdir1${CMAKE_SEP}@/${BIN_REL_PATH}testdir2;srcdir=${HDF5_TEST_BINARY_DIR}"
-# WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}
-#)
+# add_test (NAME H5PLUGIN-pluginRelative COMMAND $<TARGET_FILE:plugin>)
+# set_tests_properties (H5PLUGIN-pluginRelative PROPERTIES
+# ENVIRONMENT "HDF5_PLUGIN_PATH=@/${BIN_REL_PATH}testdir1${CMAKE_SEP}@/${BIN_REL_PATH}testdir2;srcdir=${HDF5_TEST_BINARY_DIR}"
+# WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}
+# )
##############################################################################
+endif ()
if (TEST_SHELL_SCRIPTS)
include (ShellTests.cmake)
endif()
if (ENABLE_EXTENDED_TESTS)
- ##############################################################################
- ### S W M R T E S T S
- ##############################################################################
- # testflushrefresh.sh: flushrefresh
- # test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes
- # testswmr.sh: swmr*
- # testvdsswmr.sh: vds_swmr*
+##############################################################################
+### S W M R T E S T S
+##############################################################################
+# testflushrefresh.sh: flushrefresh
+# test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes
+# testswmr.sh: swmr*
+# testvdsswmr.sh: vds_swmr*
# add_test (NAME H5Test-swmr_check_compat_vfd COMMAND $<TARGET_FILE:swmr_check_compat_vfd>)
diff --git a/test/Makefile.am b/test/Makefile.am
index 80e9c76..cb2156e 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -60,7 +60,7 @@ TEST_PROG= testhdf5 \
flush1 flush2 app_ref enum set_extent ttsafe enc_dec_plist \
enc_dec_plist_cross_platform getname vfd ntypes dangle dtransform \
reserved cross_read freespace mf vds file_image unregister \
- cache_logging cork swmr
+ cache_logging cork swmr vol
# List programs to be built when testing here.
# error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh.
@@ -106,7 +106,9 @@ if HAVE_SHARED_CONDITIONAL
# The libh5test library provides common support code for the tests.
# The filter_plugin* libraries are for use in filter_plugin.c.
# Build them as shared libraries if that option was enabled in configure.
- noinst_LTLIBRARIES=libh5test.la libfilter_plugin1_dsets.la libfilter_plugin2_dsets.la libfilter_plugin3_dsets.la libfilter_plugin4_groups.la
+ #
+ # echo_vol is used for testing VOL plugin functionality.
+ noinst_LTLIBRARIES=libh5test.la libfilter_plugin1_dsets.la libfilter_plugin2_dsets.la libfilter_plugin3_dsets.la libfilter_plugin4_groups.la echo_vol.la
libfilter_plugin1_dsets_la_SOURCES=filter_plugin1_dsets.c
libfilter_plugin2_dsets_la_SOURCES=filter_plugin2_dsets.c
libfilter_plugin3_dsets_la_SOURCES=filter_plugin3_dsets.c
@@ -117,6 +119,11 @@ if HAVE_SHARED_CONDITIONAL
libfilter_plugin4_groups_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
libfilter_plugin3_dsets_la_LIBADD=$(LIBHDF5)
libfilter_plugin4_groups_la_LIBADD=$(LIBHDF5)
+
+ # VOL plugin test libraries
+ echo_vol_la_SOURCES=echo_vol.c
+ echo_vol_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
+
else
# The libh5test library provides common support code for the tests.
noinst_LTLIBRARIES=libh5test.la
@@ -137,6 +144,11 @@ if DIRECT_VFD_CONDITIONAL
VFD_LIST += direct
endif
+# Test with just the native connector, with a single pass-through connector
+# and with a doubly-stacked pass-through.
+VOL_LIST = native "pass_through under_vol=0;under_info={}" \
+ "pass_through under_vol=505;under_info={under_vol=0;under_info={}}"
+
# Additional target for running timing test
timings _timings: testmeta
@for timing in $(TIMINGS) dummy; do \
@@ -194,7 +206,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse
flushrefresh_VERIFICATION_DONE atomic_data accum_swmr_big.h5 ohdr_swmr.h5 \
test_swmr*.h5 cache_logging.h5 cache_logging.out vds_swmr.h5 vds_swmr_src_*.h5 \
swmr[0-2].h5 swmr_writer.out swmr_writer.log.* swmr_reader.out.* swmr_reader.log.* \
- tbogus.h5.copy cache_image_test.h5 direct_chunk.h5
+ tbogus.h5.copy cache_image_test.h5 direct_chunk.h5 native_vol_test.h5
# Sources for testhdf5 executable
testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \
diff --git a/test/accum.c b/test/accum.c
index 19006b6..87628d8 100644
--- a/test/accum.c
+++ b/test/accum.c
@@ -23,6 +23,7 @@
#include "H5CXprivate.h" /* API Contexts */
#include "H5Iprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
/* Filename */
#define FILENAME "accum.h5"
@@ -90,21 +91,30 @@ main(void)
unsigned nerrors = 0; /* track errors */
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
hid_t fid = -1;
+ hid_t fapl = -1; /* File access property list */
H5F_t * f = NULL; /* File for all tests */
/* Test Setup */
puts("Testing the metadata accumulator");
+ /* File access property list */
+ if((fapl = h5_fileaccess()) < 0)
+ FAIL_STACK_ERROR
+
/* Create a test file */
- if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
+
+ /* Closing and remove the file */
+ if(H5Pclose(fapl) < 0)
+ FAIL_STACK_ERROR
/* Push API context */
if(H5CX_push() < 0) FAIL_STACK_ERROR
api_ctx_pushed = TRUE;
/* Get H5F_t * to internal file structure */
- if(NULL == (f = (H5F_t *)H5I_object(fid))) FAIL_STACK_ERROR
+ if(NULL == (f = (H5F_t *)H5VL_object(fid))) FAIL_STACK_ERROR
/* We'll be writing lots of garbage data, so extend the
file a ways. 10MB should do. */
@@ -1846,11 +1856,11 @@ test_swmr_write_big(hbool_t newest_format)
* by the environment variable.
*/
driver = HDgetenv("HDF5_DRIVER");
- if (!H5FD_supports_swmr_test(driver)) {
+ if(!H5FD__supports_swmr_test(driver)) {
SKIPPED();
HDputs(" Test skipped due to VFD not supporting SWMR I/O.");
return 0;
- } /* end if */
+ }
/* File access property list */
if((fapl = h5_fileaccess()) < 0)
@@ -1863,7 +1873,8 @@ test_swmr_write_big(hbool_t newest_format)
if((fid = H5Fcreate(SWMR_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
- } else { /* non-latest-format */
+ }
+ else { /* non-latest-format */
if((fid = H5Fcreate(SWMR_FILENAME, H5F_ACC_TRUNC|H5F_ACC_SWMR_WRITE, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
} /* end if */
@@ -1881,7 +1892,7 @@ test_swmr_write_big(hbool_t newest_format)
api_ctx_pushed = TRUE;
/* Get H5F_t * to internal file structure */
- if(NULL == (rf = (H5F_t *)H5I_object(fid))) FAIL_STACK_ERROR
+ if(NULL == (rf = (H5F_t *)H5VL_object(fid))) FAIL_STACK_ERROR
/* We'll be writing lots of garbage data, so extend the
file a ways. 10MB should do. */
@@ -1951,10 +1962,11 @@ test_swmr_write_big(hbool_t newest_format)
if((pid = HDfork()) < 0) {
HDperror("fork");
FAIL_STACK_ERROR;
- } else if(0 == pid) { /* Child process */
+ }
+ else if(0 == pid) { /* Child process */
/* Run the reader */
status = HDexecv(SWMR_READER, new_argv);
- printf("errno from execv = %s\n", strerror(errno));
+ HDprintf("errno from execv = %s\n", strerror(errno));
FAIL_STACK_ERROR;
} /* end if */
@@ -2030,18 +2042,19 @@ accum_printf(const H5F_t *f)
{
H5F_meta_accum_t * accum = &f->shared->accum;
- printf("\n");
- printf("Current contents of accumulator:\n");
- if (accum->alloc_size == 0) {
- printf("=====================================================\n");
- printf(" No accumulator allocated.\n");
- printf("=====================================================\n");
- } else {
- printf("=====================================================\n");
- printf(" accumulator allocated size == %zu\n", accum->alloc_size);
- printf(" accumulated data size == %zu\n", accum->size);
+ HDprintf("\n");
+ HDprintf("Current contents of accumulator:\n");
+ if(accum->alloc_size == 0) {
+ HDprintf("=====================================================\n");
+ HDprintf(" No accumulator allocated.\n");
+ HDprintf("=====================================================\n");
+ }
+ else {
+ HDprintf("=====================================================\n");
+ HDprintf(" accumulator allocated size == %zu\n", accum->alloc_size);
+ HDprintf(" accumulated data size == %zu\n", accum->size);
HDfprintf(stdout, " accumulator dirty? == %t\n", accum->dirty);
- printf("=====================================================\n");
+ HDprintf("=====================================================\n");
HDfprintf(stdout, " start of accumulated data, loc = %a\n", accum->loc);
if(accum->dirty) {
HDfprintf(stdout, " start of dirty region, loc = %a\n", (haddr_t)(accum->loc + accum->dirty_off));
@@ -2049,8 +2062,8 @@ accum_printf(const H5F_t *f)
} /* end if */
HDfprintf(stdout, " end of accumulated data, loc = %a\n", (haddr_t)(accum->loc + accum->size));
HDfprintf(stdout, " end of accumulator allocation, loc = %a\n", (haddr_t)(accum->loc + accum->alloc_size));
- printf("=====================================================\n");
+ HDprintf("=====================================================\n");
}
- printf("\n\n");
+ HDprintf("\n\n");
} /* accum_printf() */
diff --git a/test/accum_swmr_reader.c b/test/accum_swmr_reader.c
index 5bda46a..16e0ddc 100644
--- a/test/accum_swmr_reader.c
+++ b/test/accum_swmr_reader.c
@@ -20,6 +20,7 @@
#include "H5CXprivate.h" /* API Contexts */
#include "H5Iprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
/* Filename: this is the same as the define in accum.c used by test_swmr_write_big() */
#define SWMR_FILENAME "accum_swmr_big.h5"
@@ -56,9 +57,8 @@ main(void)
* by the environment variable.
*/
driver = HDgetenv("HDF5_DRIVER");
- if(!H5FD_supports_swmr_test(driver)) {
+ if(!H5FD__supports_swmr_test(driver))
return EXIT_SUCCESS;
- }
/* Initialize buffers */
for(u = 0; u < 1024; u++) {
@@ -78,7 +78,7 @@ main(void)
api_ctx_pushed = TRUE;
/* Get H5F_t * to internal file structure */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
FAIL_STACK_ERROR
/* Should read in [1024, 2024] with buf data */
@@ -101,8 +101,11 @@ main(void)
return EXIT_SUCCESS;
-error:
- H5Fclose(fid);
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose(fapl);
+ H5Fclose(fid);
+ } H5E_END_TRY;
if(api_ctx_pushed) H5CX_pop();
diff --git a/test/btree2.c b/test/btree2.c
index d26fed5..8d77438 100644
--- a/test/btree2.c
+++ b/test/btree2.c
@@ -26,7 +26,7 @@
/* Other private headers that this test requires */
#include "H5CXprivate.h" /* API Contexts */
-#include "H5Iprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
const char *FILENAME[] = {
"btree2",
@@ -117,7 +117,7 @@ create_file(hid_t *file, H5F_t **f, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
+ if(NULL == (*f = (H5F_t *)H5VL_object(*file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -191,7 +191,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
+ if(NULL == (*f = (H5F_t *)H5VL_object(*file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3017,7 +3017,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3055,7 +3055,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -8568,7 +8568,7 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam,
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -8722,7 +8722,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -8817,7 +8817,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -8905,7 +8905,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -8990,7 +8990,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -9338,7 +9338,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -9382,7 +9382,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -9439,7 +9439,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -9496,7 +9496,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -9826,7 +9826,7 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -9880,7 +9880,7 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f2 = (H5F_t *)H5I_object(file2)))
+ if(NULL == (f2 = (H5F_t *)H5VL_object(file2)))
FAIL_STACK_ERROR
/* Open the B-tree through the second file handle */
diff --git a/test/cache_api.c b/test/cache_api.c
index 7c0ffa3..4f29009 100644
--- a/test/cache_api.c
+++ b/test/cache_api.c
@@ -230,7 +230,7 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* get a pointer to the files internal data structure */
if ( pass ) {
- file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+ file_ptr = (H5F_t *)H5VL_object_verify(file_id, H5I_FILE);
if ( file_ptr == NULL ) {
@@ -378,7 +378,7 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* get a pointer to the files internal data structure */
if ( pass ) {
- file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+ file_ptr = (H5F_t *)H5VL_object_verify(file_id, H5I_FILE);
if ( file_ptr == NULL ) {
diff --git a/test/cache_common.c b/test/cache_common.c
index 2cc188e..94d3f59 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -20,6 +20,7 @@
#include "H5CXprivate.h" /* API Contexts */
#include "H5MFprivate.h"
#include "H5MMprivate.h"
+
#include "cache_common.h"
@@ -3276,23 +3277,24 @@ setup_cache(size_t max_cache_size,
FUNC, mile_stone++, (int)pass);
if(pass) {
- HDassert(fid >= 0);
- saved_fid = fid;
+ HDassert(fid >= 0);
+ saved_fid = fid;
if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) {
pass = FALSE;
failure_mssg = "H5Fflush() failed.";
if(verbose)
HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC);
- } else {
- file_ptr = (H5F_t *)H5I_object_verify(fid, H5I_FILE);
- if(file_ptr == NULL) {
+ }
+ else {
+ file_ptr = (H5F_t *)H5VL_object_verify(fid, H5I_FILE);
+ if(file_ptr == NULL) {
pass = FALSE;
failure_mssg = "Can't get file_ptr.";
if(verbose)
HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC);
- }
+ }
}
}
@@ -3303,36 +3305,36 @@ setup_cache(size_t max_cache_size,
if(pass) {
/* A bit of fancy footwork here:
- *
- * The call to H5Fcreate() allocates an instance of H5C_t,
- * initializes it, and stores its address in f->shared->cache.
- *
- * We don't want to use this cache, as it has a bunch of extra
- * initialization that may change over time, and in any case
- * it will not in general be configured the way we want it.
- *
- * We used to deal with this problem by storing the file pointer
- * in another instance of H5C_t, and then ignoring the original
- * version. However, this strategy doesn't work any more, as
- * we can't store the file pointer in the instance of H5C_t,
- * and we have modified many cache routines to use a file
- * pointer to look up the target cache.
- *
- * Thus we now make note of the address of the instance of
- * H5C_t created by the call to H5Fcreate(), set
- * file_ptr->shared->cache to NULL, call H5C_create()
- * to allocate a new instance of H5C_t for test purposes,
- * and store than new instance's address in
- * file_ptr->shared->cache.
- *
- * On shut down, we call H5C_dest on our instance of H5C_t,
- * set file_ptr->shared->cache to point to the original
- * instance, and then close the file normally.
- */
+ *
+ * The call to H5Fcreate() allocates an instance of H5C_t,
+ * initializes it, and stores its address in f->shared->cache.
+ *
+ * We don't want to use this cache, as it has a bunch of extra
+ * initialization that may change over time, and in any case
+ * it will not in general be configured the way we want it.
+ *
+ * We used to deal with this problem by storing the file pointer
+ * in another instance of H5C_t, and then ignoring the original
+ * version. However, this strategy doesn't work any more, as
+ * we can't store the file pointer in the instance of H5C_t,
+ * and we have modified many cache routines to use a file
+ * pointer to look up the target cache.
+ *
+ * Thus we now make note of the address of the instance of
+ * H5C_t created by the call to H5Fcreate(), set
+ * file_ptr->shared->cache to NULL, call H5C_create()
+ * to allocate a new instance of H5C_t for test purposes,
+ * and store than new instance's address in
+ * file_ptr->shared->cache.
+ *
+ * On shut down, we call H5C_dest on our instance of H5C_t,
+ * set file_ptr->shared->cache to point to the original
+ * instance, and then close the file normally.
+ */
HDassert(saved_cache == NULL);
- saved_cache = file_ptr->shared->cache;
- file_ptr->shared->cache = NULL;
+ saved_cache = file_ptr->shared->cache;
+ file_ptr->shared->cache = NULL;
cache_ptr = H5C_create(max_cache_size,
min_clean_size,
@@ -3351,19 +3353,20 @@ setup_cache(size_t max_cache_size,
FUNC, mile_stone++, (int)pass);
if(pass) {
- if(cache_ptr == NULL) {
+ if(cache_ptr == NULL) {
pass = FALSE;
failure_mssg = "H5C_create() failed.";
if(verbose)
HDfprintf(stdout, "%s: H5C_create() failed.\n", FUNC);
- } else if(cache_ptr->magic != H5C__H5C_T_MAGIC) {
+ }
+ else if(cache_ptr->magic != H5C__H5C_T_MAGIC) {
pass = FALSE;
- failure_mssg = "Bad cache_ptr magic.";
+ failure_mssg = "Bad cache_ptr magic.";
if(verbose)
HDfprintf(stdout, "%s: Bad cache_ptr magic.\n", FUNC);
- }
+ }
}
if(show_progress) /* 7 */
@@ -3446,7 +3449,7 @@ takedown_cache(H5F_t * file_ptr,
H5C_stats(cache_ptr, "test cache", dump_detailed_stats);
}
- if ( H5C_prep_for_file_close(file_ptr) < 0 ) {
+ if ( H5C_prep_for_file_close(file_ptr) < 0 ) {
pass = FALSE;
failure_mssg = "unexpected failure of prep for file close.\n";
@@ -3456,23 +3459,23 @@ takedown_cache(H5F_t * file_ptr,
H5C_dest(file_ptr);
- if ( saved_cache != NULL ) {
+ if ( saved_cache != NULL ) {
- file_ptr->shared->cache = saved_cache;
- saved_cache = NULL;
- }
+ file_ptr->shared->cache = saved_cache;
+ saved_cache = NULL;
+ }
}
if ( saved_fapl_id != H5P_DEFAULT ) {
H5Pclose(saved_fapl_id);
- saved_fapl_id = H5P_DEFAULT;
+ saved_fapl_id = H5P_DEFAULT;
}
if ( saved_fcpl_id != H5P_DEFAULT ) {
H5Pclose(saved_fcpl_id);
- saved_fcpl_id = H5P_DEFAULT;
+ saved_fcpl_id = H5P_DEFAULT;
}
if ( saved_fid != -1 ) {
@@ -3480,7 +3483,7 @@ takedown_cache(H5F_t * file_ptr,
if ( H5F_addr_defined(saved_actual_base_addr) ) {
if ( NULL == file_ptr ) {
- file_ptr = (H5F_t *)H5I_object_verify(saved_fid, H5I_FILE);
+ file_ptr = (H5F_t *)H5VL_object_verify(saved_fid, H5I_FILE);
HDassert ( file_ptr );
}
@@ -3489,21 +3492,21 @@ takedown_cache(H5F_t * file_ptr,
saved_actual_base_addr = HADDR_UNDEF;
}
- if ( H5Fclose(saved_fid) < 0 ) {
+ if ( H5Fclose(saved_fid) < 0 ) {
pass = FALSE;
- failure_mssg = "couldn't close test file.";
+ failure_mssg = "couldn't close test file.";
- } else {
+ } else {
- saved_fid = -1;
+ saved_fid = -1;
}
/* Pop API context */
H5CX_pop();
- if ( ( ! try_core_file_driver ) || ( core_file_driver_failed ) ) {
+ if ( ( ! try_core_file_driver ) || ( core_file_driver_failed ) ) {
if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))
== NULL ) {
@@ -3515,10 +3518,10 @@ takedown_cache(H5F_t * file_ptr,
if ( HDremove(filename) < 0 ) {
pass = FALSE;
- failure_mssg = "couldn't delete test file.";
+ failure_mssg = "couldn't delete test file.";
- }
- }
+ }
+ }
}
return;
@@ -6030,7 +6033,7 @@ check_and_validate_cache_hit_rate(hid_t file_id,
/* get a pointer to the files internal data structure */
if ( pass ) {
- file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+ file_ptr = (H5F_t *)H5VL_object_verify(file_id, H5I_FILE);
if ( file_ptr == NULL ) {
@@ -6167,7 +6170,7 @@ check_and_validate_cache_size(hid_t file_id,
/* get a pointer to the files internal data structure */
if ( pass ) {
- file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+ file_ptr = (H5F_t *)H5VL_object_verify(file_id, H5I_FILE);
if ( file_ptr == NULL ) {
@@ -6349,7 +6352,7 @@ validate_mdc_config(hid_t file_id,
/* get a pointer to the files internal data structure */
if ( pass ) {
- file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+ file_ptr = (H5F_t *)H5VL_object_verify(file_id, H5I_FILE);
if ( file_ptr == NULL ) {
diff --git a/test/cache_common.h b/test/cache_common.h
index 9c66357..2604567 100644
--- a/test/cache_common.h
+++ b/test/cache_common.h
@@ -28,6 +28,7 @@
#include "H5Cpkg.h"
#include "H5Fpkg.h"
#include "H5Iprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
/* Include test header files */
#include "h5test.h"
diff --git a/test/cache_image.c b/test/cache_image.c
index 5967ecc..10e9a8a 100644
--- a/test/cache_image.c
+++ b/test/cache_image.c
@@ -586,12 +586,12 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected,
/* create a file access propertly list. */
if ( pass ) {
- fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ fapl_id = h5_fileaccess();
if ( fapl_id < 0 ) {
pass = FALSE;
- failure_mssg = "H5Pcreate() failed.\n";
+ failure_mssg = "h5_fileaccess() failed.\n";
}
}
@@ -720,7 +720,7 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected,
} else {
- file_ptr = (struct H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+ file_ptr = (struct H5F_t *)H5VL_object_verify(file_id, H5I_FILE);
if ( file_ptr == NULL ) {
@@ -928,12 +928,12 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file,
/* create a file access propertly list. */
if ( pass ) {
- fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ fapl_id = h5_fileaccess();
if ( fapl_id < 0 ) {
pass = FALSE;
- failure_mssg = "H5Pcreate() failed.\n";
+ failure_mssg = "h5_fileaccess() failed.\n";
}
}
@@ -6688,12 +6688,12 @@ cache_image_api_error_check_4(void)
*/
if ( pass ) {
- fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ fapl_id = h5_fileaccess();
if ( fapl_id < 0 ) {
pass = FALSE;
- failure_mssg = "H5Pcreate() failed.\n";
+ failure_mssg = "h5_fileaccess() failed.\n";
}
}
@@ -6732,7 +6732,7 @@ cache_image_api_error_check_4(void)
} else {
- file_ptr = (struct H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+ file_ptr = (struct H5F_t *)H5VL_object_verify(file_id, H5I_FILE);
if ( file_ptr == NULL ) {
@@ -6882,7 +6882,7 @@ cache_image_api_error_check_4(void)
} else {
- file_ptr = (struct H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+ file_ptr = (struct H5F_t *)H5VL_object_verify(file_id, H5I_FILE);
if ( file_ptr == NULL ) {
@@ -6960,7 +6960,7 @@ cache_image_api_error_check_4(void)
} else {
- file_ptr = (struct H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+ file_ptr = (struct H5F_t *)H5VL_object_verify(file_id, H5I_FILE);
if ( file_ptr == NULL ) {
diff --git a/test/cache_logging.c b/test/cache_logging.c
index b4ed53b..6fd48d8 100644
--- a/test/cache_logging.c
+++ b/test/cache_logging.c
@@ -40,8 +40,8 @@ test_logging_api(void)
char *location = NULL;
size_t size;
- hid_t fid;
- hid_t gid;
+ hid_t fid = -1;
+ hid_t gid = -1;
hbool_t is_currently_logging;
char group_name[8];
char filename[1024];
@@ -65,16 +65,16 @@ test_logging_api(void)
start_on_access_out = TRUE;
location = NULL;
size = 999;
- if(H5Pget_mdc_log_options(fapl, &is_enabled_out, location, &size,
+ if(H5Pget_mdc_log_options(fapl, &is_enabled_out, location, &size,
&start_on_access_out) < 0)
TEST_ERROR;
- if(size != strlen(LOG_LOCATION) + 1)
+ if(size != HDstrlen(LOG_LOCATION) + 1)
TEST_ERROR;
/* Check to make sure that the property list getter works */
if(NULL == (location = (char *)HDcalloc(size, sizeof(char))))
TEST_ERROR;
- if(H5Pget_mdc_log_options(fapl, &is_enabled_out, location, &size,
+ if(H5Pget_mdc_log_options(fapl, &is_enabled_out, location, &size,
&start_on_access_out) < 0)
TEST_ERROR;
if((is_enabled != is_enabled_out)
@@ -159,17 +159,18 @@ main(void)
/* Reset library */
h5_reset();
- printf("Testing basic metadata cache logging functionality.\n");
+ HDprintf("Testing basic metadata cache logging functionality.\n");
nerrors += test_logging_api();
if(nerrors) {
- printf("***** %d Metadata cache logging TEST%s FAILED! *****\n",
+ HDprintf("***** %d Metadata cache logging TEST%s FAILED! *****\n",
nerrors, nerrors > 1 ? "S" : "");
- return 1;
+ HDexit(EXIT_FAILURE);
}
- printf("All Metadata Cache Logging tests passed.\n");
- return 0;
+ HDprintf("All Metadata Cache Logging tests passed.\n");
+
+ HDexit(EXIT_SUCCESS);
}
diff --git a/test/cache_tagging.c b/test/cache_tagging.c
index 119ba62..752dd27 100644
--- a/test/cache_tagging.c
+++ b/test/cache_tagging.c
@@ -119,7 +119,7 @@ static int dump_cache(hid_t fid)
H5F_t *f; /* File Pointer */
/* Get Internal File / Cache Pointers */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR;
/* Dump the cache */
@@ -159,7 +159,7 @@ verify_no_unknown_tags(hid_t fid)
int i; /* Iterator */
/* Get Internal File / Cache Pointers */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR;
cache_ptr = f->shared->cache;
@@ -207,7 +207,7 @@ mark_all_entries_investigated(hid_t fid)
int i; /* Iterator */
/* Get Internal File / Cache Pointers */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR;
cache_ptr = f->shared->cache;
@@ -253,7 +253,7 @@ reset_all_entries_investigated(hid_t fid)
int i; /* Iterator */
/* Get Internal File / Cache Pointers */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR;
cache_ptr = f->shared->cache;
@@ -301,7 +301,7 @@ verify_tag(hid_t fid, int id, haddr_t tag)
int i; /* Iterator */
/* Get Internal File / Cache Pointers */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR;
cache_ptr = f->shared->cache;
@@ -341,7 +341,7 @@ evict_entries(hid_t fid)
H5F_t *f; /* File Pointer */
/* Get Internal File / Cache Pointers */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR;
/* Mark all entries investigated */
@@ -394,7 +394,7 @@ error:
* Function: get_sbe_tag()
*
* Purpose: This function retrieves the tag associated with the superblock
- * extension (the object header address stored in the superblock)
+ * extension (the object header address stored in the superblock)
*
* Return: 0 on Success; 1 on Failure
*
@@ -407,7 +407,7 @@ static int
get_sbe_tag(hid_t fid, haddr_t *tag)
{
/* Retrieve the superblock extension's object header address for the file */
- if(H5F_get_sbe_addr_test(fid, tag) < 0)
+ if(H5F__get_sbe_addr_test(fid, tag) < 0)
TEST_ERROR;
return 0;
@@ -440,14 +440,20 @@ check_file_creation_tags(hid_t fcpl_id, int type)
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
int verbose = FALSE; /* verbose test outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t sbe_tag = 0;
/* Testing Macro */
TESTING("tag application during file creation");
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
#ifndef NDEBUG
/* if verbose, print cache index to screen before verification . */
@@ -521,6 +527,7 @@ check_file_open_tags(hid_t fcpl, int type)
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
int verbose = FALSE; /* verbose file outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag; /* Root Group Tag */
haddr_t sbe_tag; /* Sblock Extension Tag */
@@ -531,8 +538,13 @@ check_file_open_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -628,6 +640,7 @@ check_group_creation_tags(void)
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
int verbose = FALSE; /* verbose file outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = HADDR_UNDEF; /* Root Group Tag */
haddr_t g_tag; /* Group Tag */
@@ -638,8 +651,13 @@ check_group_creation_tags(void)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -733,7 +751,7 @@ check_multi_group_creation_tags(void)
TESTING("tag application during multiple group creation");
/* Create Fapl */
- if ( (fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
/* Set latest version of library */
if ( H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) TEST_ERROR;
@@ -816,6 +834,7 @@ check_multi_group_creation_tags(void)
/* Close open objects and file */
/* =========================== */
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
if ( H5Fclose(fid) < 0 ) TEST_ERROR;
/* ========================================== */
@@ -855,15 +874,21 @@ check_link_iteration_tags(void)
haddr_t root_tag = 0; /* Root Group Tag Value */
char dsetname[500]; /* Name of dataset */
H5G_info_t ginfo; /* Group Info Struct */
+ hid_t fapl = -1; /* File access prop list */
hid_t root_group = -1; /* Root Group Identifier */
/* Testing Macro */
TESTING("tag application during iteration over links in a group");
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* =========== */
/* Create File */
/* =========== */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* Get root group tag */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -975,7 +1000,7 @@ check_dense_attribute_tags(void)
TESTING("tag application during dense attribute manipulation");
/* Create Fapl */
- if ( (fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
if ( H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) TEST_ERROR;
/* Create Dcpl */
@@ -986,6 +1011,8 @@ check_dense_attribute_tags(void)
/* =========== */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
+
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1145,6 +1172,7 @@ check_group_open_tags(void)
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
int verbose = FALSE; /* verbose file output */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = HADDR_UNDEF;
haddr_t g_tag;
@@ -1155,8 +1183,13 @@ check_group_open_tags(void)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1248,6 +1281,7 @@ check_attribute_creation_tags(hid_t fcpl, int type)
hid_t gid = -1; /* Group Identifier */
hid_t sid = -1; /* Dataspace Identifier */
int verbose = FALSE; /* verbose file outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0; /* Root group tag */
haddr_t g_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1260,8 +1294,11 @@ check_attribute_creation_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1341,6 +1378,7 @@ check_attribute_creation_tags(hid_t fcpl, int type)
if ( H5Aclose(aid) < 0 ) TEST_ERROR;
if ( H5Gclose(gid) < 0 ) TEST_ERROR;
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
if ( H5Fclose(fid) < 0 ) TEST_ERROR;
/* ========================================== */
@@ -1377,6 +1415,7 @@ check_attribute_open_tags(hid_t fcpl, int type)
hid_t gid = -1; /* Group Identifier */
hid_t sid = -1; /* Dataspace Identifier */
int verbose = FALSE; /* verbose file outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t g_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1389,8 +1428,13 @@ check_attribute_open_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1510,6 +1554,7 @@ check_attribute_rename_tags(hid_t fcpl, int type)
int verbose = FALSE; /* verbose file outout */
int *data = NULL; /* data buffer */
int i,j,k = 0; /* iterators */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t g_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1530,8 +1575,13 @@ check_attribute_rename_tags(hid_t fcpl, int type)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1689,6 +1739,7 @@ check_attribute_delete_tags(hid_t fcpl, int type)
int verbose = FALSE; /* verbose file outout */
int *data = NULL; /* data buffer */
int i,j,k = 0; /* iterators */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t g_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1709,8 +1760,13 @@ check_attribute_delete_tags(hid_t fcpl, int type)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1847,6 +1903,7 @@ check_dataset_creation_tags(hid_t fcpl, int type)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1859,7 +1916,12 @@ check_dataset_creation_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1974,6 +2036,7 @@ check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1987,7 +2050,12 @@ check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -2105,6 +2173,7 @@ check_dataset_open_tags(void)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2117,8 +2186,13 @@ check_dataset_open_tags(void)
/* Open File */
/* ========= */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -2225,6 +2299,7 @@ check_dataset_write_tags(void)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2242,8 +2317,13 @@ check_dataset_write_tags(void)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -2360,6 +2440,7 @@ check_attribute_write_tags(hid_t fcpl, int type)
int verbose = FALSE; /* verbose file outout */
int *data = NULL; /* data buffer */
int i,j,k = 0; /* iterators */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t g_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2375,8 +2456,13 @@ check_attribute_write_tags(hid_t fcpl, int type)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -2508,6 +2594,7 @@ check_dataset_read_tags(void)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2525,8 +2612,13 @@ check_dataset_read_tags(void)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -2639,6 +2731,7 @@ check_dataset_size_retrieval(void)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2657,8 +2750,13 @@ check_dataset_size_retrieval(void)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -2772,6 +2870,7 @@ check_dataset_extend_tags(void)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2790,8 +2889,13 @@ check_dataset_extend_tags(void)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -2900,6 +3004,7 @@ check_object_info_tags(void)
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
int verbose = FALSE; /* verbose file output */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = HADDR_UNDEF;
haddr_t g_tag;
H5O_info_t oinfo; /* Object info struct */
@@ -2911,8 +3016,13 @@ check_object_info_tags(void)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -3003,6 +3113,7 @@ check_object_copy_tags(void)
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
int verbose = FALSE; /* verbose file output */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = HADDR_UNDEF;
haddr_t g_tag;
haddr_t copy_tag;
@@ -3014,8 +3125,13 @@ check_object_copy_tags(void)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -3121,6 +3237,7 @@ check_link_removal_tags(hid_t fcpl, int type)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
haddr_t g_tag = 0;
@@ -3139,8 +3256,13 @@ check_link_removal_tags(hid_t fcpl, int type)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -3274,6 +3396,7 @@ check_link_getname_tags(void)
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
haddr_t g_tag = 0;
@@ -3292,8 +3415,13 @@ check_link_getname_tags(void)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -3414,6 +3542,7 @@ check_external_link_creation_tags(void)
hid_t fid2 = -1; /* File Identifier */
hid_t gid = -1; /* Dataspace Identifier */
int verbose = FALSE; /* verbose file outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
/* Testing Macro */
@@ -3423,21 +3552,26 @@ check_external_link_creation_tags(void)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
/* Close and Reopen the file */
if ( H5Fclose(fid) < 0 ) TEST_ERROR;
- if ( (fid = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl)) < 0 ) TEST_ERROR;
/* Evict as much as we can from the cache so we can track full tag path */
if ( evict_entries(fid) < 0 ) TEST_ERROR;
/* Create a second file */
- if ( (fid2 = H5Fcreate(FILENAME2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid2 = H5Fcreate(FILENAME2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* Create group in second file */
if ( (gid = H5Gcreate2(fid2, GROUPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
@@ -3514,6 +3648,7 @@ check_external_link_open_tags(void)
hid_t gid = -1; /* Dataspace Identifier */
hid_t xid = -1; /* Dataspace Identifier */
int verbose = FALSE; /* verbose file outout */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t root2_tag = 0;
@@ -3524,14 +3659,19 @@ check_external_link_open_tags(void)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
/* Create a second file */
- if ( (fid2 = H5Fcreate(FILENAME2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid2 = H5Fcreate(FILENAME2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid2, &root2_tag) < 0 ) TEST_ERROR;
@@ -3599,7 +3739,7 @@ check_external_link_open_tags(void)
/* =========================== */
/* Close open objects and file */
/* =========================== */
- if ( (H5Gclose(xid)) < 0 ) TEST_ERROR;
+ if ( H5Gclose(xid) < 0 ) TEST_ERROR;
if ( H5Fclose(fid) < 0 ) TEST_ERROR;
if ( H5Fclose(fid2) < 0 ) TEST_ERROR;
@@ -3638,6 +3778,7 @@ check_invalid_tag_application(void)
hid_t fid = -1;
haddr_t addr;
H5HL_t * lheap = NULL;
+ hid_t fapl = -1; /* File access prop list */
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
#endif /* H5C_DO_TAGGING_SANITY_CHECKS */
@@ -3645,15 +3786,20 @@ check_invalid_tag_application(void)
TESTING("failure on invalid tag application");
#if H5C_DO_TAGGING_SANITY_CHECKS
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR;
+
/* Create a test file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* Push API context */
if(H5CX_push() < 0) TEST_ERROR
api_ctx_pushed = TRUE;
/* Get internal file pointer*/
- if ( NULL == (f = (H5F_t *)H5I_object(fid)) ) TEST_ERROR;
+ if ( NULL == (f = (H5F_t *)H5VL_object(fid)) ) TEST_ERROR;
/* Call H5HL_create, an internal function that calls H5AC_insert_entry without setting up a tag */
/* Ensure this returns FAILURE, as a tag has not been set up. */
@@ -3672,7 +3818,7 @@ check_invalid_tag_application(void)
/* This should fail as no tag is set up during the protect call */
if (( lheap = H5HL_protect(f, addr, H5AC__NO_FLAGS_SET)) != NULL ) TEST_ERROR;
- /* Again, set up a valid tag in the DXPL */
+ /* Again, set up a valid tag in the API context */
H5AC_tag((haddr_t)25, NULL);
/* Call H5HL_protect again to protect the local heap. This should succeed. */
@@ -3711,9 +3857,7 @@ error:
*
* Purpose: Run tests on library's ability to tag metadata entries.
*
- * Return: Success:
- *
- * Failure:
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Mike McGreevy
* January 15, 2009
@@ -3755,12 +3899,12 @@ main(void)
/* Run tests on each fcpl set up above. */
if (test_type == TEST_DEFAULT) {
- if (!nerrs) printf("Testing standard tag application cases w/ default fcpl:\n");
+ if (!nerrs) HDprintf("Testing standard tag application cases w/ default fcpl:\n");
fcpl = fcpl_default;
} else if (test_type == TEST_SHMESG) {
- if (!nerrs) printf("Testing standard tag application cases w/ shared messages:\n");
+ if (!nerrs) HDprintf("Testing standard tag application cases w/ shared messages:\n");
fcpl = fcpl_shmesg_all;
} else {
@@ -3780,7 +3924,7 @@ main(void)
if (!nerrs) nerrs += check_link_removal_tags(fcpl, test_type);
} /* end for */
- if (!nerrs) printf("Testing other specific tag application cases:\n");
+ if (!nerrs) HDprintf("Testing other specific tag application cases:\n");
if (!nerrs) nerrs += check_group_creation_tags();
if (!nerrs) nerrs += check_multi_group_creation_tags();
if (!nerrs) nerrs += check_group_open_tags();
@@ -3804,10 +3948,13 @@ main(void)
HDremove(FILENAME2);
/* Return Errors */
- return nerrs > 0;
+ if (nerrs > 0)
+ return EXIT_FAILURE;
+ else
+ return EXIT_SUCCESS;
error:
/* Return with Error */
- return 1;
+ return EXIT_FAILURE;
} /* main */
diff --git a/test/chunk_info.c b/test/chunk_info.c
deleted file mode 100644
index e3006cc..0000000
--- a/test/chunk_info.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * 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. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*
- * Programmer: Pedro Vicente <pvn@hdfgroup.edu>
- * April 7, 2008
- *
- * Purpose: Tests the H5Dget_chunk_info API function
- * This program writes a 4x4 dataset by iterating on 2x2 chunks
- * at a time
- */
-
-
-#include "h5test.h"
-
-#define PRINT_DATA
-#define H5FILE_NAME "chunk_info.h5"
-#define DATASETNAME "2d"
-#define RANK 2
-
-
-int main( void )
-{
-
- hid_t fid; /* file ID */
- hid_t did; /* dataset ID */
- hid_t f_sid; /* file space ID */
- hid_t m_sid; /* memory space ID */
- hid_t pid; /* property list ID */
- hsize_t start[2]; /* chunk location to start writing */
- hsize_t dims[2] = { 4, 4};
- hsize_t chunk_dims[2] = { 2, 2 };
- int chunk_data[2][2] = { {1, 1}, {1, 1} };
- int buf[4][4];
- int fillvalue = 0;
- int i, j, ii, jj;
-
- /* create a new file using default properties. */
- if ((fid = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
- /* create the file space */
- if ((f_sid = H5Screate_simple(RANK, dims, dims)) < 0) TEST_ERROR;
- /* create the memory space with chunk dimensions */
- if ((m_sid = H5Screate_simple(RANK, chunk_dims, chunk_dims)) < 0) TEST_ERROR;
- start[0] = 0;
- start[1] = 0;
- if (H5Sselect_hyperslab(m_sid, H5S_SELECT_SET, start, NULL, chunk_dims, NULL) < 0) TEST_ERROR;
-
- TESTING("chunk info");
-
- /*-------------------------------------------------------------------------
- * create a dataset
- *-------------------------------------------------------------------------
- */
-
- /* modify dataset creation properties, i.e. enable chunking. */
- if ((pid = H5Pcreate (H5P_DATASET_CREATE)) < 0) TEST_ERROR;
- if (H5Pset_chunk(pid, RANK, chunk_dims) < 0) TEST_ERROR;
- if (H5Pset_fill_value(pid, H5T_NATIVE_INT, &fillvalue) < 0) TEST_ERROR;
-
- /* create a new dataset */
- if((did = H5Dcreate2(fid , DATASETNAME, H5T_NATIVE_INT, f_sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR;
-
-
- /*-------------------------------------------------------------------------
- * write the dataset in 2x2 chunks
- *-------------------------------------------------------------------------
- */
-
- /* iterate in dim 0 */
- for (j = 0; j < chunk_dims[0]; j++)
- {
-
- /* reset start in dim 1 */
- start[1] = 0;
-
- /* iterate in dim 1 */
- for (i = 0; i < chunk_dims[1]; i++)
- {
-
- /* select file hyperslab to save a 2x2 chunk */
- if (H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, chunk_dims, NULL) < 0) TEST_ERROR;
-
- /* write the data to the hyperslab. */
- if (H5Dwrite(did, H5T_NATIVE_INT, m_sid, f_sid, H5P_DEFAULT, chunk_data) < 0) TEST_ERROR;
-
- /* read back and display complete dataset 4x4 */
- if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR;
-
-
-#if defined (PRINT_DATA)
- printf("\n");
- printf("dataset: \n");
- for (jj = 0; jj < dims[0]; jj++) {
- for (ii = 0; ii < dims[1]; ii++) printf("%d ", buf[jj][ii]);
- printf("\n");
- }
-#endif
-
-
- /* increment start in dim 1 */
- start[1] += 2;
-
-
- }
-
- /* increment start in dim 0 */
- start[0] += 2;
- }
-
-
-
- /*-------------------------------------------------------------------------
- * close
- *-------------------------------------------------------------------------
- */
-
- if (H5Dclose(did) < 0) TEST_ERROR
- if (H5Sclose(f_sid) < 0) TEST_ERROR
- if (H5Sclose(m_sid) < 0) TEST_ERROR
- if (H5Pclose(pid) < 0) TEST_ERROR
- if (H5Fclose(fid) < 0) TEST_ERROR
-
- PASSED();
-
- puts("All chunk info tests passed.");
- return 0;
-
-
-error:
- H5Dclose( did );
- H5Sclose( f_sid );
- H5Sclose( m_sid );
- H5Pclose( pid );
- H5Fclose( fid );
- H5_FAILED();
- return 1;
-}
-
-
-
diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c
index 5d6cfc7..b011bc2 100644
--- a/test/cmpd_dset.c
+++ b/test/cmpd_dset.c
@@ -2032,7 +2032,7 @@ error:
*-------------------------------------------------------------------------
*/
static unsigned
-test_ooo_order(char *filename)
+test_ooo_order(char *filename, hid_t fapl_id)
{
hid_t file = -1; /* File ID */
hid_t dtype = -1; /* Datatype IDs */
@@ -2042,7 +2042,7 @@ test_ooo_order(char *filename)
TESTING("that compound member insertion order is preserved")
/* Create the file */
- if ((file = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if ((file = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
TEST_ERROR
/* Create the compound */
@@ -2242,7 +2242,7 @@ main (int argc, char *argv[])
nerrors += test_pack_ooo();
puts("Testing compound member ordering:");
- nerrors += test_ooo_order(fname);
+ nerrors += test_ooo_order(fname, fapl_id);
/* Verify symbol table messages are cached */
nerrors += (h5_verify_cached_stabs(FILENAME, fapl_id) < 0 ? 1 : 0);
diff --git a/test/dangle.c b/test/dangle.c
index 75e9c84..9f30f10 100644
--- a/test/dangle.c
+++ b/test/dangle.c
@@ -602,7 +602,8 @@ test_dangle_force(void)
TEST_ERROR;
/* Allocate the array of object IDs */
- objs = (hid_t*)HDmalloc(sizeof(hid_t) * (size_t)count);
+ if(NULL == (objs = (hid_t *)HDcalloc((size_t)count, sizeof(hid_t))))
+ TEST_ERROR;
/* Get the list of open IDs */
if(H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)count, objs) < 0)
diff --git a/test/dsets.c b/test/dsets.c
index 092b616..292ea06 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -27,7 +27,6 @@
#include "testhdf5.h"
#include "H5srcdir.h"
-#include "H5Bprivate.h"
#include "H5CXprivate.h" /* API Contexts */
#include "H5Iprivate.h"
#include "H5Pprivate.h"
@@ -827,7 +826,7 @@ test_compact_io(hid_t fapl)
**************************************/
/* Create a copy of file access property list */
- if((new_fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR
+ if((new_fapl = new_fapl = h5_fileaccess()) < 0) TEST_ERROR
/* Loop through all the combinations of low/high library format bounds,
skipping invalid combinations.
@@ -878,10 +877,10 @@ test_compact_io(hid_t fapl)
} /* end */
/* Get the internal file pointer */
- if((fp = (H5F_t *)H5I_object(verfile)) == NULL) TEST_ERROR
+ if((fp = (H5F_t *)H5VL_object(verfile)) == NULL) TEST_ERROR
/* Get the internal dataset pointer */
- if((dsetp = (H5D_t *)H5I_object(dataset)) == NULL) TEST_ERROR
+ if((dsetp = (H5D_t *)H5VL_object(dataset)) == NULL) TEST_ERROR
/* Verify the dataset's layout and fill message versions */
if(fp->shared->low_bound == H5F_LIBVER_EARLIEST) {
@@ -1335,6 +1334,19 @@ test_conv_buffer(hid_t fid)
return 0;
error:
+ H5E_BEGIN_TRY {
+ H5Pclose(xfer_list);
+ H5Sclose(space);
+ H5Tclose(arr_type1);
+ H5Tclose(arr_type2);
+ H5Tclose(arr_type3);
+ H5Tclose(ctype1);
+ H5Tclose(ctype2);
+ H5Tclose(arr_type4);
+ H5Tclose(arr_type5);
+ H5Dclose(dataset);
+ } H5E_END_TRY;
+
return -1;
}
@@ -2517,8 +2529,7 @@ error:
*
* Purpose: Tests library behavior when filter is missing
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2543,7 +2554,7 @@ test_missing_filter(hid_t file)
/* Verify deflate filter is registered currently */
if(H5Zfilter_avail(H5Z_FILTER_DEFLATE)!=TRUE) {
H5_FAILED();
- printf(" Line %d: Deflate filter not available\n",__LINE__);
+ HDprintf(" Line %d: Deflate filter not available\n",__LINE__);
goto error;
} /* end if */
@@ -2555,31 +2566,31 @@ test_missing_filter(hid_t file)
/* (Use private routine, to avoid range checking on filter ID) */
if(H5Z__unregister(H5Z_FILTER_DEFLATE) < 0) {
H5_FAILED();
- printf(" Line %d: Can't unregister deflate filter\n",__LINE__);
+ HDprintf(" Line %d: Can't unregister deflate filter\n",__LINE__);
goto error;
} /* end if */
#endif /* H5_HAVE_FILTER_DEFLATE */
/* Verify deflate filter is not registered currently */
if(H5Zfilter_avail(H5Z_FILTER_DEFLATE)!=FALSE) {
H5_FAILED();
- printf(" Line %d: Deflate filter available\n",__LINE__);
+ HDprintf(" Line %d: Deflate filter available\n",__LINE__);
goto error;
} /* end if */
/* Create dcpl with deflate filter */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't create dcpl\n",__LINE__);
+ HDprintf(" Line %d: Can't create dcpl\n",__LINE__);
goto error;
} /* end if */
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) {
H5_FAILED();
- printf(" Line %d: Can't set chunk sizes\n",__LINE__);
+ HDprintf(" Line %d: Can't set chunk sizes\n",__LINE__);
goto error;
} /* end if */
if(H5Pset_deflate(dcpl, 9) < 0) {
H5_FAILED();
- printf(" Line %d: Can't set deflate filter\n",__LINE__);
+ HDprintf(" Line %d: Can't set deflate filter\n",__LINE__);
goto error;
} /* end if */
@@ -2587,47 +2598,47 @@ test_missing_filter(hid_t file)
ret=H5Pall_filters_avail(dcpl);
if(ret<0) {
H5_FAILED();
- printf(" Line %d: Can't check filter availability\n",__LINE__);
+ HDprintf(" Line %d: Can't check filter availability\n",__LINE__);
goto error;
} /* end if */
if(ret!=FALSE) {
H5_FAILED();
- printf(" Line %d: Filter shouldn't be available\n",__LINE__);
+ HDprintf(" Line %d: Filter shouldn't be available\n",__LINE__);
goto error;
} /* end if */
/* Create the data space */
if((sid = H5Screate_simple(2, dims, NULL)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't open dataspace\n",__LINE__);
+ HDprintf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
} /* end if */
/* Create new dataset */
if((dsid = H5Dcreate2(file, DSET_MISSING_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't create dataset\n",__LINE__);
+ HDprintf(" Line %d: Can't create dataset\n",__LINE__);
goto error;
} /* end if */
/* Write data */
if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) {
H5_FAILED();
- printf(" Line %d: Error writing dataset data\n",__LINE__);
+ HDprintf(" Line %d: Error writing dataset data\n",__LINE__);
goto error;
} /* end if */
/* Flush the file (to clear the cache) */
if(H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) {
H5_FAILED();
- printf(" Line %d: Error flushing file\n",__LINE__);
+ HDprintf(" Line %d: Error flushing file\n",__LINE__);
goto error;
} /* end if */
/* Query the dataset's size on disk */
if(0 == (dset_size = H5Dget_storage_size(dsid))) {
H5_FAILED();
- printf(" Line %d: Error querying dataset size, dset_size=%lu\n",__LINE__,(unsigned long)dset_size);
+ HDprintf(" Line %d: Error querying dataset size, dset_size=%lu\n",__LINE__,(unsigned long)dset_size);
goto error;
} /* end if */
@@ -2635,14 +2646,14 @@ test_missing_filter(hid_t file)
/* (i.e. the deflation filter we asked for was silently ignored) */
if((H5Tget_size(H5T_NATIVE_INT) * DSET_DIM1 * DSET_DIM2) != dset_size) {
H5_FAILED();
- printf(" Line %d: Incorrect dataset size: %lu\n",__LINE__,(unsigned long)dset_size);
+ HDprintf(" Line %d: Incorrect dataset size: %lu\n",__LINE__,(unsigned long)dset_size);
goto error;
} /* end if */
/* Read data */
if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) {
H5_FAILED();
- printf(" Line %d: Error reading dataset data\n",__LINE__);
+ HDprintf(" Line %d: Error reading dataset data\n",__LINE__);
goto error;
} /* end if */
@@ -2652,10 +2663,10 @@ test_missing_filter(hid_t file)
for(j=0; j<(size_t)dims[1]; j++) {
if(points[i][j] != check[i][j]) {
H5_FAILED();
- printf(" Line %d: Read different values than written.\n",__LINE__);
- printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
- printf(" At original: %d\n",points[i][j]);
- printf(" At returned: %d\n",check[i][j]);
+ HDprintf(" Line %d: Read different values than written.\n",__LINE__);
+ HDprintf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
+ HDprintf(" At original: %d\n",points[i][j]);
+ HDprintf(" At returned: %d\n",check[i][j]);
goto error;
} /* end if */
} /* end for */
@@ -2664,21 +2675,21 @@ test_missing_filter(hid_t file)
/* Close dataset */
if(H5Dclose(dsid) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dataset\n",__LINE__);
+ HDprintf(" Line %d: Can't close dataset\n",__LINE__);
goto error;
} /* end if */
/* Close dataspace */
if(H5Sclose(sid) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dataspace\n",__LINE__);
+ HDprintf(" Line %d: Can't close dataspace\n",__LINE__);
goto error;
} /* end if */
/* Close dataset creation property list */
if(H5Pclose(dcpl) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dcpl\n",__LINE__);
+ HDprintf(" Line %d: Can't close dcpl\n",__LINE__);
goto error;
} /* end if */
@@ -2688,14 +2699,14 @@ test_missing_filter(hid_t file)
/* Open existing file */
if((fid = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't open existing deflated file\n", __LINE__);
+ HDprintf(" Line %d: Can't open existing deflated file\n", __LINE__);
goto error;
} /* end if */
/* Open dataset */
if((dsid = H5Dopen2(fid, "Dataset1", H5P_DEFAULT)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't open dataset\n", __LINE__);
+ HDprintf(" Line %d: Can't open dataset\n", __LINE__);
goto error;
} /* end if */
@@ -2705,21 +2716,21 @@ test_missing_filter(hid_t file)
} H5E_END_TRY;
if(ret>=0) {
H5_FAILED();
- printf(" Line %d: Should not be able to read dataset data\n", __LINE__);
+ HDprintf(" Line %d: Should not be able to read dataset data\n", __LINE__);
goto error;
} /* end if */
/* Close dataset */
if(H5Dclose(dsid) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close dataset\n", __LINE__);
+ HDprintf(" Line %d: Can't close dataset\n", __LINE__);
goto error;
} /* end if */
/* Close existing file */
if(H5Fclose(fid) < 0) {
H5_FAILED();
- printf(" Line %d: Can't close file\n", __LINE__);
+ HDprintf(" Line %d: Can't close file\n", __LINE__);
goto error;
} /* end if */
@@ -2727,21 +2738,21 @@ test_missing_filter(hid_t file)
/* Verify deflate filter is not registered currently */
if(H5Zfilter_avail(H5Z_FILTER_DEFLATE)!=FALSE) {
H5_FAILED();
- printf(" Line %d: Deflate filter available\n",__LINE__);
+ HDprintf(" Line %d: Deflate filter available\n",__LINE__);
goto error;
} /* end if */
#ifdef H5_HAVE_FILTER_DEFLATE
/* Register deflate filter (use internal function to avoid range checks) */
if(H5Z_register(H5Z_DEFLATE) < 0) {
H5_FAILED();
- printf(" Line %d: Can't unregister deflate filter\n",__LINE__);
+ HDprintf(" Line %d: Can't unregister deflate filter\n",__LINE__);
goto error;
} /* end if */
/* Verify deflate filter is registered currently */
if(H5Zfilter_avail(H5Z_FILTER_DEFLATE)!=TRUE) {
H5_FAILED();
- printf(" Line %d: Deflate filter not available\n",__LINE__);
+ HDprintf(" Line %d: Deflate filter not available\n",__LINE__);
goto error;
} /* end if */
#endif /* H5_HAVE_FILTER_DEFLATE */
@@ -2751,13 +2762,13 @@ test_missing_filter(hid_t file)
api_ctx_pushed = FALSE;
PASSED();
- return 0;
+ return SUCCEED;
error:
if(api_ctx_pushed) H5CX_pop();
- return -1;
-}
+ return FAIL;
+} /* end test_missing_filter() */
/*-------------------------------------------------------------------------
@@ -8301,25 +8312,25 @@ test_chunk_fast(const char *env_h5_driver, hid_t fapl)
/* Loop over using SWMR access to write */
for(swmr = 0; swmr <= 1; swmr++) {
- int compress; /* Whether chunks should be compressed */
+ int compress; /* Whether chunks should be compressed */
/* SWMR is now supported with/without latest format: */
- /* (1) write+latest-format (2) SWMR-write+non-latest-format */
+ /* (1) write+latest-format (2) SWMR-write+non-latest-format */
/* Skip this iteration if SWMR I/O is not supported for the VFD specified
* by the environment variable.
*/
- if(swmr && !H5FD_supports_swmr_test(env_h5_driver))
+ if(swmr && !H5FD__supports_swmr_test(env_h5_driver))
continue;
#ifdef H5_HAVE_FILTER_DEFLATE
/* Loop over compressing chunks */
for(compress = 0; compress <= 1; compress++)
#else
- /* Loop over without compression */
+ /* Loop over without compression */
for(compress = 0; compress <= 0; compress++)
#endif /* H5_HAVE_FILTER_DEFLATE */
- {
+ {
H5D_alloc_time_t alloc_time; /* Storage allocation time */
/* Loop over storage allocation time */
@@ -10412,11 +10423,11 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl)
/* Skip this test if SWMR I/O is not supported for the VFD specified
* by the environment variable.
*/
- if(!H5FD_supports_swmr_test(env_h5_driver)) {
+ if(!H5FD__supports_swmr_test(env_h5_driver)) {
SKIPPED();
HDputs(" Test skipped due to VFD not supporting SWMR I/O.");
return 0;
- } /* end if */
+ }
/* Check if we are using the latest version of the format */
if(H5Pget_libver_bounds(fapl, &low, NULL) < 0)
@@ -10428,7 +10439,8 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl)
/* Create file with write+latest-format */
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
- } else {
+ }
+ else {
/* Create file with SWMR-write+non-latest-format */
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC|H5F_ACC_SWMR_WRITE, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
@@ -10661,11 +10673,11 @@ test_earray_hdr_fd(const char *env_h5_driver, hid_t fapl)
/* Skip this test if SWMR I/O is not supported for the VFD specified
* by the environment variable.
*/
- if(!H5FD_supports_swmr_test(env_h5_driver)) {
+ if(!H5FD__supports_swmr_test(env_h5_driver)) {
SKIPPED();
HDputs(" Test skipped due to VFD not supporting SWMR I/O.");
return 0;
- } /* end if */
+ }
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
FAIL_STACK_ERROR;
@@ -10781,11 +10793,11 @@ test_farray_hdr_fd(const char *env_h5_driver, hid_t fapl)
/* Skip this test if SWMR I/O is not supported for the VFD specified
* by the environment variable.
*/
- if(!H5FD_supports_swmr_test(env_h5_driver)) {
+ if(!H5FD__supports_swmr_test(env_h5_driver)) {
SKIPPED();
HDputs(" Test skipped due to VFD not supporting SWMR I/O.");
return 0;
- } /* end if */
+ }
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
FAIL_STACK_ERROR;
@@ -10901,11 +10913,11 @@ test_bt2_hdr_fd(const char *env_h5_driver, hid_t fapl)
/* Skip this test if SWMR I/O is not supported for the VFD specified
* by the environment variable.
*/
- if(!H5FD_supports_swmr_test(env_h5_driver)) {
+ if(!H5FD__supports_swmr_test(env_h5_driver)) {
SKIPPED();
HDputs(" Test skipped due to VFD not supporting SWMR I/O.");
return 0;
- } /* end if */
+ }
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
FAIL_STACK_ERROR;
@@ -12904,7 +12916,7 @@ error:
#define SRC_DSET "src_dset"
#define V_DSET "v_dset"
static herr_t
-test_versionbounds()
+test_versionbounds(void)
{
hid_t fapl = -1;
hid_t srcfile = -1; /* Files with source dsets */
diff --git a/test/dtypes.c b/test/dtypes.c
index 3253d6c..7e5a992 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -6957,13 +6957,13 @@ test_delete_obj_named_fileid(hid_t fapl)
/* Verify file ID from dataset matches correct file */
dset_fid = H5Iget_file_id(dset);
- if(dset_fid != filea1) TEST_ERROR
+ if(!H5F__same_file_test(dset_fid, filea1)) TEST_ERROR
H5Fclose(dset_fid);
/* Verify file ID from datatype (from dataset) matches correct file */
type = H5Dget_type(dset);
type_fid = H5Iget_file_id(type);
- if(type_fid != filea1) TEST_ERROR
+ if(!H5F__same_file_test(type_fid, filea1)) TEST_ERROR
H5Fclose(type_fid);
H5Tclose(type);
@@ -6979,13 +6979,13 @@ test_delete_obj_named_fileid(hid_t fapl)
/* Verify file ID from dataset matches correct file */
dset_fid = H5Iget_file_id(dset);
- if(dset_fid != filea1) TEST_ERROR
+ if(!H5F__same_file_test(dset_fid, filea1)) TEST_ERROR
H5Fclose(dset_fid);
/* Verify file ID from datatype (from dataset) matches correct file */
type = H5Dget_type(dset);
type_fid = H5Iget_file_id(type);
- if(type_fid != filea1) TEST_ERROR
+ if(!H5F__same_file_test(type_fid, filea1)) TEST_ERROR
H5Fclose(type_fid);
H5Tclose(type);
@@ -7007,13 +7007,13 @@ test_delete_obj_named_fileid(hid_t fapl)
/* Verify file ID from dataset matches correct file */
attr_fid = H5Iget_file_id(attr);
- if(attr_fid != filea1) TEST_ERROR
+ if(!H5F__same_file_test(attr_fid, filea1)) TEST_ERROR
H5Fclose(attr_fid);
/* Verify file ID from datatype (from dataset) matches correct file */
type = H5Aget_type(attr);
type_fid = H5Iget_file_id(type);
- if(type_fid != filea1) TEST_ERROR
+ if(!H5F__same_file_test(type_fid, filea1)) TEST_ERROR
H5Fclose(type_fid);
H5Tclose(type);
@@ -7029,13 +7029,13 @@ test_delete_obj_named_fileid(hid_t fapl)
/* Verify file ID from dataset matches correct file */
attr_fid = H5Iget_file_id(attr);
- if(attr_fid != filea1) TEST_ERROR
+ if(!H5F__same_file_test(attr_fid, filea1)) TEST_ERROR
H5Fclose(attr_fid);
/* Verify file ID from datatype (from dataset) matches correct file */
type = H5Aget_type(attr);
type_fid = H5Iget_file_id(type);
- if(type_fid != filea1) TEST_ERROR
+ if(!H5F__same_file_test(type_fid, filea1)) TEST_ERROR
H5Fclose(type_fid);
H5Tclose(type);
diff --git a/test/earray.c b/test/earray.c
index d72b3f5..bb258c7 100644
--- a/test/earray.c
+++ b/test/earray.c
@@ -27,6 +27,7 @@
/* Other private headers that this test requires */
#include "H5CXprivate.h" /* API Contexts */
#include "H5Iprivate.h" /* IDs */
+#include "H5VLprivate.h" /* Virtual Object Layer */
#include "H5VMprivate.h" /* Vectors and arrays */
@@ -300,7 +301,7 @@ create_file(unsigned flags, hid_t fapl, hid_t *file, H5F_t **f)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
+ if(NULL == (*f = (H5F_t *)H5VL_object(*file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -433,7 +434,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl,
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
+ if(NULL == (*f = (H5F_t *)H5VL_object(*file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -521,18 +522,18 @@ verify_cparam(const H5EA_t *ea, const H5EA_create_t *cparam)
/* Retrieve creation parameters */
HDmemset(&test_cparam, 0, sizeof(H5EA_create_t));
- if(H5EA_get_cparam_test(ea, &test_cparam) < 0)
+ if(H5EA__get_cparam_test(ea, &test_cparam) < 0)
FAIL_STACK_ERROR
/* Verify creation parameters */
- if(H5EA_cmp_cparam_test(cparam, &test_cparam))
+ if(H5EA__cmp_cparam_test(cparam, &test_cparam))
TEST_ERROR
/* Success */
- return(0);
+ return 0;
error:
- return(-1);
+ return -1;
} /* verify_cparam() */
@@ -943,7 +944,7 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f2 = (H5F_t *)H5I_object(file2)))
+ if(NULL == (f2 = (H5F_t *)H5VL_object(file2)))
FAIL_STACK_ERROR
/* Open the extensible array through the second file handle */
@@ -1089,7 +1090,7 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f2 = (H5F_t *)H5I_object(file2)))
+ if(NULL == (f2 = (H5F_t *)H5VL_object(file2)))
FAIL_STACK_ERROR
/* Open the extensible array through the second file handle */
@@ -2398,7 +2399,7 @@ error:
H5E_BEGIN_TRY {
if(ea)
H5EA_close(ea);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
diff --git a/test/echo_vol.c b/test/echo_vol.c
new file mode 100644
index 0000000..7f59832
--- /dev/null
+++ b/test/echo_vol.c
@@ -0,0 +1,127 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Purpose: A simple virtual object layer (VOL) plugin that just echoes
+ * the name of the API call.
+ */
+
+#include "H5PLextern.h"
+
+/* The VOL class struct.
+ */
+static const H5VL_class_t echo_vol_g = {
+ 0, /* version */
+ (H5VL_class_value_t)501, /* value */
+ "echo", /* name */
+ 0, /* capability flags */
+ NULL, /* initialize */
+ NULL, /* terminate */
+ (size_t)0, /* info size */
+ NULL, /* info copy */
+ NULL, /* info compare */
+ NULL, /* info free */
+ NULL, /* info to str */
+ NULL, /* str to info */
+ NULL, /* get_object */
+ NULL, /* get_wrap_ctx */
+ NULL, /* wrap_object */
+ NULL, /* free_wrap_ctx */
+ { /* attribute_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* read */
+ NULL, /* write */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ { /* dataset_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* read */
+ NULL, /* write */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ { /* datatype_cls */
+ NULL, /* commit */
+ NULL, /* open */
+ NULL, /* get_size */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ { /* file_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ { /* group_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ { /* link_cls */
+ NULL, /* create */
+ NULL, /* copy */
+ NULL, /* move */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL /* optional */
+ },
+ { /* object_cls */
+ NULL, /* open */
+ NULL, /* copy */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL /* optional */
+ },
+ { /* request_cls */
+ NULL, /* wait */
+ NULL, /* notify */
+ NULL, /* cancel */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* free */
+ },
+ NULL /* optional */
+};
+
+
+
+/* These two functions are necessary to load this plugin using
+ * the HDF5 library.
+ */
+
+H5PL_type_t
+H5PLget_plugin_type(void)
+{
+ return H5PL_TYPE_VOL;
+}
+
+
+const void*
+H5PLget_plugin_info(void)
+{
+ return &echo_vol_g;
+}
+
diff --git a/test/efc.c b/test/efc.c
index 5a946bb..d63ef34 100644
--- a/test/efc.c
+++ b/test/efc.c
@@ -2885,8 +2885,7 @@ error:
*
* Purpose: Test the external file cache code
*
- * Return: Success: SUCCEED
- * Failure: FAIL
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Neil Fortner
* December 16, 2010
@@ -2900,7 +2899,7 @@ main(void)
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
/* Test Setup */
- puts("Testing the external file cache");
+ HDputs("Testing the external file cache");
/* Create property lists */
fcpl_id = H5Pcreate(H5P_FILE_CREATE);
@@ -2937,14 +2936,14 @@ main(void)
if(nerrors)
goto error;
- puts("All external file cache tests passed.");
+ HDputs("All external file cache tests passed.");
h5_clean_files(FILENAME, fapl_id);
- return 0;
+ return EXIT_SUCCESS;
error:
- puts("*** TESTS FAILED ***");
+ HDputs("*** TESTS FAILED ***");
H5E_BEGIN_TRY {
H5Pclose(fapl_id);
@@ -2952,6 +2951,6 @@ error:
if(api_ctx_pushed) H5CX_pop();
- return 1;
+ return EXIT_FAILURE;
} /* end main() */
diff --git a/test/enc_dec_plist_cross_platform.c b/test/enc_dec_plist_cross_platform.c
index 1fbb41b..15c7391 100644
--- a/test/enc_dec_plist_cross_platform.c
+++ b/test/enc_dec_plist_cross_platform.c
@@ -28,7 +28,7 @@ int
main(void)
{
if(VERBOSE_MED)
- printf("Encode/Decode property list endianess\n");
+ HDprintf("Encode/Decode property list endianess\n");
/******* ENCODE/DECODE DCPLS *****/
TESTING("Default DCPL Encoding/Decoding");
@@ -227,7 +227,7 @@ test_plists(const char *filename_prefix)
return 1;
error:
- printf("***** Plist Encode/Decode tests FAILED! *****\n");
+ HDprintf("***** Plist Encode/Decode tests FAILED! *****\n");
return -1;
}
diff --git a/test/err_compat.c b/test/err_compat.c
index eee150b..4860a3c 100644
--- a/test/err_compat.c
+++ b/test/err_compat.c
@@ -469,7 +469,7 @@ main(void)
char filename[1024];
const char *FUNC_main="main";
- fprintf(stderr, " This program tests the Error API compatible with HDF5 v1.6. There're supposed to be some error messages\n");
+ fprintf(stderr, " This program tests the Error API compatible with HDF5 v1.6. There are supposed to be some error messages\n");
fapl = h5_fileaccess();
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
diff --git a/test/evict_on_close.c b/test/evict_on_close.c
index 6536837..9918829 100644
--- a/test/evict_on_close.c
+++ b/test/evict_on_close.c
@@ -11,11 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/*
- * Programmer: Dana Robinson
- * Spring 2016
- *
- * Purpose: Tests the basic operation of the evict-on-close cache
+/* Purpose: Tests the basic operation of the evict-on-close cache
* behavior. Tests that ensure the tagging is handled correctly
* are located in cache.c.
*/
@@ -36,6 +32,7 @@
#include "H5Fpkg.h"
#include "H5Gpkg.h"
#include "H5Ipkg.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
/* Evict on close is not supported under parallel at this time.
* In the meantime, we just run a simple check that EoC can't be
@@ -91,9 +88,6 @@ static herr_t check_group_layout(hid_t fid, const char *group_name);
*
* Return: TRUE/FALSE
*
- * Programmer: Dana Robinson
- * Fall 2016
- *
*-------------------------------------------------------------------------
*/
static hbool_t
@@ -114,8 +108,8 @@ verify_tag_not_in_cache(H5F_t *f, haddr_t tag)
return TRUE;
else
entry_ptr = entry_ptr->ht_next;
- } /* end while */
- } /* end for */
+ }
+ }
return FALSE;
} /* end verify_tag_not_in_cache() */
@@ -129,9 +123,6 @@ verify_tag_not_in_cache(H5F_t *f, haddr_t tag)
* Return: Success: The file ID of the created file
* Failure: -1
*
- * Programmer: Dana Robinson
- * Fall 2016
- *
*-------------------------------------------------------------------------
*/
static hid_t
@@ -207,7 +198,7 @@ generate_eoc_test_file(hid_t fapl_id)
TEST_ERROR;
if(H5Gclose(gid2) < 0)
TEST_ERROR;
- } /* end for */
+ }
if(H5Gclose(gid1) < 0)
TEST_ERROR;
@@ -303,7 +294,7 @@ generate_eoc_test_file(hid_t fapl_id)
TEST_ERROR;
if(H5Gclose(gid2) < 0)
TEST_ERROR;
- } /* end for */
+ }
if(H5Gclose(gid1) < 0)
TEST_ERROR;
@@ -593,9 +584,6 @@ error:
*
* Return: SUCCEED/FAIL
*
- * Programmer: Dana Robinson
- * Fall 2016
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -611,7 +599,7 @@ check_group_layout(hid_t fid, const char *group_name)
/* NOTE: The TESTING() macro is called in main() */
/* Get a pointer to the file struct */
- if(NULL == (file_ptr = (H5F_t *)H5I_object_verify(fid, H5I_FILE)))
+ if(NULL == (file_ptr = (H5F_t *)H5VL_object_verify(fid, H5I_FILE)))
TEST_ERROR;
/* Record the number of cache entries */
@@ -627,7 +615,7 @@ check_group_layout(hid_t fid, const char *group_name)
/* Open the main group and get its tag */
if((gid1 = H5Gopen2(fid, group_name, H5P_DEFAULT)) < 0)
TEST_ERROR;
- if(NULL == (grp_ptr = (H5G_t *)H5I_object_verify(gid1, H5I_GROUP)))
+ if(NULL == (grp_ptr = (H5G_t *)H5VL_object_verify(gid1, H5I_GROUP)))
TEST_ERROR;
tag1 = grp_ptr->oloc.addr;
@@ -644,7 +632,7 @@ check_group_layout(hid_t fid, const char *group_name)
if((gid2 = H5Gopen2(gid1, subgroup_name, H5P_DEFAULT)) < 0)
TEST_ERROR;
- if(NULL == (grp_ptr = (H5G_t *)H5I_object_verify(gid2, H5I_GROUP)))
+ if(NULL == (grp_ptr = (H5G_t *)H5VL_object_verify(gid2, H5I_GROUP)))
TEST_ERROR;
tag2 = grp_ptr->oloc.addr;
@@ -710,9 +698,6 @@ error:
*
* Return: SUCCEED/FAIL
*
- * Programmer: Dana Robinson
- * Fall 2016
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -728,7 +713,7 @@ check_dset_scheme(hid_t fid, const char *dset_name)
/* NOTE: The TESTING() macro is called in main() */
/* Get a pointer to the file struct */
- if(NULL == (file_ptr = (H5F_t *)H5I_object_verify(fid, H5I_FILE)))
+ if(NULL == (file_ptr = (H5F_t *)H5VL_object_verify(fid, H5I_FILE)))
TEST_ERROR;
/* Create the data buffer */
@@ -748,7 +733,7 @@ check_dset_scheme(hid_t fid, const char *dset_name)
/* Open dataset and get the metadata tag */
if((did = H5Dopen2(fid, dset_name, H5P_DEFAULT)) < 0)
TEST_ERROR;
- if(NULL == (dset_ptr = (H5D_t *)H5I_object_verify(did, H5I_DATASET)))
+ if(NULL == (dset_ptr = (H5D_t *)H5VL_object_verify(did, H5I_DATASET)))
TEST_ERROR;
tag = dset_ptr->oloc.addr;
@@ -815,9 +800,6 @@ error:
*
* Return: SUCCEED/FAIL
*
- * Programmer: Dana Robinson
- * Spring 2016
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -873,7 +855,7 @@ check_evict_on_close_api(void)
/* ensure an invalid plist fails */
H5E_BEGIN_TRY {
- status = H5Pget_evict_on_close((hid_t)-1, &evict_on_close);
+ status = H5Pget_evict_on_close(H5I_INVALID_HID, &evict_on_close);
} H5E_END_TRY;
if(status >= 0)
FAIL_PUTS_ERROR("H5Pget_evict_on_close() accepted invalid hid_t.");
@@ -897,9 +879,6 @@ error:
*
* Return: EXIT_FAILURE/EXIT_SUCCESS
*
- * Programmer: Dana Robinson
- * Spring 2016
- *
*-------------------------------------------------------------------------
*/
int
@@ -979,7 +958,7 @@ main(void)
HDprintf("All evict-on-close tests passed.\n");
- return EXIT_SUCCESS;
+ HDexit(EXIT_SUCCESS);
error:
@@ -992,7 +971,7 @@ error:
H5Pclose(fapl_id);
} H5E_END_TRY;
- return EXIT_FAILURE;
+ HDexit(EXIT_FAILURE);
} /* end main() */
@@ -1007,9 +986,6 @@ error:
*
* Return: SUCCEED/FAIL
*
- * Programmer: Dana Robinson
- * Spring 2017
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1052,9 +1028,6 @@ error:
*
* Return: EXIT_FAILURE/EXIT_SUCCESS
*
- * Programmer: Dana Robinson
- * Spring 2016
- *
*-------------------------------------------------------------------------
*/
int
@@ -1076,14 +1049,14 @@ main(void)
HDprintf("All evict-on-close tests passed.\n");
HDprintf("Note that EoC is not supported under parallel so most tests are skipped.\n");
- return EXIT_SUCCESS;
+ HDexit(EXIT_SUCCESS);
error:
HDprintf("***** %u evict-on-close test%s FAILED! *****\n",
nerrors, nerrors > 1 ? "S" : "");
- return EXIT_FAILURE;
+ HDexit(EXIT_FAILURE);
} /* main() - parallel */
diff --git a/test/farray.c b/test/farray.c
index 383cb32..c9584b8 100644
--- a/test/farray.c
+++ b/test/farray.c
@@ -25,9 +25,10 @@
#include "H5FApkg.h" /* Fixed Arrays */
/* Other private headers that this test requires */
-#include "H5CXprivate.h" /* API Contexts */
-#include "H5Iprivate.h" /* IDs */
-#include "H5VMprivate.h" /* Vectors and arrays */
+#include "H5CXprivate.h" /* API Contexts */
+#include "H5Iprivate.h" /* IDs */
+#include "H5VMprivate.h" /* Vectors and arrays */
+#include "H5VLprivate.h" /* Virtual Object Layer */
/* Local macros */
@@ -113,121 +114,116 @@ h5_stat_size_t empty_size_g;
/*-------------------------------------------------------------------------
- * Function: init_cparam
+ * Function: init_cparam
*
- * Purpose: Initialize array creation parameter structure
+ * Purpose: Initialize array creation parameter structure
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
-static int
+static herr_t
init_cparam(H5FA_create_t *cparam, farray_test_param_t *tparam)
{
/* Wipe out background */
HDmemset(cparam, 0, sizeof(*cparam));
- cparam->cls = H5FA_CLS_TEST;
- cparam->raw_elmt_size = ELMT_SIZE;
- cparam->max_dblk_page_nelmts_bits = MAX_DBLOCK_PAGE_NELMTS_BITS;
- cparam->nelmts = tparam->nelmts;
+ cparam->cls = H5FA_CLS_TEST;
+ cparam->raw_elmt_size = ELMT_SIZE;
+ cparam->max_dblk_page_nelmts_bits = MAX_DBLOCK_PAGE_NELMTS_BITS;
+ cparam->nelmts = tparam->nelmts;
- return(0);
+ return SUCCEED;
} /* init_cparam() */
/*-------------------------------------------------------------------------
- * Function: create_file
+ * Function: create_file
*
- * Purpose: Create file and retrieve pointer to internal file object
- *
- * Return: Success: 0
- * Failure: -1
+ * Purpose: Create file and retrieve pointer to internal file object
*
+ * Return: SUCCEED/FAIL
+ *
*-------------------------------------------------------------------------
*/
-static int
-create_file(hid_t fapl, hid_t *file, H5F_t **f)
+static herr_t
+create_file(hid_t fapl_id, hid_t *fid, H5F_t **f)
{
/* Create the file to work on */
- if((*file = H5Fcreate(filename_g, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- FAIL_STACK_ERROR
+ if ((*fid = H5Fcreate(filename_g, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
- FAIL_STACK_ERROR
+ if (NULL == (*f = (H5F_t *)H5VL_object(*fid)))
+ FAIL_STACK_ERROR;
/* Ignore metadata tags in the file's cache */
- if(H5AC_ignore_tags(*f) < 0)
- FAIL_STACK_ERROR
+ if (H5AC_ignore_tags(*f) < 0)
+ FAIL_STACK_ERROR;
/* Success */
- return(0);
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* create_file() */
/*-------------------------------------------------------------------------
- * Function: check_stats
+ * Function: check_stats
*
- * Purpose: Verify stats for a fixed array
+ * Purpose: Verify stats for a fixed array
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
-static int
+static herr_t
check_stats(const H5FA_t *fa, const farray_state_t *state)
{
H5FA_stat_t farray_stats; /* Statistics about the array */
/* Get statistics for fixed array and verify they are correct */
- if(H5FA_get_stats(fa, &farray_stats) < 0)
+ if (H5FA_get_stats(fa, &farray_stats) < 0)
FAIL_STACK_ERROR
/* Compare information */
- if(farray_stats.hdr_size != state->hdr_size) {
+ if (farray_stats.hdr_size != state->hdr_size) {
HDfprintf(stdout, "farray_stats.hdr_size = %Hu, state->hdr_size = %Hu\n",
farray_stats.hdr_size, state->hdr_size);
TEST_ERROR
- } /* end if */
+ }
- if(farray_stats.dblk_size != state->dblk_size) {
+ if (farray_stats.dblk_size != state->dblk_size) {
HDfprintf(stdout, "farray_stats.dblk_size = %Hu, state->dblk_size = %Hu\n",
farray_stats.dblk_size, state->dblk_size);
TEST_ERROR
- } /* end if */
+ }
- if(farray_stats.nelmts != state->nelmts) {
+ if (farray_stats.nelmts != state->nelmts) {
HDfprintf(stdout, "farray_stats.nelmts = %Hu, state->nelmts = %Hu\n",
farray_stats.nelmts, state->nelmts);
TEST_ERROR
- } /* end if */
+ }
- /* All tests passed */
- return(0);
+ /* Success */
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* check_stats() */
/*-------------------------------------------------------------------------
- * Function: set_fa_state
- *
- * Purpose: Set the state of the Fixed Array
+ * Function: set_fa_state
*
- * Return: does not fail
+ * Purpose: Set the state of the Fixed Array
*
- * Programmer: Vailin Choi; 5th August, 2009
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
-static int
+static herr_t
set_fa_state(const H5FA_create_t *cparam, farray_state_t *state)
{
size_t dblk_page_nelmts; /* # of elements per page */
@@ -241,190 +237,190 @@ set_fa_state(const H5FA_create_t *cparam, farray_state_t *state)
state->nelmts = cparam->nelmts;
dblk_page_nelmts = (size_t)1 << cparam->max_dblk_page_nelmts_bits;
- if(state->nelmts > dblk_page_nelmts) {
- size_t npages = (size_t)(((state->nelmts + dblk_page_nelmts) - 1) / dblk_page_nelmts);
- size_t dblk_page_init_size = (npages + 7) / 8;
- hsize_t checksum_size = npages * 4;
+ if (state->nelmts > dblk_page_nelmts) {
+ size_t npages = (size_t)(((state->nelmts + dblk_page_nelmts) - 1) / dblk_page_nelmts);
+ size_t dblk_page_init_size = (npages + 7) / 8;
+ hsize_t checksum_size = npages * 4;
- state->dblk_size = DBLOCK_PREFIX + dblk_page_init_size + checksum_size +
+ state->dblk_size = DBLOCK_PREFIX + dblk_page_init_size + checksum_size +
state->nelmts * cparam->raw_elmt_size;
- } else
- state->dblk_size = DBLOCK_PREFIX + state->nelmts * cparam->raw_elmt_size;
+ }
+ else
+ state->dblk_size = DBLOCK_PREFIX + state->nelmts * cparam->raw_elmt_size;
- return(0);
+ return SUCCEED;
} /* end set_fa_state() */
/*-------------------------------------------------------------------------
- * Function: reopen_file
+ * Function: reopen_file
*
- * Purpose: Perform common "re-open" operations on file & array for testing
+ * Purpose: Perform common "re-open" operations on file & array for testing
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
static int
-reopen_file(hid_t *file, H5F_t **f, hid_t fapl,
+reopen_file(hid_t *fid, H5F_t **f, hid_t fapl_id,
H5FA_t **fa, haddr_t fa_addr, const farray_test_param_t *tparam)
{
/* Check for closing & re-opening the array */
/* (actually will close & re-open the file as well) */
- if(tparam->reopen_array) {
+ if (tparam->reopen_array) {
+
/* Close array, if given */
- if(fa && *fa) {
- if(H5FA_close(*fa) < 0)
+ if (fa && *fa) {
+ if (H5FA_close(*fa) < 0)
FAIL_STACK_ERROR
*fa = NULL;
- } /* end if */
+ }
/* Close file */
- if(*file) {
- if(H5Fclose(*file) < 0)
+ if (*fid) {
+ if (H5Fclose(*fid) < 0)
FAIL_STACK_ERROR
- *file = (-1);
+ *fid = H5I_INVALID_HID;
*f = NULL;
- } /* end if */
+ }
/* Re-open the file */
- if((*file = H5Fopen(filename_g, H5F_ACC_RDWR, fapl)) < 0)
+ if ((*fid = H5Fopen(filename_g, H5F_ACC_RDWR, fapl_id)) < 0)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
- FAIL_STACK_ERROR
+ if (NULL == (*f = (H5F_t *)H5VL_object(*fid)))
+ FAIL_STACK_ERROR;
/* Ignore metadata tags in the file's cache */
- if(H5AC_ignore_tags(*f) < 0)
+ if (H5AC_ignore_tags(*f) < 0)
FAIL_STACK_ERROR
/* Re-open array, if given */
- if(fa)
- if(NULL == (*fa = H5FA_open(*f, fa_addr, NULL)))
+ if (fa)
+ if (NULL == (*fa = H5FA_open(*f, fa_addr, NULL)))
FAIL_STACK_ERROR
- } /* end if */
+ }
/* Success */
- return(0);
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* reopen_file() */
/*-------------------------------------------------------------------------
- * Function: create_array
+ * Function: create_array
*
- * Purpose: Create a fixed array and perform initial checks
+ * Purpose: Create a fixed array and perform initial checks
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
-static int
+static herr_t
create_array(H5F_t *f, const H5FA_create_t *cparam,
H5FA_t **fa, haddr_t *fa_addr)
{
farray_state_t state; /* State of extensible array */
/* Create array */
- if(NULL == (*fa = H5FA_create(f, cparam, NULL)))
+ if (NULL == (*fa = H5FA_create(f, cparam, NULL)))
FAIL_STACK_ERROR
/* Check status of array */
- if(H5FA_get_addr(*fa, fa_addr) < 0)
+ if (H5FA_get_addr(*fa, fa_addr) < 0)
FAIL_STACK_ERROR
- if(!H5F_addr_defined(*fa_addr))
+ if (!H5F_addr_defined(*fa_addr))
TEST_ERROR
+
+ /* Check array stats */
HDmemset(&state, 0, sizeof(state));
- state.hdr_size = FA_HDR_SIZE;
- state.nelmts = cparam->nelmts;
- if(check_stats(*fa, &state))
+ state.hdr_size = FA_HDR_SIZE;
+ state.nelmts = cparam->nelmts;
+ if (check_stats(*fa, &state))
TEST_ERROR
/* Success */
- return(0);
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* create_array() */
/*-------------------------------------------------------------------------
- * Function: verify_cparam
+ * Function: verify_cparam
*
- * Purpose: Verify creation parameters are correct
+ * Purpose: Verify creation parameters are correct
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
-static int
+static herr_t
verify_cparam(const H5FA_t *fa, const H5FA_create_t *cparam)
{
H5FA_create_t test_cparam; /* Creation parameters for array */
/* Retrieve creation parameters */
HDmemset(&test_cparam, 0, sizeof(H5FA_create_t));
- if(H5FA_get_cparam_test(fa, &test_cparam) < 0)
+ if (H5FA__get_cparam_test(fa, &test_cparam) < 0)
FAIL_STACK_ERROR
/* Verify creation parameters */
- if(H5FA_cmp_cparam_test(cparam, &test_cparam))
+ if (H5FA__cmp_cparam_test(cparam, &test_cparam))
TEST_ERROR
/* Success */
- return(0);
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* verify_cparam() */
/*-------------------------------------------------------------------------
- * Function: finish
+ * Function: finish
*
- * Purpose: Close array, delete array, close file and verify that file
+ * Purpose: Close array, delete array, close file and verify that file
* is empty size
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
-static int
-finish(hid_t file, hid_t fapl, H5F_t *f, H5FA_t *fa, haddr_t fa_addr)
+static herr_t
+finish(hid_t fid, hid_t fapl_id, H5F_t *f, H5FA_t *fa, haddr_t fa_addr)
{
h5_stat_size_t file_size; /* File size, after deleting array */
/* Close the fixed array */
- if(H5FA_close(fa) < 0)
+ if (H5FA_close(fa) < 0)
FAIL_STACK_ERROR
/* Delete array */
- if(H5FA_delete(f, fa_addr, NULL) < 0)
+ if (H5FA_delete(f, fa_addr, NULL) < 0)
FAIL_STACK_ERROR
/* Close the file */
- if(H5Fclose(file) < 0)
+ if (H5Fclose(fid) < 0)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename_g, fapl)) < 0)
+ if ((file_size = h5_get_file_size(filename_g, fapl_id)) < 0)
TEST_ERROR
/* Verify the file is correct size */
- if(file_size != empty_size_g)
+ if (file_size != empty_size_g)
TEST_ERROR
/* Success */
- return(0);
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* finish() */
@@ -627,66 +623,64 @@ error:
*-------------------------------------------------------------------------
*/
static unsigned
-test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
+test_open_twice(hid_t fapl_id, H5FA_create_t *cparam, farray_test_param_t *tparam)
{
- hid_t file = -1; /* File ID */
- hid_t file2 = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- H5F_t *f2 = NULL; /* Internal file object pointer */
- H5FA_t *fa = NULL; /* Fixed array wrapper */
- H5FA_t *fa2 = NULL; /* Fixed array wrapper */
- haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fid2 = H5I_INVALID_HID; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
+ H5F_t *f2 = NULL; /* Internal file object pointer */
+ H5FA_t *fa = NULL; /* Fixed array wrapper */
+ H5FA_t *fa2 = NULL; /* Fixed array wrapper */
+ haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */
/* Create file & retrieve pointer to internal file object */
- if(create_file(fapl, &file, &f) < 0)
+ if (create_file(fapl_id, &fid, &f) < 0)
TEST_ERROR
- /*
- * Display testing message
- */
+ /* Display testing message */
TESTING("open fixed array twice");
/* Create array */
- if(create_array(f, cparam, &fa, &fa_addr) < 0)
+ if (create_array(f, cparam, &fa, &fa_addr) < 0)
TEST_ERROR
/* Open the array again, through the first file handle */
- if(NULL == (fa2 = H5FA_open(f, fa_addr, NULL)))
+ if (NULL == (fa2 = H5FA_open(f, fa_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
- if(verify_cparam(fa, cparam) < 0)
+ if (verify_cparam(fa, cparam) < 0)
TEST_ERROR
- if(verify_cparam(fa2, cparam) < 0)
+ if (verify_cparam(fa2, cparam) < 0)
TEST_ERROR
/* Close the second fixed array wrapper */
- if(H5FA_close(fa2) < 0)
+ if (H5FA_close(fa2) < 0)
FAIL_STACK_ERROR
fa2 = NULL;
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, &fa, fa_addr, tparam) < 0)
+ if (reopen_file(&fid, &f, fapl_id, &fa, fa_addr, tparam) < 0)
TEST_ERROR
/* Re-open the file */
- if((file2 = H5Freopen(file)) < 0)
+ if ((fid2 = H5Freopen(fid)) < 0)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f2 = (H5F_t *)H5I_object(file2)))
- FAIL_STACK_ERROR
+ if (NULL == (f2 = (H5F_t *)H5VL_object(fid2)))
+ FAIL_STACK_ERROR;
/* Open the fixed array through the second file handle */
- if(NULL == (fa2 = H5FA_open(f2, fa_addr, NULL)))
+ if (NULL == (fa2 = H5FA_open(f2, fa_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
- if(verify_cparam(fa, cparam) < 0)
+ if (verify_cparam(fa, cparam) < 0)
TEST_ERROR
/* Close the first extensible array wrapper */
- if(H5FA_close(fa) < 0)
+ if (H5FA_close(fa) < 0)
FAIL_STACK_ERROR
fa = NULL;
@@ -694,11 +688,11 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
/* (close before second file, to detect error on internal array header's
* shared file information)
*/
- if(H5Fclose(file) < 0)
+ if (H5Fclose(fid) < 0)
FAIL_STACK_ERROR
/* Close array, delete array, close file & verify file is empty */
- if(finish(file2, fapl, f2, fa2, fa_addr) < 0)
+ if (finish(fid2, fapl_id, f2, fa2, fa_addr) < 0)
TEST_ERROR
/* All tests passed */
@@ -708,12 +702,12 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
error:
H5E_BEGIN_TRY {
- if(fa)
+ if (fa)
H5FA_close(fa);
- if(fa2)
+ if (fa2)
H5FA_close(fa2);
- H5Fclose(file);
- H5Fclose(file2);
+ H5Fclose(fid);
+ H5Fclose(fid2);
} H5E_END_TRY;
return 1;
@@ -736,44 +730,42 @@ error:
*-------------------------------------------------------------------------
*/
static unsigned
-test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
+test_open_twice_diff(hid_t fapl_id, H5FA_create_t *cparam, farray_test_param_t *tparam)
{
- char filename_tmp[FARRAY_FILENAME_LEN]; /* Temporary file name */
- hid_t file = -1; /* File ID */
- hid_t file2 = -1; /* File ID */
- hid_t file0 = -1; /* File ID */
- hid_t file00 = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- H5F_t *f2 = NULL; /* Internal file object pointer */
- H5FA_t *fa = NULL; /* Fixed array wrapper */
- H5FA_t *fa2 = NULL; /* Fixed array wrapper */
- haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */
-
- /*
- * Display testing message
- */
+ char filename_tmp[FARRAY_FILENAME_LEN]; /* Temporary file name */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fid2 = H5I_INVALID_HID; /* File ID */
+ hid_t fid0 = H5I_INVALID_HID; /* File ID */
+ hid_t fid00 = H5I_INVALID_HID; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
+ H5F_t *f2 = NULL; /* Internal file object pointer */
+ H5FA_t *fa = NULL; /* Fixed array wrapper */
+ H5FA_t *fa2 = NULL; /* Fixed array wrapper */
+ haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */
+
+ /* Display testing message */
TESTING("open fixed array twice, through different file handles");
/* Create file & retrieve pointer to internal file object */
- if(create_file(fapl, &file, &f) < 0)
+ if (create_file(fapl_id, &fid, &f) < 0)
TEST_ERROR
/* Create array */
- if(create_array(f, cparam, &fa, &fa_addr) < 0)
+ if (create_array(f, cparam, &fa, &fa_addr) < 0)
TEST_ERROR
/* Open the array again, through the first file handle */
- if(NULL == (fa2 = H5FA_open(f, fa_addr, NULL)))
+ if (NULL == (fa2 = H5FA_open(f, fa_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
- if(verify_cparam(fa, cparam) < 0)
+ if (verify_cparam(fa, cparam) < 0)
TEST_ERROR
- if(verify_cparam(fa2, cparam) < 0)
+ if (verify_cparam(fa2, cparam) < 0)
TEST_ERROR
/* Close the second fixed array wrapper */
- if(H5FA_close(fa2) < 0)
+ if (H5FA_close(fa2) < 0)
FAIL_STACK_ERROR
fa2 = NULL;
@@ -781,15 +773,15 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa
/* (So that there is something holding the file open when the extensible
* array is closed)
*/
- if((file0 = H5Fopen(filename_g, H5F_ACC_RDWR, fapl)) < 0)
+ if ((fid0 = H5Fopen(filename_g, H5F_ACC_RDWR, fapl_id)) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, &fa, fa_addr, tparam) < 0)
+ if (reopen_file(&fid, &f, fapl_id, &fa, fa_addr, tparam) < 0)
TEST_ERROR
/* Close the first fixed array wrapper */
- if(H5FA_close(fa) < 0)
+ if (H5FA_close(fa) < 0)
FAIL_STACK_ERROR
fa = NULL;
@@ -797,44 +789,43 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa
/* (close before second file, to detect error on internal array header's
* shared file information)
*/
- if(H5Fclose(file) < 0)
+ if (H5Fclose(fid) < 0)
FAIL_STACK_ERROR
- file = -1;
+ fid = H5I_INVALID_HID;
/* Open a different file */
/* (This re-allocates the 'top' file pointer and assigns it a different
* 'shared' file pointer, making the file pointer in the fixed array's
* header stale)
*/
- h5_fixname(FILENAME[1], fapl, filename_tmp, sizeof(filename_tmp));
- if((file00 = H5Fcreate(filename_tmp, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ h5_fixname(FILENAME[1], fapl_id, filename_tmp, sizeof(filename_tmp));
+ if ((fid00 = H5Fcreate(filename_tmp, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
FAIL_STACK_ERROR
-
/* Re-open the file with the fixed array */
- if((file2 = H5Fopen(filename_g, H5F_ACC_RDWR, fapl)) < 0)
+ if ((fid2 = H5Fopen(filename_g, H5F_ACC_RDWR, fapl_id)) < 0)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f2 = (H5F_t *)H5I_object(file2)))
- FAIL_STACK_ERROR
+ if (NULL == (f2 = (H5F_t *)H5VL_object(fid2)))
+ FAIL_STACK_ERROR;
/* Open the fixed array through the second file handle */
- if(NULL == (fa2 = H5FA_open(f2, fa_addr, NULL)))
+ if (NULL == (fa2 = H5FA_open(f2, fa_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
- if(verify_cparam(fa2, cparam) < 0)
+ if (verify_cparam(fa2, cparam) < 0)
TEST_ERROR
/* Close the extra file handles */
- if(H5Fclose(file0) < 0)
+ if (H5Fclose(fid0) < 0)
FAIL_STACK_ERROR
- if(H5Fclose(file00) < 0)
+ if (H5Fclose(fid00) < 0)
FAIL_STACK_ERROR
/* Close array, delete array, close file & verify file is empty */
- if(finish(file2, fapl, f2, fa2, fa_addr) < 0)
+ if (finish(fid2, fapl_id, f2, fa2, fa_addr) < 0)
TEST_ERROR
/* All tests passed */
@@ -844,14 +835,14 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa
error:
H5E_BEGIN_TRY {
- if(fa)
+ if (fa)
H5FA_close(fa);
- if(fa2)
+ if (fa2)
H5FA_close(fa2);
- H5Fclose(file);
- H5Fclose(file2);
- H5Fclose(file0);
- H5Fclose(file00);
+ H5Fclose(fid);
+ H5Fclose(fid2);
+ H5Fclose(fid0);
+ H5Fclose(fid00);
} H5E_END_TRY;
return 1;
@@ -966,7 +957,7 @@ error:
H5FA_close(fa);
if(fa2)
H5FA_close(fa2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
@@ -1666,7 +1657,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");
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename_g, sizeof(filename_g));
@@ -1706,12 +1697,12 @@ main(void)
switch(curr_test) {
/* "Normal" testing parameters */
case FARRAY_TEST_NORMAL:
- puts("Testing with NORMAL PARAMETERS");
+ HDputs("Testing with NORMAL PARAMETERS");
break;
/* "Re-open array" testing parameters */
case FARRAY_TEST_REOPEN:
- puts("Testing with reopen array flag set");
+ HDputs("Testing with reopen array flag set");
tparam.reopen_array = FARRAY_TEST_REOPEN;
break;
@@ -1738,25 +1729,25 @@ main(void)
switch(curr_iter) {
/* "Forward" testing parameters */
case FARRAY_ITER_FW:
- puts("Testing with forward iteration");
+ HDputs("Testing with forward iteration");
tparam.fiter = &fa_iter_fw;
break;
/* "Reverse" testing parameters */
case FARRAY_ITER_RV:
- puts("Testing with reverse iteration");
+ HDputs("Testing with reverse iteration");
tparam.fiter = &fa_iter_rv;
break;
/* "Random" testing parameters */
case FARRAY_ITER_RND:
- puts("Testing with random iteration");
+ HDputs("Testing with random iteration");
tparam.fiter = &fa_iter_rnd;
break;
/* "Cyclic" testing parameters */
case FARRAY_ITER_CYC:
- puts("Testing with cyclic iteration");
+ HDputs("Testing with cyclic iteration");
tparam.fiter = &fa_iter_cyc;
break;
@@ -1772,22 +1763,26 @@ main(void)
nerrors += test_set_elmts(fapl, &cparam, &tparam, (hsize_t)tparam.nelmts, "setting all the array elements");
} /* end for */
- /* Check skipping elements */
+ /* Check skipping elements */
nerrors += test_skip_elmts(fapl, &cparam, &tparam, (hsize_t)1, TRUE, "skipping to first element");
nerrors += test_skip_elmts(fapl, &cparam, &tparam, ((hsize_t)1 << cparam.max_dblk_page_nelmts_bits), TRUE, "skipping to first element in data block page");
nerrors += test_skip_elmts(fapl, &cparam, &tparam, (hsize_t)(tparam.nelmts - 1), TRUE, "skipping to last element");
- /* Create Fixed Array of MAX_NELMTS elements */
- /*
- * MAX_NELMTS succeeds on jam and smirom.
- * The value was adjusted for linew due to the following:
- Linew failed with "H5FD_sec2_truncate(): unable to extend file properly"
- Linew failed with "H5FD_sec2_truncate(): File too large"
- */
+ /* Create Fixed Array */
+ /* MAX_NELMTS succeeds on some platforms buy may fail on others:
+ *
+ * "H5FD_sec2_truncate(): unable to extend file properly"
+ *
+ * and
+ *
+ * "H5FD_sec2_truncate(): File too large"
+ *
+ * have both been seen.
+ */
tparam.nelmts = MAX_NELMTS/17;
- init_cparam(&cparam, &tparam);
+ init_cparam(&cparam, &tparam);
- /* Set the last element in the Fixed Array */
+ /* Set the last element in the Fixed Array */
nerrors += test_skip_elmts(fapl, &cparam, &tparam, (hsize_t)(tparam.nelmts - 1), FALSE, "skipping to last element");
} /* end for */
@@ -1800,22 +1795,22 @@ main(void)
if(nerrors)
goto error;
- puts("All fixed array tests passed.");
+ HDputs("All fixed array tests passed.");
/* Clean up file used */
h5_cleanup(FILENAME, fapl);
- return 0;
+ HDexit(EXIT_SUCCESS);
error:
- puts("*** TESTS FAILED ***");
+ HDputs("*** TESTS FAILED ***");
H5E_BEGIN_TRY {
- H5Pclose(fapl);
+ H5Pclose(fapl);
} H5E_END_TRY;
if(api_ctx_pushed) H5CX_pop();
- return 1;
+ HDexit(EXIT_FAILURE);
} /* end main() */
diff --git a/test/fheap.c b/test/fheap.c
index e38d263..c7f6ff0 100644
--- a/test/fheap.c
+++ b/test/fheap.c
@@ -30,9 +30,9 @@
/* Other private headers that this test requires */
#include "H5CXprivate.h" /* API Contexts */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5VMprivate.h" /* Vectors and arrays */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5VLprivate.h" /* Virtual Object Layer */
+#include "H5VMprivate.h" /* Vectors and arrays */
/* Max. testfile name length */
#define FHEAP_FILENAME_LEN 1024
@@ -605,7 +605,7 @@ reopen_file(hid_t *file, H5F_t **f, const char *filename, hid_t fapl,
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
+ if(NULL == (*f = (H5F_t *)H5VL_object(*file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -656,7 +656,7 @@ open_heap(char *filename, hid_t fapl, const H5HF_create_t *cparam,
/* Check for deleting the entire heap */
if(tparam->del_dir != FHEAP_DEL_HEAP) {
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
+ if(NULL == (*f = (H5F_t *)H5VL_object(*file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -698,7 +698,7 @@ open_heap(char *filename, hid_t fapl, const H5HF_create_t *cparam,
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
+ if(NULL == (*f = (H5F_t *)H5VL_object(*file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -1868,7 +1868,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -1986,7 +1986,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
if(f->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE)
@@ -2032,7 +2032,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -2140,7 +2140,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
if(f->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE)
@@ -2195,7 +2195,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f2 = (H5F_t *)H5I_object(file2)))
+ if(NULL == (f2 = (H5F_t *)H5VL_object(file2)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -2314,7 +2314,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -2387,7 +2387,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -2472,7 +2472,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -2814,7 +2814,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -2857,7 +2857,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -2936,7 +2936,7 @@ test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -2990,7 +2990,7 @@ test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3037,7 +3037,7 @@ error:
H5E_BEGIN_TRY {
if(fh)
H5HF_close(fh);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_size() */
@@ -3078,7 +3078,7 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file1)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file1)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3122,7 +3122,7 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object (file1) */
- if(NULL == (f = (H5F_t *)H5I_object(file1)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file1)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3144,7 +3144,7 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
/* Get a pointer to the internal file object (file2) */
- if(NULL == (f = (H5F_t *)H5I_object(file2)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file2)))
FAIL_STACK_ERROR
/* Reopen the heap */
@@ -3216,7 +3216,7 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3325,7 +3325,7 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3425,7 +3425,7 @@ test_man_insert_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3521,7 +3521,7 @@ test_man_insert_root_mult(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3619,7 +3619,7 @@ test_man_insert_force_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_par
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3724,7 +3724,7 @@ test_man_insert_fill_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3830,7 +3830,7 @@ test_man_insert_third_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3940,7 +3940,7 @@ test_man_fill_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -4035,7 +4035,7 @@ test_man_start_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -4137,7 +4137,7 @@ test_man_fill_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -4237,7 +4237,7 @@ test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -4347,7 +4347,7 @@ test_man_fill_fourth_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -4443,7 +4443,7 @@ test_man_fill_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -4538,7 +4538,7 @@ test_man_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -4639,7 +4639,7 @@ test_man_second_direct_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhe
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -4748,7 +4748,7 @@ test_man_fill_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -4850,7 +4850,7 @@ test_man_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -4960,7 +4960,7 @@ test_man_fill_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -5067,7 +5067,7 @@ test_man_fill_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_te
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Create absolute heap */
@@ -5164,7 +5164,7 @@ test_man_start_2nd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -5272,7 +5272,7 @@ test_man_recursive_indirect_two_deep(hid_t fapl, H5HF_create_t *cparam, fheap_te
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -5374,7 +5374,7 @@ test_man_start_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -5483,7 +5483,7 @@ test_man_fill_first_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -5593,7 +5593,7 @@ test_man_fill_3rd_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -5699,7 +5699,7 @@ test_man_fill_all_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -5806,7 +5806,7 @@ test_man_start_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -5920,7 +5920,7 @@ test_man_fill_first_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -6039,7 +6039,7 @@ test_man_fill_4th_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -6150,7 +6150,7 @@ test_man_fill_all_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -6264,7 +6264,7 @@ test_man_start_5th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -6397,7 +6397,7 @@ test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -6549,7 +6549,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -6590,7 +6590,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -6712,7 +6712,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -6753,7 +6753,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -6904,7 +6904,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -6945,7 +6945,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -7072,7 +7072,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -7113,7 +7113,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -7315,7 +7315,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -7356,7 +7356,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -7613,7 +7613,7 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -13774,7 +13774,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -14950,7 +14950,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -15135,7 +15135,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -15199,7 +15199,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -15235,7 +15235,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -15272,7 +15272,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -15308,7 +15308,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -15946,7 +15946,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -16013,7 +16013,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -16177,7 +16177,7 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -16207,7 +16207,7 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
diff --git a/test/file_image.c b/test/file_image.c
index 12f0a18..0dba236 100644
--- a/test/file_image.c
+++ b/test/file_image.c
@@ -579,7 +579,8 @@ test_core(void)
reset_udata(udata);
file = H5Fopen(copied_filename, H5F_ACC_RDONLY, fapl);
VERIFY(file >= 0, "H5Fopen failed");
- VERIFY(udata->used_callbacks == MALLOC, "opening a core file used the wrong callbacks");
+ VERIFY((udata->used_callbacks == MALLOC) ||
+ (udata->used_callbacks == MALLOC | UDATA_COPY | UDATA_FREE), "opening a core file used the wrong callbacks");
VERIFY(udata->malloc_src == H5FD_FILE_IMAGE_OP_FILE_OPEN, "Malloc callback came from wrong sourc in core open");
/* Close file */
diff --git a/test/fillval.c b/test/fillval.c
index 8c8e902..5b95de9 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -762,15 +762,17 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
comp_datatype *buf_c=NULL;
H5D_space_status_t allocation;
- if(datatype==H5T_INTEGER)
+ if(datatype == H5T_INTEGER) {
fillval = *(int*)_fillval;
- else if(datatype==H5T_COMPOUND) {
- fill_c.a=((comp_datatype*)_fillval)->a;
+ }
+ else if(datatype == H5T_COMPOUND) {
+ fill_c.a=((comp_datatype*)_fillval)->a;
fill_c.x=((comp_datatype*)_fillval)->x;
fill_c.y=((comp_datatype*)_fillval)->y;
fill_c.z=((comp_datatype*)_fillval)->z;
- } else {
- puts("Invalid type for test");
+ }
+ else {
+ HDputs("Invalid type for test");
goto error;
}
@@ -806,7 +808,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
goto error;
}
/* case for compound datatype */
- } else if(datatype==H5T_COMPOUND) {
+ }
+ else if(datatype==H5T_COMPOUND) {
if(H5Dread(dset2, ctype_id, mspace, fspace, H5P_DEFAULT,
&rd_c) < 0) goto error;
if(fill_time != H5D_FILL_TIME_NEVER && (!H5_FLT_ABS_EQUAL(rd_c.a, fill_c.a) ||
@@ -828,10 +831,10 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
/* Select all odd data locations in the file dataset */
for (i=0, nelmts=1; i<5; i++) {
- hs_size[i] = cur_size[i]/2;
- hs_offset[i] = 0;
- hs_stride[i] = 2;
- nelmts *= hs_size[i];
+ hs_size[i] = cur_size[i]/2;
+ hs_offset[i] = 0;
+ hs_stride[i] = 2;
+ nelmts *= hs_size[i];
}
if((mspace=H5Screate_simple(5, hs_size, hs_size)) < 0) goto error;
if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, hs_stride,
@@ -1089,17 +1092,23 @@ test_rdwr(hid_t fapl, const char *base_name, H5D_layout_t layout)
}
h5_fixname(base_name, fapl, filename, sizeof filename);
- if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
goto error;
- if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if(H5D_CHUNKED==layout) {
- if(H5Pset_chunk(dcpl, 5, ch_size) < 0) goto error;
- } else if(H5D_COMPACT==layout) {
- if(H5Pset_layout(dcpl, H5D_COMPACT) < 0) goto error;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ goto error;
+
+ if(H5D_CHUNKED == layout) {
+ if(H5Pset_chunk(dcpl, 5, ch_size) < 0)
+ goto error;
+ }
+ else if(H5D_COMPACT == layout) {
+ if(H5Pset_layout(dcpl, H5D_COMPACT) < 0)
+ goto error;
}
- if((ctype_id=create_compound_type()) < 0) goto error;
+ if((ctype_id = create_compound_type()) < 0)
+ goto error;
/* I. Test H5D_ALLOC_TIME_LATE space allocation cases */
if(H5D_COMPACT != layout) {
@@ -2359,8 +2368,6 @@ test_partalloc(hid_t fapl, const char *base_name)
* Programmer: Robb Matzke
* Thursday, October 1, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
@@ -2380,8 +2387,8 @@ main(int argc, char *argv[])
else if(!strcmp(argv[argno], "compact"))
test_compact =1;
else {
- fprintf(stderr, "usage: %s [contiguous] [chunked] [compact]\n", argv[0]);
- exit(EXIT_FAILURE);
+ HDfprintf(stderr, "usage: %s [contiguous] [chunked] [compact]\n", argv[0]);
+ HDexit(EXIT_FAILURE);
}
} /* end for */
} /* end if */
@@ -2444,15 +2451,15 @@ main(int argc, char *argv[])
if(nerrors)
goto error;
- puts("All fill value tests passed.");
+ HDputs("All fill value tests passed.");
if(h5_cleanup(FILENAME, fapl))
HDremove(FILE_NAME_RAW);
- return 0;
+ HDexit(EXIT_SUCCESS);
error:
- puts("***** FILL VALUE TESTS FAILED *****");
- return 1;
+ HDputs("***** FILL VALUE TESTS FAILED *****");
+ HDexit(EXIT_FAILURE);
}
diff --git a/test/flush1.c b/test/flush1.c
index bdbd731..fefa8d0 100644
--- a/test/flush1.c
+++ b/test/flush1.c
@@ -209,7 +209,7 @@ main(void)
/* Check if the current VFD supports SWMR */
driver = HDgetenv("HDF5_DRIVER");
- vfd_supports_swmr = H5FD_supports_swmr_test(driver);
+ vfd_supports_swmr = H5FD__supports_swmr_test(driver);
/*************************************************/
/* NOTE: Not closing the file ID is intentional! */
diff --git a/test/flush2.c b/test/flush2.c
index 9fdf6c1..6e8aee7 100644
--- a/test/flush2.c
+++ b/test/flush2.c
@@ -258,7 +258,7 @@ main(void)
/* Check if the current VFD supports SWMR */
driver = HDgetenv("HDF5_DRIVER");
- vfd_supports_swmr = H5FD_supports_swmr_test(driver);
+ vfd_supports_swmr = H5FD__supports_swmr_test(driver);
/* TEST 1 */
/* Check the case where the file was flushed */
diff --git a/test/flushrefresh.c b/test/flushrefresh.c
index 4196d85..92c9f87 100644
--- a/test/flushrefresh.c
+++ b/test/flushrefresh.c
@@ -130,7 +130,7 @@ herr_t end_verification(void);
* it will time out waiting for a signal from the test script
* which will never come.
*
- * Return: 0 on Success, 1 on Failure
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Mike McGreevy
* July 1, 2010
@@ -155,7 +155,7 @@ int main(int argc, const char *argv[])
/* Determine driver being used */
envval = HDgetenv("HDF5_DRIVER");
- if(envval == NULL || H5FD_supports_swmr_test(envval)) {
+ if(envval == NULL || H5FD__supports_swmr_test(envval)) {
if(test_flush() != SUCCEED) TEST_ERROR;
if(test_refresh() != SUCCEED) TEST_ERROR;
} /* end if */
@@ -166,23 +166,26 @@ int main(int argc, const char *argv[])
if(end_verification() < 0) TEST_ERROR;
if(end_verification() < 0) TEST_ERROR;
} /* end else */
- } else if(argc == 3) {
+ }
+ else if(argc == 3) {
/* Two arguments supplied. Pass them to flush verification routine. */
if(flush_verification(argv[1], argv[2]) != 0) PROCESS_ERROR;
- } else if(argc == 2) {
+ }
+ else if(argc == 2) {
/* One argument supplied. Pass it to refresh verification routine. */
if(refresh_verification(argv[1]) != 0) PROCESS_ERROR;
- } else {
+ }
+ else {
/* Illegal number of arguments supplied. Error. */
HDfprintf(stderr, "Error. %d is an Invalid number of arguments to main().\n", argc);
PROCESS_ERROR
} /* end if */
- return SUCCEED;
+ return EXIT_SUCCESS;
error:
/* Return */
- return FAIL;
+ return EXIT_FAILURE;
} /* main */
@@ -695,7 +698,6 @@ herr_t test_refresh(void)
/* ================= */
/* Refresh Datatypes */
/* ================= */
-
TESTING("to ensure that H5Trefresh correctly refreshes single datatypes");
/* Verify First Committed Datatype can be refreshed with H5Trefresh */
@@ -715,7 +717,6 @@ herr_t test_refresh(void)
if(H5Oflush(tid2) < 0) TEST_ERROR;
if(end_refresh_verification_process() != 0) TEST_ERROR;
-
PASSED();
/* =============== */
@@ -995,7 +996,7 @@ herr_t refresh_verification(const char * obj_pathname)
check to ensure we didn't erroneously flush the attribute before
starting the verification. */
if(flushed_oinfo.num_attrs != 0)
- PROCESS_ERROR;
+ PROCESS_ERROR;
/* Send Signal to MAIN PROCESS indicating that it can go ahead and modify the
object. */
@@ -1027,55 +1028,57 @@ herr_t refresh_verification(const char * obj_pathname)
* test cases is easy). */
do {
- if((HDstrcmp(obj_pathname, D1) == 0) || (HDstrcmp(obj_pathname, D2) == 0)) {
- if(H5Drefresh(oid) < 0) PROCESS_ERROR;
- } /* end if */
- else if((HDstrcmp(obj_pathname, G1) == 0) || (HDstrcmp(obj_pathname, G2) == 0)) {
- if(H5Grefresh(oid) < 0) PROCESS_ERROR;
- } /* end if */
- else if((HDstrcmp(obj_pathname, T1) == 0) || (HDstrcmp(obj_pathname, T2) == 0)) {
- if(H5Trefresh(oid) < 0) PROCESS_ERROR;
- } /* end if */
- else if((HDstrcmp(obj_pathname, D3) == 0) || (HDstrcmp(obj_pathname, G3) == 0) ||
+ if((HDstrcmp(obj_pathname, D1) == 0) || (HDstrcmp(obj_pathname, D2) == 0)) {
+ if(H5Drefresh(oid) < 0) PROCESS_ERROR;
+ } /* end if */
+ else if((HDstrcmp(obj_pathname, G1) == 0) || (HDstrcmp(obj_pathname, G2) == 0)) {
+ if(H5Grefresh(oid) < 0) PROCESS_ERROR;
+ } /* end if */
+ else if((HDstrcmp(obj_pathname, T1) == 0) || (HDstrcmp(obj_pathname, T2) == 0)) {
+ if(H5Trefresh(oid) < 0) PROCESS_ERROR;
+ } /* end if */
+ else if((HDstrcmp(obj_pathname, D3) == 0) || (HDstrcmp(obj_pathname, G3) == 0) ||
(HDstrcmp(obj_pathname, T3) == 0)) {
- if(H5Orefresh(oid) < 0) PROCESS_ERROR;
- } /* end if */
- else {
- HDfprintf(stdout, "Error. %s is an unrecognized object.\n", obj_pathname);
- PROCESS_ERROR;
- } /* end else */
-
- /* Get object info. This should now accurately reflect the refreshed object on disk. */
- if((status = H5Oget_info2(oid, &refreshed_oinfo, H5O_INFO_BASIC|H5O_INFO_NUM_ATTRS|H5O_INFO_HDR)) < 0) PROCESS_ERROR;
-
- /* Confirm following (first 4) attributes are the same: */
- /* Confirm following (last 4) attributes are different */
- if( (flushed_oinfo.addr == refreshed_oinfo.addr) &&
- (flushed_oinfo.type == refreshed_oinfo.type) &&
- (flushed_oinfo.hdr.version == refreshed_oinfo.hdr.version) &&
- (flushed_oinfo.hdr.flags == refreshed_oinfo.hdr.flags) &&
- (flushed_oinfo.num_attrs != refreshed_oinfo.num_attrs) &&
- (flushed_oinfo.hdr.nmesgs != refreshed_oinfo.hdr.nmesgs) &&
- (flushed_oinfo.hdr.nchunks != refreshed_oinfo.hdr.nchunks) &&
- (flushed_oinfo.hdr.space.total != refreshed_oinfo.hdr.space.total) ) {
- ok = TRUE;
- break;
- }
- if(tries == sleep_tries)
- HDsleep(1);
+ if(H5Orefresh(oid) < 0) PROCESS_ERROR;
+ } /* end if */
+ else {
+ HDfprintf(stdout, "Error. %s is an unrecognized object.\n", obj_pathname);
+ PROCESS_ERROR;
+ } /* end else */
+
+ /* Get object info. This should now accurately reflect the refreshed object on disk. */
+ if((status = H5Oget_info2(oid, &refreshed_oinfo, H5O_INFO_BASIC|H5O_INFO_NUM_ATTRS|H5O_INFO_HDR)) < 0)
+ PROCESS_ERROR;
+
+ /* Confirm following (first 4) attributes are the same: */
+ /* Confirm following (last 4) attributes are different */
+ if( (flushed_oinfo.addr == refreshed_oinfo.addr) &&
+ (flushed_oinfo.type == refreshed_oinfo.type) &&
+ (flushed_oinfo.hdr.version == refreshed_oinfo.hdr.version) &&
+ (flushed_oinfo.hdr.flags == refreshed_oinfo.hdr.flags) &&
+ (flushed_oinfo.num_attrs != refreshed_oinfo.num_attrs) &&
+ (flushed_oinfo.hdr.nmesgs != refreshed_oinfo.hdr.nmesgs) &&
+ (flushed_oinfo.hdr.nchunks != refreshed_oinfo.hdr.nchunks) &&
+ (flushed_oinfo.hdr.space.total != refreshed_oinfo.hdr.space.total) ) {
+ ok = TRUE;
+ break;
+ }
+
+ if(tries == sleep_tries)
+ HDsleep(1);
} while(--tries);
-
+
if(!ok) {
- printf("FLUSHED: num_attrs=%d, nmesgs=%d, nchunks=%d, total=%d\n",
- (int)flushed_oinfo.num_attrs, (int)flushed_oinfo.hdr.nmesgs,
- (int)flushed_oinfo.hdr.nchunks, (int)flushed_oinfo.hdr.space.total);
- printf("REFRESHED: num_attrs=%d, nmesgs=%d, nchunks=%d, total=%d\n",
- (int)refreshed_oinfo.num_attrs, (int)refreshed_oinfo.hdr.nmesgs,
- (int)refreshed_oinfo.hdr.nchunks, (int)refreshed_oinfo.hdr.space.total);
- PROCESS_ERROR;
+ HDprintf("FLUSHED: num_attrs=%d, nmesgs=%d, nchunks=%d, total=%d\n",
+ (int)flushed_oinfo.num_attrs, (int)flushed_oinfo.hdr.nmesgs,
+ (int)flushed_oinfo.hdr.nchunks, (int)flushed_oinfo.hdr.space.total);
+ HDprintf("REFRESHED: num_attrs=%d, nmesgs=%d, nchunks=%d, total=%d\n",
+ (int)refreshed_oinfo.num_attrs, (int)refreshed_oinfo.hdr.nmesgs,
+ (int)refreshed_oinfo.hdr.nchunks, (int)refreshed_oinfo.hdr.space.total);
+ PROCESS_ERROR;
}
-
+
/* Close objects */
if(H5Oclose(oid) < 0) PROCESS_ERROR;
if(H5Fclose(fid) < 0) PROCESS_ERROR;
diff --git a/test/freespace.c b/test/freespace.c
index 33a6f89..947b2ce 100644
--- a/test/freespace.c
+++ b/test/freespace.c
@@ -24,8 +24,9 @@
#define H5F_FRIEND /*suppress error about including H5Fpkg */
#include "H5Fpkg.h"
-#include "H5CXprivate.h" /* API Contexts */
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Iprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
#include "H5VMprivate.h"
#define FILENAME_LEN 1024
@@ -480,7 +481,7 @@ test_fs_create(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* initialize creation parameters for free-space manager */
@@ -496,7 +497,7 @@ test_fs_create(hid_t fapl)
if(!H5F_addr_defined(fs_addr))
TEST_ERROR
- if (frsp->nclasses != nclasses)
+ if(frsp->nclasses != nclasses)
TEST_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -504,9 +505,9 @@ test_fs_create(hid_t fapl)
TEST_ERROR
HDmemset(&test_cparam, 0, sizeof(H5FS_create_t));
- if(H5FS_get_cparam_test(frsp, &test_cparam) < 0)
+ if(H5FS__get_cparam_test(frsp, &test_cparam) < 0)
FAIL_STACK_ERROR
- if (H5FS_cmp_cparam_test(&cparam, &test_cparam))
+ if(H5FS__cmp_cparam_test(&cparam, &test_cparam))
FAIL_STACK_ERROR
/* Close the free space manager */
@@ -622,7 +623,7 @@ test_fs_sect_add(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -686,7 +687,7 @@ test_fs_sect_add(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -756,7 +757,7 @@ test_fs_sect_add(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
TEST_set_eoa((haddr_t)TEST_SECT_ADDR150); /* set end of file address for shrinking */
@@ -825,7 +826,7 @@ test_fs_sect_add(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
TEST_set_eoa((haddr_t)TEST_SECT_ADDR150); /* set end of file address for shrinking */
@@ -946,7 +947,7 @@ test_fs_sect_find(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -1334,7 +1335,7 @@ test_fs_sect_merge(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -1464,7 +1465,7 @@ test_fs_sect_merge(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -1566,7 +1567,7 @@ test_fs_sect_merge(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -1801,7 +1802,7 @@ test_fs_sect_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -1857,14 +1858,14 @@ test_fs_sect_shrink(hid_t fapl)
* Re-add section A that allow shrinking and its section class type defines "can_shrink"
*/
if(NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
can_shrink = FALSE;
if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* should have nothing in free-space */
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -1875,18 +1876,18 @@ test_fs_sect_shrink(hid_t fapl)
/* section A should not be there in free-space */
if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if (node_found) TEST_ERROR
/* Close the free space manager */
if(H5FS_close(f, frsp) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
if(H5FS_delete(f, fs_addr) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
/* Close the file */
@@ -1903,7 +1904,7 @@ test_fs_sect_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -2004,7 +2005,7 @@ test_fs_sect_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -2082,7 +2083,7 @@ test_fs_sect_shrink(hid_t fapl)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
- /* Close the file and dxpl */
+ /* Close the file */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -2142,7 +2143,7 @@ test_fs_sect_change_class(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -2251,7 +2252,7 @@ test_fs_sect_change_class(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -2357,7 +2358,7 @@ test_fs_sect_change_class(hid_t fapl)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
- /* Close the file and dxpl */
+ /* Close the file */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -2433,7 +2434,7 @@ test_fs_sect_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Tag with the global free space tag */
@@ -2787,7 +2788,7 @@ test_fs_sect_iterate(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -2861,14 +2862,8 @@ main(void)
{
hid_t fapl = -1; /* File access property list for data files */
unsigned nerrors = 0; /* Cumulative error count */
- const char *env_h5_drvr = NULL; /* File Driver value from environment */
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
- /* Get the VFD to use */
- env_h5_drvr = HDgetenv("HDF5_DRIVER");
- if(env_h5_drvr == NULL)
- env_h5_drvr = "nomatch";
-
h5_reset();
if((fapl = h5_fileaccess()) < 0) {
diff --git a/test/genall5.c b/test/genall5.c
index 37bab7a..4cc0a2d 100644
--- a/test/genall5.c
+++ b/test/genall5.c
@@ -12,11 +12,11 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Programmer: John Mainzer
- * 9/23/15
+ * 9/23/15
*
- * This file contains a heavily edited and functionaly reduce
- * version of the test code first written by Quincey in a file
- * of the same name.
+ * This file contains a heavily edited and functionaly reduce
+ * version of the test code first written by Quincey in a file
+ * of the same name.
*/
#include "cache_common.h"
@@ -32,7 +32,7 @@
* Function: ns_grp_0
*
* Purpose: Create an empty "new style" group at the specified location
- * in the specified file.
+ * in the specified file.
*
* If pass is false on entry, do nothing.
*
@@ -48,70 +48,59 @@
*/
void
-ns_grp_0(hid_t fid, const char *group_name)
-{
+ns_grp_0(hid_t fid, const char *group_name) {
hid_t gid = -1;
hid_t gcpl = -1;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Pcreate(H5P_GROUP_CREATE);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_0: H5Pcreate() failed";
- }
- assert(gcpl > 0);
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_0: H5Pcreate() failed";
+ }
+ HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pset_link_creation_order(gcpl, H5P_CRT_ORDER_TRACKED);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_0: H5Pset_link_creation_order() failed";
- }
- assert(ret >= 0);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_0: H5Pset_link_creation_order() failed";
+ }
+ HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, gcpl, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_0: H5Gcreate2() failed";
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_0: H5Gcreate2() failed";
}
- assert(gid > 0);
+ HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_0: H5Pclose(gcpl) failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_0: H5Pclose(gcpl) failed";
}
- assert(ret >= 0);
+ HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_0: H5Gclose(gid) failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_0: H5Gclose(gid) failed";
}
- assert(ret >= 0);
+ HDassert(ret >= 0);
}
return;
@@ -138,97 +127,81 @@ ns_grp_0(hid_t fid, const char *group_name)
*-------------------------------------------------------------------------
*/
-void vrfy_ns_grp_0(hid_t fid, const char *group_name)
-{
+void vrfy_ns_grp_0(hid_t fid, const char *group_name) {
hid_t gid = -1;
hid_t gcpl = -1;
H5G_info_t grp_info;
unsigned crt_order_flags = 0;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_0: H5Gopen2() failed";
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_0: H5Gopen2() failed";
}
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Gget_create_plist(gid);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_0: H5Gget_create_plist() failed";
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_0: H5Gget_create_plist() failed";
}
HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_0: H5Pget_link_creation_order() failed";
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_0: H5Pget_link_creation_order() failed";
}
- else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_0: H5P_CRT_ORDER_TRACKED != crt_order_flags";
+ else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags) {
+ pass = FALSE;
+ failure_mssg =
+ "vrfy_ns_grp_0: H5P_CRT_ORDER_TRACKED != crt_order_flags";
}
HDassert(ret >= 0);
HDassert(H5P_CRT_ORDER_TRACKED == crt_order_flags);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_0: H5Pclose() failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_0: H5Pclose() failed";
}
HDassert(ret >= 0);
}
- if ( pass ) {
-
- memset(&grp_info, 0, sizeof(grp_info));
+ if (pass) {
+ HDmemset(&grp_info, 0, sizeof(grp_info));
ret = H5Gget_info(gid, &grp_info);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: H5Gget_info() failed";
}
- else if ( H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type ) {
-
+ else if (H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_0: H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type";
+ failure_mssg =
+ "vrfy_ns_grp_0: H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type";
}
- else if ( 0 != grp_info.nlinks ) {
-
+ else if (0 != grp_info.nlinks) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: 0 != grp_info.nlinks";
}
- else if ( 0 != grp_info.max_corder ) {
-
+ else if (0 != grp_info.max_corder) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: 0 != grp_info.max_corder";
}
- else if ( FALSE != grp_info.mounted ) {
-
+ else if ( FALSE != grp_info.mounted) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: FALSE != grp_info.mounted";
}
@@ -240,12 +213,10 @@ void vrfy_ns_grp_0(hid_t fid, const char *group_name)
HDassert(false == grp_info.mounted);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: H5Gclose() failed";
}
@@ -253,15 +224,14 @@ void vrfy_ns_grp_0(hid_t fid, const char *group_name)
}
return;
-
} /* vrfy_ns_grp_0() */
/*-------------------------------------------------------------------------
* Function: ns_grp_c
*
- * Purpose: Create a compact "new style" group, with 'nlinks'
- * soft/hard/external links in it in the specified file.
+ * Purpose: Create a compact "new style" group, with 'nlinks'
+ * soft/hard/external links in it in the specified file.
*
* If pass is false on entry, do nothing.
*
@@ -276,68 +246,57 @@ void vrfy_ns_grp_0(hid_t fid, const char *group_name)
*-------------------------------------------------------------------------
*/
-void
-ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
-{
+void
+ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
hid_t gid = -1;
hid_t gcpl = -1;
unsigned max_compact;
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Pcreate(H5P_GROUP_CREATE);
- if ( gcpl <= 0 ) {
-
+ if (gcpl <= 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Pcreate(H5P_GROUP_CREATE) failed";
}
HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pset_link_creation_order(gcpl, H5P_CRT_ORDER_TRACKED);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Pset_link_creation_order() failed";
}
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, gcpl, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
+ if (gid <= 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Gcreate2() failed";
}
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
max_compact = 0;
ret = H5Pget_link_phase_change(gcpl, &max_compact, NULL);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Pget_link_phase_change() failed";
}
- else if ( nlinks <= 0 ) {
-
+ else if (nlinks <= 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: nlinks <= 0";
}
- else if ( nlinks >= max_compact ) {
-
+ else if (nlinks >= max_compact) {
pass = FALSE;
failure_mssg = "ns_grp_c: nlinks >= max_compact";
}
@@ -348,72 +307,59 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
}
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
-
+ while ((pass) && (u < nlinks)) {
char linkname[16];
- sprintf(linkname, "%u", u);
-
- if(0 == (u % 3)) {
-
- ret = H5Lcreate_soft(group_name, gid, linkname, H5P_DEFAULT,
- H5P_DEFAULT);
+ HDsprintf(linkname, "%u", u);
- if ( ret < 0 ) {
+ if (0 == (u % 3)) {
+ ret = H5Lcreate_soft(group_name, gid, linkname, H5P_DEFAULT, H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Lcreate_soft() failed";
}
HDassert(ret >= 0);
} /* end if */
- else if(1 == (u % 3)) {
-
- ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT,
- H5P_DEFAULT);
-
- if ( ret < 0 ) {
+ else if (1 == (u % 3)) {
+ ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT,
+ H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Lcreate_hard() failed";
}
HDassert(ret >= 0);
} /* end else-if */
else {
-
HDassert(2 == (u % 3));
- ret = H5Lcreate_external("external.h5", "/ext", gid, linkname,
- H5P_DEFAULT, H5P_DEFAULT);
-
- if ( ret < 0 ) {
+ ret = H5Lcreate_external("external.h5", "/ext", gid, linkname,
+ H5P_DEFAULT, H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Lcreate_external() failed";
}
HDassert(ret >= 0);
} /* end else */
- u++;
-
+ u++;
} /* end while() */
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Pclose(gcpl) failed";
}
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Gclose(gid) failed";
}
@@ -428,8 +374,8 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
/*-------------------------------------------------------------------------
* Function: vrfy_ns_grp_c
*
- * Purpose: Verify a compact "new style" group, with 'nlinks'
- * soft/hard/external links in it in the specified file.
+ * Purpose: Verify a compact "new style" group, with 'nlinks'
+ * soft/hard/external links in it in the specified file.
*
* If pass is false on entry, do nothing.
*
@@ -445,8 +391,7 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
*/
void
-vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
-{
+vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
hid_t gid = -1;
hid_t gcpl = -1;
H5G_info_t grp_info;
@@ -454,89 +399,73 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
+ if (gid <= 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Gopen2() failed";
}
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Gget_create_plist(gid);
- if ( gcpl <= 0 ) {
-
+ if (gcpl <= 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Gget_create_plist(gid) failed";
}
- assert(gcpl > 0);
+ HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Pget_link_creation_order() failed";
}
- else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags ) {
-
+ else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: H5P_CRT_ORDER_TRACKED != crt_order_flags";
+ failure_mssg = "vrfy_ns_grp_c: H5P_CRT_ORDER_TRACKED != crt_order_flags";
}
HDassert(ret >= 0);
HDassert(H5P_CRT_ORDER_TRACKED == crt_order_flags);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Pclose() failed";
}
HDassert(ret >= 0);
}
- if ( pass ) {
-
- memset(&grp_info, 0, sizeof(grp_info));
+ if (pass) {
+ HDmemset(&grp_info, 0, sizeof(grp_info));
ret = H5Gget_info(gid, &grp_info);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Gget_info() failed";
}
- else if ( H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type ) {
-
+ else if (H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type";
+ failure_mssg =
+ "vrfy_ns_grp_c: H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type";
}
- else if ( nlinks != grp_info.nlinks ) {
-
+ else if (nlinks != grp_info.nlinks) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: nlinks != grp_info.nlinks";
}
- else if ( nlinks != grp_info.max_corder ) {
-
+ else if (nlinks != grp_info.max_corder) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: nlinks != grp_info.max_corder";
}
- else if ( FALSE != grp_info.mounted ) {
-
+ else if ( FALSE != grp_info.mounted) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: FALSE != grp_info.mounted";
}
@@ -549,42 +478,36 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
}
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
-
+ while ((pass) && (u < nlinks)) {
H5L_info_t lnk_info;
char linkname[16];
htri_t link_exists;
- sprintf(linkname, "%u", u);
+ HDsprintf(linkname, "%u", u);
link_exists = H5Lexists(gid, linkname, H5P_DEFAULT);
- if ( link_exists < 0 ) {
-
+ if (link_exists < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lexists() failed";
}
HDassert(link_exists >= 0);
- memset(&lnk_info, 0, sizeof(grp_info));
+ HDmemset(&lnk_info, 0, sizeof(grp_info));
ret = H5Lget_info(gid, linkname, &lnk_info, H5P_DEFAULT);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lget_info() failed";
}
- else if ( TRUE != lnk_info.corder_valid ) {
-
+ else if ( TRUE != lnk_info.corder_valid) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: TRUE != lnk_info.corder_valid";
}
- else if ( u != lnk_info.corder ) {
-
+ else if (u != lnk_info.corder) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: u != lnk_info.corder";
}
- else if ( H5T_CSET_ASCII != lnk_info.cset ) {
-
+ else if (H5T_CSET_ASCII != lnk_info.cset) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5T_CSET_ASCII != lnk_info.cset";
}
@@ -593,75 +516,62 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
HDassert(u == lnk_info.corder);
HDassert(H5T_CSET_ASCII == lnk_info.cset);
- if ( 0 == (u % 3) ) {
-
+ if (0 == (u % 3)) {
char *slinkval;
- if ( H5L_TYPE_SOFT != lnk_info.type ) {
-
+ if (H5L_TYPE_SOFT != lnk_info.type) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5L_TYPE_SOFT != lnk_info.type";
}
- else if ( (strlen(group_name) + 1) != lnk_info.u.val_size ) {
-
+ else if ((HDstrlen(group_name) + 1) != lnk_info.u.val_size) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: (strlen(group_name) + 1) != lnk_info.u.val_size";
+ failure_mssg = "vrfy_ns_grp_c: (HDstrlen(group_name) + 1) != lnk_info.u.val_size";
}
HDassert(H5L_TYPE_SOFT == lnk_info.type);
- HDassert((strlen(group_name) + 1) == lnk_info.u.val_size);
+ HDassert((HDstrlen(group_name) + 1) == lnk_info.u.val_size);
- slinkval = (char *)malloc(lnk_info.u.val_size);
-
- if ( ! slinkval ) {
+ slinkval = (char *) HDmalloc(lnk_info.u.val_size);
+ if (!slinkval) {
pass = FALSE;
- failure_mssg = "vrfy_ns_grp_c: malloc of slinkval failed";
+ failure_mssg = "vrfy_ns_grp_c: HDmalloc of slinkval failed";
}
HDassert(slinkval);
- ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
- if ( ret < 0 ) {
-
+ ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
+ H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lget_val() failed";
}
- else if ( 0 != strcmp(slinkval, group_name) ) {
-
+ else if (0 != HDstrcmp(slinkval, group_name)) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: 0 != strcmp(slinkval, group_name)";
+ failure_mssg = "vrfy_ns_grp_c: 0 != HDstrcmp(slinkval, group_name)";
}
HDassert(ret >= 0);
- HDassert(0 == strcmp(slinkval, group_name));
+ HDassert(0 == HDstrcmp(slinkval, group_name));
- free(slinkval);
+ HDfree(slinkval);
} /* end if */
- else if(1 == (u % 3)) {
-
+ else if (1 == (u % 3)) {
H5O_info_t root_oinfo;
- if ( H5L_TYPE_HARD != lnk_info.type ) {
-
+ if (H5L_TYPE_HARD != lnk_info.type) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5L_TYPE_HARD != lnk_info.type";
}
HDassert(H5L_TYPE_HARD == lnk_info.type);
- memset(&root_oinfo, 0, sizeof(root_oinfo));
+ HDmemset(&root_oinfo, 0, sizeof(root_oinfo));
ret = H5Oget_info2(fid, &root_oinfo, H5O_INFO_BASIC);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Oget_info() failed.";
}
- else if ( root_oinfo.addr != lnk_info.u.address ) {
-
+ else if (root_oinfo.addr != lnk_info.u.address) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: root_oinfo.addr != lnk_info.u.address";
+ failure_mssg = "vrfy_ns_grp_c: root_oinfo.addr != lnk_info.u.address";
}
HDassert(ret >= 0);
HDassert(root_oinfo.addr == lnk_info.u.address);
@@ -673,83 +583,70 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
HDassert(2 == (u % 3));
- if ( H5L_TYPE_EXTERNAL != lnk_info.type ) {
-
+ if (H5L_TYPE_EXTERNAL != lnk_info.type) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: H5L_TYPE_EXTERNAL != lnk_info.type";
+ failure_mssg = "vrfy_ns_grp_c: H5L_TYPE_EXTERNAL != lnk_info.type";
}
HDassert(H5L_TYPE_EXTERNAL == lnk_info.type);
- elinkval = malloc(lnk_info.u.val_size);
-
- if ( ! elinkval ) {
+ elinkval = HDmalloc(lnk_info.u.val_size);
+ if (!elinkval) {
pass = FALSE;
- failure_mssg = "vrfy_ns_grp_c: malloc of elinkval failed.";
+ failure_mssg = "vrfy_ns_grp_c: HDmalloc of elinkval failed.";
}
HDassert(elinkval);
- ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
- if ( ret < 0 ) {
-
+ ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size,
+ H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lget_val() failed.";
}
HDassert(ret >= 0);
- ret = H5Lunpack_elink_val(elinkval, lnk_info.u.val_size,
- NULL, &file, &path);
- if ( ret < 0 ) {
-
+ ret = H5Lunpack_elink_val(elinkval, lnk_info.u.val_size, NULL, &file, &path);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lunpack_elink_val() failed.";
}
- else if ( 0 != strcmp(file, "external.h5") ) {
-
+ else if (0 != HDstrcmp(file, "external.h5")) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: 0 != strcmp(file, \"external.h5\")";
+ failure_mssg = "vrfy_ns_grp_c: 0 != HDstrcmp(file, \"external.h5\")";
}
- else if ( 0 != strcmp(path, "/ext") ) {
-
+ else if (0 != HDstrcmp(path, "/ext")) {
pass = FALSE;
- failure_mssg = "vrfy_ns_grp_c: 0 != strcmp(path, \"/ext\")";
+ failure_mssg = "vrfy_ns_grp_c: 0 != HDstrcmp(path, \"/ext\")";
}
HDassert(ret >= 0);
- HDassert(0 == strcmp(file, "external.h5"));
- HDassert(0 == strcmp(path, "/ext"));
+ HDassert(0 == HDstrcmp(file, "external.h5"));
+ HDassert(0 == HDstrcmp(path, "/ext"));
- free(elinkval);
+ HDfree(elinkval);
} /* end else */
- u++;
-
+ u++;
} /* end while */
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Gclose() failed.";
}
- assert(ret >= 0);
+ HDassert(ret >= 0);
}
return;
-
} /* vrfy_ns_grp_c() */
/*-------------------------------------------------------------------------
* Function: ns_grp_d
*
- * Purpose: Create a dense "new style" group, with 'nlinks'
- * (soft/hard/external) links in it in the specified file.
+ * Purpose: Create a dense "new style" group, with 'nlinks'
+ * (soft/hard/external) links in it in the specified file.
*
* If pass is false on entry, do nothing.
*
@@ -765,153 +662,130 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
*/
void
-ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
-{
+ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
hid_t gid = -1;
hid_t gcpl = -1;
unsigned max_compact;
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Pcreate(H5P_GROUP_CREATE);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Pcreate() failed.";
- }
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Pcreate() failed.";
+ }
HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pset_link_creation_order(gcpl, H5P_CRT_ORDER_TRACKED);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Pset_link_creation_order() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Pset_link_creation_order() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, gcpl, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Gcreate2() failed.";
- }
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Gcreate2() failed.";
+ }
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
max_compact = 0;
ret = H5Pget_link_phase_change(gcpl, &max_compact, NULL);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Pget_link_phase_change() failed.";
- }
- else if ( nlinks <= max_compact ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: nlinks <= max_compact";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Pget_link_phase_change() failed.";
+ }
+ else if (nlinks <= max_compact) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: nlinks <= max_compact";
+ }
HDassert(ret >= 0);
HDassert(nlinks > max_compact);
}
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
-
+ while ((pass) && (u < nlinks)) {
char linkname[16];
- sprintf(linkname, "%u", u);
-
- if(0 == (u % 3)) {
+ HDsprintf(linkname, "%u", u);
- ret = H5Lcreate_soft(group_name, gid, linkname,
- H5P_DEFAULT, H5P_DEFAULT);
+ if (0 == (u % 3)) {
+ ret = H5Lcreate_soft(group_name, gid, linkname,
+ H5P_DEFAULT, H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Lcreate_soft() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Lcreate_soft() failed.";
+ }
HDassert(ret >= 0);
} /* end if */
- else if(1 == (u % 3)) {
-
- ret = H5Lcreate_hard(fid, "/", gid, linkname,
- H5P_DEFAULT, H5P_DEFAULT);
+ else if (1 == (u % 3)) {
+ ret = H5Lcreate_hard(fid, "/", gid, linkname,
+ H5P_DEFAULT, H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Lcreate_hard() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Lcreate_hard() failed.";
+ }
HDassert(ret >= 0);
} /* end else-if */
else {
-
HDassert(2 == (u % 3));
- ret = H5Lcreate_external("external.h5", "/ext", gid, linkname,
- H5P_DEFAULT, H5P_DEFAULT);
+ ret = H5Lcreate_external("external.h5", "/ext", gid, linkname,
+ H5P_DEFAULT, H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Lcreate_external() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Lcreate_external() failed.";
+ }
HDassert(ret >= 0);
} /* end else */
u++;
-
} /* end while */
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Gclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Gclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* ns_grp_d() */
/*-------------------------------------------------------------------------
* Function: vrfy_ns_grp_d
*
- * Purpose: Verify a dense "new style" group, with 'nlinks'
- * soft/hard/external links in it in the specified file.
+ * Purpose: Verify a dense "new style" group, with 'nlinks'
+ * soft/hard/external links in it in the specified file.
*
* If pass is false on entry, do nothing.
*
@@ -928,8 +802,7 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
void
-vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
-{
+vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
hid_t gid = -1;
hid_t gcpl = -1;
H5G_info_t grp_info;
@@ -937,93 +810,75 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Gopen2() failed.";
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Gopen2() failed.";
}
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Gget_create_plist(gid);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Gget_create_plist() failed.";
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Gget_create_plist() failed.";
}
- assert(gcpl > 0);
+ HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: H5Pget_link_creation_order() failed.";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Pget_link_creation_order() failed.";
}
- else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: H5P_CRT_ORDER_TRACKED != crt_order_flags";
+ else if (H5P_CRT_ORDER_TRACKED != crt_order_flags) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5P_CRT_ORDER_TRACKED != crt_order_flags";
}
HDassert(ret >= 0);
HDassert(H5P_CRT_ORDER_TRACKED == crt_order_flags);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
- memset(&grp_info, 0, sizeof(grp_info));
+ if (pass) {
+ HDmemset(&grp_info, 0, sizeof(grp_info));
ret = H5Gget_info(gid, &grp_info);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Gget_info() failed.";
- }
- else if ( H5G_STORAGE_TYPE_DENSE != grp_info.storage_type ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: H5G_STORAGE_TYPE_DENSE != grp_info.storage_type";
- }
- else if ( nlinks != grp_info.nlinks ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: nlinks != grp_info.nlinks";
- }
- else if ( nlinks != grp_info.max_corder ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: nlinks != grp_info.max_corder";
- }
- else if ( FALSE != grp_info.mounted ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: FALSE != grp_info.mounted";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Gget_info() failed.";
+ }
+ else if (H5G_STORAGE_TYPE_DENSE != grp_info.storage_type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5G_STORAGE_TYPE_DENSE != grp_info.storage_type";
+ }
+ else if (nlinks != grp_info.nlinks) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: nlinks != grp_info.nlinks";
+ }
+ else if (nlinks != grp_info.max_corder) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: nlinks != grp_info.max_corder";
+ }
+ else if ( FALSE != grp_info.mounted) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: FALSE != grp_info.mounted";
+ }
HDassert(ret >= 0);
HDassert(H5G_STORAGE_TYPE_DENSE == grp_info.storage_type);
HDassert(nlinks == grp_info.nlinks);
@@ -1032,116 +887,100 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
}
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
-
+ while ((pass) && (u < nlinks)) {
H5L_info_t lnk_info;
char linkname[16];
htri_t link_exists;
- sprintf(linkname, "%u", u);
+ HDsprintf(linkname, "%u", u);
link_exists = H5Lexists(gid, linkname, H5P_DEFAULT);
- if ( link_exists < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Lexists() failed.";
- }
+ if (link_exists < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Lexists() failed.";
+ }
HDassert(link_exists >= 0);
- memset(&lnk_info, 0, sizeof(grp_info));
+ HDmemset(&lnk_info, 0, sizeof(grp_info));
ret = H5Lget_info(gid, linkname, &lnk_info, H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Lget_info() failed.";
- }
- else if ( TRUE != lnk_info.corder_valid ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: TRUE != lnk_info.corder_valid";
- }
- else if ( u != lnk_info.corder ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: u != lnk_info.corder";
- }
- else if ( H5T_CSET_ASCII != lnk_info.cset ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5T_CSET_ASCII != lnk_info.cset";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Lget_info() failed.";
+ }
+ else if (TRUE != lnk_info.corder_valid) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: TRUE != lnk_info.corder_valid";
+ }
+ else if (u != lnk_info.corder) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: u != lnk_info.corder";
+ }
+ else if (H5T_CSET_ASCII != lnk_info.cset) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5T_CSET_ASCII != lnk_info.cset";
+ }
HDassert(ret >= 0);
HDassert(true == lnk_info.corder_valid);
HDassert(u == lnk_info.corder);
HDassert(H5T_CSET_ASCII == lnk_info.cset);
- if(0 == (u % 3)) {
+ if (0 == (u % 3)) {
char *slinkval;
- if ( H5L_TYPE_SOFT != lnk_info.type ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_SOFT != lnk_info.type";
- }
- else if ( (strlen(group_name) + 1) != lnk_info.u.val_size ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_SOFT != lnk_info.type";
- }
+ if (H5L_TYPE_SOFT != lnk_info.type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_SOFT != lnk_info.type";
+ }
+ else if ((HDstrlen(group_name) + 1) != lnk_info.u.val_size) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_SOFT != lnk_info.type";
+ }
HDassert(H5L_TYPE_SOFT == lnk_info.type);
- HDassert((strlen(group_name) + 1) == lnk_info.u.val_size);
-
- slinkval = (char *)malloc(lnk_info.u.val_size);
+ HDassert((HDstrlen(group_name) + 1) == lnk_info.u.val_size);
- if ( ! slinkval ) {
+ slinkval = (char *) HDmalloc(lnk_info.u.val_size);
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: malloc of slinkval failed";
- }
+ if (!slinkval) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: HDmalloc of slinkval failed";
+ }
HDassert(slinkval);
- ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Lget_val() failed";
- }
- else if ( 0 != strcmp(slinkval, group_name) ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: 0 != strcmp(slinkval, group_name)";
- }
+ ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
+ H5P_DEFAULT);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Lget_val() failed";
+ }
+ else if (0 != HDstrcmp(slinkval, group_name)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: 0 != HDstrcmp(slinkval, group_name)";
+ }
HDassert(ret >= 0);
- HDassert(0 == strcmp(slinkval, group_name));
+ HDassert(0 == HDstrcmp(slinkval, group_name));
- free(slinkval);
+ HDfree(slinkval);
} /* end if */
- else if(1 == (u % 3)) {
+ else if (1 == (u % 3)) {
H5O_info_t root_oinfo;
- if ( H5L_TYPE_HARD != lnk_info.type ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_HARD != lnk_info.type";
- }
+ if (H5L_TYPE_HARD != lnk_info.type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_HARD != lnk_info.type";
+ }
HDassert(H5L_TYPE_HARD == lnk_info.type);
- memset(&root_oinfo, 0, sizeof(root_oinfo));
+ HDmemset(&root_oinfo, 0, sizeof(root_oinfo));
ret = H5Oget_info2(fid, &root_oinfo, H5O_INFO_BASIC);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Oget_info() failed.";
- }
- else if ( root_oinfo.addr != lnk_info.u.address ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: root_oinfo.addr != lnk_info.u.address";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Oget_info() failed.";
+ }
+ else if (root_oinfo.addr != lnk_info.u.address) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: root_oinfo.addr != lnk_info.u.address";
+ }
HDassert(ret >= 0);
HDassert(root_oinfo.addr == lnk_info.u.address);
} /* end else-if */
@@ -1152,72 +991,58 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
HDassert(2 == (u % 3));
- if ( H5L_TYPE_EXTERNAL != lnk_info.type ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: H5L_TYPE_EXTERNAL != lnk_info.type";
- }
+ if (H5L_TYPE_EXTERNAL != lnk_info.type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_EXTERNAL != lnk_info.type";
+ }
HDassert(H5L_TYPE_EXTERNAL == lnk_info.type);
- elinkval = malloc(lnk_info.u.val_size);
+ elinkval = HDmalloc(lnk_info.u.val_size);
- if ( ! elinkval ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: malloc of elinkval failed.";
- }
+ if (!elinkval) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: HDmalloc of elinkval failed.";
+ }
HDassert(elinkval);
- ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
+ ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size,
+ H5P_DEFAULT);
+ if (ret < 0) {
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5Lget_val failed.";
}
HDassert(ret >= 0);
- ret = H5Lunpack_elink_val(elinkval, lnk_info.u.val_size, NULL,
- &file, &path);
- if ( ret < 0 ) {
-
- pass = FALSE;
+ ret = H5Lunpack_elink_val(elinkval, lnk_info.u.val_size, NULL, &file, &path);
+ if (ret < 0) {
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5Lunpack_elink_val failed.";
}
- else if ( 0 != strcmp(file, "external.h5") ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: 0 != strcmp(file, \"external.h5\").";
+ else if (0 != HDstrcmp(file, "external.h5")) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: 0 != HDstrcmp(file, \"external.h5\").";
+ }
+ else if (0 != HDstrcmp(path, "/ext")) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: 0 != HDstrcmp(path, \"/ext\")";
}
- else if ( 0 != strcmp(path, "/ext") ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: 0 != strcmp(path, \"/ext\")";
- }
HDassert(ret >= 0);
- HDassert(0 == strcmp(file, "external.h5"));
- HDassert(0 == strcmp(path, "/ext"));
-
- free(elinkval);
+ HDassert(0 == HDstrcmp(file, "external.h5"));
+ HDassert(0 == HDstrcmp(path, "/ext"));
+ HDfree(elinkval);
} /* end else */
- u++;
-
+ u++;
} /* end while() */
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Gclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Gclose() failed.";
+ }
HDassert(ret >= 0);
}
@@ -1254,21 +1079,17 @@ os_grp_0(hid_t fid, const char *group_name)
herr_t ret;
if ( pass ) { /* get the file's file access property list */
-
fapl = H5Fget_access_plist(fid);
if ( fapl <= 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_0: H5Fget_access_plist() failed.";
}
HDassert(fapl > 0);
}
-
- if ( pass ) { /* get low and high bounds from fapl */
+ if ( pass ) { /* get low and high bounds from fapl */
ret = H5Pget_libver_bounds(fapl, &low, &high);
if ( ret < 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_0: H5Pget_libver_bounds() failed(1).";
}
@@ -1276,11 +1097,9 @@ os_grp_0(hid_t fid, const char *group_name)
}
if ( pass ) { /* turn file format latest off */
-
if(low >= H5F_LIBVER_V18) {
ret = H5Fset_libver_bounds(fid, H5F_LIBVER_EARLIEST, high);
if ( ret < 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1).";
}
@@ -1289,11 +1108,8 @@ os_grp_0(hid_t fid, const char *group_name)
}
if ( pass ) {
-
- gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT,
- H5P_DEFAULT);
+ gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if ( gid <= 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_0: H5Gcreate2() failed.";
}
@@ -1301,11 +1117,9 @@ os_grp_0(hid_t fid, const char *group_name)
}
if ( pass ) {
-
ret = H5Gclose(gid);
if ( ret < 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_0: H5Gclose() failed.";
}
@@ -1313,11 +1127,9 @@ os_grp_0(hid_t fid, const char *group_name)
}
if ( pass ) { /* restore low and high bounds */
-
if(low >= H5F_LIBVER_V18) {
ret = H5Fset_libver_bounds(fid, low, high);
if ( ret < 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1).";
}
@@ -1326,7 +1138,6 @@ os_grp_0(hid_t fid, const char *group_name)
}
return;
-
} /* os_grp_0() */
@@ -1349,98 +1160,83 @@ os_grp_0(hid_t fid, const char *group_name)
*/
void
-vrfy_os_grp_0(hid_t fid, const char *group_name)
-{
+vrfy_os_grp_0(hid_t fid, const char *group_name) {
hid_t gid = -1;
hid_t gcpl = -1;
H5G_info_t grp_info;
unsigned crt_order_flags = 0;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Gopen2() failed.";
- }
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Gopen2() failed.";
+ }
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Gget_create_plist(gid);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Gget_create_plist() failed.";
- }
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Gget_create_plist() failed.";
+ }
HDassert(gcpl > 0);
}
- if ( pass ) {
+ if (pass) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Pget_link_creation_order() failed";
- }
- else if ( 0 != crt_order_flags ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: 0 != crt_order_flags";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Pget_link_creation_order() failed";
+ }
+ else if (0 != crt_order_flags) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: 0 != crt_order_flags";
+ }
HDassert(ret >= 0);
HDassert(0 == crt_order_flags);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
- memset(&grp_info, 0, sizeof(grp_info));
+ if (pass) {
+ HDmemset(&grp_info, 0, sizeof(grp_info));
ret = H5Gget_info(gid, &grp_info);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Gget_info() failed.";
- }
- else if ( H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type";
- }
- else if ( 0 != grp_info.nlinks ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: 0 != grp_info.nlinks";
- }
- else if ( 0 != grp_info.max_corder ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: 0 != grp_info.max_corder";
- }
- else if ( FALSE != grp_info.mounted ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: FALSE != grp_info.mounted";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Gget_info() failed.";
+ }
+ else if (H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type";
+ }
+ else if (0 != grp_info.nlinks) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: 0 != grp_info.nlinks";
+ }
+ else if (0 != grp_info.max_corder) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: 0 != grp_info.max_corder";
+ }
+ else if ( FALSE != grp_info.mounted) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: FALSE != grp_info.mounted";
+ }
HDassert(ret >= 0);
HDassert(H5G_STORAGE_TYPE_SYMBOL_TABLE == grp_info.storage_type);
HDassert(0 == grp_info.nlinks);
@@ -1448,28 +1244,25 @@ vrfy_os_grp_0(hid_t fid, const char *group_name)
HDassert(false == grp_info.mounted);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Gclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Gclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* vrfy_os_grp_0() */
/*-------------------------------------------------------------------------
* Function: os_grp_n
*
- * Purpose: Create an "old style" group, with 'nlinks' soft/hard
- * links in it.
+ * Purpose: Create an "old style" group, with 'nlinks' soft/hard
+ * links in it.
*
* If pass is false on entry, do nothing.
*
@@ -1484,7 +1277,7 @@ vrfy_os_grp_0(hid_t fid, const char *group_name)
*-------------------------------------------------------------------------
*/
-void
+void
os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
{
hid_t gid = -1;
@@ -1494,10 +1287,8 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
herr_t ret;
if ( pass ) { /* get the file's file access property list */
-
fapl = H5Fget_access_plist(fid);
if ( fapl <= 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_n: H5Fget_access_plist() failed.";
}
@@ -1505,10 +1296,8 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
}
if ( pass ) { /* get low and high bounds from fapl */
-
ret = H5Pget_libver_bounds(fapl, &low, &high);
if ( ret < 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_0: H5Pget_libver_bounds() failed(1).";
}
@@ -1516,11 +1305,9 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
}
if ( pass ) { /* turn file format latest off */
-
if(low >= H5F_LIBVER_V18) {
ret = H5Fset_libver_bounds(fid, H5F_LIBVER_EARLIEST, high);
if ( ret < 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1).";
}
@@ -1529,11 +1316,8 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
}
if ( pass ) {
-
- gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT,
- H5P_DEFAULT);
+ gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if ( gid <= 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_n: H5Gcreate2() failed.";
}
@@ -1544,58 +1328,46 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
u = 0;
while ( ( pass ) && ( u < nlinks ) ) {
-
char linkname[32];
- sprintf(linkname, "ln%d_%u", proc_num, u);
+ HDsprintf(linkname, "ln%d_%u", proc_num, u);
if(0 == (u % 2)) {
-
- ret = H5Lcreate_soft(group_name, gid, linkname, H5P_DEFAULT,
- H5P_DEFAULT);
+ ret = H5Lcreate_soft(group_name, gid, linkname, H5P_DEFAULT, H5P_DEFAULT);
if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "os_grp_n: H5Lcreate_soft() failed.";
+ pass = FALSE;
+ failure_mssg = "os_grp_n: H5Lcreate_soft() failed.";
}
HDassert(ret >= 0);
} /* end if */
else {
-
HDassert(1 == (u % 2));
- ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT,
- H5P_DEFAULT);
+ ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT, H5P_DEFAULT);
if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "os_grp_n: H5Lcreate_hard() failed.";
+ pass = FALSE;
+ failure_mssg = "os_grp_n: H5Lcreate_hard() failed.";
}
HDassert(ret >= 0);
} /* end else */
- u++;
-
+ u++;
} /* end while */
if ( pass ) {
-
ret = H5Gclose(gid);
if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "os_grp_n: H5Gclose() failed.";
+ pass = FALSE;
+ failure_mssg = "os_grp_n: H5Gclose() failed.";
}
- assert(ret >= 0);
+ HDassert(ret >= 0);
}
if ( pass ) { /* restore low and high bounds */
-
if(low >= H5F_LIBVER_V18) {
ret = H5Fset_libver_bounds(fid, low, high);
if ( ret < 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_n: H5Fset_libver_bounds() failed(2).";
}
@@ -1626,8 +1398,8 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
*-------------------------------------------------------------------------
*/
void
-vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
-{
+vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num,
+ unsigned nlinks) {
hid_t gid = -1;
hid_t gcpl = -1;
H5G_info_t grp_info;
@@ -1635,92 +1407,76 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Gopen2() failed";
- }
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Gopen2() failed";
+ }
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Gget_create_plist(gid);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Gget_create_plist() failed";
- }
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Gget_create_plist() failed";
+ }
HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Pget_link_creation_order";
- }
- else if ( 0 != crt_order_flags ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: 0 != crt_order_flags";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Pget_link_creation_order";
+ }
+ else if (0 != crt_order_flags) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: 0 != crt_order_flags";
+ }
HDassert(ret >= 0);
HDassert(0 == crt_order_flags);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Pclose() failed";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Pclose() failed";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
- memset(&grp_info, 0, sizeof(grp_info));
+ if (pass) {
+ HDmemset(&grp_info, 0, sizeof(grp_info));
ret = H5Gget_info(gid, &grp_info);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Gget_info() failed";
- }
- else if ( H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_os_grp_n: H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type";
- }
- else if ( nlinks != grp_info.nlinks ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: nlinks != grp_info.nlinks";
- }
- else if ( 0 != grp_info.max_corder ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: 0 != grp_info.max_corder";
- }
- else if ( FALSE != grp_info.mounted ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: FALSE != grp_info.mounted";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Gget_info() failed";
+ }
+ else if (H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type";
+ }
+ else if (nlinks != grp_info.nlinks) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: nlinks != grp_info.nlinks";
+ }
+ else if (0 != grp_info.max_corder) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: 0 != grp_info.max_corder";
+ }
+ else if ( FALSE != grp_info.mounted) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: FALSE != grp_info.mounted";
+ }
HDassert(ret >= 0);
HDassert(H5G_STORAGE_TYPE_SYMBOL_TABLE == grp_info.storage_type);
HDassert(nlinks == grp_info.nlinks);
@@ -1729,137 +1485,117 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
}
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
-
+ while ((pass) && (u < nlinks)) {
H5L_info_t lnk_info;
char linkname[32];
htri_t link_exists;
- sprintf(linkname, "ln%d_%u", proc_num, u);
+ HDsprintf(linkname, "ln%d_%u", proc_num, u);
link_exists = H5Lexists(gid, linkname, H5P_DEFAULT);
- if ( link_exists < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Lexists() failed";
+ if (link_exists < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Lexists() failed";
}
HDassert(link_exists >= 0);
- memset(&lnk_info, 0, sizeof(grp_info));
+ HDmemset(&lnk_info, 0, sizeof(grp_info));
ret = H5Lget_info(gid, linkname, &lnk_info, H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Lget_info() failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Lget_info() failed";
}
- else if ( FALSE != lnk_info.corder_valid ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: FALSE != lnk_info.corder_valid";
+ else if ( FALSE != lnk_info.corder_valid) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: FALSE != lnk_info.corder_valid";
}
- else if ( H5T_CSET_ASCII != lnk_info.cset ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5T_CSET_ASCII != lnk_info.cset";
+ else if (H5T_CSET_ASCII != lnk_info.cset) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5T_CSET_ASCII != lnk_info.cset";
}
HDassert(ret >= 0);
HDassert(false == lnk_info.corder_valid);
HDassert(H5T_CSET_ASCII == lnk_info.cset);
- if(0 == (u % 2)) {
+ if (0 == (u % 2)) {
char *slinkval;
- if ( H5L_TYPE_SOFT != lnk_info.type ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5L_TYPE_SOFT != lnk_info.type";
+ if (H5L_TYPE_SOFT != lnk_info.type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5L_TYPE_SOFT != lnk_info.type";
}
- else if ( (strlen(group_name) + 1) != lnk_info.u.val_size ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_os_grp_n: (strlen(group_name) + 1) != lnk_info.u.val_size";
+ else if ((HDstrlen(group_name) + 1) != lnk_info.u.val_size) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: (HDstrlen(group_name) + 1) != lnk_info.u.val_size";
}
HDassert(H5L_TYPE_SOFT == lnk_info.type);
- HDassert((strlen(group_name) + 1) == lnk_info.u.val_size);
-
- slinkval = (char *)malloc(lnk_info.u.val_size);
+ HDassert((HDstrlen(group_name) + 1) == lnk_info.u.val_size);
- if ( ! slinkval ) {
+ slinkval = (char *) HDmalloc(lnk_info.u.val_size);
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: malloc of slinkval failed";
+ if (!slinkval) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: HDmalloc of slinkval failed";
}
HDassert(slinkval);
- ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
-
- if ( ret < 0 ) {
+ ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
+ H5P_DEFAULT);
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Lget_val() failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Lget_val() failed";
}
- else if ( 0 != strcmp(slinkval, group_name) ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_os_grp_n: 0 != strcmp(slinkval, group_name)";
+ else if (0 != HDstrcmp(slinkval, group_name)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: 0 != HDstrcmp(slinkval, group_name)";
}
HDassert(ret >= 0);
- HDassert(0 == strcmp(slinkval, group_name));
+ HDassert(0 == HDstrcmp(slinkval, group_name));
- free(slinkval);
+ HDfree(slinkval);
} /* end if */
else {
H5O_info_t root_oinfo;
HDassert(1 == (u % 2));
- if ( H5L_TYPE_HARD != lnk_info.type ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5L_TYPE_HARD != lnk_info.type";
+ if (H5L_TYPE_HARD != lnk_info.type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5L_TYPE_HARD != lnk_info.type";
}
HDassert(H5L_TYPE_HARD == lnk_info.type);
- memset(&root_oinfo, 0, sizeof(root_oinfo));
+ HDmemset(&root_oinfo, 0, sizeof(root_oinfo));
ret = H5Oget_info2(fid, &root_oinfo, H5O_INFO_BASIC);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Oget_info() failed.";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Oget_info() failed.";
}
- else if ( root_oinfo.addr != lnk_info.u.address ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_os_grp_n: root_oinfo.addr != lnk_info.u.address";
+ else if (root_oinfo.addr != lnk_info.u.address) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: root_oinfo.addr != lnk_info.u.address";
}
HDassert(ret >= 0);
HDassert(root_oinfo.addr == lnk_info.u.address);
} /* end else */
- u++;
-
+ u++;
} /* end while */
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Gclose() failed.";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Gclose() failed.";
}
HDassert(ret >= 0);
}
return;
-
} /* vrfy_os_grp_n() */
@@ -1867,8 +1603,8 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
* Function: ds_ctg_i
*
* Purpose: Create a contiguous dataset w/int datatype. Write data
- * to the data set or not as indicated by the write_data
- * parameter.
+ * to the data set or not as indicated by the write_data
+ * parameter.
*
* If pass is false on entry, do nothing.
*
@@ -1882,106 +1618,91 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
*
*-------------------------------------------------------------------------
*/
-void
-ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *wdata = NULL;
unsigned u;
hid_t dsid = -1;
hid_t sid = -1;
- hsize_t dims[1] = {DSET_DIMS};
+ hsize_t dims[1] = { DSET_DIMS };
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
sid = H5Screate_simple(1, dims, NULL);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_i: H5Screate_simple() failed";
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: H5Screate_simple() failed";
}
HDassert(sid > 0);
}
- if ( pass ) {
-
- dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT,
- H5P_DEFAULT, H5P_DEFAULT);
+ if (pass) {
+ dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT,
+ H5P_DEFAULT, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_i: H5Dcreate2() failed";
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: H5Dcreate2() failed";
}
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_i: H5Sclose() failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: H5Sclose() failed";
}
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- wdata = (int *)malloc(sizeof(int) * DSET_DIMS);
-
- if ( ! wdata ) {
+ if ((pass) && (write_data)) {
+ wdata = (int *) HDmalloc(sizeof(int) * DSET_DIMS);
- pass = FALSE;
- failure_mssg = "ds_ctg_i: malloc of wdata failed.";
+ if (!wdata) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: HDmalloc of wdata failed.";
}
HDassert(wdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_DIMS; u++)
-
- wdata[u] = (int)u;
-
- ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, wdata);
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_DIMS; u++)
+ wdata[u] = (int) u;
- if ( ret < 0 ) {
+ ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, wdata);
- pass = FALSE;
- failure_mssg = "ds_ctg_i: H5Dwrite() failed.";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: H5Dwrite() failed.";
}
HDassert(ret >= 0);
- free(wdata);
- }
-
- if ( pass ) {
+ HDfree(wdata);
+ }
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_i: H5Dclose() failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: H5Dclose() failed";
}
HDassert(ret >= 0);
}
return;
-
} /* ds_ctg_i */
/*-------------------------------------------------------------------------
* Function: vrfy_ds_ctg_i
*
- * Purpose: Validate a contiguous datasets w/int datatypes. Validate
- * data if indicated via the write_data parameter.
+ * Purpose: Validate a contiguous datasets w/int datatypes. Validate
+ * data if indicated via the write_data parameter.
*
* If pass is false on entry, do nothing.
*
@@ -1995,9 +1716,8 @@ ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *rdata = NULL;
unsigned u;
hid_t dsid = -1;
@@ -2011,225 +1731,187 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
htri_t type_equal;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
dsid = H5Dopen2(fid, dset_name, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dopen2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dopen2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
sid = H5Dget_space(dsid);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dget_space() failed.";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dget_space() failed.";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ndims = H5Sget_simple_extent_ndims(sid);
- if ( 1 != ndims ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: 1 != ndims";
- }
+ if (1 != ndims) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: 1 != ndims";
+ }
HDassert(1 == ndims);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sget_simple_extent_dims(sid, dims, max_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Sget_simple_extent_dims() failed";
- }
- else if ( DSET_DIMS != dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: DSET_DIMS != dims[0]";
- }
- else if ( DSET_DIMS != max_dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: DSET_DIMS != max_dims[0]";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Sget_simple_extent_dims() failed";
+ }
+ else if ( DSET_DIMS != dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: DSET_DIMS != dims[0]";
+ }
+ else if ( DSET_DIMS != max_dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: DSET_DIMS != max_dims[0]";
+ }
HDassert(ret >= 0);
HDassert(DSET_DIMS == dims[0]);
HDassert(DSET_DIMS == max_dims[0]);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
tid = H5Dget_type(dsid);
- if ( tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dget_type() failed.";
- }
+ if (tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dget_type() failed.";
+ }
HDassert(tid > 0);
}
- if ( pass ) {
-
+ if (pass) {
type_equal = H5Tequal(tid, H5T_NATIVE_INT);
- if ( 1 != type_equal ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: type not H5T_NATIVE_INT";
- }
+ if (1 != type_equal) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: type not H5T_NATIVE_INT";
+ }
HDassert(1 == type_equal);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Tclose() failed.";
- }
- assert(ret >= 0);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Tclose() failed.";
+ }
+ HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dget_space_status(dsid, &allocation);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dget_space_status() failed.";
- }
- else if ( write_data && ( allocation != H5D_SPACE_STATUS_ALLOCATED ) ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ds_ctg_i: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
- }
- else if ( !write_data &&
- ( allocation != H5D_SPACE_STATUS_NOT_ALLOCATED ) ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dget_space_status() failed.";
+ }
+ else if (write_data && (allocation != H5D_SPACE_STATUS_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
+ }
+ else if (!write_data
+ && (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
+ }
HDassert(ret >= 0);
- HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) ||
- (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
+ HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED)
+ || (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Dget_create_plist(dsid);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dget_create_plist() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dget_create_plist() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
layout = H5Pget_layout(dcpl);
- if ( H5D_CONTIGUOUS != layout ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5D_CONTIGUOUS != layout";
- }
+ if (H5D_CONTIGUOUS != layout) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5D_CONTIGUOUS != layout";
+ }
HDassert(H5D_CONTIGUOUS == layout);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- rdata = (int *)malloc(sizeof(int) * DSET_DIMS);
+ if ((pass) && (write_data)) {
+ rdata = (int *) HDmalloc(sizeof(int) * DSET_DIMS);
- if ( ! rdata ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: malloc of rdata failed.";
- }
+ if (!rdata) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: HDmalloc of rdata failed.";
+ }
HDassert(rdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, rdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dread() failed.";
- }
+ if ((pass) && (write_data)) {
+ ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, rdata);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dread() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_DIMS; u++) {
-
- if ( (int)u != rdata[u] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: u != rdata[u].";
- break;
- }
- HDassert((int)u == rdata[u]);
- }
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_DIMS; u++) {
+ if ((int) u != rdata[u]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: u != rdata[u].";
+ break;
+ }
+ HDassert((int )u == rdata[u]);
+ }
- free(rdata);
+ HDfree(rdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dclose() failed";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dclose() failed";
+ }
HDassert(ret >= 0);
}
@@ -2242,8 +1924,8 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
* Function: ds_chk_i
*
* Purpose: Create a chunked dataset w/int datatype. Write data
- * to the data set or not as indicated by the write_data
- * parameter.
+ * to the data set or not as indicated by the write_data
+ * parameter.
*
* If pass is false on entry, do nothing.
*
@@ -2257,142 +1939,121 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *wdata = NULL;
unsigned u;
hid_t dsid = -1;
hid_t dcpl = -1;
hid_t sid = -1;
- hsize_t dims[1] = {DSET_DIMS};
- hsize_t chunk_dims[1] = {DSET_CHUNK_DIMS};
+ hsize_t dims[1] = { DSET_DIMS };
+ hsize_t chunk_dims[1] = { DSET_CHUNK_DIMS };
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
sid = H5Screate_simple(1, dims, NULL);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Screate_simple() failed.";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Screate_simple() failed.";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Pcreate() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Pcreate() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pset_chunk(dcpl, 1, chunk_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Pset_chunk() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Pset_chunk() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
- dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid,
- H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (pass) {
+ dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid,
+ H5P_DEFAULT, dcpl, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Dcreate2() failed";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Dcreate2() failed";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- wdata = (int *)malloc(sizeof(int) * DSET_DIMS);
+ if ((pass) && (write_data)) {
+ wdata = (int *) HDmalloc(sizeof(int) * DSET_DIMS);
- if ( ! wdata ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: malloc of wdata failed.";
- }
+ if (!wdata) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: HDmalloc of wdata failed.";
+ }
HDassert(wdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_DIMS; u++)
- wdata[u] = (int)u;
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_DIMS; u++)
+ wdata[u] = (int) u;
- ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, wdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Dwrite() failed.";
- }
+ ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, wdata);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Dwrite() failed.";
+ }
HDassert(ret >= 0);
-
- free(wdata);
+ HDfree(wdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* ds_chk_i */
/*-------------------------------------------------------------------------
* Function: vrfy_ds_chk_i
*
- * Purpose: Validate a chunked datasets w/int datatypes. Validate
- * data if indicated via the write_data parameter.
+ * Purpose: Validate a chunked datasets w/int datatypes. Validate
+ * data if indicated via the write_data parameter.
*
* If pass is false on entry, do nothing.
*
@@ -2406,9 +2067,8 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *rdata = NULL;
unsigned u;
hid_t dsid = -1;
@@ -2422,249 +2082,204 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
htri_t type_equal;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
dsid = H5Dopen2(fid, dset_name, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dopen2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dopen2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
sid = H5Dget_space(dsid);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dget_space() failed.";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dget_space() failed.";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ndims = H5Sget_simple_extent_ndims(sid);
- if ( 1 != ndims ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: 1 != ndims";
- }
+ if (1 != ndims) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: 1 != ndims";
+ }
HDassert(1 == ndims);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sget_simple_extent_dims(sid, dims, max_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Sget_simple_extent_dims() failed";
- }
- else if ( DSET_DIMS != dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: DSET_DIMS != dims[0]";
- }
- else if ( DSET_DIMS != max_dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: DSET_DIMS != max_dims[0]";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Sget_simple_extent_dims() failed";
+ }
+ else if ( DSET_DIMS != dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: DSET_DIMS != dims[0]";
+ }
+ else if ( DSET_DIMS != max_dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: DSET_DIMS != max_dims[0]";
+ }
HDassert(ret >= 0);
HDassert(DSET_DIMS == dims[0]);
HDassert(DSET_DIMS == max_dims[0]);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
tid = H5Dget_type(dsid);
- if ( tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dget_type() failed.";
- }
+ if (tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dget_type() failed.";
+ }
HDassert(tid > 0);
}
- if ( pass ) {
-
+ if (pass) {
type_equal = H5Tequal(tid, H5T_NATIVE_INT);
- if ( 1 != type_equal ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: tid != H5T_NATIVE_INT";
- }
+ if (1 != type_equal) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: tid != H5T_NATIVE_INT";
+ }
HDassert(1 == type_equal);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Tclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Tclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dget_space_status(dsid, &allocation);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dget_space_status() failed.";
- }
- else if ( write_data && ( allocation != H5D_SPACE_STATUS_ALLOCATED ) ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ds_chk_i: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
- }
- else if ( !write_data &&
- ( allocation != H5D_SPACE_STATUS_NOT_ALLOCATED ) ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dget_space_status() failed.";
+ }
+ else if (write_data && (allocation != H5D_SPACE_STATUS_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
+ }
+ else if (!write_data && (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
+ }
HDassert(ret >= 0);
- HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) ||
- (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
+ HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED)
+ || (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Dget_create_plist(dsid);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dget_create_plist() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dget_create_plist() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
layout = H5Pget_layout(dcpl);
- if ( H5D_CHUNKED != layout ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5D_CHUNKED != layout";
- }
+ if (H5D_CHUNKED != layout) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5D_CHUNKED != layout";
+ }
HDassert(H5D_CHUNKED == layout);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pget_chunk(dcpl, 1, chunk_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Pget_chunk";
- }
- else if ( DSET_CHUNK_DIMS != chunk_dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: ";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Pget_chunk";
+ }
+ else if ( DSET_CHUNK_DIMS != chunk_dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: ";
+ }
HDassert(ret >= 0);
HDassert(DSET_CHUNK_DIMS == chunk_dims[0]);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- rdata = (int *)malloc(sizeof(int) * DSET_DIMS);
+ if ((pass) && (write_data)) {
+ rdata = (int *) HDmalloc(sizeof(int) * DSET_DIMS);
- if ( ! rdata ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: malloc of rdata failed.";
- }
+ if (!rdata) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: HDmalloc of rdata failed.";
+ }
HDassert(rdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- rdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dread() failed.";
- }
+ if ((pass) && (write_data)) {
+ ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dread() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_DIMS; u++) {
-
- if ( (int)u != rdata[u] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: u != rdata[u]";
- break;
- }
- HDassert((int)u == rdata[u]);
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_DIMS; u++) {
+ if ((int) u != rdata[u]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: u != rdata[u]";
+ break;
+ }
+ HDassert((int )u == rdata[u]);
}
- free(rdata);
+ HDfree(rdata);
} /* end if */
-
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* vrfy_ds_chk_i() */
@@ -2672,8 +2287,8 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
* Function: ds_cpt_i
*
* Purpose: Create a compact dataset w/int datatype. Write data
- * to the data set or not as indicated by the write_data
- * parameter.
+ * to the data set or not as indicated by the write_data
+ * parameter.
*
* If pass is false on entry, do nothing.
*
@@ -2687,129 +2302,110 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *wdata = NULL;
unsigned u;
hid_t dsid = -1;
hid_t dcpl = -1;
hid_t sid = -1;
- hsize_t dims[1] = {DSET_COMPACT_DIMS};
+ hsize_t dims[1] = { DSET_COMPACT_DIMS };
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
sid = H5Screate_simple(1, dims, NULL);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Screate_simple() failed.";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Screate_simple() failed.";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Pcreate() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Pcreate() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pset_layout(dcpl, H5D_COMPACT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Pset_layout() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Pset_layout() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
- dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid,
- H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (pass) {
+ dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid,
+ H5P_DEFAULT, dcpl, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Dcreate2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Dcreate2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- wdata = (int *)malloc(sizeof(int) * DSET_COMPACT_DIMS);
+ if ((pass) && (write_data)) {
+ wdata = (int *) HDmalloc(sizeof(int) * DSET_COMPACT_DIMS);
- if ( ! wdata ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: malloc of wdata failed.";
- }
+ if (!wdata) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: HDmalloc of wdata failed.";
+ }
HDassert(wdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_COMPACT_DIMS; u++)
- wdata[u] = (int)u;
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_COMPACT_DIMS; u++)
+ wdata[u] = (int) u;
- ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, wdata);
+ ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, wdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Dwrite() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Dwrite() failed.";
+ }
HDassert(ret >= 0);
- free(wdata);
+ HDfree(wdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
@@ -2821,8 +2417,8 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
/*-------------------------------------------------------------------------
* Function: vrfy_ds_cpt_i
*
- * Purpose: Validate a compact datasets w/int datatypes. Validate
- * data if indicated via the write_data parameter.
+ * Purpose: Validate a compact datasets w/int datatypes. Validate
+ * data if indicated via the write_data parameter.
*
* If pass is false on entry, do nothing.
*
@@ -2836,9 +2432,8 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *rdata = NULL;
unsigned u;
hid_t dsid = -1;
@@ -2852,232 +2447,195 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
htri_t type_equal;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
dsid = H5Dopen2(fid, dset_name, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dopen2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dopen2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
sid = H5Dget_space(dsid);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dget_space() failed.";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dget_space() failed.";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ndims = H5Sget_simple_extent_ndims(sid);
- if ( 1 != ndims ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: 1 != ndims";
- }
+ if (1 != ndims) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: 1 != ndims";
+ }
HDassert(1 == ndims);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sget_simple_extent_dims(sid, dims, max_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Sget_simple_extent_dims() failed";
- }
- else if ( DSET_COMPACT_DIMS != dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: DSET_COMPACT_DIMS != dims[0]";
- }
- else if ( DSET_COMPACT_DIMS != max_dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: DSET_COMPACT_DIMS != max_dims[0]";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Sget_simple_extent_dims() failed";
+ }
+ else if ( DSET_COMPACT_DIMS != dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: DSET_COMPACT_DIMS != dims[0]";
+ }
+ else if ( DSET_COMPACT_DIMS != max_dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: DSET_COMPACT_DIMS != max_dims[0]";
+ }
HDassert(ret >= 0);
HDassert(DSET_COMPACT_DIMS == dims[0]);
HDassert(DSET_COMPACT_DIMS == max_dims[0]);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
tid = H5Dget_type(dsid);
- if ( tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dget_type() failed.";
- }
+ if (tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dget_type() failed.";
+ }
HDassert(tid > 0);
}
- if ( pass ) {
-
+ if (pass) {
type_equal = H5Tequal(tid, H5T_NATIVE_INT);
- if ( 1 != type_equal ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: type != H5T_NATIVE_INT";
- }
+ if (1 != type_equal) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: type != H5T_NATIVE_INT";
+ }
HDassert(1 == type_equal);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Tclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Tclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dget_space_status(dsid, &allocation);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dget_space_status() failed.";
- }
- else if ( H5D_SPACE_STATUS_ALLOCATED != allocation ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ds_cpt_i: H5D_SPACE_STATUS_ALLOCATED != allocation";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dget_space_status() failed.";
+ }
+ else if (H5D_SPACE_STATUS_ALLOCATED != allocation) {
+ pass = FALSE;
+ failure_mssg =
+ "vrfy_ds_cpt_i: H5D_SPACE_STATUS_ALLOCATED != allocation";
+ }
HDassert(ret >= 0);
HDassert(H5D_SPACE_STATUS_ALLOCATED == allocation);
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Dget_create_plist(dsid);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dget_create_plist() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dget_create_plist() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
layout = H5Pget_layout(dcpl);
- if ( H5D_COMPACT != layout ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5D_COMPACT != layout";
- }
+ if (H5D_COMPACT != layout) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5D_COMPACT != layout";
+ }
HDassert(H5D_COMPACT == layout);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
- }
-
- if ( ( pass ) && ( write_data ) ) {
-
- rdata = (int *)malloc(sizeof(int) * DSET_COMPACT_DIMS);
+ }
- if ( ! rdata ) {
+ if ((pass) && (write_data)) {
+ rdata = (int *) HDmalloc(sizeof(int) * DSET_COMPACT_DIMS);
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: malloc of rdata failed.";
- }
+ if (!rdata) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: HDmalloc of rdata failed.";
+ }
HDassert(rdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, rdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dread() failed.";
- }
+ if ((pass) && (write_data)) {
+ ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, rdata);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dread() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_COMPACT_DIMS; u++) {
-
- if ( (int)u != rdata[u] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: (int)u != rdata[u]";
- break;
- }
- HDassert((int)u == rdata[u]);
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_COMPACT_DIMS; u++) {
+ if ((int) u != rdata[u]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: (int)u != rdata[u]";
+ break;
+ }
+ HDassert((int )u == rdata[u]);
}
- free(rdata);
+ HDfree(rdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* vrfy_ds_cpt_i() */
/*-------------------------------------------------------------------------
* Function: ds_ctg_v
*
- * Purpose: Create a contiguous dataset w/variable-length datatype.
- * Write data to the data set or not as indicated by the
- * write_data parameter.
+ * Purpose: Create a contiguous dataset w/variable-length datatype.
+ * Write data to the data set or not as indicated by the
+ * write_data parameter.
*
* If pass is false on entry, do nothing.
*
@@ -3091,166 +2649,142 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
hid_t dsid = -1;
hid_t sid = -1;
hid_t tid = -1;
- hsize_t dims[1] = {DSET_SMALL_DIMS};
+ hsize_t dims[1] = { DSET_SMALL_DIMS };
herr_t ret;
hvl_t *wdata = NULL;
unsigned u;
- if ( pass ) {
-
+ if (pass) {
sid = H5Screate_simple(1, dims, NULL);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Screate_simple";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Screate_simple";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
tid = H5Tvlen_create(H5T_NATIVE_INT);
- if ( tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Tvlen_create() failed.";
- }
+ if (tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Tvlen_create() failed.";
+ }
HDassert(tid > 0);
}
- if ( pass ) {
-
- dsid = H5Dcreate2(fid, dset_name, tid, sid, H5P_DEFAULT,
- H5P_DEFAULT, H5P_DEFAULT);
+ if (pass) {
+ dsid = H5Dcreate2(fid, dset_name, tid, sid, H5P_DEFAULT,
+ H5P_DEFAULT, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Dcreate2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Dcreate2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- wdata = (hvl_t *)malloc(sizeof(hvl_t) * DSET_SMALL_DIMS);
+ if ((pass) && (write_data)) {
+ wdata = (hvl_t *) HDmalloc(sizeof(hvl_t) * DSET_SMALL_DIMS);
- if ( ! wdata ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: malloc of wdata failed.";
- }
+ if (!wdata) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: HDmalloc of wdata failed.";
+ }
HDassert(wdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_SMALL_DIMS; u++) {
-
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_SMALL_DIMS; u++) {
int *tdata;
unsigned len;
unsigned v;
len = (u % 10) + 1;
- tdata = (int *)malloc(sizeof(int) * len);
-
- if ( !tdata ) {
+ tdata = (int *) HDmalloc(sizeof(int) * len);
- pass = FALSE;
- failure_mssg = "ds_ctg_v: malloc of tdata failed.";
- break;
- }
+ if (!tdata) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: HDmalloc of tdata failed.";
+ break;
+ }
HDassert(tdata);
- for(v = 0; v < len; v++)
- tdata[v] = (int)(u + v);
+ for (v = 0; v < len; v++)
+ tdata[v] = (int) (u + v);
- wdata[u].len = len;
- wdata[u].p = tdata;
+ wdata[u].len = len;
+ wdata[u].p = tdata;
} /* end for */
}
- if ( ( pass ) && ( write_data ) ) {
-
+ if ((pass) && (write_data)) {
ret = H5Dwrite(dsid, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Dwrite() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Dwrite() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
+ if ((pass) && (write_data)) {
ret = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, wdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Dvlen_reclaim() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Dvlen_reclaim() failed.";
+ }
HDassert(ret >= 0);
- free(wdata);
-
+ HDfree(wdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( sid < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Sclose() failed.";
- }
+ if (sid < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tid);
- if ( tid < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Tclose() failed.";
- }
+ if (tid < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Tclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* ds_ctg_v() */
/*-------------------------------------------------------------------------
* Function: vrfy_ds_ctg_v
*
- * Purpose: Validate a contiguous datasets w/variable-length datatypes.
- * Validate data if indicated via the write_data parameter.
+ * Purpose: Validate a contiguous datasets w/variable-length datatypes.
+ * Validate data if indicated via the write_data parameter.
*
* If pass is false on entry, do nothing.
*
@@ -3264,9 +2798,8 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
hid_t dsid = -1;
hid_t sid = -1;
hid_t tid = -1;
@@ -3281,283 +2814,240 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
dsid = H5Dopen2(fid, dset_name, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dopen2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dopen2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
sid = H5Dget_space(dsid);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dget_space() failed";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dget_space() failed";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ndims = H5Sget_simple_extent_ndims(sid);
- if ( 1 != ndims ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: 1 != ndims";
- }
+ if (1 != ndims) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: 1 != ndims";
+ }
HDassert(1 == ndims);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sget_simple_extent_dims(sid, dims, max_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Sget_simple_extent_dims() failed.";
- }
- else if ( DSET_SMALL_DIMS != dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: DSET_SMALL_DIMS != dims[0]";
- }
- else if ( DSET_SMALL_DIMS != max_dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: DSET_SMALL_DIMS != max_dims[0]";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Sget_simple_extent_dims() failed.";
+ }
+ else if ( DSET_SMALL_DIMS != dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: DSET_SMALL_DIMS != dims[0]";
+ }
+ else if ( DSET_SMALL_DIMS != max_dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: DSET_SMALL_DIMS != max_dims[0]";
+ }
HDassert(ret >= 0);
HDassert(DSET_SMALL_DIMS == dims[0]);
HDassert(DSET_SMALL_DIMS == max_dims[0]);
}
- if ( pass ) {
-
+ if (pass) {
tid = H5Dget_type(dsid);
- if ( tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dget_type() failed.";
- }
+ if (tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dget_type() failed.";
+ }
HDassert(tid > 0);
}
- if ( pass ) {
-
+ if (pass) {
tmp_tid = H5Tvlen_create(H5T_NATIVE_INT);
- if ( tmp_tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Tvlen_create() failed.";
- }
+ if (tmp_tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Tvlen_create() failed.";
+ }
HDassert(tmp_tid > 0);
}
- if ( pass ) {
-
+ if (pass) {
type_equal = H5Tequal(tid, tmp_tid);
- if ( 1 != type_equal ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: type != vlen H5T_NATIVE_INT";
- }
+ if (1 != type_equal) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: type != vlen H5T_NATIVE_INT";
+ }
HDassert(1 == type_equal);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tmp_tid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Tclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Tclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dget_space_status(dsid, &allocation);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dget_space_status() failed";
- }
- else if ( write_data && (allocation != H5D_SPACE_STATUS_ALLOCATED) ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ds_ctg_v: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
- }
- else if ( !write_data &&
- ( allocation != H5D_SPACE_STATUS_NOT_ALLOCATED ) ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dget_space_status() failed";
+ }
+ else if (write_data && (allocation != H5D_SPACE_STATUS_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg =
+ "vrfy_ds_ctg_v: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
+ }
+ else if (!write_data
+ && (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg =
+ "vrfy_ds_ctg_v: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
+ }
HDassert(ret >= 0);
- HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) ||
- (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
+ HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED)
+ || (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Dget_create_plist(dsid);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dget_create_plist() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dget_create_plist() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
layout = H5Pget_layout(dcpl);
- if ( H5D_CONTIGUOUS != layout ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5D_CONTIGUOUS != layout";
- }
+ if (H5D_CONTIGUOUS != layout) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5D_CONTIGUOUS != layout";
+ }
HDassert(H5D_CONTIGUOUS == layout);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
+ if ((pass) && (write_data)) {
+ rdata = (hvl_t *) HDmalloc(sizeof(hvl_t) * DSET_SMALL_DIMS);
- rdata = (hvl_t *)malloc(sizeof(hvl_t) * DSET_SMALL_DIMS);
-
- if ( !rdata ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: malloc of rdata failed.";
- }
+ if (!rdata) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: HDmalloc of rdata failed.";
+ }
HDassert(rdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
+ if ((pass) && (write_data)) {
ret = H5Dread(dsid, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dread() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dread() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_SMALL_DIMS; u++) {
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_SMALL_DIMS; u++) {
unsigned len;
unsigned v;
- len = (unsigned)rdata[u].len;
- for(v = 0; v < len; v++) {
- int *tdata = (int *)rdata[u].p;
-
- if ( !tdata ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: !tdata";
- break;
- }
- else if ( (int)(u + v) != tdata[v] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: (int)(u + v) != tdata[v]";
- break;
- }
+ len = (unsigned) rdata[u].len;
+ for (v = 0; v < len; v++) {
+ int *tdata = (int *) rdata[u].p;
+
+ if (!tdata) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: !tdata";
+ break;
+ }
+ else if ((int) (u + v) != tdata[v]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: (int)(u + v) != tdata[v]";
+ break;
+ }
HDassert(tdata);
- HDassert((int)(u + v) == tdata[v]);
+ HDassert((int )(u + v) == tdata[v]);
} /* end for */
} /* end for */
}
- if ( ( pass ) && ( write_data ) ) {
-
+ if ((pass) && (write_data)) {
ret = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, rdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dvlen_reclaim() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dvlen_reclaim() failed.";
+ }
HDassert(ret >= 0);
- free(rdata);
+ HDfree(rdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Tclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Tclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* vrfy_ds_ctg_v() */
-
+
/*-------------------------------------------------------------------------
* Function: create_zoo
*
@@ -3596,203 +3086,202 @@ create_zoo(hid_t fid, const char *base_path, int proc_num)
/* Add & verify an empty "new style" group */
if ( pass ) {
- sprintf(full_path, "%s/A", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/A", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ns_grp_0(fid, full_path);
}
if ( pass ) {
- sprintf(full_path, "%s/A", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/A", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_0(fid, full_path);
}
/* Add & verify a compact "new style" group (3 link messages) */
if ( pass ) {
- sprintf(full_path, "%s/B", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/B", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ns_grp_c(fid, full_path, 3);
}
if ( pass ) {
- sprintf(full_path, "%s/B", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/B", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_c(fid, full_path, 3);
}
- /* Add & verify a dense "new style" group (w/300 links, in v2 B-tree &
+ /* Add & verify a dense "new style" group (w/300 links, in v2 B-tree &
* fractal heap)
*/
if ( pass ) {
- sprintf(full_path, "%s/C", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/C", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ns_grp_d(fid, full_path, 300);
}
if ( pass ) {
- sprintf(full_path, "%s/C", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/C", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_d(fid, full_path, 300);
}
/* Add & verify an empty "old style" group to file */
if ( pass ) {
- sprintf(full_path, "%s/D", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/D", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
os_grp_0(fid, full_path);
}
if ( pass ) {
- sprintf(full_path, "%s/D", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/D", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_os_grp_0(fid, full_path);
}
- /* Add & verify an "old style" group (w/300 links, in v1 B-tree &
- * local heap) to file
+ /* Add & verify an "old style" group (w/300 links, in v1 B-tree &
+ * local heap) to file
*/
if ( pass ) {
- sprintf(full_path, "%s/E", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/E", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
os_grp_n(fid, full_path, proc_num, 300);
}
if ( pass ) {
- sprintf(full_path, "%s/E", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/E", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_os_grp_n(fid, full_path, proc_num, 300);
}
- /* Add & verify a contiguous dataset w/integer datatype (but no data)
- * to file
+ /* Add & verify a contiguous dataset w/integer datatype (but no data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/F", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/F", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_ctg_i(fid, full_path, FALSE);
}
if ( pass ) {
- sprintf(full_path, "%s/F", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/F", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_i(fid, full_path, FALSE);
}
- /* Add & verify a contiguous dataset w/integer datatype (with data)
- * to file
+ /* Add & verify a contiguous dataset w/integer datatype (with data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/G", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/G", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_ctg_i(fid, full_path, TRUE);
}
if ( pass ) {
- sprintf(full_path, "%s/G", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/G", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_i(fid, full_path, TRUE);
}
- /* Add & verify a chunked dataset w/integer datatype (but no data)
- * to file
+ /* Add & verify a chunked dataset w/integer datatype (but no data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/H", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/H", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_chk_i(fid, full_path, FALSE);
}
if ( pass ) {
- sprintf(full_path, "%s/H", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/H", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_chk_i(fid, full_path, FALSE);
}
- /* Add & verify a chunked dataset w/integer datatype (and data)
- * to file
+ /* Add & verify a chunked dataset w/integer datatype (and data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/I", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/I", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_chk_i(fid, full_path, TRUE);
}
if ( pass ) {
- sprintf(full_path, "%s/I", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/I", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_chk_i(fid, full_path, TRUE);
}
- /* Add & verify a compact dataset w/integer datatype (but no data)
- * to file
+ /* Add & verify a compact dataset w/integer datatype (but no data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/J", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/J", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_cpt_i(fid, full_path, FALSE);
}
if ( pass ) {
- sprintf(full_path, "%s/J", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/J", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_cpt_i(fid, full_path, FALSE);
}
- /* Add & verify a compact dataset w/integer datatype (and data)
- * to file
+ /* Add & verify a compact dataset w/integer datatype (and data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/K", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/K", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_cpt_i(fid, full_path, TRUE);
}
if ( pass ) {
- sprintf(full_path, "%s/K", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/K", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_cpt_i(fid, full_path, TRUE);
}
- /* Add & verify a contiguous dataset w/variable-length datatype
- * (but no data) to file
+ /* Add & verify a contiguous dataset w/variable-length datatype
+ * (but no data) to file
*/
if ( pass ) {
- sprintf(full_path, "%s/L", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/L", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_ctg_v(fid, full_path, FALSE);
}
if ( pass ) {
- sprintf(full_path, "%s/L", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/L", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_v(fid, full_path, FALSE);
}
- /* Add & verify a contiguous dataset w/variable-length datatype
- * (and data) to file
+ /* Add & verify a contiguous dataset w/variable-length datatype
+ * (and data) to file
*/
if ( pass ) {
- sprintf(full_path, "%s/M", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/M", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_ctg_v(fid, full_path, TRUE);
}
if ( pass ) {
- sprintf(full_path, "%s/M", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/M", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_v(fid, full_path, TRUE);
}
return;
-
} /* create_zoo() */
-
+
/*-------------------------------------------------------------------------
* Function: validate_zoo
*
- * Purpose: Given the path to a group in which a "zoo" has been
- * constructed, validate the objects in the "zoo".
+ * Purpose: Given the path to a group in which a "zoo" has been
+ * constructed, validate the objects in the "zoo".
*
* If pass is false on entry, do nothing.
*
@@ -3824,116 +3313,115 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num)
/* validate an empty "new style" group */
if ( pass ) {
- sprintf(full_path, "%s/A", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/A", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_0(fid, full_path);
}
/* validate a compact "new style" group (3 link messages) */
if ( pass ) {
- sprintf(full_path, "%s/B", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/B", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_c(fid, full_path, 3);
}
- /* validate a dense "new style" group (w/300 links, in v2 B-tree &
+ /* validate a dense "new style" group (w/300 links, in v2 B-tree &
* fractal heap)
*/
if ( pass ) {
- sprintf(full_path, "%s/C", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/C", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_d(fid, full_path, 300);
}
/* validate an empty "old style" group in file */
if ( pass ) {
- sprintf(full_path, "%s/D", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/D", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_os_grp_0(fid, full_path);
}
- /* validate an "old style" group (w/300 links, in v1 B-tree &
+ /* validate an "old style" group (w/300 links, in v1 B-tree &
* local heap)
*/
if ( pass ) {
- sprintf(full_path, "%s/E", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/E", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_os_grp_n(fid, full_path, proc_num, 300);
}
- /* validate a contiguous dataset w/integer datatype (but no data)
- * in file.
+ /* validate a contiguous dataset w/integer datatype (but no data)
+ * in file.
*/
if ( pass ) {
- sprintf(full_path, "%s/F", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/F", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_i(fid, full_path, FALSE);
}
- /* validate a contiguous dataset w/integer datatype (with data)
- * in file.
+ /* validate a contiguous dataset w/integer datatype (with data)
+ * in file.
*/
if ( pass ) {
- sprintf(full_path, "%s/G", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/G", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_i(fid, full_path, TRUE);
}
- /* validate a chunked dataset w/integer datatype (but no data)
- * in file
+ /* validate a chunked dataset w/integer datatype (but no data)
+ * in file
*/
if ( pass ) {
- sprintf(full_path, "%s/H", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/H", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_chk_i(fid, full_path, FALSE);
}
- /* validate a chunked dataset w/integer datatype (and data)
- * in file
+ /* validate a chunked dataset w/integer datatype (and data)
+ * in file
*/
if ( pass ) {
- sprintf(full_path, "%s/I", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/I", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_chk_i(fid, full_path, TRUE);
}
- /* Validate a compact dataset w/integer datatype (but no data)
- * in file
+ /* Validate a compact dataset w/integer datatype (but no data)
+ * in file
*/
if ( pass ) {
- sprintf(full_path, "%s/J", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/J", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_cpt_i(fid, full_path, FALSE);
}
- /* validate a compact dataset w/integer datatype (and data)
- * in file
+ /* validate a compact dataset w/integer datatype (and data)
+ * in file
*/
if ( pass ) {
- sprintf(full_path, "%s/K", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/K", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_cpt_i(fid, full_path, TRUE);
}
- /* validate a contiguous dataset w/variable-length datatype
- * (but no data) to file
+ /* validate a contiguous dataset w/variable-length datatype
+ * (but no data) to file
*/
if ( pass ) {
- sprintf(full_path, "%s/L", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/L", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_v(fid, full_path, FALSE);
}
- /* validate a contiguous dataset w/variable-length datatype
- * (and data) to file
+ /* validate a contiguous dataset w/variable-length datatype
+ * (and data) to file
*/
if ( pass ) {
- sprintf(full_path, "%s/M", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/M", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_v(fid, full_path, TRUE);
}
return;
-
} /* validate_zoo() */
diff --git a/test/gheap.c b/test/gheap.c
index bf0f18a..5b51c0e 100644
--- a/test/gheap.c
+++ b/test/gheap.c
@@ -15,9 +15,9 @@
* Programmer: Robb Matzke <matzke@llnl.gov>
* 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 "H5ACprivate.h"
@@ -28,6 +28,7 @@
#include "H5HGprivate.h"
#include "H5Iprivate.h"
#include "H5Pprivate.h"
+#include "H5VLprivate.h"
/* Macros for printing error messages in loops. These print up to
* GHEAP_REPEATED_ERR_LIM errors, and suppress the rest */
@@ -56,37 +57,35 @@ const char *FILENAME[] = {
NULL
};
-
+
/*-------------------------------------------------------------------------
* 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
+ * 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");
@@ -97,10 +96,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;
- if(NULL == (f = (H5F_t *)H5I_object(file))) {
+ goto error;
+ if(NULL == (f = (H5F_t *)H5VL_object(file))) {
H5_FAILED();
- puts(" Unable to create file");
+ HDputs(" Unable to create file");
goto error;
}
@@ -116,11 +115,12 @@ test_1 (hid_t fapl)
status = H5HG_insert(f, 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++;
}
}
@@ -134,11 +134,12 @@ test_1 (hid_t fapl)
H5Eclear2(H5E_DEFAULT);
if(NULL == H5HG_read(f, 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++;
}
}
@@ -147,51 +148,51 @@ 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);
return MAX(1, nerrors);
}
-
+
/*-------------------------------------------------------------------------
* 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");
@@ -202,10 +203,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;
- if(NULL == (f = (H5F_t *)H5I_object(file))) {
+ goto error;
+ if(NULL == (f = (H5F_t *)H5VL_object(file))) {
H5_FAILED();
- puts(" Unable to create file");
+ HDputs(" Unable to create file");
goto error;
}
@@ -216,9 +217,9 @@ test_2 (hid_t fapl)
size = GHEAP_TEST_NOBJS - u;
HDmemset(out, (int)('A' + u % 26), size);
H5Eclear2(H5E_DEFAULT);
- if (H5HG_insert (f, size, out, obj + u) < 0) {
+ if(H5HG_insert(f, size, out, obj + u) < 0) {
H5_FAILED();
- puts(" Unable to insert object into global heap");
+ HDputs(" Unable to insert object into global heap");
nerrors++;
}
}
@@ -232,11 +233,12 @@ test_2 (hid_t fapl)
H5Eclear2(H5E_DEFAULT);
if(NULL == H5HG_read(f, 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++;
}
}
@@ -245,51 +247,51 @@ 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);
return MAX(1, nerrors);
}
-
+
/*-------------------------------------------------------------------------
* 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
+ * 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");
@@ -300,11 +302,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;
- if(NULL == (f = (H5F_t *)H5I_object(file))) {
- H5_FAILED();
- puts(" Unable to create file");
- goto error;
+ goto error;
+ if(NULL == (f = (H5F_t *)H5VL_object(file))) {
+ H5_FAILED();
+ HDputs(" Unable to create file");
+ goto error;
}
/* Create some stuff */
@@ -315,7 +317,7 @@ test_3 (hid_t fapl)
status = H5HG_insert(f, 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++;
}
}
@@ -325,7 +327,7 @@ test_3 (hid_t fapl)
status = H5HG_remove(f, obj + u);
if (status<0) {
H5_FAILED();
- puts(" Unable to remove object");
+ HDputs(" Unable to remove object");
nerrors++;
}
}
@@ -334,52 +336,52 @@ 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);
return MAX(1, nerrors);
}
-
+
/*-------------------------------------------------------------------------
* 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
+ * 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");
@@ -390,10 +392,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;
- if(NULL == (f = (H5F_t *)H5I_object(file))) {
+ goto error;
+ if(NULL == (f = (H5F_t *)H5VL_object(file))) {
H5_FAILED();
- puts(" Unable to create file");
+ HDputs(" Unable to create file");
goto error;
}
@@ -405,21 +407,20 @@ test_4 (hid_t fapl)
status = H5HG_insert(f, 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, 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);
@@ -430,51 +431,51 @@ 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);
return MAX(1, nerrors);
}
-
+
/*-------------------------------------------------------------------------
* 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
+ * 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");
@@ -485,18 +486,20 @@ test_ooo_indices(hid_t fapl)
h5_fixname(FILENAME[4], fapl, filename, sizeof filename);
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
goto error;
- if(NULL == (f = (H5F_t *)H5I_object(file))) {
+ if(NULL == (f = (H5F_t *)H5VL_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, sizeof(j), &j, &obj[j]);
@@ -506,7 +509,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)
@@ -515,20 +518,21 @@ test_ooo_indices(hid_t fapl)
status = H5HG_remove(f, &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))) {
+ if(NULL == (f = (H5F_t *)H5VL_object(file))) {
H5_FAILED();
- puts(" Unable to open file");
+ HDputs(" Unable to open file");
goto error;
} /* end if */
@@ -538,14 +542,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;
@@ -554,69 +559,67 @@ test_ooo_indices(hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
return MAX(1, nerrors);
} /* end test_ooo_indices */
-
+
/*-------------------------------------------------------------------------
- * Function: main
- *
- * Purpose: Tests global heap.
+ * Function: main
*
- * Return: Success: zero
- *
- * Failure: non-zero
- *
- * Programmer: Robb Matzke
- * Tuesday, March 31, 1998
+ * Purpose: Tests global heap.
*
- * 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;
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
h5_reset();
- fapl = h5_fileaccess();
+ if ((fapl_id = h5_fileaccess()) < 0)
+ goto error;
/* Push API context */
if(H5CX_push() < 0) FAIL_STACK_ERROR
api_ctx_pushed = TRUE;
- 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.");
+
+ HDputs("All global heap tests passed.");
/* Pop API context */
if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
api_ctx_pushed = FALSE;
- h5_cleanup(FILENAME, fapl);
- return 0;
+ h5_cleanup(FILENAME, fapl_id);
+ HDexit(EXIT_SUCCESS);
error:
- puts("*** TESTS FAILED ***");
+ H5E_BEGIN_TRY {
+ H5Pclose(fapl_id);
+ } H5E_END_TRY;
if(api_ctx_pushed) H5CX_pop();
- return 1;
-}
+ HDputs("*** TESTS FAILED ***");
+ HDexit(EXIT_FAILURE);
+} /* end main() */
diff --git a/test/h5test.c b/test/h5test.c
index 64a22b1..203e02a 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -42,7 +42,16 @@
* 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_VOL_CONNECTOR: This string describes what VOL connector to
+ * use for HDF5 file access. The first word in the
+ * value is the name of the connector and subsequent data
+ * is interpreted according to the connector. See
+ * h5_get_vol_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
@@ -753,8 +762,8 @@ h5_rmprefix(const char *filename)
* Function: h5_fileaccess
*
* Purpose: Returns a file access template which is the default template
- * but with a file driver set according to the constant or
- * environment variable HDF5_DRIVER
+ * 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: -1
@@ -767,135 +776,34 @@ h5_rmprefix(const char *filename)
hid_t
h5_fileaccess(void)
{
- const char *val = NULL;
- const char *name;
- char s[1024];
hid_t fapl = -1;
- /* First use the environment variable, then the constant */
- val = HDgetenv("HDF5_DRIVER");
-#ifdef HDF5_DRIVER
- if(!val)
- val = 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")) {
- /* Standard C fread() and fwrite() system calls */
- if (H5Pset_fapl_stdio(fapl) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "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")) {
- /* In-memory driver with write tracking and paging on */
- if(H5Pset_fapl_core(fapl, (size_t)1, TRUE) < 0)
- return -1;
- if(H5Pset_core_write_tracking(fapl, TRUE, (size_t)4096) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "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")) {
- /* 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 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);
+ /* Attempt to set up a file driver first */
+ if(h5_get_vfd_fapl(fapl) < 0)
+ return -1;
- 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;
- 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;
-
- 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*/
-
- /* 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;
-
- /* Log file access */
- if((val = HDstrtok(NULL, " \t\n\r")))
- log_flags = (unsigned)HDstrtol(val, NULL, 0);
- if(H5Pset_fapl_log(fapl, NULL, log_flags, (size_t)0) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "direct")) {
-#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. */
- if(H5Pset_fapl_direct(fapl, 1024, 4096, 8 * 4096) < 0)
- return -1;
-#endif
- }
- else if(!HDstrcmp(name, "latest")) {
- /* use the latest format */
- if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- return -1;
- }
- else {
- /* Unknown driver */
+ /* Next, try to set up a VOL connector */
+ if(h5_get_vol_fapl(fapl) < 0)
return -1;
- }
-
- return fapl;
-}
+
+ /* Finally, check for libver bounds */
+ if(h5_get_libver_fapl(fapl) < 0)
+ return -1;
+
+ return(fapl);
+} /* end h5_fileaccess() */
/*-------------------------------------------------------------------------
* Function: h5_get_vfd_fapl
*
- * Purpose: Returns a file access property list which is the default
- * fapl but with a file driver set according to the constant or
- * environment variable HDF5_DRIVER.
+ * Purpose: Sets the file driver for a FAPL according to the value specified
+ * in the constant or environment variable "HDF5_DRIVER".
*
- * Return: Success: A file access property list ID
+ * Return: Success: 0
* Failure: -1
*
* Programmer: Dana Robinson
@@ -903,60 +811,58 @@ h5_fileaccess(void)
*
*-------------------------------------------------------------------------
*/
-hid_t
-h5_get_vfd_fapl(void)
+herr_t
+h5_get_vfd_fapl(hid_t fapl)
{
const char *env = NULL; /* HDF5_DRIVER environment variable */
const char *tok = NULL; /* strtok pointer */
char buf[1024]; /* buffer for tokenizing HDF5_DRIVER */
- hid_t fapl = -1; /* fapl to be returned */
/* Get the environment variable, if it exists */
env = HDgetenv("HDF5_DRIVER");
-
- /* Create a default fapl */
- if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- return -1;
+#ifdef HDF5_DRIVER
+ /* Use the environment variable, then the compile-time constant */
+ if(!env)
+ env = HDF5_DRIVER;
+#endif
/* If the environment variable was not set, just return
- * the default fapl.
+ * without modifying the FAPL.
*/
if(!env || !*env)
- return fapl;
+ 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));
- HDmemset(buf, 0, sizeof(buf));
+ buf[sizeof(buf) - 1] = '\0';
if(NULL == (tok = HDstrtok(buf, " \t\n\r")))
- return fapl;
+ goto done;
if(!HDstrcmp(tok, "sec2")) {
/* POSIX (section 2) read() and write() system calls */
if(H5Pset_fapl_sec2(fapl) < 0)
- return -1;
+ goto error;
} else if(!HDstrcmp(tok, "stdio")) {
/* Standard C fread() and fwrite() system calls */
if(H5Pset_fapl_stdio(fapl) < 0)
- return -1;
+ 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;
+ 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;
+ goto error;
if(H5Pset_core_write_tracking(fapl, TRUE, (size_t)4096) < 0)
- return -1;
+ 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;
+ 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];
@@ -982,19 +888,19 @@ h5_get_vfd_fapl(void)
} /* 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(tok, "family")) {
/* Family of files, each 1MB and using the default driver */
- hsize_t fam_size = 100*1024*1024; /*100 MB*/
+ hsize_t fam_size = 100 * 1024 * 1024; /* 100 MB */
/* Was a family size specified in the environment variable? */
if((tok = HDstrtok(NULL, " \t\n\r")))
- fam_size = (hsize_t)(HDstrtod(tok, NULL) * 1024*1024);
+ fam_size = (hsize_t)(HDstrtod(tok, NULL) * 1024 * 1024);
if(H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT) < 0)
- return -1;
+ goto error;
} else if(!HDstrcmp(tok, "log")) {
/* Log file access */
unsigned log_flags = H5FD_LOG_LOC_IO | H5FD_LOG_ALLOC;
@@ -1004,25 +910,194 @@ h5_get_vfd_fapl(void)
log_flags = (unsigned)HDstrtol(tok, NULL, 0);
if(H5Pset_fapl_log(fapl, NULL, log_flags, (size_t)0) < 0)
- return -1;
+ goto error;
#ifdef H5_HAVE_DIRECT
} 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;
+ if(H5Pset_fapl_direct(fapl, 1024, 4096, 8 * 4096) < 0)
+ goto error;
#endif
} 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 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(buf, " \t\n\r")))
+ 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() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: h5_get_vol_fapl
+ *
+ * Purpose: Returns a file access property list which is the default
+ * fapl but with a VOL connector set according to the constant
+ * or environment variable HDF5_VOL_CONNECTOR.
+ *
+ * Return: Success: A file access property list ID
+ * Failure: -1
+ *
+ * Programmer: Jordan Henderson
+ * November 2018
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+h5_get_vol_fapl(hid_t fapl)
+{
+ const char *env = NULL;
+ const char *tok = NULL;
+ htri_t connector_is_registered;
+ char buf[1024]; /* Buffer for tokenizing HDF5_VOL_CONNECTOR */
+ void *vol_info = NULL; /* VOL connector info */
+ hid_t connector_id = -1;
+
+ /* Get the environment variable, if it exists */
+ env = HDgetenv("HDF5_VOL_CONNECTOR");
+#ifdef HDF5_VOL_CONNECTOR
+ /* Use the environment variable, then the compile-time constant */
+ if(!env)
+ env = HDF5_VOL_CONNECTOR;
+#endif
+
+ /* If the environment variable was not set, just return. */
+ if(!env || !*env)
+ goto done;
+
+ /* Get the first 'word' of the environment variable.
+ * If it's nothing (environment variable was whitespace) just return.
+ */
+ HDstrncpy(buf, env, sizeof(buf));
+ buf[sizeof(buf) - 1] = '\0';
+ if(NULL == (tok = HDstrtok(buf, " \t\n\r")))
+ goto done;
+
+ /* First, check to see if the connector is already registered */
+ if((connector_is_registered = H5VLis_connector_registered(tok)) < 0)
+ goto done;
+ else if(connector_is_registered) {
+ /* Retrieve the ID of the already-registered VOL connector */
+ if((connector_id = H5VLget_connector_id(tok)) < 0)
+ goto error;
+ } /* end else-if */
+ else {
+ /* Check for VOL connectors that ship with the library */
+ if(!HDstrcmp(tok, "native")) {
+ connector_id = H5VL_NATIVE;
+ if(H5Iinc_ref(connector_id) < 0)
+ goto error;
+ } else if(!HDstrcmp(tok, "pass_through")) {
+ connector_id = H5VL_PASSTHRU;
+ if(H5Iinc_ref(connector_id) < 0)
+ goto error;
+ } else {
+ /* Register the VOL connector */
+ /* (NOTE: No provisions for vipl_id currently) */
+ if((connector_id = H5VLregister_connector_by_name(tok, H5P_DEFAULT)) < 0)
+ goto error;
+ } /* end else */
+ } /* end else */
+
+ /* Was there any connector info specified in the environment variable? */
+ if(NULL != (tok = HDstrtok(NULL, " \t\n\r")))
+ if(H5VLconnector_str_to_info(tok, connector_id, &vol_info) < 0)
+ goto error;
+
+ /* Set the VOL connector in the FAPL */
+ if(H5Pset_vol(fapl, connector_id, vol_info) < 0)
+ goto error;
+
+ /* Release VOL connector info, if there was any */
+ if(vol_info)
+ if(H5VLfree_connector_info(connector_id, vol_info) < 0)
+ goto error;
+
+ /* Close the connector ID */
+ if(connector_id >= 0)
+ if(H5VLunregister_connector(connector_id) < 0)
+ goto error;
+
+done:
+ return 0;
+
+error:
+ if(vol_info)
+ H5VLfree_connector_info(connector_id, vol_info);
+ if(connector_id >= 0)
+ H5VLunregister_connector(connector_id);
+
+ return -1;
+} /* end h5_get_vol_fapl() */
+
+
+/*-------------------------------------------------------------------------
* Function: h5_no_hwconv
*
* Purpose: Turn off hardware data type conversions.
@@ -1594,15 +1669,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
@@ -1610,9 +1681,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() */
@@ -1866,3 +1937,46 @@ error:
return NULL;
} /* h5_get_dummy_vfd_class */
+
+/*-------------------------------------------------------------------------
+ * Function: h5_get_dummy_vol_class()
+ *
+ * Purpose: Returns a disposable, generally non-functional,
+ * VOL class struct.
+ *
+ * In some of the test code, we need a disposable VOL connector
+ * but we don't want to mess with the real VFDs and we also
+ * don't have access to the internals of the real VOL connectors
+ * (which use static globals and functions) to easily duplicate
+ * them (e.g.: for testing VOL connector ID handling).
+ *
+ * This API call will return a pointer to a VOL class that
+ * can be used to construct a test VOL using H5VLregister_connector().
+ *
+ * Return: Success: A pointer to a VOL class struct
+ * Failure: NULL
+ *
+ *-------------------------------------------------------------------------
+ */
+H5VL_class_t *
+h5_get_dummy_vol_class(void)
+{
+ H5VL_class_t *vol_class = NULL; /* Dummy VOL class that will be returned */
+
+ /* Create the class and initialize everything to zero/NULL */
+ if(NULL == (vol_class = (H5VL_class_t *)HDcalloc((size_t)1, sizeof(H5VL_class_t))))
+ TEST_ERROR;
+
+ /* Fill in the minimum parameters to make a VOL connector class that
+ * can be registered.
+ */
+ vol_class->name = "dummy";
+
+ return vol_class;
+
+error:
+ if(vol_class)
+ HDfree(vol_class);
+ return NULL;
+} /* h5_get_dummy_vol_class */
+
diff --git a/test/h5test.h b/test/h5test.h
index 8e87192..c72f389 100644
--- a/test/h5test.h
+++ b/test/h5test.h
@@ -142,13 +142,12 @@ 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);
H5TEST_DLL H5FD_class_t *h5_get_dummy_vfd_class(void);
+H5TEST_DLL H5VL_class_t *h5_get_dummy_vol_class(void);
-/* 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 */
-H5TEST_DLL hid_t h5_get_vfd_fapl(void);
+/* 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_vol_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);
diff --git a/test/istore.c b/test/istore.c
index b5bac2c..1d57a2a 100644
--- a/test/istore.c
+++ b/test/istore.c
@@ -216,7 +216,7 @@ test_create(hid_t f, const char *prefix)
/* Create chunked dataset of this dimensionality */
HDsnprintf(name, sizeof name, "%s_%02u", prefix, u);
- if ((dataset=new_object(f, name, (int)u, dims, my_chunk_dims)) < 0)
+ if((dataset = new_object(f, name, (int)u, dims, my_chunk_dims)) < 0)
return FAIL;
/* Close dataset created */
diff --git a/test/lheap.c b/test/lheap.c
index 4f09b6e..e9e626f 100644
--- a/test/lheap.c
+++ b/test/lheap.c
@@ -23,6 +23,7 @@
#include "H5CXprivate.h" /* API Contexts */
#include "H5HLprivate.h"
#include "H5Iprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
const char *FILENAME[] = {
"lheap",
@@ -41,9 +42,7 @@ const char *FILENAME[] = {
* heap, close the file, open the file, read data out of the
* local heap, close the file.
*
- * Return: Success: zero
- *
- * Failure: non-zero
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Robb Matzke
* Tuesday, November 24, 1998
@@ -80,7 +79,7 @@ main(void)
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if(FAIL == (file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)))
goto error;
- if(NULL == (f = (H5F_t *)H5I_object(file))) {
+ if(NULL == (f = (H5F_t *)H5VL_object(file))) {
H5_FAILED();
H5Eprint2(H5E_DEFAULT, stdout);
goto error;
@@ -95,7 +94,7 @@ main(void)
H5Eprint2(H5E_DEFAULT, stdout);
goto error;
}
- if (NULL == (heap = H5HL_protect(f, heap_addr, H5AC__NO_FLAGS_SET))) {
+ if(NULL == (heap = H5HL_protect(f, heap_addr, H5AC__NO_FLAGS_SET))) {
H5_FAILED();
H5Eprint2(H5E_DEFAULT, stdout);
goto error;
@@ -130,7 +129,7 @@ main(void)
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if(FAIL == (file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)))
goto error;
- if(NULL == (f = (H5F_t *)H5I_object(file))) {
+ if(NULL == (f = (H5F_t *)H5VL_object(file))) {
H5_FAILED();
H5Eprint2(H5E_DEFAULT, stdout);
goto error;
@@ -147,7 +146,7 @@ main(void)
if(j > 4)
buf[j] = '\0';
- if (NULL == (heap = H5HL_protect(f, heap_addr, H5AC__READ_ONLY_FLAG))) {
+ if(NULL == (heap = H5HL_protect(f, heap_addr, H5AC__READ_ONLY_FLAG))) {
H5_FAILED();
H5Eprint2(H5E_DEFAULT, stdout);
goto error;
@@ -211,7 +210,7 @@ main(void)
HDputs("All local heap tests passed.");
h5_cleanup(FILENAME, fapl);
- return 0;
+ return EXIT_SUCCESS;
error:
HDputs("*** TESTS FAILED ***");
@@ -221,6 +220,6 @@ main(void)
if(api_ctx_pushed) H5CX_pop();
- return 1;
+ return EXIT_FAILURE;
}
diff --git a/test/links.c b/test/links.c
index 4d8b810..b1fd9a3 100644
--- a/test/links.c
+++ b/test/links.c
@@ -4059,7 +4059,7 @@ external_set_elink_acc_flags(const char *env_h5_drvr, hid_t fapl, hbool_t new_fo
if(H5Fclose(file1) < 0) TEST_ERROR
/* Only run this part with VFDs that support SWMR */
- if(H5FD_supports_swmr_test(env_h5_drvr)) {
+ if(H5FD__supports_swmr_test(env_h5_drvr)) {
/* Reopen file1, with read-write and SWMR-write access */
/* Only supported under the latest file format */
@@ -7756,6 +7756,7 @@ done:
case H5I_ATTR:
case H5I_REFERENCE:
case H5I_VFL:
+ case H5I_VOL:
case H5I_GENPROP_CLS:
case H5I_GENPROP_LST:
case H5I_ERROR_CLASS:
@@ -7844,6 +7845,7 @@ done:
case H5I_ATTR:
case H5I_REFERENCE:
case H5I_VFL:
+ case H5I_VOL:
case H5I_GENPROP_CLS:
case H5I_GENPROP_LST:
case H5I_ERROR_CLASS:
@@ -8365,9 +8367,9 @@ ud_callbacks(hid_t fapl, hbool_t new_format)
if (H5Lget_info(fid, UD_CB_LINK_NAME, &li, H5P_DEFAULT) < 0) TEST_ERROR
if(li.u.val_size != 16) TEST_ERROR
if (UD_CB_TYPE != li.type) {
- H5_FAILED();
- HDputs(" Unexpected link class - should have been a UD hard link");
- goto error;
+ H5_FAILED();
+ HDputs(" Unexpected link class - should have been a UD hard link");
+ goto error;
}
/* Fill the query buffer */
@@ -9015,9 +9017,9 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
gid = H5Oopen(fid, "soft5", plist);
} H5E_END_TRY;
if (gid >= 0) {
- H5_FAILED();
- HDputs(" Should have failed for sequence of too many nested links.");
- goto error;
+ H5_FAILED();
+ HDputs(" Should have failed for sequence of too many nested links.");
+ goto error;
}
/* Open object through lesser soft link */
@@ -15061,6 +15063,7 @@ main(void)
/* New group revision feature tests */
nerrors += corder_create_empty(fapl2) < 0 ? 1 : 0;
+
/* XXX: when creation order indexing is fully working, go back and add checks
* to these tests to make certain that the creation order values are
* correct.
diff --git a/test/links_env.c b/test/links_env.c
index b32fb32..0cd690a 100644
--- a/test/links_env.c
+++ b/test/links_env.c
@@ -148,11 +148,6 @@ main(void)
{
hid_t fapl; /* File access property lists */
int nerrors = 0; /* Error from tests */
- const char *env_h5_drvr; /* File Driver value from environment */
-
- env_h5_drvr = HDgetenv("HDF5_DRIVER");
- if(env_h5_drvr == NULL)
- env_h5_drvr = "nomatch";
h5_reset();
fapl = h5_fileaccess();
diff --git a/test/mf.c b/test/mf.c
index 04b7c0b..4dccae6 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -36,6 +36,7 @@
#include "H5CXprivate.h" /* API Contexts */
#include "H5FLprivate.h"
#include "H5Iprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
#include "H5VMprivate.h"
#define FILENAME_LEN 1024
@@ -255,7 +256,7 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -297,7 +298,7 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30);
@@ -400,7 +401,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -432,7 +433,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -477,7 +478,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -526,7 +527,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -569,7 +570,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -681,7 +682,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -712,7 +713,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* should succeed */
@@ -759,7 +760,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -899,11 +900,11 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Retrieve the file's maxaddr */
- if(H5F_get_maxaddr_test(file, &maxaddr) < 0)
+ if(H5F__get_maxaddr_test(file, &maxaddr) < 0)
FAIL_STACK_ERROR
/* Allocate some temporary address space */
@@ -953,7 +954,7 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate 1/3 of the file as temporary address space */
@@ -1061,7 +1062,7 @@ test_mf_fs_start(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
@@ -1173,7 +1174,7 @@ test_mf_fs_alloc_free(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
@@ -1250,7 +1251,7 @@ test_mf_fs_alloc_free(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
@@ -1325,7 +1326,7 @@ test_mf_fs_alloc_free(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
@@ -1498,7 +1499,7 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
@@ -1606,7 +1607,7 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
@@ -1708,7 +1709,7 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
@@ -1810,7 +1811,7 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
@@ -1982,7 +1983,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
@@ -2038,7 +2039,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
@@ -2164,7 +2165,7 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
TEST_ERROR
/* Allocate first block from meta_aggr */
@@ -2202,7 +2203,7 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
TEST_ERROR
/* Free the two blocks: order matters because of H5F_FSPACE_STRATEGY_AGGR strategy */
@@ -2305,7 +2306,7 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
@@ -2351,7 +2352,7 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30+TBLOCK_SIZE50+TBLOCK_SIZE2058);
@@ -2461,7 +2462,7 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate first block from meta_aggr */
@@ -2624,7 +2625,7 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate first block from meta_aggr */
@@ -2772,7 +2773,7 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate first block from meta_aggr */
@@ -2906,7 +2907,7 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
@@ -3073,7 +3074,7 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate the first block from meta_aggr */
@@ -3236,7 +3237,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate the first block from meta_aggr */
@@ -3327,7 +3328,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate the first block from meta_aggr */
@@ -3397,7 +3398,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate first block from meta_aggr */
@@ -3527,7 +3528,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate block A from meta_aggr */
@@ -3574,7 +3575,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate block A from meta_aggr */
@@ -3633,7 +3634,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate block A from meta_aggr */
@@ -3702,7 +3703,7 @@ error:
* Alignment = 1024 or 4096
*
* Test 1:
- * Turn off using meta data aggregator
+ * Turn off using metadata aggregator
* Allocate a block of 30 which should be from file allocation
* Result:
* The return address should be aligned
@@ -3715,13 +3716,13 @@ error:
* A fragment [1054, 994] or [4126, 4066] is freed to free-space
* EOA is 2098 or 8242
* Test 2:
- * Turn off using meta data aggregator
+ * Turn off using metadata aggregator
* Allocate a block which should be from file allocation
* The return address should be aligned
* H5MF_try_shrink() the block with aligned address should succeed
*
* Test 3:
- * Turn off using meta data aggregator
+ * Turn off using metadata aggregator
* Allocate a block which should be from file allocation
* The return address should be aligned
* H5MF_try_extend() the block with aligned address should succeed
@@ -3782,7 +3783,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* calculate fragment for alignment of block 30 */
@@ -3864,7 +3865,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* allocate a block of 50 from meta_aggr */
@@ -3886,7 +3887,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* shrink the block */
@@ -3919,7 +3920,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* allocate a block of 50 */
@@ -3941,7 +3942,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* try to extend the block */
@@ -4041,7 +4042,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
@@ -4104,7 +4105,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
@@ -4187,7 +4188,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
@@ -4407,7 +4408,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* calculate fragment for alignment of block 30 */
@@ -4663,7 +4664,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* calculate fragment for alignment of block 30 */
@@ -5002,7 +5003,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* calculate fragment for alignment of block 30 */
@@ -5303,7 +5304,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* get alignment setting */
@@ -5514,7 +5515,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* get alignment setting */
@@ -5778,7 +5779,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* get alignment setting */
@@ -5917,17 +5918,17 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
PASSED()
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support mis-aligned fragments");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
- return(0);
+ return 0;
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_mf_align_alloc6() */
/*
@@ -6028,7 +6029,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
TEST_ERROR
/* Allocate a block of size align from meta_aggr. This should create an
@@ -6114,7 +6115,7 @@ test_mf_fs_persist_split(void)
TESTING("File's free-space managers are persistent for split-file");
- /* for now, we don't support persistent free space managers
+ /* for now, we don't support persistent free space managers
* with the split file driver.
*/
SKIPPED();
@@ -6124,7 +6125,7 @@ test_mf_fs_persist_split(void)
/* File creation property list template */
if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
- /* for now, we don't support persistent free space managers
+ /* for now, we don't support persistent free space managers
* with the split file driver.
*/
SKIPPED();
@@ -6156,7 +6157,7 @@ test_mf_fs_persist_split(void)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate 4 blocks of type H5FD_MEM_SUPER */
@@ -6201,7 +6202,7 @@ test_mf_fs_persist_split(void)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Verify that the H5FD_MEM_SUPER free-space manager is there */
@@ -6286,7 +6287,7 @@ test_mf_fs_persist_split(void)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Verify that the free-space manager for H5FD_MEM_DRAW is not there */
@@ -6330,7 +6331,7 @@ test_mf_fs_persist_split(void)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Verify that the H5FD_MEM_SUPER free-space manager is there */
@@ -6436,14 +6437,14 @@ test_mf_fs_persist_multi(void)
TESTING("File's free-space managers are persistent for multi-file");
- /* for now, we don't support persistent free space managers
+ /* for now, we don't support persistent free space managers
* with the multi file driver.
*/
SKIPPED();
HDfprintf(stdout, " Persistent FSMs disabled in multi file driver.\n");
return 0; /* <========== note return */
- /* for now, we don't support persistent free space managers
+ /* for now, we don't support persistent free space managers
* with the multi file driver.
*/
SKIPPED();
@@ -6473,7 +6474,7 @@ test_mf_fs_persist_multi(void)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate 4 blocks of type H5FD_MEM_SUPER */
@@ -6518,7 +6519,7 @@ test_mf_fs_persist_multi(void)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Verify that the H5FD_MEM_SUPER free-space manager is there */
@@ -6600,7 +6601,7 @@ test_mf_fs_persist_multi(void)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Verify that the free-space manager for H5FD_MEM_SUPER is there */
@@ -6666,7 +6667,7 @@ test_mf_fs_persist_multi(void)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* If H5FD_MEM_SUPER is there, should not find block #1 & #3 */
@@ -6778,7 +6779,7 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate 6 blocks */
@@ -6812,7 +6813,7 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
H5MF__alloc_to_fs_type(f, type, TBLOCK_SIZE6, (H5F_mem_page_t *)&tt);
@@ -6867,7 +6868,7 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Verify that H5FD_MEM_SUPER free-space manager is there */
@@ -6959,7 +6960,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate 4 blocks */
@@ -6993,7 +6994,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
H5MF__alloc_to_fs_type(f, type, TBLOCK_SIZE4, (H5F_mem_page_t *)&fs_type);
@@ -7014,7 +7015,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Verify that H5FD_MEM_SUPER free-space manager is there */
@@ -7027,7 +7028,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
* assertion failures on the first file space alloc / dealloc.
*/
if(f->shared->first_alloc_dealloc){
- if(SUCCEED!=H5MF_tidy_self_referential_fsm_hack(f))
+ if(SUCCEED != H5MF_tidy_self_referential_fsm_hack(f))
FAIL_STACK_ERROR
ran_H5MF_tidy_self_referential_fsm_hack = TRUE;
}
@@ -7071,7 +7072,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Verify that the H5FD_MEM_SUPER free-space manager is not there */
if(H5F_addr_defined(f->shared->fs_addr[fs_type]))
@@ -7169,7 +7170,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate 6 blocks */
@@ -7205,13 +7206,13 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
H5MF__alloc_to_fs_type(f, type, TBLOCK_SIZE6, (H5F_mem_page_t *)&tt);
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
if(f->shared->fs_persist) {
@@ -7341,7 +7342,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate 6 blocks */
@@ -7424,7 +7425,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Free-space manager should be empty */
@@ -7498,7 +7499,7 @@ test_dichotomy(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate the first block of type H5FD_MEM_SUPER */
@@ -7614,7 +7615,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
hid_t fcpl = -1; /* File creation property list */
hid_t fapl_new = -1; /* File access property list ID */
H5F_t *f = NULL; /* Internal file object pointer */
- haddr_t addr2, addr3; /* Addresses for small meta data blocks */
+ haddr_t addr2, addr3; /* Addresses for small metadata blocks */
haddr_t saddr1; /* Addresses for small raw data blocks */
haddr_t gaddr1; /* Addresses for large data blocks */
hbool_t split = FALSE, multi = FALSE;
@@ -7658,10 +7659,10 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR
- /* Allocate 3 small meta data blocks: addr1, addr2, addr3 */
+ /* Allocate 3 small metadata blocks: addr1, addr2, addr3 */
H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE30);
addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE1034);
addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50);
@@ -7673,7 +7674,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
H5MF__alloc_to_fs_type(f, H5FD_MEM_OHDR, TBLOCK_SIZE1034, (H5F_mem_page_t *)&fs_type);
- /* Verify that the freed block with addr2 is found from the small meta data manager */
+ /* Verify that the freed block with addr2 is found from the small metadata manager */
if(H5MF__find_sect(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE1034, f->shared->fs_man[fs_type], &found_addr) < 0)
TEST_ERROR
if(found_addr != addr2)
@@ -7727,7 +7728,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR
/* Verify that the large generic manager is there */
@@ -7735,7 +7736,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
if(!H5F_addr_defined(f->shared->fs_addr[fs_type]))
TEST_ERROR
- /* Verify that the small meta data manager is there */
+ /* Verify that the small metadata manager is there */
H5MF__alloc_to_fs_type(f, H5FD_MEM_OHDR, f->shared->fs_page_size - 1, (H5F_mem_page_t *)&fs_type);
if(!H5F_addr_defined(f->shared->fs_addr[fs_type]))
TEST_ERROR
@@ -7746,16 +7747,16 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
* assertion failures on the first file space alloc / dealloc.
*/
if(f->shared->first_alloc_dealloc){
- if(SUCCEED!=H5MF_tidy_self_referential_fsm_hack(f))
+ if(SUCCEED != H5MF_tidy_self_referential_fsm_hack(f))
FAIL_STACK_ERROR
}
- /* Set up to use the small meta data manager */
+ /* Set up to use the small metadata manager */
if(!(f->shared->fs_man[fs_type]))
if(H5MF__open_fstype(f, fs_type) < 0)
TEST_ERROR
- /* Verify that the freed block with addr2 is found from the small meta data manager */
+ /* Verify that the freed block with addr2 is found from the small metadata manager */
if(H5MF__find_sect(f, H5FD_MEM_OHDR, (hsize_t)(f->shared->fs_page_size-(addr3+TBLOCK_SIZE50)), f->shared->fs_man[fs_type], &found_addr) < 0)
TEST_ERROR
@@ -7838,7 +7839,7 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl)
hid_t fid = -1; /* File ID */
hid_t fcpl = -1; /* File creation property list */
H5F_t *f = NULL; /* Internal file object pointer */
- haddr_t addr1; /* Address for small meta data block */
+ haddr_t addr1; /* Address for small metadata block */
haddr_t saddr1; /* Address for small raw data block */
haddr_t gaddr1; /* Address for large data block */
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
@@ -7869,17 +7870,17 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
FAIL_STACK_ERROR
- /* Allocate a small meta data block with addr1 */
+ /* Allocate a small metadata block with addr1 */
addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50);
/* Try to shrink the block with addr1 */
if((status = H5MF_try_shrink(f, H5FD_MEM_OHDR, addr1, (hsize_t)TBLOCK_SIZE50)) < 0)
FAIL_STACK_ERROR
- /* Couldn't shrink due to the section (remaining space in the page) is in the small meta data free-space manager */
+ /* Couldn't shrink due to the section (remaining space in the page) is in the small metadata free-space manager */
if(status == TRUE) TEST_ERROR
/* Allocate a small raw data block with saddr1 */
@@ -7961,7 +7962,7 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl)
hid_t fid = -1; /* File ID */
hid_t fcpl = -1; /* File creation property list */
H5F_t *f = NULL; /* Internal file object pointer */
- haddr_t addr1, addr2, addr3; /* Addresses for small meta data blocks */
+ haddr_t addr1, addr2, addr3; /* Addresses for small metadata blocks */
haddr_t saddr1; /* Address for small raw data block */
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
htri_t was_extended; /* Whether the block can be extended or not */
@@ -7990,10 +7991,10 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
FAIL_STACK_ERROR
- /* Allocate a small meta data block with addr1 */
+ /* Allocate a small metadata block with addr1 */
addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE98);
/* Try extending the block with addr1 at EOF not crossing page boundary */
@@ -8001,7 +8002,7 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl)
/* Should succeed */
if(was_extended != TRUE) TEST_ERROR
- /* Allocate 2 small meta data blocks with addr2 and addr3--will be on another meta data page */
+ /* Allocate 2 small metadata blocks with addr2 and addr3--will be on another metadata page */
addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE100);
addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE150);
@@ -8028,7 +8029,7 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl)
/* Free the block with addr1 */
H5MF_xfree(f, H5FD_MEM_OHDR, addr1, (hsize_t)TBLOCK_SIZE3248);
- /* Allocate a new meta data block with addr1 */
+ /* Allocate a new metadata block with addr1 */
/* There is a page end threshold of size H5F_FILE_SPACE_PGEND_META_THRES at the end of the block */
/* The block is right next to the threshold */
addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3286);
@@ -8144,7 +8145,7 @@ test_page_large_try_extend(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
FAIL_STACK_ERROR
/* Allocate a large data block with gaddr1 */
@@ -8286,7 +8287,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
FAIL_STACK_ERROR
/* Allocate a large data block with gaddr1 */
@@ -8409,7 +8410,7 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
hid_t fcpl = -1; /* File creation property list */
H5F_t *f = NULL; /* Internal file object pointer */
haddr_t addr2, addr3, addr4, addr5; /* Addresses for blocks */
- haddr_t addr9, addr10, addr11; /* Address for small meta data blocks */
+ haddr_t addr9, addr10, addr11; /* Address for small metadata blocks */
haddr_t saddr1, saddr2; /* Addresses for small raw data blocks */
H5FS_stat_t fs_stat; /* Information for free-space manager */
char filename[FILENAME_LEN]; /* Filename to use */
@@ -8442,10 +8443,10 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
FAIL_STACK_ERROR
- /* Allocate 2 small meta data blocks: addr1, addr2 */
+ /* Allocate 2 small metadata blocks: addr1, addr2 */
H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE30);
addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50);
@@ -8464,13 +8465,13 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
if(saddr2 != (saddr1 + TBLOCK_SIZE30))
TEST_ERROR
- /* Allocate a small meta data block with addr3--there is no free-space section big enough to fulfill the request */
+ /* Allocate a small metadata block with addr3--there is no free-space section big enough to fulfill the request */
addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE4020);
/* Should be on the third page and page aligned */
if(addr3 % TBLOCK_SIZE4096)
TEST_ERROR
- /* Allocate a small meta data block with addr4--there is a free-space section big enough to fulfill the request */
+ /* Allocate a small metadata block with addr4--there is a free-space section big enough to fulfill the request */
addr4 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80);
/* Should not be page aligned */
if(!(addr4 % TBLOCK_SIZE4096))
@@ -8479,7 +8480,7 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
if(addr4 != (addr2 + TBLOCK_SIZE50))
TEST_ERROR
- /* Allocate a small meta data block with addr5--there is a free-space section big enough to fulfill the request */
+ /* Allocate a small metadata block with addr5--there is a free-space section big enough to fulfill the request */
addr5 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE40);
/* Should not be page aligned */
if(!(addr5 % TBLOCK_SIZE4096))
@@ -8489,16 +8490,16 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
if(addr5 != (addr3 + TBLOCK_SIZE4020))
TEST_ERROR
- /* Allocate a small meta data block with addr6--taking up the remaining space in the first page */
+ /* Allocate a small metadata block with addr6--taking up the remaining space in the first page */
if(family)
H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3080);
else
H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3088);
- /* Allocate a small meta data block with addr7--taking up the remaining space in the third page */
+ /* Allocate a small metadata block with addr7--taking up the remaining space in the third page */
H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE36);
- /* Allocate 2 small meta data blocks: addr8, addr9--there is no free-space to fulfill the request */
+ /* Allocate 2 small metadata blocks: addr8, addr9--there is no free-space to fulfill the request */
H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50);
addr9 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80);
@@ -8514,13 +8515,13 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
if(fs_stat.tot_space != TBLOCK_SIZE4096)
TEST_ERROR
- /* Allocate a small meta data block with addr10--there is a free-space section big enough to fulfill the request */
+ /* Allocate a small metadata block with addr10--there is a free-space section big enough to fulfill the request */
addr10 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3900);
/* The block should be next to the block with addr9 */
if(addr10 != (addr9 + TBLOCK_SIZE80))
TEST_ERROR
- /* Allocate a small meta data block with addr11 */
+ /* Allocate a small metadata block with addr11 */
/* The current free-space section is unable to fulfill the request; obtain a page from the large manager */
addr11 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80);
/* The address of the block should be the same the freed block with saddr1 */
@@ -8575,7 +8576,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
hid_t fcpl2 = -1; /* File creation property list ID */
hid_t fapl_new = -1; /* File access property list ID */
H5F_t *f = NULL; /* Internal file object pointer */
- haddr_t addr1, addr2; /* Addresses for small meta data blocks */
+ haddr_t addr1, addr2; /* Addresses for small metadata blocks */
haddr_t saddr1, saddr2; /* Addresses for small raw data blocks */
haddr_t gaddr1, gaddr2; /* Addresses for blocks */
char filename[FILENAME_LEN]; /* Filename to use */
@@ -8686,7 +8687,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR
/* Allocate 2 small raw data blocks */
@@ -8729,7 +8730,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
/* Disable small data block mechanism */
if(H5Pset_small_data_block_size(fapl_new, (hsize_t)0) < 0)
TEST_ERROR
- /* Disable meta data block mechanism */
+ /* Disable metadata block mechanism */
if(H5Pset_meta_block_size(fapl_new, (hsize_t)0) < 0)
TEST_ERROR
@@ -8738,10 +8739,10 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR
- /* Allocate 2 small meta data blocks */
+ /* Allocate 2 small metadata blocks */
addr1 = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30);
addr2 = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE50);
@@ -8799,7 +8800,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR
/* Allocate 2 small raw data blocks */
diff --git a/test/objcopy.c b/test/objcopy.c
index 18de027..6ee2f72 100644
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -21,9 +21,9 @@
#include "testhdf5.h"
#include "H5srcdir.h"
-#include "H5Bprivate.h"
#include "H5Iprivate.h"
#include "H5Pprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
#define H5F_FRIEND /*suppress error about including H5Fpkg */
#define H5F_TESTING
@@ -2151,7 +2151,7 @@ test_copy_dataset_versionbounds(hid_t fcpl_src, hid_t fapl_src)
buf[i][j] = 10000 + 100*i+j;
/* Create a file access property list for destination file */
- if ((fapl_dst = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR
+ if ((fapl_dst = h5_fileaccess()) < 0) TEST_ERROR
/* Initialize the filenames */
h5_fixname(FILENAME[4], fapl_src, src_fname, sizeof src_fname);
@@ -2180,7 +2180,7 @@ test_copy_dataset_versionbounds(hid_t fcpl_src, hid_t fapl_src)
if (ret < 0) TEST_ERROR
/* Get the internal dset ptr to get the fill version for verifying later */
- if ((dsetp = (H5D_t *)H5I_object(did_src)) == NULL) TEST_ERROR
+ if ((dsetp = (H5D_t *)H5VL_object(did_src)) == NULL) TEST_ERROR
srcdset_fillversion = dsetp->shared->dcpl_cache.fill.version;
/* Close dataspace */
@@ -7854,6 +7854,7 @@ test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, hbool_t test_open)
{
hid_t fid_src = -1, fid_dst = -1; /* File IDs */
hid_t did = -1, did2 = -1; /* Dataset IDs */
+ hid_t src_fapl = -1; /* Source file FAPL ID */
const char *src_filename = H5_get_srcdir_filename(FILE_OLD_LAYOUT); /* Corrected test file name */
char dst_filename[NAME_BUF_SIZE];
@@ -7869,8 +7870,14 @@ test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, hbool_t test_open)
/* Reset file address checking info */
addr_reset();
+ /* Setup */
+ if((src_fapl = h5_fileaccess()) < 0) TEST_ERROR
+
/* open source file (read-only) */
- if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR
+
+ /* Close source FAPL */
+ if(H5Pclose(src_fapl) < 0) TEST_ERROR
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR
@@ -7914,6 +7921,7 @@ test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, hbool_t test_open)
error:
H5E_BEGIN_TRY {
+ H5Pclose(src_fapl);
H5Dclose(did2);
H5Dclose(did);
H5Fclose(fid_dst);
diff --git a/test/ohdr.c b/test/ohdr.c
index 146245f..cca7e7e 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -15,24 +15,25 @@
* Tuesday, November 24, 1998
*/
#include "h5test.h"
-#include "H5Iprivate.h"
+
+#include "H5CXprivate.h" /* API Contexts */
+#include "H5Iprivate.h" /* Identifiers */
+#include "H5VLprivate.h" /* Virtual Object Layer */
/*
* This file needs to access private datatypes from the H5O package.
* This file also needs to access the object header testing code.
*/
-#define H5O_FRIEND /*suppress error about including H5Opkg */
+#define H5O_FRIEND /* suppress error about including H5Opkg */
#define H5O_TESTING
#include "H5Opkg.h"
/*
* This file needs to access private datatypes from the H5G package.
*/
-#define H5G_FRIEND /*suppress error about including H5Gpkg */
+#define H5G_FRIEND /* suppress error about including H5Gpkg */
#include "H5Gpkg.h"
-#include "H5CXprivate.h" /* API Contexts */
-
const char *FILENAME[] = {
"ohdr",
NULL
@@ -78,7 +79,7 @@ test_cont(char *filename, hid_t fapl)
/* Create the file to operate on */
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
if (H5AC_ignore_tags(f) < 0) {
H5_FAILED();
@@ -119,7 +120,7 @@ test_cont(char *filename, hid_t fapl)
FAIL_STACK_ERROR
if(H5AC_flush(f) < 0)
FAIL_STACK_ERROR
- if(H5O_expunge_chunks_test(&oh_locA) < 0)
+ if(H5O__expunge_chunks_test(&oh_locA) < 0)
FAIL_STACK_ERROR
if(H5O_get_hdr_info(&oh_locA, &hdr_info) < 0)
@@ -200,7 +201,7 @@ test_ohdr_cache(char *filename, hid_t fapl)
FAIL_STACK_ERROR
if(H5Pclose(my_fapl) < 0)
FAIL_STACK_ERROR
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
if(H5AC_ignore_tags(f) < 0)
FAIL_STACK_ERROR
@@ -220,7 +221,7 @@ test_ohdr_cache(char *filename, hid_t fapl)
/* Query object header information */
rc = 0;
- if(H5O_get_rc(&oh_loc, &rc) < 0)
+ if(H5O__get_rc_test(&oh_loc, &rc) < 0)
FAIL_STACK_ERROR
if(0 != rc)
TEST_ERROR
@@ -261,7 +262,7 @@ test_ohdr_cache(char *filename, hid_t fapl)
* a non-invasive way -QAK)
*/
rc = 0;
- if(H5O_get_rc(&oh_loc, &rc) < 0)
+ if(H5O__get_rc_test(&oh_loc, &rc) < 0)
FAIL_STACK_ERROR
if(0 != rc)
TEST_ERROR
@@ -303,17 +304,17 @@ error:
static herr_t
test_ohdr_swmr(hbool_t new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t fapl = -1; /* File access property list */
- hid_t did = -1; /* Dataset ID */
- hid_t sid = -1; /* Dataspace ID */
- hid_t plist = -1; /* Dataset creation property list */
- size_t compact_size = 1024; /* The size of compact dataset */
- int *wbuf = NULL; /* Buffer for writing */
- hsize_t dims[1]; /* Dimension sizes */
- size_t u; /* Iterator */
- int n; /* Data variable */
- H5O_info_t obj_info; /* Information for the object */
+ hid_t fid = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list */
+ hid_t did = -1; /* Dataset ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t plist = -1; /* Dataset creation property list */
+ size_t compact_size = 1024; /* The size of compact dataset */
+ int *wbuf = NULL; /* Buffer for writing */
+ hsize_t dims[1]; /* Dimension sizes */
+ size_t u; /* Iterator */
+ int n; /* Data variable */
+ H5O_info_t obj_info; /* Information for the object */
if(new_format) {
TESTING("exercise the coding for the re-read of the object header for SWMR access: latest-format");
@@ -470,8 +471,8 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
/* 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. */
@@ -485,7 +486,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
FAIL_STACK_ERROR
/* Open FILE_BOGUS */
- if((fid_bogus = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
+ if((fid_bogus = H5Fopen(testfile, H5F_ACC_RDONLY, fapl)) < 0)
FAIL_STACK_ERROR
/* Set up location ID depending on bogus_id */
@@ -567,7 +568,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
FAIL_STACK_ERROR
/* Check that the "unknown" message was _NOT_ marked */
- if(H5O_check_msg_marked_test(did, FALSE) < 0)
+ if(H5O__check_msg_marked_test(did, FALSE) < 0)
FAIL_STACK_ERROR
/* Close the dataset */
@@ -647,7 +648,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
FAIL_STACK_ERROR
/* Check that the "unknown" message was marked */
- if(H5O_check_msg_marked_test(did, TRUE) < 0)
+ if(H5O__check_msg_marked_test(did, TRUE) < 0)
FAIL_STACK_ERROR
/* Close the dataset */
@@ -769,9 +770,9 @@ version_string(H5F_libver_t libver)
/* Return the formed version bound string */
return str;
-} /* end of version_string */
-
+} /* end version_string() */
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -780,13 +781,9 @@ version_string(H5F_libver_t libver)
* Return: Success: 0
* Failure: 1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, November 24, 1998
*
- * Modification:
- * - Added loop of combinations of low/high library format bounds
- * (BMR, Feb 2018)
- *
*-------------------------------------------------------------------------
*/
int
@@ -844,7 +841,7 @@ main(void)
/* Create the file to operate on */
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
if(H5AC_ignore_tags(f) < 0) {
H5_FAILED();
@@ -942,7 +939,7 @@ main(void)
FAIL_STACK_ERROR
if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
FAIL_STACK_ERROR
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
if (H5AC_ignore_tags(f) < 0)
FAIL_STACK_ERROR
diff --git a/test/page_buffer.c b/test/page_buffer.c
index 3c61ab0..b9b31f8 100644
--- a/test/page_buffer.c
+++ b/test/page_buffer.c
@@ -21,6 +21,11 @@
#include "h5test.h"
+#include "H5CXprivate.h" /* API Contexts */
+#include "H5Iprivate.h"
+#include "H5PBprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
+
/*
* This file needs to access private information from the H5F package.
*/
@@ -31,12 +36,8 @@
#define H5F_TESTING
#include "H5Fpkg.h"
-#include "H5CXprivate.h" /* API Contexts */
-#include "H5Iprivate.h"
-#include "H5PBprivate.h"
-
-#define FILENAME_LEN 1024
+#define FILENAME_LEN 1024
#define NUM_DSETS 5
#define NX 100
#define NY 50
@@ -241,7 +242,7 @@ open_file(char *filename, hid_t fapl, hsize_t page_size,
FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file_id)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file_id)))
FAIL_STACK_ERROR;
if(f->shared->page_buf == NULL)
@@ -604,7 +605,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file_id)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file_id)))
FAIL_STACK_ERROR;
/* opening the file inserts one or more pages into the page buffer.
@@ -887,7 +888,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file_id)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file_id)))
FAIL_STACK_ERROR;
/* opening the file inserts one or more pages into the page buffer.
@@ -1146,7 +1147,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file_id)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file_id)))
FAIL_STACK_ERROR;
/* opening the file inserts one or more pages into the page buffer.
@@ -1281,7 +1282,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file_id)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file_id)))
FAIL_STACK_ERROR;
/* opening the file inserts one or more pages into the page buffer.
@@ -1411,7 +1412,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file_id)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file_id)))
FAIL_STACK_ERROR;
/* opening the file inserts one or more pages into the page buffer.
@@ -1552,7 +1553,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file_id)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file_id)))
FAIL_STACK_ERROR;
page_buf = f->shared->page_buf;
@@ -1776,7 +1777,7 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file_id)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file_id)))
FAIL_STACK_ERROR;
/* opening the file inserts one or more pages into the page buffer.
diff --git a/test/swmr.c b/test/swmr.c
index 0b352e2..bab91bd 100644
--- a/test/swmr.c
+++ b/test/swmr.c
@@ -26,6 +26,7 @@
#include "h5test.h"
#include "H5Iprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
/*
* This file needs to access private information from the H5F package.
@@ -1168,7 +1169,7 @@ test_metadata_read_retry_info(hid_t in_fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if((f = (H5F_t *)H5I_object(fid)) == NULL)
+ if((f = (H5F_t *)H5VL_object(fid)) == NULL)
FAIL_STACK_ERROR
/*
@@ -1326,7 +1327,7 @@ test_metadata_read_retry_info(hid_t in_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if((f = (H5F_t *)H5I_object(fid)) == NULL)
+ if((f = (H5F_t *)H5VL_object(fid)) == NULL)
FAIL_STACK_ERROR
/* File's superblock: log retry 1 for 1 time */
@@ -1430,7 +1431,7 @@ test_metadata_read_retry_info(hid_t in_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object for fid */
- if((f = (H5F_t *)H5I_object(fid)) == NULL)
+ if((f = (H5F_t *)H5VL_object(fid)) == NULL)
FAIL_STACK_ERROR
/* Re-open fid */
@@ -1438,7 +1439,7 @@ test_metadata_read_retry_info(hid_t in_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object for fid1 */
- if((f1 = (H5F_t *)H5I_object(fid1)) == NULL)
+ if((f1 = (H5F_t *)H5VL_object(fid1)) == NULL)
FAIL_STACK_ERROR
/* For fid: fixed array data block page--log retry 9 for 500 times */
@@ -3015,7 +3016,7 @@ test_start_swmr_write_stress_ohdr(hid_t in_fapl)
/* Retrieve the chunk # for the dataspace message */
chunk_num = UINT_MAX;
- if(H5O_msg_get_chunkno_test(did, H5O_SDSPACE_ID, &chunk_num) < 0)
+ if(H5O__msg_get_chunkno_test(did, H5O_SDSPACE_ID, &chunk_num) < 0)
FAIL_STACK_ERROR;
/* Should be in chunk #0 for now */
if(0 != chunk_num)
@@ -3072,7 +3073,7 @@ test_start_swmr_write_stress_ohdr(hid_t in_fapl)
/* Retrieve the chunk # for the dataspace message */
chunk_num = UINT_MAX;
- if(H5O_msg_get_chunkno_test(did, H5O_SDSPACE_ID, &chunk_num) < 0)
+ if(H5O__msg_get_chunkno_test(did, H5O_SDSPACE_ID, &chunk_num) < 0)
FAIL_STACK_ERROR;
/* Should be in chunk #0 for now */
if(1 != chunk_num)
@@ -6288,7 +6289,7 @@ test_bug_refresh(hid_t in_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
FAIL_STACK_ERROR
/* Create groups: compact to dense storage */
@@ -6484,106 +6485,104 @@ test_refresh_concur(hid_t in_fapl, hbool_t new_format)
if(childpid == 0) { /* Child process */
hid_t child_fid1 = -1; /* File ID */
hid_t child_fid2 = -1; /* File ID */
- hid_t child_did1 = -1, child_did2 = -1;
- hid_t child_sid = -1;
- hsize_t tdims[1];
- int rbuf[2] = {0, 0};
- int child_notify = 0;
+ hid_t child_did1 = -1, child_did2 = -1;
+ hid_t child_sid = -1;
+ hsize_t tdims[1];
+ int rbuf[2] = {0, 0};
+ int child_notify = 0;
- /* Close unused write end for out_pdf */
- if(HDclose(out_pdf[1]) < 0)
- HDexit(EXIT_FAILURE);
+ /* Close unused write end for out_pdf */
+ if(HDclose(out_pdf[1]) < 0)
+ HDexit(EXIT_FAILURE);
- /* close unused read end for in_pdf */
- if(HDclose(in_pdf[0]) < 0)
- HDexit(EXIT_FAILURE);
+ /* close unused read end for in_pdf */
+ if(HDclose(in_pdf[0]) < 0)
+ HDexit(EXIT_FAILURE);
- /* Wait for notification from parent process */
- while(child_notify != 1) {
- if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0)
- HDexit(EXIT_FAILURE);
- }
+ /* Wait for notification from parent process */
+ while(child_notify != 1)
+ if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0)
+ HDexit(EXIT_FAILURE);
- /* Open the file 2 times */
- if((child_fid1 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0)
- HDexit(EXIT_FAILURE);
+ /* Open the file 2 times */
+ if((child_fid1 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0)
+ HDexit(EXIT_FAILURE);
- if((child_fid2 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0)
- HDexit(EXIT_FAILURE);
+ if((child_fid2 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0)
+ HDexit(EXIT_FAILURE);
- /* Open the dataset 2 times */
- if((child_did1 = H5Dopen2(child_fid1, "dataset", H5P_DEFAULT)) < 0)
- HDexit(EXIT_FAILURE);
- if((child_did2 = H5Dopen2(child_fid2, "dataset", H5P_DEFAULT)) < 0)
- HDexit(EXIT_FAILURE);
+ /* Open the dataset 2 times */
+ if((child_did1 = H5Dopen2(child_fid1, "dataset", H5P_DEFAULT)) < 0)
+ HDexit(EXIT_FAILURE);
+ if((child_did2 = H5Dopen2(child_fid2, "dataset", H5P_DEFAULT)) < 0)
+ HDexit(EXIT_FAILURE);
- /* Get the dataset's dataspace via did1 */
- if((child_sid = H5Dget_space(child_did1)) < 0)
- HDexit(EXIT_FAILURE);
- if(H5Sget_simple_extent_dims(child_sid, tdims, NULL) < 0)
- HDexit(EXIT_FAILURE);
- if(tdims[0] != 1)
- HDexit(EXIT_FAILURE);
+ /* Get the dataset's dataspace via did1 */
+ if((child_sid = H5Dget_space(child_did1)) < 0)
+ HDexit(EXIT_FAILURE);
+ if(H5Sget_simple_extent_dims(child_sid, tdims, NULL) < 0)
+ HDexit(EXIT_FAILURE);
+ if(tdims[0] != 1)
+ HDexit(EXIT_FAILURE);
- /* Read from the dataset via did2 */
- if(H5Dread(child_did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- HDexit(EXIT_FAILURE);
+ /* Read from the dataset via did2 */
+ if(H5Dread(child_did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
+ HDexit(EXIT_FAILURE);
- /* Verify the data is correct */
- if(rbuf[0] != 99)
- HDexit(EXIT_FAILURE);
+ /* Verify the data is correct */
+ if(rbuf[0] != 99)
+ HDexit(EXIT_FAILURE);
- /* Notify parent process */
- child_notify = 2;
- if(HDwrite(in_pdf[1], &child_notify, sizeof(int)) < 0)
- HDexit(EXIT_FAILURE);
+ /* Notify parent process */
+ child_notify = 2;
+ if(HDwrite(in_pdf[1], &child_notify, sizeof(int)) < 0)
+ HDexit(EXIT_FAILURE);
- /* Wait for notification from parent process */
- while(child_notify != 3) {
- if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0)
- HDexit(EXIT_FAILURE);
- }
+ /* Wait for notification from parent process */
+ while(child_notify != 3)
+ if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0)
+ HDexit(EXIT_FAILURE);
- /* Refresh dataset via did1 */
- if(H5Drefresh(child_did1) < 0)
- HDexit(EXIT_FAILURE);
+ /* Refresh dataset via did1 */
+ if(H5Drefresh(child_did1) < 0)
+ HDexit(EXIT_FAILURE);
- /* Get the dataset's dataspace and verify */
- if((child_sid = H5Dget_space(child_did1)) < 0)
- HDexit(EXIT_FAILURE);
- if(H5Sget_simple_extent_dims(child_sid, tdims, NULL) < 0)
- HDexit(EXIT_FAILURE);
+ /* Get the dataset's dataspace and verify */
+ if((child_sid = H5Dget_space(child_did1)) < 0)
+ HDexit(EXIT_FAILURE);
+ if(H5Sget_simple_extent_dims(child_sid, tdims, NULL) < 0)
+ HDexit(EXIT_FAILURE);
- if(tdims[0] != 2)
- HDexit(EXIT_FAILURE);
+ if(tdims[0] != 2)
+ HDexit(EXIT_FAILURE);
- /* Read from the dataset */
- if(H5Dread(child_did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- HDexit(EXIT_FAILURE);
+ /* Read from the dataset */
+ if(H5Dread(child_did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
+ HDexit(EXIT_FAILURE);
- /* Verify the data is correct */
- if(rbuf[0] != 100 || rbuf[1] != 100)
- HDexit(EXIT_FAILURE);
+ /* Verify the data is correct */
+ if(rbuf[0] != 100 || rbuf[1] != 100)
+ HDexit(EXIT_FAILURE);
- /* Close the 2 datasets */
- if(H5Dclose(child_did1) < 0)
- HDexit(EXIT_FAILURE);
- if(H5Dclose(child_did2) < 0)
- HDexit(EXIT_FAILURE);
+ /* Close the 2 datasets */
+ if(H5Dclose(child_did1) < 0)
+ HDexit(EXIT_FAILURE);
+ if(H5Dclose(child_did2) < 0)
+ HDexit(EXIT_FAILURE);
- /* Close the 2 files */
- if(H5Fclose(child_fid1) < 0)
- HDexit(EXIT_FAILURE);
- if(H5Fclose(child_fid2) < 0)
- HDexit(EXIT_FAILURE);
+ /* Close the 2 files */
+ if(H5Fclose(child_fid1) < 0)
+ HDexit(EXIT_FAILURE);
+ if(H5Fclose(child_fid2) < 0)
+ HDexit(EXIT_FAILURE);
- /* Close the pipes */
- if(HDclose(out_pdf[0]) < 0)
- HDexit(EXIT_FAILURE);
- if(HDclose(in_pdf[1]) < 0)
- HDexit(EXIT_FAILURE);
+ /* Close the pipes */
+ if(HDclose(out_pdf[0]) < 0)
+ HDexit(EXIT_FAILURE);
+ if(HDclose(in_pdf[1]) < 0)
+ HDexit(EXIT_FAILURE);
- HDexit(EXIT_SUCCESS);
+ HDexit(EXIT_SUCCESS);
}
/* Close unused read end for out_pdf */
@@ -6618,8 +6617,8 @@ test_refresh_concur(hid_t in_fapl, hbool_t new_format)
/* Wait for notification from child process */
while(notify != 2) {
- if(HDread(in_pdf[0], &notify, sizeof(int)) < 0)
- FAIL_STACK_ERROR;
+ if(HDread(in_pdf[0], &notify, sizeof(int)) < 0)
+ FAIL_STACK_ERROR;
}
/* Cork the metadata cache, to prevent the object header from being
@@ -7042,8 +7041,8 @@ main(void)
* by the environment variable.
*/
driver = HDgetenv("HDF5_DRIVER");
- if(!H5FD_supports_swmr_test(driver)) {
- printf("This VFD does not support SWMR I/O\n");
+ if(!H5FD__supports_swmr_test(driver)) {
+ HDprintf("This VFD does not support SWMR I/O\n");
return EXIT_SUCCESS;
} /* end if */
@@ -7133,7 +7132,7 @@ main(void)
if(nerrors)
goto error;
- printf("All tests passed.\n");
+ HDprintf("All tests passed.\n");
h5_cleanup(FILENAME, fapl);
@@ -7141,7 +7140,7 @@ main(void)
error:
nerrors = MAX(1, nerrors);
- printf("***** %d SWMR TEST%s FAILED! *****\n",
+ HDprintf("***** %d SWMR TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S");
return EXIT_FAILURE;
diff --git a/test/swmr_check_compat_vfd.c b/test/swmr_check_compat_vfd.c
index 1589f6e..e249e09 100644
--- a/test/swmr_check_compat_vfd.c
+++ b/test/swmr_check_compat_vfd.c
@@ -46,7 +46,7 @@ main(void)
driver = HDgetenv("HDF5_DRIVER");
- if(H5FD_supports_swmr_test(driver))
+ if(H5FD__supports_swmr_test(driver))
return EXIT_SUCCESS;
else
return EXIT_FAILURE;
diff --git a/test/swmr_generator.c b/test/swmr_generator.c
index 1c2ec04..23620fb 100644
--- a/test/swmr_generator.c
+++ b/test/swmr_generator.c
@@ -230,12 +230,12 @@ gen_skeleton(const char *filename, hbool_t verbose, hbool_t swmr_write,
unsigned chunk_num; /* Object header chunk # for dataspace message */
/* Move the dataspace message to a new object header chunk */
- if(H5O_msg_move_to_new_chunk_test(dsid, H5O_SDSPACE_ID) < 0)
+ if(H5O__msg_move_to_new_chunk_test(dsid, H5O_SDSPACE_ID) < 0)
return -1;
/* Retrieve the chunk # for the dataspace message */
chunk_num = UINT_MAX;
- if(H5O_msg_get_chunkno_test(dsid, H5O_SDSPACE_ID, &chunk_num) < 0)
+ if(H5O__msg_get_chunkno_test(dsid, H5O_SDSPACE_ID, &chunk_num) < 0)
return -1;
/* Should not be in chunk #0 for now */
if(0 == chunk_num)
diff --git a/test/tarray.c b/test/tarray.c
index 99f7bf8..d8ededf 100644
--- a/test/tarray.c
+++ b/test/tarray.c
@@ -26,8 +26,8 @@
#define TESTFILE "tarrold.h5"
/* 1-D array datatype */
-#define ARRAY1_RANK 1
-#define ARRAY1_DIM1 4
+#define ARRAY1_RANK 1
+#define ARRAY1_DIM1 4
/* 3-D array datatype */
#define ARRAY2_RANK 3
@@ -65,7 +65,7 @@ typedef struct
void *test_array_alloc_custom(size_t size, void *info);
void test_array_free_custom(void *mem, void *info);
-
+
/*-------------------------------------------------------------------------
* Function: test_array_atomic_1d
*
@@ -189,7 +189,7 @@ test_array_atomic_1d(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_array_atomic_1d() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_funcs
*
@@ -252,7 +252,7 @@ test_array_funcs(void)
CHECK(ret, FAIL, "H5Tclose");
} /* end test_array_funcs() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_atomic_3d
*
@@ -381,7 +381,7 @@ test_array_atomic_3d(void)
} /* end test_array_atomic_3d() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_array_atomic
*
@@ -540,7 +540,7 @@ test_array_array_atomic(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_array_array_atomic() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_compound_atomic
*
@@ -747,7 +747,7 @@ test_array_compound_atomic(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_array_compound_atomic() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_compound_array
*
@@ -1006,7 +1006,7 @@ test_array_compound_array(void)
** allocated.
**
****************************************************************/
-
+
/*-------------------------------------------------------------------------
* Function: test_array_alloc_custom
*
@@ -1045,7 +1045,7 @@ test_array_alloc_custom(size_t size, void *info)
return ret_value;
} /* end test_array_alloc_custom() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_free_custom
*
@@ -1081,7 +1081,7 @@ test_array_free_custom(void *_mem, void *info)
return;
} /* end test_array_free_custom() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_vlen_atomic
*
@@ -1296,7 +1296,7 @@ test_array_vlen_atomic(void)
} /* end test_array_vlen_atomic() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_vlen_array
*
@@ -1341,7 +1341,7 @@ test_array_vlen_array(void)
for(k=0; k<(i+j+1); k++)
for(l=0; l<ARRAY1_DIM1; l++)
((unsigned int *)wdata[i][j].p)[k*ARRAY1_DIM1+l] = (unsigned int)(i*1000+j*100+k*10+l);
- } /* end for */
+ }
/* Create file */
fid1 = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -1551,7 +1551,7 @@ test_array_vlen_array(void)
} /* end test_array_vlen_array() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_bkg
*
@@ -1580,9 +1580,9 @@ test_array_bkg(void)
unsigned ndims[3] = {1,1,1};
typedef struct {
- int a[ALEN];
- float b[ALEN];
- double c[ALEN];
+ int a[ALEN];
+ float b[ALEN];
+ double c[ALEN];
} CmpField;
CmpField cf[LENGTH];
@@ -1855,7 +1855,7 @@ test_array_bkg(void)
HDfree(dtsinfo);
} /* end test_array_bkg() */
-
+
/*-------------------------------------------------------------------------
* Function: test_compat
*
@@ -2150,7 +2150,7 @@ test_compat(void)
} /* end test_compat() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array
*
@@ -2183,7 +2183,7 @@ test_array(void)
} /* end test_array() */
-
+
/*-------------------------------------------------------------------------
* Function: cleanup_array
*
diff --git a/test/tattr.c b/test/tattr.c
index 379ae87..20b88f6 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -160,7 +160,7 @@ static herr_t attr_op1(hid_t loc_id, const char *name, const H5A_info_t *ainfo,
static hid_t dcpl_g = H5P_DEFAULT;
-
+
/****************************************************************
**
** test_attr_basic_write(): Test basic H5A (attribute) code.
@@ -400,7 +400,7 @@ test_attr_basic_write(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_basic_write() */
-
+
/****************************************************************
**
** test_attr_basic_read(): Test basic H5A (attribute) code.
@@ -491,7 +491,7 @@ test_attr_basic_read(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_basic_read() */
-
+
/****************************************************************
**
** test_attr_flush(): Test H5A (attribute) code for performing
@@ -558,7 +558,7 @@ test_attr_flush(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_flush() */
-
+
/****************************************************************
**
** test_attr_plist(): Test Attribute Creation Property Lists
@@ -671,7 +671,7 @@ test_attr_plist(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_plist() */
-
+
/****************************************************************
**
** test_attr_compound_write(): Test H5A (attribute) code.
@@ -760,7 +760,7 @@ test_attr_compound_write(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_compound_write() */
-
+
/****************************************************************
**
** test_attr_compound_read(): Test basic H5A (attribute) code.
@@ -910,7 +910,7 @@ test_attr_compound_read(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_compound_read() */
-
+
/****************************************************************
**
** test_attr_scalar_write(): Test scalar H5A (attribute) writing code.
@@ -976,7 +976,7 @@ test_attr_scalar_write(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_scalar_write() */
-
+
/****************************************************************
**
** test_attr_scalar_read(): Test scalar H5A (attribute) reading code.
@@ -1047,7 +1047,7 @@ test_attr_scalar_read(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_scalar_read() */
-
+
/****************************************************************
**
** test_attr_mult_write(): Test basic H5A (attribute) code.
@@ -1168,7 +1168,7 @@ test_attr_mult_write(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_mult_write() */
-
+
/****************************************************************
**
** test_attr_mult_read(): Test basic H5A (attribute) code.
@@ -1390,7 +1390,7 @@ test_attr_mult_read(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_mult_read() */
-
+
/****************************************************************
**
** attr_op1(): Attribute operator
@@ -1430,7 +1430,7 @@ attr_op1(hid_t H5_ATTR_UNUSED loc_id, const char *name, const H5A_info_t H5_ATTR
return(ret);
} /* end attr_op1() */
-
+
/****************************************************************
**
** test_attr_iterate(): Test H5A (attribute) iterator code.
@@ -1502,7 +1502,7 @@ test_attr_iterate(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_iterate() */
-
+
/****************************************************************
**
** test_attr_delete(): Test H5A (attribute) code for deleting objects.
@@ -1622,7 +1622,7 @@ test_attr_delete(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_delete() */
-
+
/****************************************************************
**
** test_attr_dtype_shared(): Test H5A (attribute) code for using
@@ -1660,7 +1660,6 @@ test_attr_dtype_shared(hid_t fapl)
if(empty_filesize < 0)
TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
-
/* Re-open file */
file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
CHECK(file_id, FAIL, "H5Fopen");
@@ -1799,7 +1798,7 @@ test_attr_dtype_shared(hid_t fapl)
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dtype_shared() */
-
+
/****************************************************************
**
** test_attr_duplicate_ids(): Test operations with more than
@@ -2044,7 +2043,7 @@ test_attr_duplicate_ids(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_duplicate_ids() */
-
+
/****************************************************************
**
** test_attr_dense_verify(): Test basic H5A (attribute) code.
@@ -2114,7 +2113,7 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr)
return(-1);
} /* test_attr_dense_verify() */
-
+
/****************************************************************
**
** test_attr_dense_create(): Test basic H5A (attribute) code.
@@ -2184,8 +2183,8 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add attributes, until just before converting to dense storage */
for(u = 0; u < max_compact; u++) {
@@ -2204,8 +2203,8 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
} /* end for */
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add one more attribute, to push into "dense" storage */
/* Create attribute */
@@ -2214,8 +2213,8 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -2250,7 +2249,7 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dense_create() */
-
+
/****************************************************************
**
** test_attr_dense_open(): Test basic H5A (attribute) code.
@@ -2324,8 +2323,8 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add attributes, until just before converting to dense storage */
for(u = 0; u < max_compact; u++) {
@@ -2348,8 +2347,8 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
} /* end for */
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add one more attribute, to push into "dense" storage */
/* Create attribute */
@@ -2358,8 +2357,8 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -2394,7 +2393,7 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dense_open() */
-
+
/****************************************************************
**
** test_attr_dense_delete(): Test basic H5A (attribute) code.
@@ -2483,8 +2482,8 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add attributes, until well into dense storage */
for(u = 0; u < (max_compact * 2); u++) {
@@ -2508,8 +2507,8 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
} /* end for */
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Close dataspace */
ret = H5Sclose(sid);
@@ -2545,8 +2544,8 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
} /* end for */
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Delete one more attribute, which should cause reversion to compact storage */
sprintf(attrname, "attr %02u", u);
@@ -2554,8 +2553,8 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Verify attributes still left */
ret = test_attr_dense_verify(dataset, (u - 1));
@@ -2567,8 +2566,8 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Verify attributes still left */
ret = test_attr_dense_verify(dataset, (u - 2));
@@ -2591,7 +2590,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dense_delete() */
-
+
/****************************************************************
**
** test_attr_dense_rename(): Test basic H5A (attribute) code.
@@ -2677,8 +2676,8 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add attributes, until well into dense storage */
for(u = 0; u < (max_compact * 2); u++) {
@@ -2709,8 +2708,8 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
} /* end for */
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Close dataspace */
ret = H5Sclose(sid);
@@ -2769,7 +2768,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dense_rename() */
-
+
/****************************************************************
**
** test_attr_dense_unlink(): Test basic H5A (attribute) code.
@@ -2853,8 +2852,8 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add attributes, until well into dense storage */
for(u = 0; u < (max_compact * 2); u++) {
@@ -2878,8 +2877,8 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
} /* end for */
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Close dataspace */
ret = H5Sclose(sid);
@@ -2903,9 +2902,9 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Ldelete");
/* Check on dataset's attribute storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
/* Close file */
ret = H5Fclose(fid);
@@ -2916,7 +2915,7 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dense_unlink() */
-
+
/****************************************************************
**
** test_attr_dense_limits(): Test basic H5A (attribute) code.
@@ -2995,8 +2994,8 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add first attribute, which should be immediately in dense storage */
@@ -3016,8 +3015,8 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Add second attribute, to allow deletions to be checked easily */
@@ -3037,8 +3036,8 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Delete second attribute, attributes should still be stored densely */
@@ -3048,8 +3047,8 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Delete first attribute, attributes should not be stored densely */
@@ -3061,8 +3060,8 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Close dataspace */
@@ -3086,7 +3085,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dense_limits() */
-
+
/****************************************************************
**
** test_attr_dense_dup_ids(): Test operations with multiple ID
@@ -3158,8 +3157,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add attributes, until just before converting to dense storage */
for(u = 0; u < max_compact; u++) {
@@ -3178,8 +3177,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
} /* end for */
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add one more attribute, to push into "dense" storage */
/* Create dataspace for attribute */
@@ -3192,8 +3191,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Open the attribute just created and get a second ID */
attr2 = H5Aopen(dataset, attrname, H5P_DEFAULT);
@@ -3227,8 +3226,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
CHECK(dataset, FAIL, "H5Dopen2");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Open first attribute for the dataset */
attr = H5Aopen(dataset, attrname, H5P_DEFAULT);
@@ -3280,8 +3279,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
CHECK(dataset, FAIL, "H5Dopen2");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Open first attribute for the dataset */
attr = H5Aopen(dataset, attrname, H5P_DEFAULT);
@@ -3341,8 +3340,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
CHECK(dataset, FAIL, "H5Dopen2");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Open first attribute for the dataset */
attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)4,
@@ -3397,8 +3396,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
CHECK(dataset, FAIL, "H5Dopen2");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Open attribute of the dataset for the first time */
attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)2,
@@ -3413,8 +3412,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
}
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Open attribute for the second time */
attr2 = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)2,
@@ -3464,8 +3463,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
CHECK(dataset, FAIL, "H5Dopen2");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Open attribute of the dataset for the first time */
attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)3,
@@ -3489,8 +3488,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
}
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Open attribute for the second time */
attr2 = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)3,
@@ -3563,8 +3562,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* Check on group's attribute storage status */
- is_dense = H5O_is_attr_dense_test(gid1);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(gid1);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Open the hard link just created */
gid2 = H5Gopen2(fid, GROUP2_NAME, H5P_DEFAULT);
@@ -3614,7 +3613,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_dense_dup_ids() */
-
+
/****************************************************************
**
** test_attr_big(): Test basic H5A (attribute) code.
@@ -3702,10 +3701,10 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add first "small" attribute, which should be in compact storage */
@@ -3721,10 +3720,10 @@ test_attr_big(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add second "small" attribute, which should stay in compact storage */
@@ -3740,10 +3739,10 @@ test_attr_big(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add first "big" attribute, which should push storage into dense form */
@@ -3764,10 +3763,10 @@ test_attr_big(hid_t fcpl, hid_t fapl)
* message heap instead of forcing the attribute storage into the dense
* form - QAK)
*/
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, (nshared_indices ? FALSE : TRUE), "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, (nshared_indices ? FALSE : TRUE), "H5O__is_attr_dense_test");
/* Add second "big" attribute, which should leave storage in dense form */
@@ -3787,10 +3786,10 @@ test_attr_big(hid_t fcpl, hid_t fapl)
* message heap instead of forcing the attribute storage into the dense
* form - QAK)
*/
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, (nshared_indices ? FALSE : TRUE), "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, (nshared_indices ? FALSE : TRUE), "H5O__is_attr_dense_test");
/* Delete second "small" attribute, attributes should still be stored densely */
@@ -3802,10 +3801,10 @@ test_attr_big(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete");
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, (nshared_indices ? FALSE : TRUE), "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, (nshared_indices ? FALSE : TRUE), "H5O__is_attr_dense_test");
/* Delete second "big" attribute, attributes should still be stored densely */
@@ -3817,10 +3816,10 @@ test_attr_big(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete");
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, (nshared_indices ? FALSE : TRUE), "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, (nshared_indices ? FALSE : TRUE), "H5O__is_attr_dense_test");
/* Delete first "big" attribute, attributes should _not_ be stored densely */
@@ -3832,10 +3831,10 @@ test_attr_big(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete");
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Delete first "small" attribute, should be no attributes now */
@@ -3847,8 +3846,8 @@ test_attr_big(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete");
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
} /* end if */
else {
/* Shouldn't be able to create "big" attributes with older version of format */
@@ -3859,10 +3858,10 @@ test_attr_big(hid_t fcpl, hid_t fapl)
* message heap instead of forcing the attribute storage into the dense
* form - QAK)
*/
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
} /* end else */
@@ -3889,7 +3888,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_big() */
-
+
/****************************************************************
**
** test_attr_null_space(): Test basic H5A (attribute) code.
@@ -4107,7 +4106,7 @@ test_attr_null_space(hid_t fcpl, hid_t fapl)
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_null_space() */
-
+
/****************************************************************
**
** test_attr_deprec(): Test basic H5A (attribute) code.
@@ -4150,7 +4149,6 @@ test_attr_deprec(hid_t fcpl, hid_t fapl)
ret = H5Aclose(attr);
CHECK(ret, FAIL, "H5Aclose");
-
/* Close dataspaces */
ret = H5Sclose(sid);
@@ -4216,7 +4214,7 @@ test_attr_deprec(hid_t fcpl, hid_t fapl)
#endif /* H5_NO_DEPRECATED_SYMBOLS */
} /* test_attr_deprec() */
-
+
/****************************************************************
**
** test_attr_many(): Test basic H5A (attribute) code.
@@ -4345,7 +4343,7 @@ test_attr_many(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Sclose");
} /* test_attr_many() */
-
+
/****************************************************************
**
** test_attr_corder_create_empty(): Test basic H5A (attribute) code.
@@ -4412,10 +4410,10 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Sclose");
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -4439,10 +4437,10 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl)
CHECK(dataset, FAIL, "H5Dopen2");
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Retrieve dataset creation property list for group */
dcpl = H5Dget_create_plist(dataset);
@@ -4466,7 +4464,7 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_corder_create_basic() */
-
+
/****************************************************************
**
** test_attr_corder_create_compact(): Test basic H5A (attribute) code.
@@ -4548,10 +4546,10 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Create several attributes, but keep storage in compact form */
for(u = 0; u < max_compact; u++) {
@@ -4569,13 +4567,13 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (u + 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (u + 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
} /* end for */
} /* end for */
@@ -4632,13 +4630,13 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, max_compact, "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, max_compact, "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Loop through attributes, checking their creation order values */
/* (the name index is used, but the creation order value is in the same order) */
@@ -4669,7 +4667,7 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_corder_create_compact() */
-
+
/****************************************************************
**
** test_attr_corder_create_dense(): Test basic H5A (attribute) code.
@@ -4753,10 +4751,10 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Create several attributes, but keep storage in compact form */
for(u = 0; u < max_compact; u++) {
@@ -4774,13 +4772,13 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (u + 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (u + 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
} /* end for */
/* Create another attribute, to push into dense storage */
@@ -4797,18 +4795,18 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact + 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
} /* end for */
/* Close Datasets */
@@ -4864,13 +4862,13 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact + 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Loop through attributes, checking their creation order values */
/* (the name index is used, but the creation order value is in the same order) */
@@ -4901,7 +4899,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_corder_create_dense() */
-
+
/****************************************************************
**
** test_attr_corder_create_reopen(): Test basic H5A (attribute) code.
@@ -5009,7 +5007,7 @@ test_attr_corder_create_reopen(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Sclose");
} /* test_attr_corder_create_reopen() */
-
+
/****************************************************************
**
** test_attr_corder_transition(): Test basic H5A (attribute) code.
@@ -5097,10 +5095,10 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
} /* end for */
/* Close Datasets */
@@ -5167,13 +5165,13 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (u + 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (u + 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
} /* end for */
/* Create another attribute, to push into dense storage */
@@ -5190,18 +5188,18 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact + 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
/* Delete several attributes from object, until attribute storage resumes compact form */
for(u = max_compact; u >= min_dense; u--) {
@@ -5210,18 +5208,18 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete");
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, u, "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, u, "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
} /* end for */
/* Delete another attribute, to push attribute storage into compact form */
@@ -5230,13 +5228,13 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete");
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (min_dense - 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (min_dense - 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Re-add attributes to get back into dense form */
for(u = (min_dense - 1); u < (max_compact + 1); u++) {
@@ -5255,18 +5253,18 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact + 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
} /* end for */
/* Close Datasets */
@@ -5314,18 +5312,18 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact + 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
/* Delete several attributes from object, until attribute storage resumes compact form */
for(u = max_compact; u >= min_dense; u--) {
@@ -5334,18 +5332,18 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete");
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, u, "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, u, "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
} /* end for */
/* Delete another attribute, to push attribute storage into compact form */
@@ -5354,13 +5352,13 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete");
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (min_dense - 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (min_dense - 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Re-add attributes to get back into dense form */
for(u = (min_dense - 1); u < (max_compact + 1); u++) {
@@ -5379,18 +5377,18 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact + 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
/* Delete all attributes */
for(u = max_compact; u > 0; u--) {
@@ -5420,7 +5418,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Sclose");
} /* test_attr_corder_transition() */
-
+
/****************************************************************
**
** test_attr_corder_delete(): Test basic H5A (attribute) code.
@@ -5532,10 +5530,10 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Create attributes, until attribute storage is in dense form */
for(u = 0; u < max_compact * 2; u++) {
@@ -5554,18 +5552,18 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact * 2), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
} /* end for */
/* Close Datasets */
@@ -5626,7 +5624,7 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Sclose");
} /* test_attr_corder_delete() */
-
+
/*-------------------------------------------------------------------------
* Function: attr_info_by_idx_check
*
@@ -5773,7 +5771,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n,
return(-1);
} /* end attr_info_by_idx_check() */
-
+
/****************************************************************
**
** test_attr_info_by_idx(): Test basic H5A (attribute) code.
@@ -5867,10 +5865,10 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Check for query on non-existant attribute */
ret = H5Aget_info_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, &ainfo, H5P_DEFAULT);
@@ -5899,13 +5897,13 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, max_compact, "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, max_compact, "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Check for out of bound offset queries */
ret = H5Aget_info_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &ainfo, H5P_DEFAULT);
@@ -5931,8 +5929,8 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Verify state of object */
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
/* Verify information for new attribute */
ret = attr_info_by_idx_check(my_dataset, attrname, (hsize_t)u, use_index);
@@ -5940,21 +5938,21 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact * 2), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
if(new_format) {
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
if(use_index)
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
- VERIFY(name_count, (max_compact * 2), "H5O_attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
+ VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test");
} /* end if */
/* Check for out of bound offset queries */
@@ -5988,7 +5986,7 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Sclose");
} /* test_attr_info_by_idx() */
-
+
/****************************************************************
**
** test_attr_delete_by_idx(): Test basic H5A (attribute) code.
@@ -6112,10 +6110,10 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Check for deleting non-existant attribute */
ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT);
@@ -6142,13 +6140,13 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, max_compact, "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, max_compact, "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Check for out of bound deletions */
ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT);
@@ -6208,8 +6206,8 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete_by_idx");
/* Verify state of attribute storage (empty) */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
} /* end for */
/* Work on all the datasets */
@@ -6248,8 +6246,8 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Verify state of object */
if(u >= max_compact) {
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
} /* end if */
/* Verify information for new attribute */
@@ -6258,21 +6256,21 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact * 2), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
if(new_format) {
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
if(use_index)
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
- VERIFY(name_count, (max_compact * 2), "H5O_attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
+ VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test");
} /* end if */
/* Check for out of bound deletion */
@@ -6333,8 +6331,8 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete_by_idx");
/* Verify state of attribute storage (empty) */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
/* Check for deletion on empty attribute storage again */
ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT);
@@ -6381,8 +6379,8 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Verify state of object */
if(u >= max_compact) {
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
} /* end if */
/* Verify information for new attribute */
@@ -6493,8 +6491,8 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete_by_idx");
/* Verify state of attribute storage (empty) */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
/* Check for deletion on empty attribute storage again */
ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT);
@@ -6525,7 +6523,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Sclose");
} /* test_attr_delete_by_idx() */
-
+
/****************************************************************
**
** attr_iterate2_cb(): Revised attribute operator
@@ -6599,7 +6597,7 @@ HDfprintf(stderr, "op_data->curr = %Hd\n", op_data->curr);
} /* end attr_iterate2_cb() */
#ifndef H5_NO_DEPRECATED_SYMBOLS
-
+
/****************************************************************
**
** attr_iterate1_cb(): Attribute operator
@@ -6612,7 +6610,7 @@ attr_iterate1_cb(hid_t loc_id, const char *attr_name, void *_op_data)
} /* end attr_iterate1_cb() */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-
+
/*-------------------------------------------------------------------------
* Function: attr_iterate2_fail_cb
*
@@ -6634,7 +6632,7 @@ attr_iterate2_fail_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED *
return(H5_ITER_ERROR);
} /* end attr_iterate2_fail_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: attr_iterate_check
*
@@ -6934,7 +6932,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id,
return(-1);
} /* end attr_iterate_check() */
-
+
/****************************************************************
**
** test_attr_iterate2(): Test basic H5A (attribute) code.
@@ -7069,10 +7067,10 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Check for iterating over object with no attributes (should be OK) */
ret = H5Aiterate2(my_dataset, idx_type, order, NULL, attr_iterate2_cb, NULL);
@@ -7105,13 +7103,13 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, max_compact, "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, max_compact, "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Check for out of bound iteration */
idx = u;
@@ -7171,8 +7169,8 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Verify state of object */
if(u >= max_compact) {
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
} /* end if */
/* Verify information for new attribute */
@@ -7181,21 +7179,21 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact * 2), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
if(new_format) {
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
if(use_index)
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
- VERIFY(name_count, (max_compact * 2), "H5O_attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
+ VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test");
} /* end if */
/* Check for out of bound iteration */
@@ -7243,7 +7241,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
HDfree(visited);
} /* test_attr_iterate2() */
-
+
/*-------------------------------------------------------------------------
* Function: attr_open_by_idx_check
*
@@ -7303,7 +7301,7 @@ attr_open_by_idx_check(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order,
return(-1);
} /* end attr_open_by_idx_check() */
-
+
/****************************************************************
**
** test_attr_open_by_idx(): Test basic H5A (attribute) code.
@@ -7426,10 +7424,10 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Check for opening an attribute on an object with no attributes */
ret_id = H5Aopen_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT, H5P_DEFAULT);
@@ -7456,13 +7454,13 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, max_compact, "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, max_compact, "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Check for out of bound opening an attribute on an object */
ret_id = H5Aopen_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT, H5P_DEFAULT);
@@ -7510,8 +7508,8 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Verify state of object */
if(u >= max_compact) {
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
} /* end if */
/* Verify information for new attribute */
@@ -7520,21 +7518,21 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact * 2), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
if(new_format) {
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
if(use_index)
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
- VERIFY(name_count, (max_compact * 2), "H5O_attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
+ VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test");
} /* end if */
/* Check for out of bound opening an attribute on an object */
@@ -7570,7 +7568,7 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Sclose");
} /* test_attr_open_by_idx() */
-
+
/*-------------------------------------------------------------------------
* Function: attr_open_check
*
@@ -7656,7 +7654,7 @@ attr_open_check(hid_t fid, const char *dsetname, hid_t obj_id,
return(-1);
} /* end attr_open_check() */
-
+
/****************************************************************
**
** test_attr_open_by_name(): Test basic H5A (attribute) code.
@@ -7753,10 +7751,10 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Check for opening a non-existant attribute on an object with no attributes */
ret_id = H5Aopen(my_dataset, "foo", H5P_DEFAULT);
@@ -7789,13 +7787,13 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, max_compact, "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, max_compact, "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Check for opening a non-existant attribute on an object with compact attribute storage */
ret_id = H5Aopen(my_dataset, "foo", H5P_DEFAULT);
@@ -7852,8 +7850,8 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Verify state of object */
if(u >= max_compact) {
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
} /* end if */
/* Verify information for new attribute */
@@ -7862,21 +7860,21 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact * 2), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
if(new_format) {
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
if(use_index)
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
- VERIFY(name_count, (max_compact * 2), "H5O_attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
+ VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test");
} /* end if */
/* Check for opening a non-existant attribute on an object with dense attribute storage */
@@ -7916,7 +7914,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Sclose");
} /* test_attr_open_by_name() */
-
+
/****************************************************************
**
** test_attr_create_by_name(): Test basic H5A (attribute) code.
@@ -8012,10 +8010,10 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Create attributes, up to limit of compact form */
for(u = 0; u < max_compact; u++) {
@@ -8038,13 +8036,13 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, max_compact, "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, max_compact, "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Test opening attributes stored compactly */
ret = attr_open_check(fid, dsetname, my_dataset, u);
@@ -8091,8 +8089,8 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Verify state of object */
if(u >= max_compact) {
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
} /* end if */
/* Verify information for new attribute */
@@ -8101,21 +8099,21 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact * 2), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
if(new_format) {
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
if(use_index)
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
- VERIFY(name_count, (max_compact * 2), "H5O_attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
+ VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test");
} /* end if */
/* Test opening attributes stored compactly */
@@ -8274,14 +8272,14 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
/* Check on dataset's message storage status */
if(test_shared != 0) {
/* Datasets' datatypes can be shared */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 1, "H5F__get_sohm_mesg_count_test");
/* Datasets' dataspace can be shared */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 1, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Retrieve limits for compact/dense attribute storage */
@@ -8293,10 +8291,10 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pclose");
/* Check on datasets' attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
- is_dense = H5O_is_attr_dense_test(dataset2);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset2);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add attributes to each dataset, until after converting to dense storage */
for(u = 0; u < max_compact * 2; u++) {
@@ -8348,11 +8346,11 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
+ is_dense = H5O__is_attr_dense_test(dataset);
if(u < max_compact)
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
else
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Alternate between creating "small" & "big" attributes */
@@ -8400,11 +8398,11 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset2);
+ is_dense = H5O__is_attr_dense_test(dataset2);
if(u < max_compact)
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
else
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
} /* end for */
/* Close attribute's datatype */
@@ -8421,15 +8419,15 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
if(test_shared != 0) {
if(test_shared == 1) {
/* Check on datatype storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 2, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 2, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Check on dataspace storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 2, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 2, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Unlink datasets with attributes */
@@ -8445,20 +8443,20 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
} /* end if */
/* Check on attribute storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
if(test_shared != 0) {
/* Check on datatype storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
/* Check on dataspace storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Close file */
@@ -8610,14 +8608,14 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
/* Check on dataset's message storage status */
if(test_shared != 0) {
/* Datasets' datatypes can be shared */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 1, "H5F__get_sohm_mesg_count_test");
/* Datasets' dataspace can be shared */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 1, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Retrieve limits for compact/dense attribute storage */
@@ -8629,10 +8627,10 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pclose");
/* Check on datasets' attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
- is_dense = H5O_is_attr_dense_test(dataset2);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset2);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add attributes to each dataset, until after converting to dense storage */
for(u = 0; u < max_compact * 2; u++) {
@@ -8684,11 +8682,11 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
+ is_dense = H5O__is_attr_dense_test(dataset);
if(u < max_compact)
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
else
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Alternate between creating "small" & "big" attributes */
@@ -8736,11 +8734,11 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset2);
+ is_dense = H5O__is_attr_dense_test(dataset2);
if(u < max_compact)
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
else
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Create new attribute name */
@@ -8873,15 +8871,15 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
if(test_shared != 0) {
if(test_shared == 1) {
/* Check on datatype storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 2, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 2, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Check on dataspace storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 2, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 2, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Unlink datasets with attributes */
@@ -8897,20 +8895,20 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
} /* end if */
/* Check on attribute storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
if(test_shared != 0) {
/* Check on datatype storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
/* Check on dataspace storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Close file */
@@ -9061,14 +9059,14 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
/* Check on dataset's message storage status */
if(test_shared != 0) {
/* Datasets' datatypes can be shared */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 1, "H5F__get_sohm_mesg_count_test");
/* Datasets' dataspace can be shared */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 1, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Retrieve limits for compact/dense attribute storage */
@@ -9080,10 +9078,10 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pclose");
/* Check on datasets' attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
- is_dense = H5O_is_attr_dense_test(dataset2);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset2);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add attributes to each dataset, until after converting to dense storage */
for(u = 0; u < max_compact * 2; u++) {
@@ -9135,11 +9133,11 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
+ is_dense = H5O__is_attr_dense_test(dataset);
if(u < max_compact)
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
else
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Alternate between creating "small" & "big" attributes */
@@ -9179,7 +9177,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
/* Check refcount for attribute */
ret = H5A__get_shared_rc_test(attr, &shared_refcount);
CHECK(ret, FAIL, "H5A__get_shared_rc_test");
- VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test");
+ VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test");
} /* end else */
/* Close attribute */
@@ -9187,11 +9185,11 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset2);
+ is_dense = H5O__is_attr_dense_test(dataset2);
if(u < max_compact)
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
else
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
} /* end for */
@@ -9247,15 +9245,15 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
if(test_shared != 0) {
if(test_shared == 1) {
/* Check on datatype storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 2, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 2, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Check on dataspace storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 2, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 2, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Unlink datasets with attributes */
@@ -9271,20 +9269,20 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
} /* end if */
/* Check on attribute storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
if(test_shared != 0) {
/* Check on datatype storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
/* Check on dataspace storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Close file */
@@ -9435,14 +9433,14 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
/* Check on dataset's message storage status */
if(test_shared != 0) {
/* Datasets' datatypes can be shared */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 1, "H5F__get_sohm_mesg_count_test");
/* Datasets' dataspace can be shared */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 1, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Retrieve limits for compact/dense attribute storage */
@@ -9454,10 +9452,10 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pclose");
/* Check on datasets' attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
- is_dense = H5O_is_attr_dense_test(dataset2);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset2);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add attributes to each dataset, until after converting to dense storage */
for(u = 0; u < max_compact * 2; u++) {
@@ -9509,11 +9507,11 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
+ is_dense = H5O__is_attr_dense_test(dataset);
if(u < max_compact)
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
else
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Alternate between creating "small" & "big" attributes */
@@ -9561,11 +9559,11 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset2);
+ is_dense = H5O__is_attr_dense_test(dataset2);
if(u < max_compact)
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
else
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
} /* end for */
@@ -9583,8 +9581,8 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
/* Check on first dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Check ref count on attributes of first dataset */
for(u = 0; u < max_compact * 2; u++) {
@@ -9631,20 +9629,20 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
} /* end if */
/* Check on attribute storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
if(test_shared != 0) {
/* Check on datatype storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
/* Check on dataspace storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Close file */
@@ -11112,7 +11110,7 @@ test_attr(void)
CHECK(ret, FAIL, "H5Pclose");
} /* test_attr() */
-
+
/*-------------------------------------------------------------------------
* Function: cleanup_attr
*
diff --git a/test/testfiles/err_compat_1 b/test/testfiles/err_compat_1
index 8190665..fc99f77 100644
--- a/test/testfiles/err_compat_1
+++ b/test/testfiles/err_compat_1
@@ -1,5 +1,5 @@
Testing error API H5Eset/get_auto Testing error API based on data I/O All error API tests passed.
- This program tests the Error API compatible with HDF5 version (number). There're supposed to be some error messages
+ This program tests the Error API compatible with HDF5 version (number). There are supposed to be some error messages
********* Print error stack in HDF5 default way *********
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in main(): Error test failed
@@ -12,18 +12,12 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Bad value
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #000: (file name) line (number) in H5Dcreate2(): not a location ID
+ #000: (file name) line (number) in H5Dcreate2(): invalid location identifier
major: Invalid arguments to routine
minor: Inappropriate type
- #001: (file name) line (number) in H5G_loc(): invalid object ID
- major: Invalid arguments to routine
- minor: Bad value
********* Print error stack in customized way *********
- error #000: (file name) in H5G_loc(): line (number)
- major: Invalid arguments to routine
- minor: Bad value
- error #001: (file name) in H5Dcreate2(): line (number)
+ error #000: (file name) in H5Dcreate2(): line (number)
major: Invalid arguments to routine
minor: Inappropriate type
@@ -33,19 +27,13 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Can't get value
********* Print error stack in customized way *********
- error #000: (file name) in H5G_loc(): line (number)
- major: Invalid arguments to routine
- minor: Bad value
- error #001: (file name) in H5Dcreate2(): line (number)
+ error #000: (file name) in H5Dcreate2(): line (number)
major: Invalid arguments to routine
minor: Inappropriate type
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #000: (file name) line (number) in H5Dcreate2(): not a location ID
+ #000: (file name) line (number) in H5Dcreate2(): invalid location identifier
major: Invalid arguments to routine
minor: Inappropriate type
- #001: (file name) line (number) in H5G_loc(): invalid object ID
- major: Invalid arguments to routine
- minor: Bad value
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in main(): Error test failed
diff --git a/test/testfiles/error_test_1 b/test/testfiles/error_test_1
index 02cfed8..f0e4a62 100644
--- a/test/testfiles/error_test_1
+++ b/test/testfiles/error_test_1
@@ -41,19 +41,28 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Dread(): can't read data
major: Dataset
minor: Read failed
- #001: (file name) line (number) in H5D__read(): can't read data
+ #001: (file name) line (number) in H5VL_dataset_read(): dataset read failed
+ major: Virtual Object Layer
+ minor: Read failed
+ #002: (file name) line (number) in H5VL__dataset_read(): dataset read failed
+ major: Virtual Object Layer
+ minor: Read failed
+ #003: (file name) line (number) in H5VL__native_dataset_read(): can't read data
+ major: Dataset
+ minor: Read failed
+ #004: (file name) line (number) in H5D__read(): can't read data
major: Dataset
minor: Read failed
- #002: (file name) line (number) in H5D__chunk_read(): unable to read raw data chunk
+ #005: (file name) line (number) in H5D__chunk_read(): unable to read raw data chunk
major: Low-level I/O
minor: Read failed
- #003: (file name) line (number) in H5D__chunk_lock(): data pipeline read failed
+ #006: (file name) line (number) in H5D__chunk_lock(): data pipeline read failed
major: Dataset
minor: Filter operation failed
- #004: (file name) line (number) in H5Z_pipeline(): required filter 'bogus' is not registered
+ #007: (file name) line (number) in H5Z_pipeline(): required filter 'bogus' is not registered
major: Data filters
minor: Read failed
- #005: (file name) line (number) in H5PL_load(): filter plugins disabled
+ #008: (file name) line (number) in H5PL_load(): filter plugins disabled
major: Plugin for dynamically loaded library
minor: Unable to load metadata into cache
diff --git a/test/testframe.c b/test/testframe.c
index 21f9ea3..335118c 100644
--- a/test/testframe.c
+++ b/test/testframe.c
@@ -146,10 +146,10 @@ void TestInit(const char *ProgName, void (*private_usage)(void), int (*private_p
* Record the program name and private routines if provided.
*/
TestProgName = ProgName;
- if (NULL != private_usage)
- TestPrivateUsage = private_usage;
- if (NULL != private_parser)
- TestPrivateParser = private_parser;
+ if(NULL != private_usage)
+ TestPrivateUsage = private_usage;
+ if(NULL != private_parser)
+ TestPrivateParser = private_parser;
}
diff --git a/test/testhdf5.c b/test/testhdf5.c
index 713cccf..e136086 100644
--- a/test/testhdf5.c
+++ b/test/testhdf5.c
@@ -90,8 +90,8 @@ main(int argc, char *argv[])
/* Exit failure if errors encountered; else exit success. */
/* No need to print anything since PerformTests() already does. */
if (GetTestNumErrs() > 0)
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
else
- exit(EXIT_SUCCESS);
+ HDexit(EXIT_SUCCESS);
} /* end main() */
diff --git a/test/tfile.c b/test/tfile.c
index 619320a..b2c3e1b 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -22,9 +22,9 @@
#include "testhdf5.h"
#include "H5srcdir.h"
-#include "H5Bprivate.h"
#include "H5Iprivate.h"
#include "H5Pprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
/*
* This file needs to access private information from the H5F package.
@@ -896,15 +896,15 @@ test_file_close(void)
CHECK(ret, FAIL, "H5Pget_fclose_degree");
switch(fc_degree) {
- case H5F_CLOSE_STRONG:
+ case H5F_CLOSE_STRONG:
/* Close first open */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
/* Close second open */
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
- break;
- case H5F_CLOSE_SEMI:
+ break;
+ case H5F_CLOSE_SEMI:
/* Close first open */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
@@ -919,8 +919,8 @@ test_file_close(void)
/* Close second open */
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
- break;
- case H5F_CLOSE_WEAK:
+ break;
+ case H5F_CLOSE_WEAK:
/* Close first open */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
@@ -935,7 +935,7 @@ test_file_close(void)
CHECK(ret, FAIL, "H5Gclose");
ret = H5Gclose(group_id3);
CHECK(ret, FAIL, "H5Gclose");
- break;
+ break;
case H5F_CLOSE_DEFAULT:
default:
CHECK(fc_degree, H5F_CLOSE_DEFAULT, "H5Pget_fclose_degree");
@@ -957,7 +957,7 @@ test_file_close(void)
****************************************************************/
static void
create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1,
- hid_t *ret_gid2, hid_t *ret_gid3)
+ hid_t *ret_gid2, hid_t *ret_gid3)
{
ssize_t oid_count;
herr_t ret;
@@ -1109,9 +1109,10 @@ test_get_obj_ids(void)
oid_list = (hid_t *)HDcalloc((size_t)oid_list_size, sizeof(hid_t));
CHECK_PTR(oid_list, "HDcalloc");
- /* Call the public function H5F_get_obj_ids to use H5F_get_objects. User reported having problem here.
+ /* Call the public function H5F_get_obj_ids to use H5F__get_objects. User reported having problem here.
* that the returned size (ret_count) from H5Fget_obj_ids is one greater than the size passed in
- * (oid_list_size) */
+ * (oid_list_size).
+ */
ret_count = H5Fget_obj_ids(fid, H5F_OBJ_ALL, (size_t)oid_list_size, oid_list);
CHECK(ret_count, FAIL, "H5Fget_obj_ids");
VERIFY(ret_count, oid_list_size, "H5Fget_obj_count");
@@ -1431,6 +1432,7 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1,
case H5I_ATTR:
case H5I_REFERENCE:
case H5I_VFL:
+ case H5I_VOL:
case H5I_GENPROP_CLS:
case H5I_GENPROP_LST:
case H5I_ERROR_CLASS:
@@ -1586,6 +1588,96 @@ test_file_perm2(void)
} /* end test_file_perm2() */
+/****************************************************************
+**
+** test_file_is_accessible(): low-level file test routine.
+** Clone of test_file_ishdf5 but uses the newer VOL-enabled
+** H5Fis_accessible() API call.
+**
+*****************************************************************/
+static void
+test_file_is_accessible(void)
+{
+ hid_t fid; /* File opened with read-write permission */
+ hid_t fcpl_id; /* File creation property list */
+ hid_t fapl = -1; /* File access property list */
+ int fd; /* POSIX file descriptor */
+ ssize_t nbytes; /* Number of bytes written */
+ unsigned u; /* Local index variable */
+ unsigned char buf[1024]; /* Buffer of data to write */
+ htri_t status; /* Whether a file is an HDF5 file */
+ herr_t ret;
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Detection of HDF5 Files\n"));
+
+ /* Get FAPL */
+ fapl = h5_fileaccess();
+ CHECK(fapl, FAIL, "H5Pcreate");
+
+ /* Create a file */
+ fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Close file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Verify that the file is an HDF5 file */
+ status = H5Fis_accessible(FILE1, fapl);
+ VERIFY(status, TRUE, "H5Fis_accessible");
+
+
+ /* Create a file creation property list with a non-default user block size */
+ fcpl_id = H5Pcreate(H5P_FILE_CREATE);
+ CHECK(fcpl_id, FAIL, "H5Pcreate");
+
+ ret = H5Pset_userblock(fcpl_id, (hsize_t)2048);
+ CHECK(ret, FAIL, "H5Pset_userblock");
+
+ /* Create file with non-default user block */
+ fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl_id, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Release file-creation property list */
+ ret = H5Pclose(fcpl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Verify that the file is an HDF5 file */
+ status = H5Fis_accessible(FILE1, fapl);
+ VERIFY(status, TRUE, "H5Fis_accessible");
+
+
+ /* Create non-HDF5 file and check it */
+ fd = HDopen(FILE1, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW);
+ CHECK(fd, FAIL, "HDopen");
+
+ /* Initialize information to write */
+ for (u=0; u<1024; u++)
+ buf[u]=(unsigned char)u;
+
+ /* Write some information */
+ nbytes = HDwrite(fd, buf, (size_t)1024);
+ VERIFY(nbytes, 1024, "HDwrite");
+
+ /* Close the file */
+ ret = HDclose(fd);
+ CHECK(ret, FAIL, "HDclose");
+
+ /* Verify that the file is not an HDF5 file */
+ status = H5Fis_accessible(FILE1, fapl);
+ VERIFY(status, FALSE, "H5Fis_accessible");
+
+ /* Close property list */
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+} /* end test_file_is_accessible() */
+
/****************************************************************
**
@@ -1594,11 +1686,13 @@ test_file_perm2(void)
** correctly in variuous situations.
**
*****************************************************************/
+#ifndef H5_NO_DEPRECATED_SYMBOLS
static void
test_file_ishdf5(void)
{
hid_t file; /* File opened with read-write permission */
hid_t fcpl; /* File creation property list */
+ hid_t fapl = -1; /* File access property list */
int fd; /* File Descriptor */
ssize_t nbytes; /* Number of bytes written */
unsigned u; /* Local index variable */
@@ -1607,10 +1701,14 @@ test_file_ishdf5(void)
herr_t ret;
/* Output message about test being performed */
- MESSAGE(5, ("Testing Detection of HDF5 Files\n"));
+ MESSAGE(5, ("Testing Detection of HDF5 Files (using deprecated H5Fis_hdf5() call)\n"));
+
+ /* Get FAPL */
+ fapl = h5_fileaccess();
+ CHECK(fapl, FAIL, "H5Pcreate");
/* Create a file */
- file = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ file = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
CHECK(file, FAIL, "H5Fcreate");
/* Close file */
@@ -1630,7 +1728,7 @@ test_file_ishdf5(void)
CHECK(ret, FAIL, "H5Pset_userblock");
/* Create file with non-default user block */
- file = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT);
+ file = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl);
CHECK(file, FAIL, "H5Fcreate");
/* Release file-creation property list */
@@ -1666,7 +1764,12 @@ test_file_ishdf5(void)
status = H5Fis_hdf5(FILE1);
VERIFY(status, FALSE, "H5Fis_hdf5");
+ /* Close property list */
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
} /* end test_file_ishdf5() */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
/****************************************************************
**
@@ -2155,10 +2258,8 @@ test_file_double_file_dataset_open(hbool_t new_format)
MESSAGE(5, ("Testing double file and dataset open/close\n"));
/* Setting up test file */
-
- fapl = H5Pcreate(H5P_FILE_ACCESS);
+ fapl = h5_fileaccess();
CHECK(fapl, FAIL, "H5Pcreate");
-
if(new_format) {
ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
CHECK(ret, FAIL, "H5Pset_libver_bounds");
@@ -2670,8 +2771,8 @@ test_cached_stab_info(void)
CHECK(file_id, FAIL, "H5Fopen");
/* Verify the cached symbol table information */
- ret = H5F_check_cached_stab_test(file_id);
- CHECK(ret, FAIL, "H5F_check_cached_stab_test");
+ ret = H5F__check_cached_stab_test(file_id);
+ CHECK(ret, FAIL, "H5F__check_cached_stab_test");
/* Close file */
ret = H5Fclose(file_id);
@@ -3941,14 +4042,6 @@ error:
** This routine checks the free space available in a file as
** returned by the public routine H5Fget_freespace().
**
-** Modifications:
-** Vailin Choi; July 2012
-** Remove datasets in reverse order so that all file spaces are shrunk.
-** (A change due to H5FD_FLMAP_DICHOTOMY.)
-**
-** Vailin Choi; Dec 2012
-** Add changes due to paged aggregation via new format:
-** the amount of freespace is different.
**
*****************************************************************/
static void
@@ -4088,10 +4181,7 @@ test_file_freespace(const char *env_h5_drvr)
/* Check that there is the right amount of free space in the file */
free_space = H5Fget_freespace(file);
CHECK(free_space, FAIL, "H5Fget_freespace");
- if(new_format)
- VERIFY(free_space, expected_fs_del, "H5Fget_freespace");
- else
- VERIFY(free_space, expected_fs_del, "H5Fget_freespace");
+ VERIFY(free_space, expected_fs_del, "H5Fget_freespace");
/* Close file */
ret = H5Fclose(file);
@@ -5342,8 +5432,8 @@ test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr)
/* Get the internal file pointer if the create succeeds */
if((ok = fid >= 0)) {
- f = (H5F_t *)H5I_object(fid);
- CHECK(f, NULL, "H5I_object");
+ f = (H5F_t *)H5VL_object(fid);
+ CHECK(f, NULL, "H5VL_object");
}
/* Retrieve the low/high bounds */
@@ -5360,7 +5450,8 @@ test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr)
} else /* Should fail */
VERIFY(ok, FALSE, "H5Fcreate");
- } else { /* Should succeed */
+ }
+ else { /* Should succeed */
VERIFY(ok, TRUE, "H5Fcreate");
VERIFY(low, f->shared->low_bound, "HDF5_superblock_ver_bounds");
@@ -5490,8 +5581,8 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr)
CHECK(fid, FAIL, "H5Fcreate");
/* Get the internal file pointer */
- f = (H5F_t *)H5I_object(fid);
- CHECK(f, NULL, "H5I_object");
+ f = (H5F_t *)H5VL_object(fid);
+ CHECK(f, NULL, "H5VL_object");
/* The file's superblock version */
super_vers = f->shared->sblock->super_vers;
@@ -5522,8 +5613,8 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr)
/* Get the internal file pointer if the open succeeds */
if((ok = fid >= 0)) {
- f = (H5F_t *)H5I_object(fid);
- CHECK(f, NULL, "H5I_object");
+ f = (H5F_t *)H5VL_object(fid);
+ CHECK(f, NULL, "H5VL_object");
}
/* Verify the file open succeeds or fails */
@@ -5694,8 +5785,8 @@ test_libver_bounds_obj(hid_t fapl)
if(fid >=0 ) { /* The file open succeeds */
/* Get the internal file pointer */
- f = (H5F_t *)H5I_object(fid);
- CHECK(f, NULL, "H5I_object");
+ f = (H5F_t *)H5VL_object(fid);
+ CHECK(f, NULL, "H5VL_object");
/* Create a group in the file */
gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
@@ -5802,8 +5893,8 @@ test_libver_bounds_dataset(hid_t fapl)
CHECK(did, FAIL, "H5Dcreate");
/* Get the internal dataset pointer */
- dset = (H5D_t *)H5I_object(did);
- CHECK(dset, NULL, "H5I_object");
+ dset = (H5D_t *)H5VL_object(did);
+ CHECK(dset, NULL, "H5VL_object");
/* Verify version for layout and fill value messages */
if(low == H5F_LIBVER_EARLIEST) {
@@ -5847,8 +5938,8 @@ test_libver_bounds_dataset(hid_t fapl)
if(did >= 0) {
/* Get the internal dataset pointer */
- dset = (H5D_t *)H5I_object(did);
- CHECK(dset, NULL, "H5I_object");
+ dset = (H5D_t *)H5VL_object(did);
+ CHECK(dset, NULL, "H5VL_object");
/* Verify layout message version and chunk indexing type */
VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_4, "H5O_layout_ver_bounds");
@@ -5905,16 +5996,16 @@ test_libver_bounds_dataset(hid_t fapl)
if(fid >=0 ) { /* The file open succeeds */
/* Get the internal file pointer */
- f = (H5F_t *)H5I_object(fid);
- CHECK(f, NULL, "H5I_object");
+ f = (H5F_t *)H5VL_object(fid);
+ CHECK(f, NULL, "H5VL_object");
/* Create the chunked dataset */
did = H5Dcreate2(fid, DSETC, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
CHECK(did, FAIL, "H5Dcreate2");
/* Get the internal file pointer */
- dset = (H5D_t *)H5I_object(did);
- CHECK(dset, NULL, "H5I_object");
+ dset = (H5D_t *)H5VL_object(did);
+ CHECK(dset, NULL, "H5VL_object");
/* Verify the dataset's layout, fill value and filter pipeline message versions */
/* Also verify the chunk indexing type */
@@ -6121,8 +6212,8 @@ test_libver_bounds_dataspace(hid_t fapl)
if(fid >=0 ) { /* The file open succeeds */
/* Get the internal file pointer */
- f = (H5F_t *)H5I_object(fid);
- CHECK(f, NULL, "H5I_object");
+ f = (H5F_t *)H5VL_object(fid);
+ CHECK(f, NULL, "H5VL_object");
/* Create the chunked dataset */
did = H5Dcreate2(fid, DSETA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -6443,14 +6534,14 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid)
if(fid >= 0 ) { /* The file open succeeds */
/* Get the internal file pointer */
- f = (H5F_t *)H5I_object(fid);
- CHECK(f, NULL, "H5I_object");
+ f = (H5F_t *)H5VL_object(fid);
+ CHECK(f, NULL, "H5VL_object");
/* Open the committed datatype */
str_tid = H5Topen2(fid, "datatype", H5P_DEFAULT);
CHECK(str_tid, FAIL, "H5Topen2");
- str_dtype = (H5T_t *)H5I_object(str_tid);
- CHECK(str_dtype, NULL, "H5I_object");
+ str_dtype = (H5T_t *)H5VL_object(str_tid);
+ CHECK(str_dtype, NULL, "H5VL_object");
/* Verify the committed datatype message version */
VERIFY(str_dtype->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST], "H5O_dtype_ver_bounds");
@@ -6601,8 +6692,8 @@ test_libver_bounds_attributes(hid_t fapl)
CHECK(aid, FAIL, "H5Acreate2");
/* Get the internal attribute pointer */
- attr = (H5A_t *)H5I_object(aid);
- CHECK(attr, NULL, "H5I_object");
+ attr = (H5A_t *)H5VL_object(aid);
+ CHECK(attr, NULL, "H5VL_object");
/* Verify the attribute version */
if(low == H5F_LIBVER_EARLIEST)
@@ -6620,8 +6711,8 @@ test_libver_bounds_attributes(hid_t fapl)
CHECK(aid, FAIL, "H5Acreate2");
/* Get the internal attribute pointer */
- attr = (H5A_t *)H5I_object(aid);
- CHECK(attr, NULL, "H5I_object");
+ attr = (H5A_t *)H5VL_object(aid);
+ CHECK(attr, NULL, "H5VL_object");
/* Verify attribute version */
VERIFY(attr->shared->version, H5O_attr_ver_bounds[low], "H5O_attr_ver_bounds");
@@ -6641,8 +6732,8 @@ test_libver_bounds_attributes(hid_t fapl)
CHECK(aid, FAIL, "H5Acreate2");
/* Get internal attribute pointer */
- attr = (H5A_t *)H5I_object(aid);
- CHECK(attr, NULL, "H5I_object");
+ attr = (H5A_t *)H5VL_object(aid);
+ CHECK(attr, NULL, "H5VL_object");
/* Verify attribute version */
if(low == H5F_LIBVER_EARLIEST)
@@ -6706,8 +6797,8 @@ test_libver_bounds_attributes(hid_t fapl)
CHECK(aid, FAIL, "H5Acreate2");
/* Get the internal attribute pointer */
- attr = (H5A_t *)H5I_object(aid);
- CHECK(attr, NULL, "H5I_object");
+ attr = (H5A_t *)H5VL_object(aid);
+ CHECK(attr, NULL, "H5VL_object");
/* Verify the attribute version */
if(low == H5F_LIBVER_EARLIEST)
@@ -6764,8 +6855,8 @@ test_libver_bounds_attributes(hid_t fapl)
if(fid >=0 ) { /* The file open succeeds */
/* Get the internal file pointer */
- f = (H5F_t *)H5I_object(fid);
- CHECK(f, NULL, "H5I_object");
+ f = (H5F_t *)H5VL_object(fid);
+ CHECK(f, NULL, "H5VL_object");
/* Open the group */
gid = H5Gopen2(fid, GRP_NAME, H5P_DEFAULT);
@@ -6776,8 +6867,8 @@ test_libver_bounds_attributes(hid_t fapl)
CHECK(aid, FAIL, "H5Acreate2");
/* Get the internal attribute pointer */
- attr = (H5A_t *)H5I_object(aid);
- CHECK(attr, NULL, "H5I_object");
+ attr = (H5A_t *)H5VL_object(aid);
+ CHECK(attr, NULL, "H5VL_object");
/* Verify the attribute message version */
VERIFY(attr->shared->version, H5O_attr_ver_bounds[f->shared->low_bound], "H5O_attr_ver_bounds");
@@ -7443,7 +7534,7 @@ test_file(void)
test_get_obj_ids(); /* Test H5Fget_obj_ids for Jira Issue 8528 */
test_file_perm(); /* Test file access permissions */
test_file_perm2(); /* Test file access permission again */
- test_file_ishdf5(); /* Test detecting HDF5 files correctly */
+ test_file_is_accessible(); /* Test detecting HDF5 files correctly */
test_file_open_dot(); /* Test opening objects with "." for a name */
test_file_open_overlap(); /* Test opening files in an overlapping manner */
test_file_getname(); /* Test basic H5Fget_name() functionality */
@@ -7479,11 +7570,12 @@ test_file(void)
test_incr_filesize(); /* Test H5Fincrement_filesize() and H5Fget_eoa() */
test_min_dset_ohdr(); /* Test datset object header minimization */
#ifndef H5_NO_DEPRECATED_SYMBOLS
+ test_file_ishdf5(); /* Test detecting HDF5 files correctly */
test_deprec(); /* Test deprecated routines */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
} /* test_file() */
-
+
/*-------------------------------------------------------------------------
* Function: cleanup_file
*
diff --git a/test/tgenprop.c b/test/tgenprop.c
index 5031846..151913c 100644
--- a/test/tgenprop.c
+++ b/test/tgenprop.c
@@ -1774,8 +1774,8 @@ test_genprop_path(void)
CHECK_I(ret, "H5Pregister2");
/* Get full path for first class */
- path=H5P_get_class_path_test(cid1);
- CHECK_PTR(path, "H5P_get_class_path_test");
+ path = H5P__get_class_path_test(cid1);
+ CHECK_PTR(path, "H5P__get_class_path_test");
if(HDstrcmp(path,CLASS1_PATH)!=0)
TestErrPrintf("Class names don't match!, path=%s, CLASS1_PATH=%s\n",path,CLASS1_PATH);
H5free_memory(path);
@@ -1789,14 +1789,14 @@ test_genprop_path(void)
CHECK_I(ret, "H5Pregister2");
/* Get full path for second class */
- path=H5P_get_class_path_test(cid2);
- CHECK_PTR(path, "H5P_get_class_path_test");
+ path = H5P__get_class_path_test(cid2);
+ CHECK_PTR(path, "H5P__get_class_path_test");
if(HDstrcmp(path,CLASS2_PATH)!=0)
TestErrPrintf("Class names don't match!, path=%s, CLASS2_PATH=%s\n",path,CLASS2_PATH);
/* Open a copy of the class with the path name */
- cid3 = H5P_open_class_path_test(path);
- CHECK_I(cid3, "H5Popen_class_path");
+ cid3 = H5P__open_class_path_test(path);
+ CHECK_I(cid3, "H5P__open_class_path_test");
/* Check that the classes are equal */
ret = H5Pequal(cid2,cid3);
diff --git a/test/th5s.c b/test/th5s.c
index 0619571..14f5de9 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -22,7 +22,6 @@
#include "testhdf5.h"
#include "H5srcdir.h"
-#include "H5Bprivate.h"
#include "H5Iprivate.h"
#include "H5Pprivate.h"
diff --git a/test/tmisc.c b/test/tmisc.c
index 1e62302..fef94dd 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -2272,7 +2272,7 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char
CHECK_PTR(user_block, "HDcalloc");
/* Copy in the user block data */
- HDmemcpy(user_block, str, strlen(str));
+ HDmemcpy(user_block, str, HDstrlen(str));
/* Open the new file */
new_fp = HDfopen(new_name,"wb");
@@ -2713,16 +2713,16 @@ test_misc15(void)
fapl = H5Fget_access_plist(file);
CHECK(fapl, FAIL, "H5Fget_access_plist");
- ret = H5Pclose(fapl);
- CHECK(ret, FAIL, "H5Pclose");
-
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
/* Verify that the file is still OK */
- ret = H5Fis_hdf5(MISC15_FILE);
+ ret = H5Fis_accessible(MISC15_FILE, fapl);
CHECK(ret, FAIL, "H5Fis_hdf5");
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
file = H5Fopen(MISC15_FILE, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(file, FAIL, "H5Fopen");
@@ -3028,7 +3028,9 @@ test_misc19(void)
hid_t emid = -1; /* Error Message ID */
hid_t esid = -1; /* Error Stack ID */
hid_t vfdid = -1; /* Virtual File Driver ID */
+ hid_t volid = -1; /* Virtual Object Layer ID */
H5FD_class_t *vfd_cls = NULL; /* VFD class */
+ H5VL_class_t *vol_cls = NULL; /* VOL class */
int rc; /* Reference count */
herr_t ret; /* Generic return value */
@@ -3479,6 +3481,44 @@ test_misc19(void)
HDfree(vfd_cls);
+/* Check H5I operations on virtual object connectors */
+
+ /* Get a VOL class to register */
+ vol_cls = h5_get_dummy_vol_class();
+ CHECK(vol_cls, NULL, "h5_get_dummy_vol_class");
+
+ /* Register a VOL connector */
+ volid = H5VLregister_connector(vol_cls, H5P_DEFAULT);
+ CHECK(volid, FAIL, "H5VLregister_connector");
+
+ /* Check the reference count */
+ rc = H5Iget_ref(volid);
+ VERIFY(rc, 1, "H5Iget_ref");
+
+ /* Increment the reference count */
+ rc = H5Iinc_ref(volid);
+ VERIFY(rc, 2, "H5Iinc_ref");
+
+ /* Unregister the VOL connector normally */
+ ret = H5VLunregister_connector(volid);
+ CHECK(ret, FAIL, "H5VLunregister_connector");
+
+ /* Check the reference count */
+ rc = H5Iget_ref(volid);
+ VERIFY(rc, 1, "H5Iget_ref");
+
+ /* Unregister the VOL connector by decrementing the reference count */
+ rc = H5Idec_ref(volid);
+ VERIFY(rc, 0, "H5Idec_ref");
+
+ /* Try unregistering the VOL connector again (should fail) */
+ H5E_BEGIN_TRY {
+ ret = H5VLunregister_connector(volid);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5VLunregister_connector");
+
+ HDfree(vol_cls);
+
} /* end test_misc19() */
/****************************************************************
@@ -4721,6 +4761,7 @@ test_misc25a(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_misc25a() */
+
/****************************************************************
**
** test_misc25b(): Exercise null object header message merge bug
@@ -4756,7 +4797,7 @@ test_misc25b(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_misc25b() */
-
+
/****************************************************************
**
** test_misc25c(): Exercise another null object header message merge bug.
@@ -4890,7 +4931,7 @@ test_misc25c(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_misc25c() */
-
+
/****************************************************************
**
** test_misc26(): Regression test: ensure that copying filter
@@ -4976,7 +5017,7 @@ test_misc26(void)
CHECK_I(ret, "H5Pclose");
}
-
+
/****************************************************************
**
** test_misc27(): Ensure that objects with incorrect # of object
@@ -5021,7 +5062,7 @@ test_misc27(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_misc27() */
-
+
/****************************************************************
**
** test_misc28(): Ensure that the dataset chunk cache will hold
@@ -5198,7 +5239,7 @@ test_misc28(void)
CHECK_I(ret, "H5Pclose");
} /* end test_misc28() */
-
+
/****************************************************************
**
** test_misc29(): Ensure that speculative metadata reads don't
@@ -5247,7 +5288,7 @@ test_misc30_get_info(hid_t loc_id)
return H5Literate(loc_id, H5_INDEX_NAME, H5_ITER_INC, NULL, test_misc30_get_info_cb, NULL);
}
-
+
/****************************************************************
**
** test_misc30(): Exercise local heap code that loads prefix
@@ -5312,7 +5353,7 @@ test_misc30(void)
VERIFY(file_size[0], file_size[1], "test_misc30");
} /* end test_misc30() */
-
+
/****************************************************************
**
** test_misc31(): Test reentering library through deprecated
@@ -5410,7 +5451,7 @@ test_misc31(void)
#endif /* H5_NO_DEPRECATED_SYMBOLS */
} /* end test_misc31() */
-
+
/****************************************************************
*
* test_misc32(): Simple test of filter memory allocation
@@ -5584,7 +5625,7 @@ test_misc34(void)
} /* end test_misc34() */
-
+
/****************************************************************
**
** test_misc(): Main misc. test routine.
@@ -5637,7 +5678,7 @@ test_misc(void)
} /* test_misc() */
-
+
/*-------------------------------------------------------------------------
* Function: cleanup_misc
*
@@ -5647,9 +5688,6 @@ test_misc(void)
*
* Programmer: Albert Cheng
* July 2, 1998
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void
diff --git a/test/tsohm.c b/test/tsohm.c
index b27a107..2df389e 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -3867,17 +3867,19 @@ test_sohm_external_dtype(void)
file1 = H5Fcreate(FILENAME_SRC, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT);
CHECK_I(file1, "H5Fcreate");
- ret = H5F_get_sohm_mesg_count_test(file1, H5O_DTYPE_ID, &dmsg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(dmsg_count, 0, "H5F_get_sohm_mesg_count_test");
+ /* Check on datatype storage status. It should be zero now. */
+ ret = H5F__get_sohm_mesg_count_test(file1, H5O_DTYPE_ID, &dmsg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(dmsg_count, 0, "H5F__get_sohm_mesg_count_test");
dataset1 = H5Dcreate2(file1, "dataset_1", s1_tid, space, H5P_DEFAULT, H5P_DEFAULT,
H5P_DEFAULT);
CHECK_I(dataset1, "H5Dcreate2");
- ret = H5F_get_sohm_mesg_count_test(file1, H5O_DTYPE_ID, &dmsg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(dmsg_count, 1, "H5F_get_sohm_mesg_count_test");
+ /* Check on datatype storage status. It should be 1 now. */
+ ret = H5F__get_sohm_mesg_count_test(file1, H5O_DTYPE_ID, &dmsg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(dmsg_count, 1, "H5F__get_sohm_mesg_count_test");
dset1_tid = H5Dget_type(dataset1);
CHECK_I(dset1_tid, "H5Dget_type");
@@ -3902,17 +3904,19 @@ test_sohm_external_dtype(void)
file2 = H5Fcreate(FILENAME_DST, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT);
CHECK_I(file2, "H5Fcreate");
- ret = H5F_get_sohm_mesg_count_test(file2, H5O_DTYPE_ID, &dmsg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(dmsg_count, 0, "H5F_get_sohm_mesg_count_test");
+ /* Check on datatype storage status. It should be zero now. */
+ ret = H5F__get_sohm_mesg_count_test(file2, H5O_DTYPE_ID, &dmsg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(dmsg_count, 0, "H5F__get_sohm_mesg_count_test");
dataset2 = H5Dcreate2(file2, "dataset_2", dset1_tid, space, H5P_DEFAULT, H5P_DEFAULT,
H5P_DEFAULT);
CHECK_I(dataset2, "H5Dcreate2");
- ret = H5F_get_sohm_mesg_count_test(file2, H5O_DTYPE_ID, &dmsg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(dmsg_count, 1, "H5F_get_sohm_mesg_count_test");
+ /* Check on datatype storage status. It should be 1 now. */
+ ret = H5F__get_sohm_mesg_count_test(file2, H5O_DTYPE_ID, &dmsg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(dmsg_count, 1, "H5F__get_sohm_mesg_count_test");
ret = H5Dwrite(dataset2, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig);
CHECK_I(ret, "H5Dwrite");
diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c
index 4160d3a..56d87ee 100644
--- a/test/ttsafe_error.c
+++ b/test/ttsafe_error.c
@@ -38,7 +38,7 @@
/* Having a common dataset name is an error */
#define DATASETNAME "commonname"
-#define EXPECTED_ERROR_DEPTH 7
+#define EXPECTED_ERROR_DEPTH 9
#define WRITE_NUMBER 37
/* Typedefs */
@@ -73,23 +73,32 @@ tts_error(void)
expected_g[0].maj_num = H5E_DATASET;
expected_g[0].min_num = H5E_CANTINIT;
- expected_g[1].maj_num = H5E_DATASET;
- expected_g[1].min_num = H5E_CANTINIT;
+ expected_g[1].maj_num = H5E_VOL;
+ expected_g[1].min_num = H5E_CANTCREATE;
- expected_g[2].maj_num = H5E_LINK;
- expected_g[2].min_num = H5E_CANTINIT;
+ expected_g[2].maj_num = H5E_VOL;
+ expected_g[2].min_num = H5E_CANTCREATE;
- expected_g[3].maj_num = H5E_LINK;
- expected_g[3].min_num = H5E_CANTINSERT;
+ expected_g[3].maj_num = H5E_DATASET;
+ expected_g[3].min_num = H5E_CANTINIT;
- expected_g[4].maj_num = H5E_SYM;
- expected_g[4].min_num = H5E_NOTFOUND;
+ expected_g[4].maj_num = H5E_DATASET;
+ expected_g[4].min_num = H5E_CANTINIT;
- expected_g[5].maj_num = H5E_SYM;
- expected_g[5].min_num = H5E_CALLBACK;
+ expected_g[5].maj_num = H5E_LINK;
+ expected_g[5].min_num = H5E_CANTINIT;
expected_g[6].maj_num = H5E_LINK;
- expected_g[6].min_num = H5E_EXISTS;
+ expected_g[6].min_num = H5E_CANTINSERT;
+
+ expected_g[7].maj_num = H5E_SYM;
+ expected_g[7].min_num = H5E_NOTFOUND;
+
+ expected_g[8].maj_num = H5E_SYM;
+ expected_g[8].min_num = H5E_CALLBACK;
+
+ expected_g[9].maj_num = H5E_LINK;
+ expected_g[9].min_num = H5E_EXISTS;
/* set up mutex for global count of errors */
H5TS_mutex_init(&error_mutex_g);
@@ -115,7 +124,7 @@ tts_error(void)
H5TS_wait_for_thread(threads[i]);
if (error_flag_g) {
- TestErrPrintf("At least one thread reported a value that was different from the exected value\n");
+ TestErrPrintf("At least one thread reported a value that was different from the expected value\n");
HDprintf("(Update this test if the error stack changed!)\n");
}
diff --git a/test/tunicode.c b/test/tunicode.c
index 85f5af0..5a60036 100644
--- a/test/tunicode.c
+++ b/test/tunicode.c
@@ -163,8 +163,8 @@ void test_strpad(hid_t H5_ATTR_UNUSED fid, const char *string)
/* Fill the buffer with two copies of the UTF-8 string, each with a
* terminating NULL. It will look like "abcdefg\0abcdefg\0". */
- strncpy(buf, new_string, big_len);
- strncpy(&buf[big_len], new_string, big_len);
+ HDstrncpy(buf, new_string, big_len);
+ HDstrncpy(&buf[big_len], new_string, big_len);
ret = H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Tconvert");
@@ -226,8 +226,8 @@ void test_strpad(hid_t H5_ATTR_UNUSED fid, const char *string)
/* Fill the buffer with two copies of the UTF-8 string.
* It will look like "abcdefghabcdefgh". */
- strncpy(buf, new_string, big_len);
- strncpy(&buf[big_len], new_string, big_len);
+ HDstrncpy(buf, new_string, big_len);
+ HDstrncpy(&buf[big_len], new_string, big_len);
ret = H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Tconvert");
diff --git a/test/tvlstr.c b/test/tvlstr.c
index 3315d68..68d1070 100644
--- a/test/tvlstr.c
+++ b/test/tvlstr.c
@@ -23,12 +23,16 @@
#define DATAFILE "tvlstr.h5"
#define DATAFILE2 "tvlstr2.h5"
+#define DATAFILE3 "sel2el.h5"
+
+#define DATASET "1Darray"
/* 1-D dataset with fixed dimensions */
#define SPACE1_RANK 1
#define SPACE1_DIM1 4
+#define NUMP 4
-#define VLSTR_TYPE "vl_string_type"
+#define VLSTR_TYPE "vl_string_type"
/* Definitions for the VL re-writing test */
#define REWRITE_NDATASETS 32
@@ -846,6 +850,101 @@ static void test_vl_rewrite(void)
} /* end test_vl_rewrite() */
/****************************************************************
+ **
+ ** test_write_same_element():
+ ** Tests writing to the same element of VL string using
+ ** H5Sselect_element.
+ **
+ ****************************************************************/
+static void test_write_same_element(void)
+{
+ hid_t file1, dataset1;
+ hid_t mspace, fspace, dtype;
+ hsize_t fdim[] = {SPACE1_DIM1};
+ char *val[SPACE1_DIM1] = {"But", "reuniting", "is a", "great joy"};
+ hsize_t marray[] = {NUMP};
+ hsize_t coord[SPACE1_RANK][NUMP];
+ herr_t ret;
+
+ char *wdata[SPACE1_DIM1] = {"Parting", "is such a", "sweet", "sorrow."};
+
+ file1 = H5Fcreate(DATAFILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(file1, FAIL, "H5Fcreate");
+
+ dtype = H5Tcopy(H5T_C_S1);
+ CHECK(dtype, FAIL, "H5Tcopy");
+
+ ret = H5Tset_size(dtype, H5T_VARIABLE);
+ CHECK(ret, FAIL, "H5Tset_size");
+
+ fspace = H5Screate_simple(SPACE1_RANK, fdim, NULL);
+ CHECK(fspace, FAIL, "H5Screate_simple");
+
+ dataset1 = H5Dcreate(file1, DATASET, dtype, fspace, H5P_DEFAULT,
+ H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset1, FAIL, "H5Dcreate");
+
+ ret = H5Dwrite(dataset1, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ ret = H5Dclose(dataset1);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ ret = H5Tclose(dtype);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ ret = H5Sclose(fspace);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ ret = H5Fclose(file1);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /*
+ * Open the file. Select the same points, write values to those point locations.
+ */
+ file1 = H5Fopen(DATAFILE3, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(file1, FAIL, "H5Fopen");
+
+ dataset1 = H5Dopen(file1, DATASET, H5P_DEFAULT);
+ CHECK(dataset1, FAIL, "H5Dopen");
+
+ fspace = H5Dget_space(dataset1);
+ CHECK(fspace, FAIL, "H5Dget_space");
+
+ dtype = H5Dget_type(dataset1);
+ CHECK(dtype, FAIL, "H5Dget_type");
+
+ mspace = H5Screate_simple(1, marray, NULL);
+ CHECK(mspace, FAIL, "H5Screate_simple");
+
+ coord[0][0] = 0;
+ coord[0][1] = 2;
+ coord[0][2] = 2;
+ coord[0][3] = 0;
+
+ ret = H5Sselect_elements(fspace, H5S_SELECT_SET, NUMP, (const hsize_t *)&coord);
+ CHECK(ret, FAIL, "H5Sselect_elements");
+
+ ret = H5Dwrite(dataset1, dtype, mspace, fspace, H5P_DEFAULT, val);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ ret = H5Tclose(dtype);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ ret = H5Dclose(dataset1);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ ret = H5Sclose(fspace);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ ret = H5Sclose(mspace);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ ret = H5Fclose(file1);
+ CHECK(ret, FAIL, "H5Fclose");
+} /* test_write_same_element */
+
+/****************************************************************
**
** test_vlstrings(): Main VL string testing routine.
**
@@ -869,9 +968,10 @@ test_vlstrings(void)
/* Test writing VL datasets in files with lots of unlinking */
test_vl_rewrite();
+ /* Test writing to the same element more than once using H5Sselect_elements */
+ test_write_same_element();
} /* test_vlstrings() */
-
/*-------------------------------------------------------------------------
* Function: cleanup_vlstrings
*
@@ -891,5 +991,6 @@ cleanup_vlstrings(void)
{
HDremove(DATAFILE);
HDremove(DATAFILE2);
+ HDremove(DATAFILE3);
}
diff --git a/test/tvltypes.c b/test/tvltypes.c
index e5a3d34..8824066 100644
--- a/test/tvltypes.c
+++ b/test/tvltypes.c
@@ -467,7 +467,7 @@ test_vltypes_vlen_atomic(void)
/* Try to call H5Dvlen_get_buf with bad dataspace */
H5E_BEGIN_TRY {
- ret = H5Dvlen_get_buf_size(dataset, tid1, sid2, &size);
+ ret = H5Dvlen_get_buf_size(dataset, tid1, sid2, &size);
} H5E_END_TRY
VERIFY(ret, FAIL, "H5Dvlen_get_buf_size");
@@ -499,7 +499,7 @@ test_vltypes_vlen_atomic(void)
/* Try to reclaim read data using "bad" dataspace with no extent
* Should fail */
H5E_BEGIN_TRY {
- ret=H5Dvlen_reclaim(tid1,sid2,xfer_pid,rdata);
+ ret=H5Dvlen_reclaim(tid1,sid2,xfer_pid,rdata);
} H5E_END_TRY
VERIFY(ret, FAIL, "H5Dvlen_reclaim");
@@ -1205,9 +1205,9 @@ test_vltypes_compound_vlstr(void)
wdata[i].v.p=(s2*)HDmalloc((i+L3_INCM)*sizeof(s2));
wdata[i].v.len=i+L3_INCM;
for(t1=(s2 *)((wdata[i].v).p), j=0; j<(i+L3_INCM); j++, t1++) {
- strcat(str, "m");
- t1->string = (char*)HDmalloc(strlen(str)*sizeof(char)+1);
- strcpy(t1->string, str);
+ HDstrcat(str, "m");
+ t1->string = (char*)HDmalloc(HDstrlen(str)*sizeof(char)+1);
+ HDstrcpy(t1->string, str);
/*t1->color = red;*/
t1->color = blue;
}
@@ -1348,7 +1348,7 @@ test_vltypes_compound_vlstr(void)
} /* end if */
for(t1=(s2 *)(wdata[i].v.p), t2=(s2 *)(rdata[i].v.p), j=0; j<rdata[i].v.len; j++, t1++, t2++) {
- if( strcmp(t1->string, t2->string) ) {
+ if(HDstrcmp(t1->string, t2->string)) {
TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n",t1->string, t2->string);
continue;
} /* end if */
@@ -1368,14 +1368,14 @@ test_vltypes_compound_vlstr(void)
CHECK(ret, FAIL, "H5Dvlen_reclaim");
/* Use this part for new data */
- strcpy(str, "bbbbbbbb\0");
+ HDstrcpy(str, "bbbbbbbb\0");
for(i=0; i<SPACE1_DIM1; i++) {
wdata2[i].v.p=(s2*)HDmalloc((i+1)*sizeof(s2));
wdata2[i].v.len=i+1;
for(t1=(s2*)(wdata2[i].v).p, j=0; j<i+1; j++, t1++) {
- strcat(str, "pp");
- t1->string = (char*)HDmalloc(strlen(str)*sizeof(char)+1);
- strcpy(t1->string, str);
+ HDstrcat(str, "pp");
+ t1->string = (char*)HDmalloc(HDstrlen(str)*sizeof(char)+1);
+ HDstrcpy(t1->string, str);
t1->color = green;
}
} /* end for */
@@ -1406,7 +1406,7 @@ test_vltypes_compound_vlstr(void)
} /* end if */
for(t1=(s2 *)(wdata2[i].v.p), t2=(s2 *)(rdata2[i].v.p), j=0; j<rdata2[i].v.len; j++, t1++, t2++) {
- if( strcmp(t1->string, t2->string) ) {
+ if(HDstrcmp(t1->string, t2->string)) {
TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n",t1->string, t2->string);
continue;
} /* end if */
diff --git a/test/unregister.c b/test/unregister.c
index dbf6293..ff116cf 100644
--- a/test/unregister.c
+++ b/test/unregister.c
@@ -16,6 +16,7 @@
* Purpose: Tests H5Zunregister function
*/
#include "h5test.h"
+
#include "H5CXprivate.h" /* API Contexts */
const char *FILENAME[] = {
@@ -24,8 +25,8 @@ const char *FILENAME[] = {
NULL
};
-#define GROUP_NAME "group"
-#define DSET_NAME "dataset"
+#define GROUP_NAME "test_group"
+#define DSET_NAME "test_dataset"
#define FILENAME_BUF_SIZE 1024
#define DSET_DIM1 100
#define DSET_DIM2 200
@@ -35,39 +36,34 @@ const char *FILENAME[] = {
#define H5Z_FILTER_DUMMY 312
-static size_t filter_dummy(unsigned int flags, size_t cd_nelmts,
+static size_t do_nothing(unsigned int flags, size_t cd_nelmts,
const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
/* Dummy filter for test_unregister_filters only */
const H5Z_class2_t H5Z_DUMMY[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_DUMMY, /* Filter id number */
- 1, 1, /* Encoding and decoding enabled */
- "dummy", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- filter_dummy, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ H5Z_FILTER_DUMMY, /* Filter ID number */
+ 1, 1, /* Encoding and decoding enabled */
+ "dummy", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ do_nothing, /* The actual filter function */
}};
/*-------------------------------------------------------------------------
- * Function: filter_dummy
+ * Function: do_nothing
*
- * Purpose: A dummy compression method that doesn't do anything. This
- * filter is only for test_unregister_filters. Please don't
+ * Purpose: A dummy compression method that doesn't do anything. This
+ * filter is only for test_unregister_filters. Please don't
* use it for other tests because it may mess up this test.
*
- * Return: Success: Data chunk size
- *
- * Failure: 0
- *
- * Programmer: Raymond Lu
- * April 24, 2013
+ * Return: Data chunk size
*
*-------------------------------------------------------------------------
*/
static size_t
-filter_dummy(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts,
+do_nothing(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts,
const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes,
size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf)
{
@@ -75,194 +71,233 @@ filter_dummy(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts,
}
/*-------------------------------------------------------------------------
- * Function: test_unregister_filters
- *
- * Purpose: Tests unregistering filter before closing the file
+ * Function: test_unregister_filters
*
- * Return: Success: 0
- * Failure: -1
+ * Purpose: Tests unregistering filter before closing the file
*
- * Programmer: Raymond Lu
- * 11 April 2013
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
static herr_t
-test_unregister_filters(hid_t my_fapl)
+test_unregister_filters(hid_t fapl_id)
{
- hid_t file1, file2;
- hid_t dc;
- hid_t gcpl, gid, group;
- hid_t dataset, space;
- int i, j, n;
- char gname[256];
+ hid_t fid1 = H5I_INVALID_HID;
+ hid_t fid2 = H5I_INVALID_HID;
+ hid_t dcpl_id = H5I_INVALID_HID;
+ hid_t gcpl_id = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID;
+ hid_t gid_loop = H5I_INVALID_HID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ int i, j, n;
+ char group_name[32];
char filename[FILENAME_BUF_SIZE];
- const hsize_t chunk_size[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; /* Chunk dimensions */
- hsize_t dims[2];
- int points[DSET_DIM1][DSET_DIM2];
+ const hsize_t chunk_dims[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; /* Chunk dimensions */
+ hsize_t dims[2];
+ int data[DSET_DIM1][DSET_DIM2];
herr_t ret;
TESTING("Unregistering filter");
/* Create first file */
- h5_fixname(FILENAME[0], my_fapl, filename, sizeof filename);
- if((file1 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) goto error;
+ h5_fixname(FILENAME[0], fapl_id, filename, sizeof(filename));
+ if((fid1 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ goto error;
/* Create second file */
- h5_fixname(FILENAME[1], my_fapl, filename, sizeof filename);
- if((file2 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) goto error;
+ h5_fixname(FILENAME[1], fapl_id, filename, sizeof(filename));
+ if((fid2 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ goto error;
/* Register DUMMY filter */
- if(H5Zregister(H5Z_DUMMY) < 0) goto error;
-
- if(H5Zfilter_avail(H5Z_FILTER_DUMMY)!=TRUE) goto error;
+ if (H5Zregister(H5Z_DUMMY) < 0)
+ goto error;
+ if (H5Zfilter_avail(H5Z_FILTER_DUMMY) != TRUE)
+ goto error;
+
+ /*******************
+ * PART 1 - GROUPS *
+ *******************/
- if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) goto error;
-
/* Use DUMMY filter for creating groups */
- if(H5Pset_filter (gcpl, H5Z_FILTER_DUMMY, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0) goto error;
+ if((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0)
+ goto error;
+ if(H5Pset_filter(gcpl_id, H5Z_FILTER_DUMMY, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0)
+ goto error;
/* Create a group using this filter */
- if((gid = H5Gcreate2(file1, GROUP_NAME, H5P_DEFAULT, gcpl, H5P_DEFAULT)) < 0) goto error;
+ if((gid = H5Gcreate2(fid1, GROUP_NAME, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
+ goto error;
/* Create multiple groups under the main group */
- for (i=0; i < GROUP_ITERATION; i++) {
- sprintf(gname, "group_%d", i);
- if((group = H5Gcreate2(gid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
- if(H5Gclose(group) < 0) goto error;
+ for(i = 0; i < GROUP_ITERATION; i++) {
+ HDsprintf(group_name, "group_%d", i);
+ if((gid_loop = H5Gcreate2(gid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if(H5Gclose(gid_loop) < 0)
+ goto error;
}
- if(H5Fflush(file1, H5F_SCOPE_GLOBAL) < 0) goto error;
+ /* Flush the file containing the groups */
+ if(H5Fflush(fid1, H5F_SCOPE_GLOBAL) < 0)
+ goto error;
/* Unregister the filter before closing the group. It should fail */
H5E_BEGIN_TRY {
ret = H5Zunregister(H5Z_FILTER_DUMMY);
} H5E_END_TRY;
- if(ret>=0) {
+ if(ret >= 0) {
H5_FAILED();
- printf(" Line %d: Should not be able to unregister filter\n", __LINE__);
+ HDprintf(" Line %d: Should not be able to unregister filter\n", __LINE__);
goto error;
- } /* end if */
+ }
/* Close the group */
- if(H5Gclose(gid) < 0) goto error;
+ if(H5Gclose(gid) < 0)
+ goto error;
/* Clean up objects used for this test */
- if(H5Pclose (gcpl) < 0) goto error;
+ if(H5Pclose (gcpl_id) < 0)
+ goto error;
- if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ /*********************
+ * PART 2 - DATASETS *
+ *********************/
- if(H5Pset_filter(dc, H5Z_FILTER_DUMMY, 0, (size_t)0, NULL) < 0) goto error;
+ /* Use DUMMY filter for creating datasets */
+ if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ goto error;
+ if(H5Pset_chunk(dcpl_id, 2, chunk_dims) < 0)
+ goto error;
+ if(H5Pset_filter(dcpl_id, H5Z_FILTER_DUMMY, 0, (size_t)0, NULL) < 0)
+ goto error;
- /* Initialize the dataset */
+ /* Initialize the data for writing */
for(i = n = 0; i < DSET_DIM1; i++)
for(j = 0; j < DSET_DIM2; j++)
- points[i][j] = n++;
+ data[i][j] = n++;
- /* Create the data space */
+ /* Create the dataspace */
dims[0] = DSET_DIM1;
dims[1] = DSET_DIM2;
- if((space = H5Screate_simple(2, dims, NULL)) < 0) goto error;
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0)
+ goto error;
/* Create a dataset in the first file */
- if((dataset = H5Dcreate2(file1, DSET_NAME, H5T_NATIVE_INT, space,
- H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
+ if((did = H5Dcreate2(fid1, DSET_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
+ goto error;
/* Write the data to the dataset */
- if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0)
goto error;
/* Unregister the filter before closing the dataset. It should fail */
H5E_BEGIN_TRY {
ret = H5Zunregister(H5Z_FILTER_DUMMY);
} H5E_END_TRY;
- if(ret>=0) {
+ if(ret >= 0) {
H5_FAILED();
- printf(" Line %d: Should not be able to unregister filter\n", __LINE__);
+ HDprintf(" Line %d: Should not be able to unregister filter\n", __LINE__);
goto error;
- } /* end if */
+ }
- if(H5Dclose(dataset) < 0) goto error;
+ /* Close the dataset */
+ if(H5Dclose(did) < 0)
+ goto error;
/* Create a dataset in the second file */
- if((dataset = H5Dcreate2(file2, DSET_NAME, H5T_NATIVE_INT, space,
- H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
+ if((did = H5Dcreate2(fid2, DSET_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
+ goto error;
/* Write the data to the dataset */
- if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0)
goto error;
- if(H5Dclose(dataset) < 0) goto error;
+ /* Close the dataset in the second file */
+ if(H5Dclose(did) < 0)
+ goto error;
/* Unregister the filter after closing all objects but before closing files.
- * It should flush all files. */
- if(H5Zunregister(H5Z_FILTER_DUMMY) < 0) goto error;
+ * It should flush all files.
+ */
+ if(H5Zunregister(H5Z_FILTER_DUMMY) < 0)
+ goto error;
/* Clean up objects used for this test */
- if(H5Pclose (dc) < 0) goto error;
- if(H5Fclose(file1) < 0) goto error;
- if(H5Fclose(file2) < 0) goto error;
+ if(H5Pclose(dcpl_id) < 0)
+ goto error;
+ if(H5Fclose(fid1) < 0)
+ goto error;
+ if(H5Fclose(fid2) < 0)
+ goto error;
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ H5E_BEGIN_TRY {
+ H5Fclose(fid1);
+ H5Fclose(fid2);
+ H5Pclose(dcpl_id);
+ H5Pclose(gcpl_id);
+ H5Gclose(gid);
+ H5Gclose(gid_loop);
+ H5Dclose(did);
+ H5Sclose(sid);
+ } H5E_END_TRY;
+
+ return FAIL;
}
/*-------------------------------------------------------------------------
- * Function: main
- *
- * Purpose: Tests unregistering filter with H5Zunregister
+ * Function: main
*
- * Return: Success: exit(EXIT_SUCCESS)
+ * Purpose: Tests unregistering filter with H5Zunregister
*
- * Failure: exit(EXIT_FAILURE)
- *
- * Programmer: Raymond Lu
- * 11 April 2013
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
*-------------------------------------------------------------------------
*/
int
main(void)
{
- hid_t fapl;
- int nerrors = 0;
+ hid_t fapl_id = H5I_INVALID_HID;
+ int nerrors = 0;
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
/* Testing setup */
h5_reset();
- fapl = h5_fileaccess();
+ fapl_id = h5_fileaccess();
/* Push API context */
if(H5CX_push() < 0) FAIL_STACK_ERROR
api_ctx_pushed = TRUE;
/* Test unregistering filter in its own file */
- nerrors += (test_unregister_filters(fapl) < 0 ? 1 : 0);
+ nerrors += (test_unregister_filters(fapl_id) < 0 ? 1 : 0);
- if(nerrors)
+ h5_cleanup(FILENAME, fapl_id);
+
+ if (nerrors)
goto error;
- printf("All filter unregistration tests passed.\n");
+ HDprintf("All filter unregistration tests passed.\n");
/* Pop API context */
if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
api_ctx_pushed = FALSE;
- h5_cleanup(FILENAME, fapl);
- return 0;
+ HDexit(EXIT_SUCCESS);
error:
nerrors = MAX(1, nerrors);
- printf("***** %d FILTER UNREGISTRATION TEST%s FAILED! *****\n",
+ HDprintf("***** %d FILTER UNREGISTRATION TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S");
if(api_ctx_pushed) H5CX_pop();
- return 1;
-}
+ HDexit(EXIT_FAILURE);
+} /* end main() */
diff --git a/test/use.h b/test/use.h
index 0885cc5..54d9b26 100644
--- a/test/use.h
+++ b/test/use.h
@@ -58,6 +58,6 @@ int setup_parameters(int argc, char * const argv[]);
void show_parameters(void);
void usage(const char *prog);
int create_uc_file(void);
-int write_uc_file(hbool_t tosend);
+int write_uc_file(hbool_t tosend, hid_t fid);
int read_uc_file(hbool_t towait);
diff --git a/test/use_append_chunk.c b/test/use_append_chunk.c
index 005eb51..4e8c672 100644
--- a/test/use_append_chunk.c
+++ b/test/use_append_chunk.c
@@ -124,10 +124,13 @@ main(int argc, char *argv[])
int ret_value = 0;
int child_ret_value;
hbool_t send_wait = FALSE;
+ hid_t fapl = -1; /* File access property list */
+ hid_t fid = -1; /* File ID */
+ char *name; /* Test file name */
/* initialization */
if (setup_parameters(argc, argv) < 0){
- Hgoto_error(1);
+ Hgoto_error(1);
}
/* Determine the need to send/wait message file*/
@@ -145,20 +148,20 @@ main(int argc, char *argv[])
/* Create file */
/* ============*/
if (UC_opts.launch != UC_READER){
- printf("Creating skeleton data file for test...\n");
- if (create_uc_file() < 0){
- fprintf(stderr, "***encounter error\n");
- Hgoto_error(1);
- }else
- printf("File created.\n");
+ HDprintf("Creating skeleton data file for test...\n");
+ if (create_uc_file() < 0){
+ HDfprintf(stderr, "***encounter error\n");
+ Hgoto_error(1);
+ }else
+ HDprintf("File created.\n");
}
if (UC_opts.launch==UC_READWRITE){
- /* fork process */
- if((childpid = HDfork()) < 0) {
- HDperror("fork");
- Hgoto_error(1);
- };
+ /* fork process */
+ if((childpid = HDfork()) < 0) {
+ HDperror("fork");
+ Hgoto_error(1);
+ };
};
mypid = HDgetpid();
@@ -166,53 +169,83 @@ main(int argc, char *argv[])
/* launch reader */
/* ============= */
if (UC_opts.launch != UC_WRITER){
- /* child process launch the reader */
- if(0 == childpid) {
- printf("%d: launch reader process\n", mypid);
- if (read_uc_file(send_wait) < 0){
- fprintf(stderr, "read_uc_file encountered error\n");
- exit(1);
- }
- exit(0);
- }
+ /* child process launch the reader */
+ if(0 == childpid) {
+ HDprintf("%d: launch reader process\n", mypid);
+ if (read_uc_file(send_wait) < 0){
+ HDfprintf(stderr, "read_uc_file encountered error\n");
+ HDexit(1);
+ }
+ HDexit(0);
+ }
}
/* ============= */
/* launch writer */
/* ============= */
/* this process continues to launch the writer */
- printf("%d: continue as the writer process\n", mypid);
- if (write_uc_file(send_wait) < 0){
- fprintf(stderr, "write_uc_file encountered error\n");
- Hgoto_error(1);
+ HDprintf("%d: continue as the writer process\n", mypid);
+
+ name = UC_opts.filename;
+
+ /* Set file access proeprty list */
+ if((fapl = h5_fileaccess()) < 0)
+ Hgoto_error(1);
+
+ if(UC_opts.use_swmr)
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ Hgoto_error(1);
+
+ /* Open the file */
+ if((fid = H5Fopen(name, H5F_ACC_RDWR | (UC_opts.use_swmr ? H5F_ACC_SWMR_WRITE : 0), fapl)) < 0) {
+ HDfprintf(stderr, "H5Fopen failed\n");
+ Hgoto_error(1);
+ }
+
+ if(write_uc_file(send_wait, fid) < 0) {
+ HDfprintf(stderr, "write_uc_file encountered error\n");
+ Hgoto_error(1);
}
/* ================================================ */
/* If readwrite, collect exit code of child process */
/* ================================================ */
if (UC_opts.launch == UC_READWRITE){
- if ((tmppid = HDwaitpid(childpid, &child_status, child_wait_option)) < 0){
- HDperror("waitpid");
- Hgoto_error(1);
- }
- if (WIFEXITED(child_status)){
- if ((child_ret_value=WEXITSTATUS(child_status)) != 0){
- printf("%d: child process exited with non-zero code (%d)\n",
- mypid, child_ret_value);
- Hgoto_error(2);
- }
- } else {
- printf("%d: child process terminated abnormally\n", mypid);
- Hgoto_error(2);
- }
+ if ((tmppid = HDwaitpid(childpid, &child_status, child_wait_option)) < 0){
+ HDperror("waitpid");
+ Hgoto_error(1);
+ }
+
+ /* Close the file */
+ if(H5Fclose(fid) < 0) {
+ HDfprintf(stderr, "Failed to close file id\n");
+ Hgoto_error(1);
+ }
+
+ /* Close the property list */
+ if(H5Pclose(fapl) < 0) {
+ HDfprintf(stderr, "Failed to close the property list\n");
+ Hgoto_error(1);
+ }
+
+ if (WIFEXITED(child_status)){
+ if ((child_ret_value=WEXITSTATUS(child_status)) != 0){
+ HDprintf("%d: child process exited with non-zero code (%d)\n",
+ mypid, child_ret_value);
+ Hgoto_error(2);
+ }
+ } else {
+ HDprintf("%d: child process terminated abnormally\n", mypid);
+ Hgoto_error(2);
+ }
}
done:
/* Print result and exit */
if (ret_value != 0){
- printf("Error(s) encountered\n");
+ HDprintf("Error(s) encountered\n");
}else{
- printf("All passed\n");
+ HDprintf("All passed\n");
}
return(ret_value);
diff --git a/test/use_append_mchunks.c b/test/use_append_mchunks.c
index 9ee37cb..0414628 100644
--- a/test/use_append_mchunks.c
+++ b/test/use_append_mchunks.c
@@ -117,10 +117,13 @@ main(int argc, char *argv[])
int ret_value = 0;
int child_ret_value;
hbool_t send_wait = 0;
+ hid_t fapl = -1; /* File access property list */
+ hid_t fid = -1; /* File ID */
+ char *name; /* Test file name */
/* initialization */
if (setup_parameters(argc, argv) < 0){
- Hgoto_error(1);
+ Hgoto_error(1);
}
/* Determine the need to send/wait message file*/
@@ -138,20 +141,20 @@ main(int argc, char *argv[])
/* Create file */
/* ============*/
if (UC_opts.launch != UC_READER){
- printf("Creating skeleton data file for test...\n");
+ HDprintf("Creating skeleton data file for test...\n");
if (create_uc_file() < 0){
- fprintf(stderr, "***encounter error\n");
+ HDfprintf(stderr, "***encounter error\n");
Hgoto_error(1);
}else
- printf("File created.\n");
+ HDprintf("File created.\n");
}
if (UC_opts.launch==UC_READWRITE){
- /* fork process */
- if((childpid = fork()) < 0) {
- perror("fork");
- Hgoto_error(1);
- };
+ /* fork process */
+ if((childpid = fork()) < 0) {
+ perror("fork");
+ Hgoto_error(1);
+ };
};
mypid = getpid();
@@ -159,53 +162,84 @@ main(int argc, char *argv[])
/* launch reader */
/* ============= */
if (UC_opts.launch != UC_WRITER){
- /* child process launch the reader */
- if(0 == childpid) {
- printf("%d: launch reader process\n", mypid);
- if (read_uc_file(send_wait) < 0){
- fprintf(stderr, "read_uc_file encountered error\n");
- exit(1);
- }
- exit(0);
- }
+ /* child process launch the reader */
+ if(0 == childpid) {
+ HDprintf("%d: launch reader process\n", mypid);
+ if (read_uc_file(send_wait) < 0){
+ HDfprintf(stderr, "read_uc_file encountered error\n");
+ HDexit(1);
+ }
+ HDexit(0);
+ }
}
/* ============= */
/* launch writer */
/* ============= */
/* this process continues to launch the writer */
- printf("%d: continue as the writer process\n", mypid);
- if (write_uc_file(send_wait) < 0){
- fprintf(stderr, "write_uc_file encountered error\n");
- Hgoto_error(1);
+ HDprintf("%d: continue as the writer process\n", mypid);
+
+ name = UC_opts.filename;
+
+ /* Set the file access property list */
+ if((fapl = h5_fileaccess()) < 0)
+ Hgoto_error(1);
+
+ if(UC_opts.use_swmr)
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ Hgoto_error(1);
+
+ /* Open the file */
+ if((fid = H5Fopen(name, H5F_ACC_RDWR | (UC_opts.use_swmr ? H5F_ACC_SWMR_WRITE : 0), fapl)) < 0) {
+ HDfprintf(stderr, "H5Fopen failed\n");
+ Hgoto_error(1);
+ }
+
+ if(write_uc_file(send_wait, fid) < 0) {
+ HDfprintf(stderr, "write_uc_file encountered error\n");
+ Hgoto_error(1);
}
+
/* ================================================ */
/* If readwrite, collect exit code of child process */
/* ================================================ */
if (UC_opts.launch == UC_READWRITE){
- if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0){
- perror("waitpid");
- Hgoto_error(1);
- }
- if (WIFEXITED(child_status)){
- if ((child_ret_value=WEXITSTATUS(child_status)) != 0){
- printf("%d: child process exited with non-zero code (%d)\n",
- mypid, child_ret_value);
- Hgoto_error(2);
- }
- } else {
- printf("%d: child process terminated abnormally\n", mypid);
- Hgoto_error(2);
- }
+ if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0){
+ perror("waitpid");
+ Hgoto_error(1);
+ }
+
+ /* Close the file */
+ if(H5Fclose(fid) < 0) {
+ HDfprintf(stderr, "Failed to close file id\n");
+ Hgoto_error(1);
+ }
+
+ /* Close the property list */
+ if(H5Pclose(fapl) < 0) {
+ HDfprintf(stderr, "Failed to close the property list\n");
+ Hgoto_error(1);
+ }
+
+ if (WIFEXITED(child_status)){
+ if ((child_ret_value=WEXITSTATUS(child_status)) != 0){
+ HDprintf("%d: child process exited with non-zero code (%d)\n",
+ mypid, child_ret_value);
+ Hgoto_error(1);
+ }
+ } else {
+ HDprintf("%d: child process terminated abnormally\n", mypid);
+ Hgoto_error(2);
+ }
}
done:
/* Print result and exit */
if (ret_value != 0){
- printf("Error(s) encountered\n");
+ HDprintf("Error(s) encountered\n");
}else{
- printf("All passed\n");
+ HDprintf("All passed\n");
}
return(ret_value);
diff --git a/test/use_common.c b/test/use_common.c
index 5aa6692..3ecb2e1 100644
--- a/test/use_common.c
+++ b/test/use_common.c
@@ -252,13 +252,10 @@ int create_uc_file(void)
*
* Return: 0 succeed; -1 fail.
*/
-int write_uc_file(hbool_t tosend)
+int write_uc_file(hbool_t tosend, hid_t fid)
{
- hid_t fid; /* File ID for new HDF5 file */
hid_t dsid; /* dataset ID */
- hid_t fapl; /* File access property list */
hid_t dcpl; /* Dataset creation property list */
- char *name;
UC_CTYPE *buffer, *bufptr; /* data buffer */
hsize_t cz=UC_opts.chunksize; /* Chunk size */
hid_t f_sid; /* dataset file space id */
@@ -270,19 +267,6 @@ int write_uc_file(hbool_t tosend)
hsize_t start[3] = {0,0,0}, count[3]; /* Hyperslab selection values */
hsize_t i, j, k;
- name = UC_opts.filename;
-
- /* Open the file */
- if((fapl = h5_fileaccess()) < 0)
- return -1;
- if(UC_opts.use_swmr)
- if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- return -1;
- if((fid = H5Fopen(name, H5F_ACC_RDWR | (UC_opts.use_swmr ? H5F_ACC_SWMR_WRITE : 0), fapl)) < 0){
- fprintf(stderr, "H5Fopen failed\n");
- return -1;
- }
-
if(tosend)
/* Send a message that H5Fopen is complete--releasing the file lock */
h5_send_message(WRITER_MESSAGE, NULL, NULL);
@@ -427,14 +411,6 @@ int write_uc_file(hbool_t tosend)
fprintf(stderr, "Failed to close file space\n");
return -1;
}
- if (H5Pclose(fapl) < 0){
- fprintf(stderr, "Failed to property list\n");
- return -1;
- }
- if (H5Fclose(fid) < 0){
- fprintf(stderr, "Failed to close file id\n");
- return -1;
- }
return 0;
}
@@ -471,7 +447,7 @@ int read_uc_file(hbool_t towait)
/* Before reading, wait for the message that H5Fopen is complete--file lock is released */
if(towait && h5_wait_message(WRITER_MESSAGE) < 0) {
- fprintf(stderr, "Cannot find writer message file...failed\n");
+ HDfprintf(stderr, "Cannot find writer message file...failed\n");
return -1;
}
@@ -481,19 +457,19 @@ int read_uc_file(hbool_t towait)
if((fapl = h5_fileaccess()) < 0)
return -1;
if((fid = H5Fopen(name, H5F_ACC_RDONLY | (UC_opts.use_swmr ? H5F_ACC_SWMR_READ : 0), fapl)) < 0){
- fprintf(stderr, "H5Fopen failed\n");
+ HDfprintf(stderr, "H5Fopen failed\n");
return -1;
}
if (H5Pclose(fapl) < 0){
- fprintf(stderr, "Failed to property list\n");
+ HDfprintf(stderr, "Failed to property list\n");
return -1;
}
/* Open the dataset of the program name */
if((dsid = H5Dopen2(fid, progname_g, H5P_DEFAULT)) < 0){
- fprintf(stderr, "H5Dopen2 failed\n");
- return -1;
+ HDfprintf(stderr, "H5Dopen2 failed\n");
+ return -1;
}
/* allocate space for data buffer 1 X dims[1] X dims[2] of UC_CTYPE */
@@ -501,8 +477,8 @@ int read_uc_file(hbool_t towait)
memdims[1] = UC_opts.dims[1];
memdims[2] = UC_opts.dims[2];
if ((buffer=(UC_CTYPE*)HDmalloc((size_t)memdims[1]*(size_t)memdims[2]*sizeof(UC_CTYPE)))==NULL) {
- fprintf(stderr, "malloc: failed\n");
- return -1;
+ HDfprintf(stderr, "malloc: failed\n");
+ return -1;
};
/*
@@ -512,31 +488,31 @@ int read_uc_file(hbool_t towait)
f_sid = H5Dget_space(dsid); /* Get filespace handle first. */
rank = H5Sget_simple_extent_ndims(f_sid);
if (rank != UC_RANK){
- fprintf(stderr, "rank(%d) of dataset does not match\n", rank);
- return -1;
+ HDfprintf(stderr, "rank(%d) of dataset does not match\n", rank);
+ return -1;
}
if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0){
- fprintf(stderr, "H5Sget_simple_extent_dims got error\n");
- return -1;
+ HDfprintf(stderr, "H5Sget_simple_extent_dims got error\n");
+ return -1;
}
- printf("dataset rank %d, dimensions %llu x %llu x %llu\n",
- rank, (unsigned long long)(dims[0]), (unsigned long long)(dims[1]),
- (unsigned long long)(dims[2]));
+ HDprintf("dataset rank %d, dimensions %llu x %llu x %llu\n",
+ rank, (unsigned long long)(dims[0]), (unsigned long long)(dims[1]),
+ (unsigned long long)(dims[2]));
/* verify that file space dims are as expected and are consistent with memory space dims */
if (dims[1] != memdims[1] || dims[2] != memdims[2]){
- fprintf(stderr, "dataset dimension is not as expected. Got dims=(%llu,%llu,%llu)\n",
- (unsigned long long)dims[0], (unsigned long long)dims[1],
+ HDfprintf(stderr, "dataset dimension is not as expected. Got dims=(%llu,%llu,%llu)\n",
+ (unsigned long long)dims[0], (unsigned long long)dims[1],
(unsigned long long)dims[2]);
- fprintf(stderr, "But memdims=(%llu,%llu,%llu)\n",
- (unsigned long long)memdims[0], (unsigned long long)memdims[1],
+ HDfprintf(stderr, "But memdims=(%llu,%llu,%llu)\n",
+ (unsigned long long)memdims[0], (unsigned long long)memdims[1],
(unsigned long long)memdims[2]);
- return -1;
+ return -1;
}
/* setup mem-space for buffer */
if ((m_sid=H5Screate_simple(rank, memdims, NULL))<0){
- fprintf(stderr, "H5Screate_simple for memory failed\n");
- return -1;
+ HDfprintf(stderr, "H5Screate_simple for memory failed\n");
+ return -1;
};
/* Read 1 plane at a time whenever the dataset grows larger
@@ -550,22 +526,22 @@ int read_uc_file(hbool_t towait)
/* print progress message according to if new planes are availalbe */
if (nplane_old < dims[0]) {
if (nonewplane){
- /* end the previous message */
- printf("\n");
- nonewplane=0;
+ /* end the previous message */
+ HDprintf("\n");
+ nonewplane=0;
}
- printf("reading planes %llu to %llu\n", (unsigned long long)nplane_old,
+ HDprintf("reading planes %llu to %llu\n", (unsigned long long)nplane_old,
(unsigned long long)dims[0]);
}else{
if (nonewplane){
- printf(".");
+ HDprintf(".");
if (nonewplane>=30){
- fprintf(stderr, "waited too long for new plane, quit.\n");
+ HDfprintf(stderr, "waited too long for new plane, quit.\n");
return -1;
}
}else{
- /* print mesg only the first time; dots still no new plane */
- printf("no new planes to read ");
+ /* print mesg only the first time; dots still no new plane */
+ HDprintf("no new planes to read ");
}
nonewplane++;
/* pause for a second */
@@ -575,41 +551,41 @@ int read_uc_file(hbool_t towait)
/* read planes between last old nplanes and current extent */
/* Get the dataset's dataspace */
if((f_sid = H5Dget_space(dsid)) < 0){
- fprintf(stderr, "H5Dget_space failed\n");
- return -1;
+ HDfprintf(stderr, "H5Dget_space failed\n");
+ return -1;
}
start[0]=nplane;
/* Choose the next plane to read */
if(H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0){
- fprintf(stderr, "H5Sselect_hyperslab failed\n");
- return -1;
+ HDfprintf(stderr, "H5Sselect_hyperslab failed\n");
+ return -1;
}
/* Read the plane from the dataset */
if(H5Dread(dsid, UC_DATATYPE, m_sid, f_sid, H5P_DEFAULT, buffer) < 0){
- fprintf(stderr, "H5Dread failed\n");
- return -1;
+ HDfprintf(stderr, "H5Dread failed\n");
+ return -1;
}
/* compare read data with expected data value which is nplane */
bufptr = buffer;
nerrs=0;
for (j=0; j<dims[1]; j++){
- for (k=0; k<dims[2]; k++){
- if ((hsize_t)*bufptr++ != nplane){
- if (++nerrs < ErrorReportMax){
- fprintf(stderr,
- "found error %llu plane(%llu,%llu), expected %llu, got %d\n",
- (unsigned long long)nplane, (unsigned long long)j,
- (unsigned long long)k, (unsigned long long)nplane, (int)*(bufptr-1));
- }
- }
- }
+ for (k=0; k<dims[2]; k++){
+ if ((hsize_t)*bufptr++ != nplane){
+ if (++nerrs < ErrorReportMax){
+ HDfprintf(stderr,
+ "found error %llu plane(%llu,%llu), expected %llu, got %d\n",
+ (unsigned long long)nplane, (unsigned long long)j,
+ (unsigned long long)k, (unsigned long long)nplane, (int)*(bufptr-1));
+ }
+ }
+ }
}
if (nerrs){
- nreadererr++;
- fprintf(stderr, "found %d unexpected values in plane %llu\n", nerrs,
+ nreadererr++;
+ HDfprintf(stderr, "found %d unexpected values in plane %llu\n", nerrs,
(unsigned long long)nplane);
}
}
@@ -620,19 +596,19 @@ int read_uc_file(hbool_t towait)
#if 0
/* close dsid and file, then reopen them */
if (H5Dclose(dsid) < 0){
- fprintf(stderr, "H5Dclose failed\n");
+ HDfprintf(stderr, "H5Dclose failed\n");
return -1;
}
if (H5Fclose(fid) < 0){
- fprintf(stderr, "H5Fclose failed\n");
+ HDfprintf(stderr, "H5Fclose failed\n");
return -1;
}
if((fid = H5Fopen(name, H5F_ACC_RDONLY | (UC_opts.use_swmr ? H5F_ACC_SWMR_READ : 0), H5P_DEFAULT)) < 0){
- fprintf(stderr, "H5Fopen failed\n");
+ HDfprintf(stderr, "H5Fopen failed\n");
return -1;
}
if((dsid = H5Dopen2(fid, progname_g, H5P_DEFAULT)) < 0){
- fprintf(stderr, "H5Dopen2 failed\n");
+ HDfprintf(stderr, "H5Dopen2 failed\n");
return -1;
}
#else
@@ -640,16 +616,22 @@ int read_uc_file(hbool_t towait)
#endif
f_sid = H5Dget_space(dsid); /* Get filespace handle first. */
if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0){
- fprintf(stderr, "H5Sget_simple_extent_dims got error\n");
+ HDfprintf(stderr, "H5Sget_simple_extent_dims got error\n");
return -1;
}
}
+ /* Close the file */
+ if(H5Fclose(fid) < 0) {
+ HDfprintf(stderr, "H5Fclose failed\n");
+ return -1;
+ }
+
if (nreadererr)
- return -1;
+ return -1;
else
- return 0;
-}
+ return 0;
+} /* read_uc_file() */
#endif /* H5_HAVE_FORK */
diff --git a/test/vds_swmr_gen.c b/test/vds_swmr_gen.c
index 24c6131..1cb9744 100644
--- a/test/vds_swmr_gen.c
+++ b/test/vds_swmr_gen.c
@@ -61,7 +61,7 @@ main(void)
map_start = 0;
/* All SWMR files need to use the latest file format */
- if((faplid = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ if((faplid = h5_fileaccess()) < 0)
TEST_ERROR
if(H5Pset_libver_bounds(faplid, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
TEST_ERROR
diff --git a/test/vds_swmr_reader.c b/test/vds_swmr_reader.c
index 42721d5..d0ec77b 100644
--- a/test/vds_swmr_reader.c
+++ b/test/vds_swmr_reader.c
@@ -18,6 +18,7 @@ int
main(void)
{
hid_t fid = -1; /* HDF5 file ID */
+ hid_t faplid = -1; /* file access property list ID */
hid_t did = -1; /* dataset ID */
hid_t msid = -1; /* memory dataspace ID */
hid_t fsid = -1; /* file dataspace ID */
@@ -34,7 +35,9 @@ main(void)
/* Open the VDS file and dataset */
- if((fid = H5Fopen(VDS_FILE_NAME, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, H5P_DEFAULT)) < 0)
+ if((faplid = h5_fileaccess()) < 0)
+ TEST_ERROR
+ if((fid = H5Fopen(VDS_FILE_NAME, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, faplid)) < 0)
TEST_ERROR
if((did = H5Dopen2(fid, VDS_DSET_NAME, H5P_DEFAULT)) < 0)
TEST_ERROR
@@ -97,13 +100,14 @@ main(void)
TEST_ERROR
if(H5Dread(did, H5T_NATIVE_INT, msid, fsid, H5P_DEFAULT, buffer) < 0)
TEST_ERROR
-
if(H5Sclose(fsid) < 0)
TEST_ERROR
} while (dims[0] < N_PLANES_TO_WRITE);
/* Close file and dataset */
+ if(H5Pclose(faplid) < 0)
+ TEST_ERROR
if(H5Sclose(msid) < 0)
TEST_ERROR
if(H5Dclose(did) < 0)
@@ -121,6 +125,8 @@ error:
H5E_BEGIN_TRY {
if(fid >= 0)
(void)H5Fclose(fid);
+ if(faplid >= 0)
+ (void)H5Pclose(faplid);
if(did >= 0)
(void)H5Dclose(did);
if(msid >= 0)
diff --git a/test/vds_swmr_writer.c b/test/vds_swmr_writer.c
index 7824aa0..d62ecaf 100644
--- a/test/vds_swmr_writer.c
+++ b/test/vds_swmr_writer.c
@@ -56,7 +56,7 @@ main(int argc, char *argv[])
/* Open the source file and dataset */
/* All SWMR files need to use the latest file format */
- if((faplid = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ if((faplid = h5_fileaccess()) < 0)
TEST_ERROR
if(H5Pset_libver_bounds(faplid, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
TEST_ERROR
diff --git a/test/vfd.c b/test/vfd.c
index 5d5ebfc..19223ea 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -149,7 +149,7 @@ test_sec2(void)
/* There is no garantee the size of metadata in file is constant.
* Just try to check if it's reasonable.
- *
+ *
* Currently it should be around 2 KB.
*/
if(H5Fget_filesize(fid, &file_size) < 0)
@@ -258,7 +258,7 @@ test_core(void)
| H5FD_FEAT_ACCUMULATE_METADATA
| H5FD_FEAT_DATA_SIEVE
| H5FD_FEAT_AGGREGATE_SMALLDATA
- | H5FD_FEAT_ALLOW_FILE_IMAGE
+ | H5FD_FEAT_ALLOW_FILE_IMAGE
| H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS))
TEST_ERROR
@@ -341,7 +341,7 @@ test_core(void)
/* There is no garantee the size of metadata in file is constant.
* Just try to check if it's reasonable.
- *
+ *
* TODO: Needs justification of why is this is a reasonable size.
*/
if(H5Fget_filesize(fid, &file_size) < 0)
@@ -379,7 +379,7 @@ test_core(void)
for(i = 0; i < CORE_DSET_DIM1; i++)
for(j = 0; j < CORE_DSET_DIM2; j++)
*pw++ = val++;
- HDmemset(data_r, 0, DSET1_DIM1 * DSET1_DIM2 * sizeof(int));
+ HDmemset(data_r, 0, DSET1_DIM1 * DSET1_DIM2 * sizeof(int));
/* Create the dataspace */
dims[0] = CORE_DSET_DIM1;
@@ -469,7 +469,7 @@ test_core(void)
TEST_ERROR;
/* Read the data back from the dataset */
- HDmemset(data_r, 0, DSET1_DIM1 * DSET1_DIM2 * sizeof(int));
+ HDmemset(data_r, 0, DSET1_DIM1 * DSET1_DIM2 * sizeof(int));
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_r) < 0)
TEST_ERROR;
@@ -488,7 +488,7 @@ test_core(void)
/* Check file size API.
* There is no garantee the size of metadata in file is constant.
* Just try to check if it's reasonable.
- *
+ *
* TODO: Needs justification of why is this is a reasonable size.
*/
if(H5Fget_filesize(fid, &file_size) < 0)
@@ -1118,8 +1118,7 @@ error:
* Purpose: Private function for test_multi() to tests wrong ways of
* reopening multi file.
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
* Programmer: Raymond Lu
* Thursday, May 19, 2005
@@ -1129,7 +1128,7 @@ error:
static herr_t
test_multi_opens(char *fname)
{
- hid_t file=-1;
+ hid_t fid = H5I_INVALID_HID;
char super_name[1024]; /*name string "%%s-s.h5"*/
char sf_name[1024]; /*name string "multi_file-s.h5"*/
@@ -1138,11 +1137,11 @@ test_multi_opens(char *fname)
HDsnprintf(sf_name, sizeof(sf_name), super_name, fname);
H5E_BEGIN_TRY {
- file = H5Fopen(sf_name, H5F_ACC_RDWR, H5P_DEFAULT);
+ fid = H5Fopen(sf_name, H5F_ACC_RDWR, H5P_DEFAULT);
} H5E_END_TRY;
- return(file >= 0 ? -1 : 0);
-}
+ return(fid >= 0 ? FAIL : SUCCEED);
+} /* end test_multi_opens() */
/*-------------------------------------------------------------------------
@@ -1150,8 +1149,7 @@ test_multi_opens(char *fname)
*
* Purpose: Tests the file handle interface for MUTLI driver
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
* Programmer: Raymond Lu
* Tuesday, Sept 24, 2002
@@ -1330,7 +1328,7 @@ test_multi(void)
if((atype = H5Tcopy(H5T_C_S1)) < 0)
TEST_ERROR;
- if(H5Tset_size(atype, strlen(meta) + 1) < 0)
+ if(H5Tset_size(atype, HDstrlen(meta) + 1) < 0)
TEST_ERROR;
if(H5Tset_strpad(atype, H5T_STR_NULLTERM) < 0)
@@ -1365,7 +1363,7 @@ test_multi(void)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -1374,9 +1372,10 @@ error:
H5Pclose(fapl);
H5Pclose(fapl2);
H5Fclose(file);
+ H5Aclose(attr);
} H5E_END_TRY;
- return -1;
-}
+ return FAIL;
+} /* end test_multi() */
/*-------------------------------------------------------------------------
@@ -1385,7 +1384,7 @@ error:
* Purpose: Tests the backward compatibility for MULTI driver.
* See if we can open files created with v1.6 library.
* The source file was created by the test/file_handle.c
- * of the v1.6 library. This test verifies the fix for
+ * of the v1.6 library. This test verifies the fix for
* Issue 2598. In v1.6 library, there was EOA for the whole
* MULTI file saved in the super block. We took it out in
* v1.8 library because it's meaningless for the MULTI file.
@@ -1446,7 +1445,7 @@ test_multi_compat(void)
h5_fixname(FILENAME[9], fapl, newname, sizeof newname);
- /* Make copy for the data file in the build directory, to protect the
+ /* Make copy for the data file in the build directory, to protect the
* original file in the source directory */
sprintf(filename_s, "%s-%c.h5", MULTI_COMPAT_BASENAME, 's');
sprintf(newname_s, "%s-%c.h5", FILENAME[9], 's');
@@ -1483,7 +1482,7 @@ test_multi_compat(void)
if(H5Fclose(file) < 0)
TEST_ERROR;
- /* Reopen the file for adding another dataset. The new EOA for metadata file
+ /* Reopen the file for adding another dataset. The new EOA for metadata file
* should be written to the file */
if((file=H5Fopen(newname, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR;
@@ -1510,7 +1509,7 @@ test_multi_compat(void)
if(H5Fclose(file) < 0)
TEST_ERROR;
- /* Reopen the file for read only again. Verify the library can handle
+ /* Reopen the file for read only again. Verify the library can handle
* the EOA correctly */
if((file=H5Fopen(newname, H5F_ACC_RDONLY, fapl)) < 0)
TEST_ERROR;
diff --git a/test/vol.c b/test/vol.c
new file mode 100644
index 0000000..b70c0ca
--- /dev/null
+++ b/test/vol.c
@@ -0,0 +1,1029 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Purpose: Tests the virtual object layer (H5VL)
+ *
+ * This is a minimal test to ensure VOL usage (setting a VOL, etc.)
+ * works as expected. Actual VOL functionality is tested using
+ * other mechanisms.
+ */
+
+#include "h5test.h"
+
+
+#define NATIVE_VOL_TEST_FILENAME "native_vol_test"
+#define NATIVE_VOL_TEST_GROUP_NAME "test_group"
+#define NATIVE_VOL_TEST_DATASET_NAME "test_dataset"
+#define NATIVE_VOL_TEST_ATTRIBUTE_NAME "test_dataset"
+#define NATIVE_VOL_TEST_HARD_LINK_NAME "test_hard_link"
+#define NATIVE_VOL_TEST_SOFT_LINK_NAME "test_soft_link"
+#define NATIVE_VOL_TEST_MOVE_LINK_NAME "test_move_link"
+#define NATIVE_VOL_TEST_COPY_LINK_NAME "test_copy_link"
+#define NATIVE_VOL_TEST_DATATYPE_NAME "test_datatype"
+
+#define N_ELEMENTS 10
+
+#define FAKE_VOL_NAME "fake"
+
+/* A VOL class struct that describes a VOL class with no
+ * functionality.
+ */
+static const H5VL_class_t fake_vol_g = {
+ 0, /* version */
+ (H5VL_class_value_t)501, /* value */
+ FAKE_VOL_NAME, /* name */
+ 0, /* capability flags */
+ NULL, /* initialize */
+ NULL, /* terminate */
+ (size_t)0, /* info size */
+ NULL, /* info copy */
+ NULL, /* info compare */
+ NULL, /* info free */
+ NULL, /* info to str */
+ NULL, /* str to info */
+ NULL, /* get_object */
+ NULL, /* get_wrap_ctx */
+ NULL, /* wrap_object */
+ NULL, /* free_wrap_ctx */
+ { /* attribute_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* read */
+ NULL, /* write */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ { /* dataset_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* read */
+ NULL, /* write */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ { /* datatype_cls */
+ NULL, /* commit */
+ NULL, /* open */
+ NULL, /* get_size */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ { /* file_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ { /* group_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ { /* link_cls */
+ NULL, /* create */
+ NULL, /* copy */
+ NULL, /* move */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL /* optional */
+ },
+ { /* object_cls */
+ NULL, /* open */
+ NULL, /* copy */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL /* optional */
+ },
+ { /* request_cls */
+ NULL, /* wait */
+ NULL, /* notify */
+ NULL, /* cancel */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* free */
+ },
+ NULL /* optional */
+};
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_vol_registration()
+ *
+ * Purpose: Tests if we can load, register, and close a simple
+ * VOL connector.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_vol_registration(void)
+{
+ htri_t is_registered;
+ hid_t vol_id = -1, vol_id2 = -1;
+
+ TESTING("VOL registration");
+
+ /* The test/fake VOL connector should not be registered at the start of the test */
+ if ((is_registered = H5VLis_connector_registered(FAKE_VOL_NAME)) < 0)
+ FAIL_STACK_ERROR;
+ if (is_registered > 0)
+ FAIL_PUTS_ERROR("native VOL connector is inappropriately registered");
+
+ /* Load a VOL interface */
+ if ((vol_id = H5VLregister_connector(&fake_vol_g, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR;
+
+ /* The test/fake VOL connector should be registered now */
+ if ((is_registered = H5VLis_connector_registered(FAKE_VOL_NAME)) < 0)
+ FAIL_STACK_ERROR;
+ if (0 == is_registered)
+ FAIL_PUTS_ERROR("native VOL connector is un-registered");
+
+ /* Re-register a VOL connector */
+ if ((vol_id2 = H5VLregister_connector(&fake_vol_g, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR;
+
+ /* The test/fake VOL connector should still be registered now */
+ if ((is_registered = H5VLis_connector_registered(FAKE_VOL_NAME)) < 0)
+ FAIL_STACK_ERROR;
+ if (0 == is_registered)
+ FAIL_PUTS_ERROR("native VOL connector is un-registered");
+
+ /* Unregister the second test/fake VOL ID */
+ if (H5VLunregister_connector(vol_id2) < 0)
+ FAIL_STACK_ERROR;
+
+ /* The test/fake VOL connector should still be registered now */
+ if ((is_registered = H5VLis_connector_registered(FAKE_VOL_NAME)) < 0)
+ FAIL_STACK_ERROR;
+ if (0 == is_registered)
+ FAIL_PUTS_ERROR("native VOL connector is un-registered");
+
+ /* Unregister the original test/fake VOL ID */
+ if (H5VLunregister_connector(vol_id) < 0)
+ FAIL_STACK_ERROR;
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5VLunregister_connector(vol_id);
+ } H5E_END_TRY;
+ return FAIL;
+
+} /* end test_vol_registration() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_native_vol_init()
+ *
+ * Purpose: Tests if the native VOL connector gets initialized.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_native_vol_init(void)
+{
+ htri_t is_registered;
+
+ TESTING("Native VOL connector initialization");
+
+ /* The native VOL connector should always be registered */
+ if ((is_registered = H5VLis_connector_registered(H5VL_NATIVE_NAME)) < 0)
+ FAIL_STACK_ERROR;
+ if (0 == is_registered)
+ FAIL_PUTS_ERROR("native VOL connector is un-registered");
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ return FAIL;
+
+} /* end test_native_vol_init() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_basic_file_operation()
+ *
+ * Purpose: Uses the native VOL connector to test basic VOL file operations
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_basic_file_operation(void)
+{
+ hid_t fid = H5I_INVALID_HID;
+ hid_t fid_reopen = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+ hid_t fapl_id2 = H5I_INVALID_HID;
+ hid_t fcpl_id = H5I_INVALID_HID;
+
+ ssize_t obj_count;
+ hid_t obj_id_list[1];
+ hsize_t file_size;
+ unsigned intent;
+ void *os_file_handle = NULL;
+ H5F_info2_t finfo;
+ char name[32];
+
+ TESTING("Basic VOL file operations");
+
+ /* Retrieve the file access property for testing */
+ fapl_id = h5_fileaccess();
+
+ /* Set the file close degree to a non-default value, to make the H5Pequal
+ * work out. This is kinda odd, but the library's current behavior with
+ * a default value is to return the value chosen (H5F_CLOSE_SEMI) instead
+ * of the default value (H5F_CLOSE_DEFAULT) from the property and then
+ * the H5Pequal doesn't detect that the property lists are the same. Since
+ * this is the documented behavior for file close degree for many years,
+ * I'm not fighting it, just getting the testing to verify that the VOL
+ * connector property is returned correctly. -QAK, 2018/11/17
+ */
+ if(H5Pset_fclose_degree(fapl_id, H5F_CLOSE_SEMI) < 0)
+ TEST_ERROR;
+ if(H5Pset_metadata_read_attempts(fapl_id, 9) < 0)
+ FAIL_STACK_ERROR
+
+ /* H5Fcreate */
+ if ((fid = H5Fcreate(NATIVE_VOL_TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ TEST_ERROR;
+
+ /* H5Fget_obj_count */
+ if ((obj_count = H5Fget_obj_count(fid, H5F_OBJ_FILE)) < 0)
+ TEST_ERROR;
+ if ((obj_count = H5Fget_obj_count(fid, H5F_OBJ_ALL)) < 0)
+ TEST_ERROR;
+ if ((obj_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_DATASET)) < 0)
+ TEST_ERROR;
+
+ /* H5Fget_obj_ids */
+ if ((obj_count = H5Fget_obj_ids(fid, H5F_OBJ_ALL, 2, obj_id_list)) < 0)
+ TEST_ERROR;
+ if ((obj_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_DATASET, 2, obj_id_list)) < 0)
+ TEST_ERROR;
+
+ /* H5Fget_access_plist */
+ if ((fapl_id2 = H5Fget_access_plist(fid)) < 0)
+ TEST_ERROR;
+ if (H5Pequal(fapl_id, fapl_id2) != TRUE)
+ TEST_ERROR;
+ if (H5Pclose(fapl_id2) < 0)
+ TEST_ERROR;
+
+ /* H5Fget_create_plist */
+ if ((fcpl_id = H5Fget_create_plist(fid)) < 0)
+ TEST_ERROR;
+ if (H5Pclose(fcpl_id) < 0)
+ TEST_ERROR;
+
+ /* H5Fget_filesize */
+ if (H5Fget_filesize(fid, &file_size) < 0)
+ TEST_ERROR;
+
+ /* H5Fget_vfd_handle */
+ if (H5Fget_vfd_handle(fid, H5P_DEFAULT, &os_file_handle) < 0)
+ TEST_ERROR;
+
+ /* H5Fget_intent */
+ if (H5Fget_intent(fid, &intent) < 0)
+ TEST_ERROR;
+
+ /* H5Fget_info2 */
+ if (H5Fget_info2(fid, &finfo) < 0)
+ TEST_ERROR;
+
+ /* H5Fget_name */
+ if (H5Fget_name(fid, name, 32) < 0)
+ TEST_ERROR;
+
+ /* H5Fclear_elink_file_cache */
+ if (H5Fclear_elink_file_cache(fid) < 0)
+ TEST_ERROR;
+
+ /* H5Fflush */
+ if (H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)
+ TEST_ERROR;
+
+ /* H5Fclose */
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ /* H5Fis_accessible */
+ if (H5Fis_accessible(NATIVE_VOL_TEST_FILENAME, fapl_id) < 0)
+ TEST_ERROR;
+
+ /* H5Fopen */
+ if ((fid = H5Fopen(NATIVE_VOL_TEST_FILENAME, H5F_ACC_RDWR, fapl_id)) < 0)
+ TEST_ERROR;
+
+ /* H5Fget_access_plist */
+ if ((fapl_id2 = H5Fget_access_plist(fid)) < 0)
+ TEST_ERROR;
+ if (H5Pequal(fapl_id, fapl_id2) != TRUE)
+ TEST_ERROR;
+ if (H5Pclose(fapl_id2) < 0)
+ TEST_ERROR;
+
+ if ((fid_reopen = H5Freopen(fid)) < 0)
+ TEST_ERROR;
+
+ /* H5Fget_access_plist */
+ if ((fapl_id2 = H5Fget_access_plist(fid_reopen)) < 0)
+ TEST_ERROR;
+ if (H5Pequal(fapl_id, fapl_id2) != TRUE)
+ TEST_ERROR;
+ if (H5Pclose(fapl_id2) < 0)
+ TEST_ERROR;
+
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+ if (H5Fclose(fid_reopen) < 0)
+ TEST_ERROR;
+
+ /* H5Pclose */
+ if (H5Pclose(fapl_id) < 0)
+ TEST_ERROR;
+
+ HDremove(NATIVE_VOL_TEST_FILENAME);
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Fclose(fid);
+ H5Fclose(fid_reopen);
+ H5Pclose(fapl_id);
+ H5Pclose(fapl_id2);
+ H5Pclose(fcpl_id);
+ } H5E_END_TRY;
+
+ return FAIL;
+
+} /* end test_basic_file_operation() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_basic_group_operation()
+ *
+ * Purpose: Uses the native VOL connector to test basic VOL group operations
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_basic_group_operation(void)
+{
+ hid_t fid = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID;
+ hid_t gid_a = H5I_INVALID_HID;
+ hid_t gcpl_id = H5I_INVALID_HID;
+ H5G_info_t info;
+
+ TESTING("Basic VOL group operations");
+
+ if ((fid = H5Fcreate(NATIVE_VOL_TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* H5Gcreate */
+ if ((gid = H5Gcreate2(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* H5Gget_create_plist */
+ if ((gcpl_id = H5Gget_create_plist(gid)) < 0)
+ TEST_ERROR;
+ if (H5Pclose(gcpl_id) < 0)
+ TEST_ERROR;
+
+ /* H5Gget_info */
+ if (H5Gget_info(gid, &info) < 0)
+ TEST_ERROR;
+ if (H5Gget_info(fid, &info) < 0)
+ TEST_ERROR;
+
+ /* H5Gget_info_by_name */
+ if (H5Gget_info_by_name(fid, NATIVE_VOL_TEST_GROUP_NAME, &info, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ /* H5Gget_info_by_idx */
+ if (H5Gget_info_by_idx(fid, "/", H5_INDEX_NAME, H5_ITER_NATIVE, 0, &info, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ /* H5Gflush */
+ if (H5Gflush(gid) < 0)
+ TEST_ERROR;
+
+ /* H5Gclose */
+ if (H5Gclose(gid) < 0)
+ TEST_ERROR;
+
+ /* H5Gopen */
+ if ((gid = H5Gopen2(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* H5Gcreate_anon */
+ if ((gid_a = H5Gcreate_anon(fid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* H5Grefresh */
+ if (H5Grefresh(gid) < 0)
+ TEST_ERROR;
+
+ if (H5Gclose(gid) < 0)
+ TEST_ERROR;
+ if (H5Gclose(gid_a) < 0)
+ TEST_ERROR;
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ HDremove(NATIVE_VOL_TEST_FILENAME);
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Fclose(fid);
+ H5Gclose(gid);
+ H5Pclose(gcpl_id);
+ } H5E_END_TRY;
+
+ return FAIL;
+
+} /* end test_basic_group_operation() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_basic_dataset_operation()
+ *
+ * Purpose: Uses the native VOL connector to test basic VOL dataset operations
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_basic_dataset_operation(void)
+{
+ hid_t fid = H5I_INVALID_HID;
+ hid_t dcpl_id = H5I_INVALID_HID;
+ hid_t dapl_id = H5I_INVALID_HID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t did_a = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
+
+ hsize_t curr_dims = 0;
+ hsize_t max_dims = H5S_UNLIMITED;
+
+ hsize_t storage_size;
+ haddr_t offset;
+ H5D_space_status_t status;
+
+ int in_buf[N_ELEMENTS];
+ int out_buf[N_ELEMENTS];
+
+ int i;
+
+ TESTING("Basic VOL dataset operations");
+
+ if ((fid = H5Fcreate(NATIVE_VOL_TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+ for (i = 0; i < N_ELEMENTS; i++) {
+ in_buf[i] = i;
+ out_buf[i] = 0;
+ }
+
+ /* H5Dcreate */
+ curr_dims = 0;
+ if ((sid = H5Screate_simple(1, &curr_dims, &max_dims)) < 0)
+ TEST_ERROR;
+ curr_dims = N_ELEMENTS;
+ if ((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ TEST_ERROR;
+ if (H5Pset_chunk(dcpl_id, 1, &curr_dims) < 0)
+ TEST_ERROR;
+ if ((did = H5Dcreate2(fid, NATIVE_VOL_TEST_DATASET_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* H5Dcreate_anon */
+ if ((did_a = H5Dcreate_anon(fid, H5T_NATIVE_INT, sid, dcpl_id, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ if (H5Sclose(sid) < 0)
+ TEST_ERROR;
+ if (H5Pclose(dcpl_id) < 0)
+ TEST_ERROR;
+
+ /* H5Dset_extent */
+ curr_dims = N_ELEMENTS;
+ if (H5Dset_extent(did, &curr_dims) < 0)
+ TEST_ERROR;
+
+ /* H5Dflush */
+ if (H5Dflush(did) < 0)
+ TEST_ERROR;
+
+ /* H5Dwrite */
+ if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, in_buf) < 0)
+ TEST_ERROR;
+
+ /* H5Drefresh */
+ if (H5Drefresh(did) < 0)
+ TEST_ERROR;
+
+ /* H5Dclose */
+ if (H5Dclose(did) < 0)
+ TEST_ERROR;
+ if (H5Dclose(did_a) < 0)
+ TEST_ERROR;
+
+ /* H5Dopen */
+ if ((did = H5Dopen2(fid, NATIVE_VOL_TEST_DATASET_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* H5Dget_space */
+ if ((sid = H5Dget_space(did)) < 0)
+ TEST_ERROR;
+ if (H5Sclose(sid) < 0)
+ TEST_ERROR;
+
+ /* H5Dget_space_status */
+ if (H5Dget_space_status(did, &status) < 0)
+ TEST_ERROR;
+
+ /* H5Dget_type */
+ if ((tid = H5Dget_type(did)) < 0)
+ TEST_ERROR;
+ if (H5Tclose(tid) < 0)
+ TEST_ERROR;
+
+ /* H5Tcopy (when used w/ a dataset, it gets an H5VL struct */
+ if ((tid = H5Tcopy(did)) < 0)
+ TEST_ERROR;
+ if (H5Tclose(tid) < 0)
+ TEST_ERROR;
+
+ /* H5Dget_create_plist */
+ if ((dcpl_id = H5Dget_create_plist(did)) < 0)
+ TEST_ERROR;
+ if (H5Pclose(dcpl_id) < 0)
+ TEST_ERROR;
+
+ /* H5Dget_access_plist */
+ if ((dapl_id = H5Dget_access_plist(did)) < 0)
+ TEST_ERROR;
+ if (H5Pclose(dapl_id) < 0)
+ TEST_ERROR;
+
+ /* H5Dget_storage_size */
+ /* XXX: This is a terrible API call that can't truly indicate failure */
+ if (0 == (storage_size = H5Dget_storage_size(did)))
+ TEST_ERROR;
+
+ /* H5Dget_offset */
+ /* XXX: Another bad API call that can't flag error values. Also, this
+ * returns HADDR_UNDEF for chunked datasets, which is bizarre.
+ */
+ if (HADDR_UNDEF != (offset = H5Dget_offset(did)))
+ TEST_ERROR;
+
+ /* H5Dread */
+ if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, out_buf) < 0)
+ TEST_ERROR;
+
+ for (i = 0; i < N_ELEMENTS; i++)
+ if (in_buf[i] != out_buf[i])
+ TEST_ERROR;
+
+ if (H5Dclose(did) < 0)
+ TEST_ERROR;
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ HDremove(NATIVE_VOL_TEST_FILENAME);
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Fclose(fid);
+ H5Dclose(did);
+ H5Dclose(did_a);
+ H5Sclose(sid);
+ H5Tclose(tid);
+ H5Pclose(dapl_id);
+ H5Pclose(dcpl_id);
+ } H5E_END_TRY;
+
+ return FAIL;
+
+} /* end test_basic_dataset_operation() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_basic_attribute_operation()
+ *
+ * Purpose: Uses the native VOL connector to test basic VOL attribute operations
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_basic_attribute_operation(void)
+{
+ hid_t fid = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID;
+ hid_t aid = H5I_INVALID_HID;
+ hid_t aid_name = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+
+ hsize_t dims = 1;
+
+ int data_in = 42;
+ int data_out = 0;
+
+ TESTING("Basic VOL attribute operations");
+
+ if ((fid = H5Fcreate(NATIVE_VOL_TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+ if ((gid = H5Gcreate2(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+ dims = 1;
+ if ((sid = H5Screate_simple(1, &dims, &dims)) < 0)
+ TEST_ERROR;
+
+ /* H5Acreate */
+ if ((aid = H5Acreate2(fid, NATIVE_VOL_TEST_ATTRIBUTE_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* H5Awrite */
+ if (H5Awrite(aid, H5T_NATIVE_INT, &data_in) < 0)
+ TEST_ERROR;
+
+ /* H5Aread */
+ if (H5Aread(aid, H5T_NATIVE_INT, &data_out) < 0)
+ TEST_ERROR;
+ if (data_in != data_out)
+ TEST_ERROR;
+
+ /* H5Aclose */
+ if (H5Aclose(aid) < 0)
+ TEST_ERROR;
+
+ /* H5Aopen */
+ if ((aid = H5Aopen(fid, NATIVE_VOL_TEST_ATTRIBUTE_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+ if (H5Aclose(aid) < 0)
+ TEST_ERROR;
+
+ /* H5Adelete */
+ if (H5Adelete(fid, NATIVE_VOL_TEST_ATTRIBUTE_NAME) < 0)
+ TEST_ERROR;
+
+ /* H5Acreate_by_name */
+ if ((aid_name = H5Acreate_by_name(fid, NATIVE_VOL_TEST_GROUP_NAME, NATIVE_VOL_TEST_ATTRIBUTE_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+ /* H5Aclose */
+ if (H5Aclose(aid_name) < 0)
+ TEST_ERROR;
+
+ /* H5Adelete_by_name */
+ if (H5Adelete_by_name(fid, NATIVE_VOL_TEST_GROUP_NAME, NATIVE_VOL_TEST_ATTRIBUTE_NAME, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ if (H5Sclose(sid) < 0)
+ TEST_ERROR;
+ if (H5Gclose(gid) < 0)
+ TEST_ERROR;
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ HDremove(NATIVE_VOL_TEST_FILENAME);
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Fclose(fid);
+ H5Gclose(gid);
+ H5Sclose(sid);
+ H5Aclose(aid);
+ H5Aclose(aid_name);
+ } H5E_END_TRY;
+
+ return FAIL;
+
+} /* end test_basic_attribute_operation() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_basic_object_operation()
+ *
+ * Purpose: Uses the native VOL connector to test basic VOL object operations
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_basic_object_operation(void)
+{
+ hid_t fid = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID;
+ hid_t oid = H5I_INVALID_HID;
+
+ H5O_info_t object_info;
+
+ TESTING("Basic VOL object operations");
+
+ if ((fid = H5Fcreate(NATIVE_VOL_TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+ if ((gid = H5Gcreate2(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* H5Oget_info */
+ if (H5Oget_info2(fid, &object_info, H5O_INFO_ALL) < 0)
+ TEST_ERROR;
+
+ /* H5Oget_info_by_name */
+ if (H5Oget_info_by_name2(fid, NATIVE_VOL_TEST_GROUP_NAME, &object_info, H5O_INFO_ALL, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ /* H5Oexists_by_name */
+ if (H5Oexists_by_name(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT) != TRUE)
+ TEST_ERROR;
+
+ /* H5Oopen/close */
+ if ((oid = H5Oopen(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+ if (H5Oclose(oid) < 0)
+ TEST_ERROR;
+
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+ if (H5Gclose(gid) < 0)
+ TEST_ERROR;
+
+ HDremove(NATIVE_VOL_TEST_FILENAME);
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Fclose(fid);
+ H5Gclose(gid);
+ } H5E_END_TRY;
+
+ return FAIL;
+
+} /* end test_basic_object_operation() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_basic_link_operation()
+ *
+ * Purpose: Uses the native VOL connector to test basic VOL link operations
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_basic_link_operation(void)
+{
+ hid_t fid = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID;
+
+ TESTING("Basic VOL link operations");
+
+ if ((fid = H5Fcreate(NATIVE_VOL_TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+ if ((gid = H5Gcreate2(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* H5Lcreate_hard */
+ if (H5Lcreate_hard(fid, "/", gid, NATIVE_VOL_TEST_HARD_LINK_NAME, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ /* H5Lcreate_soft (to itself) */
+ if (H5Lcreate_soft("/", fid, NATIVE_VOL_TEST_SOFT_LINK_NAME, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ /* H5Lexists */
+ if (H5Lexists(gid, NATIVE_VOL_TEST_HARD_LINK_NAME, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+ if (H5Lexists(fid, NATIVE_VOL_TEST_SOFT_LINK_NAME, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ /* H5Lcopy */
+ if (H5Lcopy(gid, NATIVE_VOL_TEST_HARD_LINK_NAME, fid, NATIVE_VOL_TEST_COPY_LINK_NAME, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ /* H5Lmove */
+ if (H5Lmove(fid, NATIVE_VOL_TEST_COPY_LINK_NAME, gid, NATIVE_VOL_TEST_MOVE_LINK_NAME, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+ if (H5Gclose(gid) < 0)
+ TEST_ERROR;
+
+ HDremove(NATIVE_VOL_TEST_FILENAME);
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Fclose(fid);
+ H5Fclose(gid);
+ } H5E_END_TRY;
+
+ return FAIL;
+
+} /* end test_basic_link_operation() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_basic_datatype_operation()
+ *
+ * Purpose: Uses the native VOL connector to test basic VOL datatype operations
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_basic_datatype_operation(void)
+{
+ hid_t fid = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
+ hid_t tid_anon = H5I_INVALID_HID;
+ hid_t tcpl_id = H5I_INVALID_HID;
+
+ TESTING("Basic VOL datatype operations");
+
+ if ((fid = H5Fcreate(NATIVE_VOL_TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+ if ((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)
+ TEST_ERROR;
+
+ /* H5Tcommit */
+ if (H5Tcommit2(fid, NATIVE_VOL_TEST_DATATYPE_NAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ /* H5Tflush */
+ if (H5Tflush(tid) < 0)
+ TEST_ERROR;
+
+ /* H5Trefresh */
+ if (H5Trefresh(tid) < 0)
+ TEST_ERROR;
+
+ /* H5Tclose */
+ if (H5Tclose(tid) < 0)
+ TEST_ERROR;
+
+ /* H5Topen */
+ if ((tid = H5Topen2(fid, NATIVE_VOL_TEST_DATATYPE_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* H5Tget_create_plist */
+ if ((tcpl_id = H5Tget_create_plist(tid)) < 0)
+ TEST_ERROR;
+
+ /* H5Tcommit_anon */
+ if ((tid_anon = H5Tcopy(H5T_NATIVE_INT)) < 0)
+ TEST_ERROR;
+ if (H5Tcommit_anon(fid, tid_anon, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ if (H5Pclose(tcpl_id) < 0)
+ TEST_ERROR;
+ if (H5Tclose(tid) < 0)
+ TEST_ERROR;
+ if (H5Tclose(tid_anon) < 0)
+ TEST_ERROR;
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ HDremove(NATIVE_VOL_TEST_FILENAME);
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose(tcpl_id);
+ H5Fclose(fid);
+ H5Tclose(tid);
+ H5Tclose(tid_anon);
+ } H5E_END_TRY;
+
+ return FAIL;
+
+} /* end test_basic_datatype_operation() */
+
+#if 0
+
+/*-------------------------------------------------------------------------
+ * Function: test_echo_vol_operation()
+ *
+ * Purpose: Uses the echo VOL connector to test basic VOL operations
+ * via the H5VL public API.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_echo_vol_operation(void)
+{
+ char name[25];
+
+ TESTING("Echo VOL operations");
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ return FAIL;
+
+} /* end test_basic_vol_operation() */
+#endif
+
+
+/*-------------------------------------------------------------------------
+ * Function: main
+ *
+ * Purpose: Tests the virtual object layer interface (H5VL)
+ *
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+main(void)
+{
+ int nerrors = 0;
+
+ h5_reset();
+
+ HDputs("Testing basic Virtual Object Layer (VOL) functionality.");
+
+ nerrors += test_vol_registration() < 0 ? 1 : 0;
+ nerrors += test_native_vol_init() < 0 ? 1 : 0;
+ nerrors += test_basic_file_operation() < 0 ? 1 : 0;
+ nerrors += test_basic_group_operation() < 0 ? 1 : 0;
+ nerrors += test_basic_dataset_operation() < 0 ? 1 : 0;
+ nerrors += test_basic_attribute_operation() < 0 ? 1 : 0;
+ nerrors += test_basic_object_operation() < 0 ? 1 : 0;
+ nerrors += test_basic_link_operation() < 0 ? 1 : 0;
+ nerrors += test_basic_datatype_operation() < 0 ? 1 : 0;
+
+ if (nerrors) {
+ HDprintf("***** %d Virtual Object Layer TEST%s FAILED! *****\n",
+ nerrors, nerrors > 1 ? "S" : "");
+ HDexit(EXIT_FAILURE);
+ }
+
+ HDputs("All Virtual Object Layer (VOL) tests passed.");
+
+ HDexit(EXIT_SUCCESS);
+
+} /* end main() */
+