diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-06-11 13:44:37 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-06-11 13:44:37 (GMT) |
commit | 3e1e5f166a1316573ea81b96178bb6a4fa3654a2 (patch) | |
tree | 117c2d8a7a50c4b345784738bdc776ec540fc1db /test | |
parent | 72e8017eadf211257caceb43095b2aed76e81632 (diff) | |
parent | d86717819242c706a34abf2d2bdb64baebfe1818 (diff) | |
download | hdf5-3e1e5f166a1316573ea81b96178bb6a4fa3654a2.zip hdf5-3e1e5f166a1316573ea81b96178bb6a4fa3654a2.tar.gz hdf5-3e1e5f166a1316573ea81b96178bb6a4fa3654a2.tar.bz2 |
[svn-r25254] merge from trunk.
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeLists.txt | 6 | ||||
-rw-r--r-- | test/CMakeTests.cmake | 107 | ||||
-rw-r--r-- | test/Makefile.am | 2 | ||||
-rw-r--r-- | test/Makefile.in | 4 | ||||
-rw-r--r-- | test/accum.c | 199 | ||||
-rw-r--r-- | test/dsets.c | 11 | ||||
-rw-r--r-- | test/enc_dec_plist.c | 3 | ||||
-rw-r--r-- | test/gen_bogus.c | 2 | ||||
-rw-r--r-- | test/gen_plist.c | 2 | ||||
-rw-r--r-- | test/h5test.c | 104 | ||||
-rw-r--r-- | test/testfiles/plist_files/fapl_be | bin | 1402 -> 1462 bytes | |||
-rw-r--r-- | test/testfiles/plist_files/fapl_le | bin | 1402 -> 1462 bytes | |||
-rw-r--r-- | test/testfiles/plist_files/lapl_be | bin | 1502 -> 1562 bytes | |||
-rw-r--r-- | test/testfiles/plist_files/lapl_le | bin | 1502 -> 1562 bytes | |||
-rw-r--r-- | test/tmisc.c | 110 | ||||
-rw-r--r-- | test/tselect.c | 12 | ||||
-rw-r--r-- | test/vfd.c | 13 |
17 files changed, 368 insertions, 207 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index dcbe9d4..b99447a 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_TEST) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -add_definitions (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Generate the H5srcdir_str.h file containing user settings needed by compilation @@ -64,7 +64,7 @@ if (BUILD_SHARED_LIBS) set (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") set (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") set (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) - add_definitions (${HDF5_EXTRA_C_FLAGS}) + add_definitions (${HDF_EXTRA_C_FLAGS}) INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) @@ -95,7 +95,7 @@ if (BUILD_SHARED_LIBS) set (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") set (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") set (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) - add_definitions (${HDF5_EXTRA_C_FLAGS}) + add_definitions (${HDF_EXTRA_C_FLAGS}) INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 33fbff6..23cc8eb 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -138,7 +138,7 @@ endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) # Remove any output file left over from previous test run add_test ( - NAME h5test-clear-testhdf5-objects + NAME H5TEST-clear-testhdf5-objects COMMAND ${CMAKE_COMMAND} -E remove coord.h5 @@ -161,21 +161,21 @@ add_test ( ) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME testhdf5-base COMMAND $<TARGET_FILE:testhdf5> -x heap -x file -x select) - set_tests_properties (testhdf5-base PROPERTIES DEPENDS h5test-clear-testhdf5-objects) - set_tests_properties (testhdf5-base PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) - add_test (NAME testhdf5-heap COMMAND $<TARGET_FILE:testhdf5> -o heap) - set_tests_properties (testhdf5-heap PROPERTIES DEPENDS h5test-clear-testhdf5-objects) - set_tests_properties (testhdf5-heap PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) - add_test (NAME testhdf5-file COMMAND $<TARGET_FILE:testhdf5> -o file) - set_tests_properties (testhdf5-file PROPERTIES DEPENDS h5test-clear-testhdf5-objects) - set_tests_properties (testhdf5-file PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) - add_test (NAME testhdf5-select COMMAND $<TARGET_FILE:testhdf5> -o select) - set_tests_properties (testhdf5-select PROPERTIES DEPENDS h5test-clear-testhdf5-objects) - set_tests_properties (testhdf5-select PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) + add_test (NAME H5TEST-testhdf5-base COMMAND $<TARGET_FILE:testhdf5> -x heap -x file -x select) + set_tests_properties (H5TEST-testhdf5-base PROPERTIES DEPENDS H5TEST-clear-testhdf5-objects) + set_tests_properties (H5TEST-testhdf5-base PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) + add_test (NAME H5TEST-testhdf5-heap COMMAND $<TARGET_FILE:testhdf5> -o heap) + set_tests_properties (H5TEST-testhdf5-heap PROPERTIES DEPENDS H5TEST-clear-testhdf5-objects) + set_tests_properties (H5TEST-testhdf5-heap PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) + add_test (NAME H5TEST-testhdf5-file COMMAND $<TARGET_FILE:testhdf5> -o file) + set_tests_properties (H5TEST-testhdf5-file PROPERTIES DEPENDS H5TEST-clear-testhdf5-objects) + set_tests_properties (H5TEST-testhdf5-file PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) + add_test (NAME H5TEST-testhdf5-select COMMAND $<TARGET_FILE:testhdf5> -o select) + set_tests_properties (H5TEST-testhdf5-select PROPERTIES DEPENDS H5TEST-clear-testhdf5-objects) + set_tests_properties (H5TEST-testhdf5-select PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) else (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME testhdf5 COMMAND $<TARGET_FILE:testhdf5>) - set_tests_properties (testhdf5 PROPERTIES DEPENDS h5test-clear-testhdf5-objects) + add_test (NAME H5TEST-testhdf5 COMMAND $<TARGET_FILE:testhdf5>) + set_tests_properties (H5TEST-testhdf5 PROPERTIES DEPENDS H5TEST-clear-testhdf5-objects) endif (HDF5_ENABLE_USING_MEMCHECKER) ############################################################################## @@ -186,7 +186,7 @@ endif (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( - NAME h5test-clear-objects + NAME H5TEST-clear-objects COMMAND ${CMAKE_COMMAND} -E remove dt_arith1.h5 @@ -249,11 +249,11 @@ add_test ( ) foreach (test ${H5_TESTS}) - add_test (NAME ${test} COMMAND $<TARGET_FILE:${test}>) - set_tests_properties (${test} PROPERTIES DEPENDS h5test-clear-objects) + add_test (NAME H5TEST-${test} COMMAND $<TARGET_FILE:${test}>) + set_tests_properties (H5TEST-${test} PROPERTIES DEPENDS H5TEST-clear-objects) endforeach (test ${H5_TESTS}) -set_tests_properties (flush2 PROPERTIES DEPENDS flush1) +set_tests_properties (H5TEST-flush2 PROPERTIES DEPENDS H5TEST-flush1) ############################################################################## ############################################################################## @@ -263,38 +263,38 @@ set_tests_properties (flush2 PROPERTIES DEPENDS flush1) #-- Adding test for cache add_test ( - NAME h5test-clear-cache-objects + NAME H5TEST-clear-cache-objects COMMAND ${CMAKE_COMMAND} -E remove cache_test.h5 ) -add_test (NAME cache COMMAND $<TARGET_FILE:cache>) -set_tests_properties (cache PROPERTIES DEPENDS h5test-clear-cache-objects) +add_test (NAME H5TEST-cache COMMAND $<TARGET_FILE:cache>) +set_tests_properties (H5TEST-cache PROPERTIES DEPENDS H5TEST-clear-cache-objects) #-- Adding test for cache_api add_test ( - NAME h5test-clear-cache_api-objects + NAME H5TEST-clear-cache_api-objects COMMAND ${CMAKE_COMMAND} -E remove cache_api_test.h5 ) -add_test (NAME cache_api COMMAND $<TARGET_FILE:cache_api>) -set_tests_properties (cache_api PROPERTIES DEPENDS h5test-clear-cache_api-objects) +add_test (NAME H5TEST-cache_api COMMAND $<TARGET_FILE:cache_api>) +set_tests_properties (H5TEST-cache_api PROPERTIES DEPENDS H5TEST-clear-cache_api-objects) #-- Adding test for cache_tagging add_test ( - NAME h5test-clear-cache_tagging-objects + NAME H5TEST-clear-cache_tagging-objects COMMAND ${CMAKE_COMMAND} -E remove tagging_test.h5 tagging_ext_test.h5 ) -add_test (NAME cache_tagging COMMAND $<TARGET_FILE:cache_tagging>) -set_tests_properties (cache_tagging PROPERTIES DEPENDS h5test-clear-cache_tagging-objects) +add_test (NAME H5TEST-cache_tagging COMMAND $<TARGET_FILE:cache_tagging>) +set_tests_properties (H5TEST-cache_tagging PROPERTIES DEPENDS H5TEST-clear-cache_tagging-objects) #-- Adding test for ttsafe add_test ( - NAME h5test-clear-ttsafe-objects + NAME H5TEST-clear-ttsafe-objects COMMAND ${CMAKE_COMMAND} -E remove ttsafe_error.h5 @@ -302,19 +302,19 @@ add_test ( ttsafe_cancel.h5 ttsafe_acreate.h5 ) -add_test (NAME ttsafe COMMAND $<TARGET_FILE:ttsafe>) -set_tests_properties (ttsafe PROPERTIES DEPENDS h5test-clear-ttsafe-objects) +add_test (NAME H5TEST-ttsafe COMMAND $<TARGET_FILE:ttsafe>) +set_tests_properties (H5TEST-ttsafe PROPERTIES DEPENDS H5TEST-clear-ttsafe-objects) #-- Adding test for err_compat if (HDF5_ENABLE_DEPRECATED_SYMBOLS) add_test ( - NAME h5test-clear-err_compat-objects + NAME H5TEST-clear-err_compat-objects COMMAND ${CMAKE_COMMAND} -E remove err_compat.txt err_compat.txt.err ) - add_test (NAME err_compat COMMAND "${CMAKE_COMMAND}" + add_test (NAME H5TEST-err_compat COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:err_compat>" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -322,20 +322,20 @@ if (HDF5_ENABLE_DEPRECATED_SYMBOLS) -D "TEST_OUTPUT=err_compat.txt" -D "TEST_REFERENCE=err_compat_1" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (err_compat PROPERTIES DEPENDS h5test-clear-err_compat-objects) + set_tests_properties (H5TEST-err_compat PROPERTIES DEPENDS H5TEST-clear-err_compat-objects) endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) #-- Adding test for error_test add_test ( - NAME h5test-clear-error_test-objects + NAME H5TEST-clear-error_test-objects COMMAND ${CMAKE_COMMAND} -E remove error_test.txt error_test.txt.err ) -add_test (NAME error_test COMMAND "${CMAKE_COMMAND}" +add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:error_test>" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -343,14 +343,14 @@ add_test (NAME error_test COMMAND "${CMAKE_COMMAND}" -D "TEST_OUTPUT=error_test.txt" -D "TEST_REFERENCE=error_test_1" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) -set_tests_properties (error_test PROPERTIES DEPENDS h5test-clear-error_test-objects) -set_tests_properties (error_test PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PRELOAD=::") +set_tests_properties (H5TEST-error_test PROPERTIES DEPENDS H5TEST-clear-error_test-objects) +set_tests_properties (H5TEST-error_test PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PRELOAD=::") #-- Adding test for links_env add_test ( - NAME h5test-clear-links_env-objects + NAME H5TEST-clear-links_env-objects COMMAND ${CMAKE_COMMAND} -E remove links_env.txt @@ -359,7 +359,7 @@ add_test ( extlinks_env1.h5 tmp/extlinks_env1.h5 ) -add_test (NAME links_env COMMAND "${CMAKE_COMMAND}" +add_test (NAME H5TEST-links_env COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:links_env>" -D "TEST_ARGS:STRING=" -D "TEST_ENV_VAR:STRING=HDF5_EXT_PREFIX" @@ -368,23 +368,23 @@ add_test (NAME links_env COMMAND "${CMAKE_COMMAND}" -D "TEST_OUTPUT=links_env.txt" -D "TEST_REFERENCE=links_env.out" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) -set_tests_properties (links_env PROPERTIES DEPENDS h5test-clear-links_env-objects) +set_tests_properties (H5TEST-links_env PROPERTIES DEPENDS H5TEST-clear-links_env-objects) #-- Adding test for libinfo -add_test (NAME testlibinfo COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$<TARGET_FILE:${HDF5_LIB_TARGET}>" -P "${GREP_RUNNER}") +add_test (NAME H5TEST-testlibinfo COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$<TARGET_FILE:${HDF5_LIB_TARGET}>" -P "${GREP_RUNNER}") ############################################################################## ### P L U G I N T E S T S ############################################################################## if (BUILD_SHARED_LIBS) - if (WIN32 AND NOT CYGWIN) + if (WIN32) set (CMAKE_SEP "\;") - else (WIN32 AND NOT CYGWIN) + else (WIN32) set (CMAKE_SEP ":") - endif (WIN32 AND NOT CYGWIN) + endif (WIN32) add_test (NAME H5PLUGIN-plugin COMMAND $<TARGET_FILE:plugin>) set_tests_properties (H5PLUGIN-plugin PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir1${CMAKE_SEP}${CMAKE_BINARY_DIR}/testdir2") @@ -438,7 +438,7 @@ if (HDF5_TEST_VFD) objcopy links unlink - big +# big mtime fillval mount @@ -467,7 +467,10 @@ if (HDF5_TEST_VFD) testmeta links_env unregister -) + ) + if (NOT CYGWIN) + set (H5_VFD_TESTS ${H5_VFD_TESTS} big) + endif (NOT CYGWIN) if (DIRECT_VFD) set (VFD_LIST ${VFD_LIST} direct) @@ -484,7 +487,7 @@ if (HDF5_TEST_VFD) -D "TEST_EXPECT=${resultcode}" -D "TEST_OUTPUT=${test}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) endforeach (test ${H5_VFD_TESTS}) if (HDF5_TEST_FHEAP_VFD) @@ -497,7 +500,7 @@ if (HDF5_TEST_VFD) -D "TEST_EXPECT=${resultcode}" -D "TEST_OUTPUT=fheap" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) endif (HDF5_TEST_FHEAP_VFD) ENDMACRO (ADD_VFD_TEST) diff --git a/test/Makefile.am b/test/Makefile.am index df8c4a2..3187d2c 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -104,7 +104,7 @@ LDADD=libh5test.la $(LIBHDF5) ttsafe_SOURCES=ttsafe.c ttsafe_dcreate.c ttsafe_error.c ttsafe_cancel.c \ ttsafe_acreate.c -VFD_LIST = sec2 stdio core split multi family +VFD_LIST = sec2 stdio core core_paged split multi family if DIRECT_VFD_CONDITIONAL VFD_LIST += direct endif diff --git a/test/Makefile.in b/test/Makefile.in index 8e243d5..2ac76fe 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -905,7 +905,6 @@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -LT_ADD_LIBHDF5_DEPENDENCY = @LT_ADD_LIBHDF5_DEPENDENCY@ LT_STATIC_EXEC = @LT_STATIC_EXEC@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ @@ -1156,7 +1155,8 @@ LDADD = libh5test.la $(LIBHDF5) ttsafe_SOURCES = ttsafe.c ttsafe_dcreate.c ttsafe_error.c ttsafe_cancel.c \ ttsafe_acreate.c -VFD_LIST = sec2 stdio core split multi family $(am__append_4) +VFD_LIST = sec2 stdio core core_paged split multi family \ + $(am__append_4) # 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 351ed88..88af44b 100644 --- a/test/accum.c +++ b/test/accum.c @@ -38,18 +38,18 @@ H5F_t * f = NULL; /* Function Prototypes */ -unsigned test_write_read(void); -unsigned test_write_read_nonacc_front(void); -unsigned test_write_read_nonacc_end(void); -unsigned test_accum_overlap(void); -unsigned test_accum_overlap_clean(void); -unsigned test_accum_overlap_size(void); -unsigned test_accum_non_overlap_size(void); -unsigned test_accum_adjust(void); -unsigned test_read_after(void); -unsigned test_free(void); -unsigned test_big(void); -unsigned test_random_write(void); +unsigned test_write_read(const H5F_io_info_t *fio_info); +unsigned test_write_read_nonacc_front(const H5F_io_info_t *fio_info); +unsigned test_write_read_nonacc_end(const H5F_io_info_t *fio_info); +unsigned test_accum_overlap(const H5F_io_info_t *fio_info); +unsigned test_accum_overlap_clean(const H5F_io_info_t *fio_info); +unsigned test_accum_overlap_size(const H5F_io_info_t *fio_info); +unsigned test_accum_non_overlap_size(const H5F_io_info_t *fio_info); +unsigned test_accum_adjust(const H5F_io_info_t *fio_info); +unsigned test_read_after(const H5F_io_info_t *fio_info); +unsigned test_free(const H5F_io_info_t *fio_info); +unsigned test_big(const H5F_io_info_t *fio_info); +unsigned test_random_write(const H5F_io_info_t *fio_info); /* Helper Function Prototypes */ void accum_printf(void); @@ -57,9 +57,9 @@ void accum_printf(void); /* Private Test H5Faccum Function Wrappers */ #define accum_write(a,s,b) H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)(a), (size_t)(s), H5P_DATASET_XFER_DEFAULT, (b)) #define accum_read(a,s,b) H5F_block_read(f, H5FD_MEM_DEFAULT, (haddr_t)(a), (size_t)(s), H5P_DATASET_XFER_DEFAULT, (b)) -#define accum_free(a,s) H5F_accum_free(f, H5P_DATASET_XFER_DEFAULT, H5FD_MEM_DEFAULT, (haddr_t)(a), (hsize_t)(s)) -#define accum_flush() H5F_accum_flush(f, H5P_DATASET_XFER_DEFAULT) -#define accum_reset() H5F_accum_reset(f, H5P_DATASET_XFER_DEFAULT, TRUE) +#define accum_free(fio_info,a,s) H5F__accum_free(fio_info, H5FD_MEM_DEFAULT, (haddr_t)(a), (hsize_t)(s)) +#define accum_flush(fio_info) H5F__accum_flush(fio_info) +#define accum_reset(fio_info) H5F__accum_reset(fio_info, TRUE) /* ================= */ /* Main Test Routine */ @@ -82,6 +82,7 @@ void accum_printf(void); int main(void) { + H5F_io_info_t fio_info; /* I/O info for operation */ unsigned nerrors = 0; /* track errors */ hid_t fid = -1; @@ -98,22 +99,26 @@ main(void) file a ways. 10MB should do. */ if(H5FD_set_eoa(f->shared->lf, H5FD_MEM_DEFAULT, (haddr_t)(1024*1024*10)) < 0) FAIL_STACK_ERROR + /* Set up I/O info for operation */ + fio_info.f = f; + if(NULL == (fio_info.dxpl = (H5P_genplist_t *)H5I_object(H5P_DATASET_XFER_DEFAULT))) FAIL_STACK_ERROR + /* Reset metadata accumulator for the file */ - if(accum_reset() < 0) FAIL_STACK_ERROR + if(accum_reset(&fio_info) < 0) FAIL_STACK_ERROR /* Test Functions */ - nerrors += test_write_read(); - nerrors += test_write_read_nonacc_front(); - nerrors += test_write_read_nonacc_end(); - nerrors += test_accum_overlap(); - nerrors += test_accum_overlap_clean(); - nerrors += test_accum_overlap_size(); - nerrors += test_accum_non_overlap_size(); - nerrors += test_accum_adjust(); - nerrors += test_read_after(); - nerrors += test_free(); - nerrors += test_big(); - nerrors += test_random_write(); + nerrors += test_write_read(&fio_info); + nerrors += test_write_read_nonacc_front(&fio_info); + nerrors += test_write_read_nonacc_end(&fio_info); + nerrors += test_accum_overlap(&fio_info); + nerrors += test_accum_overlap_clean(&fio_info); + nerrors += test_accum_overlap_size(&fio_info); + nerrors += test_accum_non_overlap_size(&fio_info); + nerrors += test_accum_adjust(&fio_info); + nerrors += test_read_after(&fio_info); + nerrors += test_free(&fio_info); + nerrors += test_big(&fio_info); + nerrors += test_random_write(&fio_info); /* End of test code, close and delete file */ if(H5Fclose(fid) < 0) TEST_ERROR @@ -149,7 +154,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_write_read(void) +test_write_read(const H5F_io_info_t *fio_info) { int i = 0; int *write_buf, *read_buf; @@ -172,7 +177,7 @@ test_write_read(void) if(accum_read(0, 1024, read_buf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(write_buf, read_buf, 1024) != 0) TEST_ERROR; - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; PASSED(); @@ -205,7 +210,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_write_read_nonacc_front(void) +test_write_read_nonacc_front(const H5F_io_info_t *fio_info) { int i = 0; int *write_buf, *read_buf; @@ -225,13 +230,13 @@ test_write_read_nonacc_front(void) /* Do a simple write/read/verify of data */ /* Write 1KB at Address 0 */ if(accum_write(0, 1024, write_buf) < 0) FAIL_STACK_ERROR; - if(accum_flush() < 0) FAIL_STACK_ERROR; - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; if(accum_write(1024, 1024, write_buf) < 0) FAIL_STACK_ERROR; if(accum_read(0, 1024, read_buf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(write_buf, read_buf, 1024) != 0) TEST_ERROR; - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; PASSED(); @@ -264,7 +269,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_write_read_nonacc_end(void) +test_write_read_nonacc_end(const H5F_io_info_t *fio_info) { int i = 0; int *write_buf, *read_buf; @@ -284,13 +289,13 @@ test_write_read_nonacc_end(void) /* Do a simple write/read/verify of data */ /* Write 1KB at Address 0 */ if(accum_write(1024, 1024, write_buf) < 0) FAIL_STACK_ERROR; - if(accum_flush() < 0) FAIL_STACK_ERROR; - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; if(accum_write(0, 1024, write_buf) < 0) FAIL_STACK_ERROR; if(accum_read(1024, 1024, read_buf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(write_buf, read_buf, 1024) != 0) TEST_ERROR; - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; PASSED(); @@ -323,7 +328,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_free(void) +test_free(const H5F_io_info_t *fio_info) { int i = 0; int32_t *wbuf = NULL; @@ -346,38 +351,38 @@ test_free(void) if(accum_write(0, 256 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; - if(accum_free(0, 256 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(fio_info, 0, 256 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Free an empty accumulator */ - if(accum_free(0, 256 * 1024 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(fio_info, 0, 256 * 1024 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Write second quarter of the accumulator */ if(accum_write(64 * sizeof(int32_t), 64 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; /* Free the second quarter of the accumulator, the requested area * is bigger than the data region on the right side. */ - if(accum_free(64 * sizeof(int32_t), 65 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(fio_info, 64 * sizeof(int32_t), 65 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Write half of the accumulator. */ if(accum_write(0, 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; /* Free the first block of 4B */ - if(accum_free(0, sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(fio_info, 0, sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(1 * sizeof(int32_t), 127 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf + 1, rbuf, 127 * sizeof(int32_t)) != 0) TEST_ERROR; /* Free the block of 4B at 127*4B */ - if(accum_free(127 * sizeof(int32_t), sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(fio_info, 127 * sizeof(int32_t), sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(1 * sizeof(int32_t), 126 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf + 1, rbuf, 126 * sizeof(int32_t)) != 0) TEST_ERROR; /* Free the block of 4B at 2*4B */ - if(accum_free(2 * sizeof(int32_t), sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(fio_info, 2 * sizeof(int32_t), sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(1 * sizeof(int32_t), 1 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -390,10 +395,10 @@ test_free(void) * entirely before dirty section */ if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t)); - if(accum_flush() < 0) FAIL_STACK_ERROR; + if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; if(accum_write(68 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 68, wbuf, 4 * sizeof(int32_t)); - if(accum_free(62 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(fio_info, 62 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(66 * sizeof(int32_t), 126 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -404,10 +409,10 @@ test_free(void) * completely contains dirty section */ if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t)); - if(accum_flush() < 0) FAIL_STACK_ERROR; + if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; if(accum_write(68 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 68, wbuf, 4 * sizeof(int32_t)); - if(accum_free(62 * sizeof(int32_t), 16 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(fio_info, 62 * sizeof(int32_t), 16 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(78 * sizeof(int32_t), 114 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -418,10 +423,10 @@ test_free(void) * before dirty section */ if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t)); - if(accum_flush() < 0) FAIL_STACK_ERROR; + if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; if(accum_write(72 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 72, wbuf, 4 * sizeof(int32_t)); - if(accum_free(66 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(fio_info, 66 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(70 * sizeof(int32_t), 122 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -432,10 +437,10 @@ test_free(void) * dirty section, and ends in dirty section */ if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t)); - if(accum_flush() < 0) FAIL_STACK_ERROR; + if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; if(accum_write(72 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 72, wbuf, 4 * sizeof(int32_t)); - if(accum_free(70 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(fio_info, 70 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(74 * sizeof(int32_t), 118 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -446,10 +451,10 @@ test_free(void) * contains dirty section */ if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t)); - if(accum_flush() < 0) FAIL_STACK_ERROR; + if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; if(accum_write(72 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 72, wbuf, 4 * sizeof(int32_t)); - if(accum_free(70 * sizeof(int32_t), 8 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(fio_info, 70 * sizeof(int32_t), 8 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(78 * sizeof(int32_t), 114 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -460,10 +465,10 @@ test_free(void) * of dirty section, and ends in dirty section */ if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t)); - if(accum_flush() < 0) FAIL_STACK_ERROR; + if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; if(accum_write(72 * sizeof(int32_t), 8 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 72, wbuf, 8 * sizeof(int32_t)); - if(accum_free(72 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(fio_info, 72 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(76 * sizeof(int32_t), 116 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -476,7 +481,7 @@ test_free(void) HDfree(expect); expect = NULL; - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; PASSED(); @@ -510,7 +515,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_accum_overlap(void) +test_accum_overlap(const H5F_io_info_t *fio_info) { int i = 0; int32_t *wbuf, *rbuf; @@ -646,7 +651,7 @@ test_accum_overlap(void) if(accum_read(112, 6 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, 6 * sizeof(int32_t)) != 0) TEST_ERROR; - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; PASSED(); @@ -682,7 +687,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_accum_overlap_clean(void) +test_accum_overlap_clean(const H5F_io_info_t *fio_info) { int i = 0; int32_t *wbuf, *rbuf; @@ -708,7 +713,7 @@ test_accum_overlap_clean(void) /* Case 2: End of new piece aligns with start of clean accumulated data */ /* Write 5 2's at address 20 */ /* @0:| 222221111111111| */ - if(accum_flush() < 0) FAIL_STACK_ERROR; + if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; for(i = 0; i < 5; i++) wbuf[i] = 2; if(accum_write(20, 5 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; @@ -748,7 +753,7 @@ test_accum_overlap_clean(void) /* Case 6: New piece completely within clean accumulated data */ /* Write 3 6's at address 44 */ /* @0:| 333334666511111| */ - if(accum_flush() < 0) FAIL_STACK_ERROR; + if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; for(i = 0; i < 3; i++) wbuf[i] = 6; if(accum_write(44, 3 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; @@ -758,7 +763,7 @@ test_accum_overlap_clean(void) /* Case 7: New piece overlaps start of clean accumulated data */ /* Write 2 7's at address 16 */ /* @0:| 7733334666511111| */ - if(accum_flush() < 0) FAIL_STACK_ERROR; + if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; for(i = 0; i < 2; i++) wbuf[i] = 7; if(accum_write(16, 2 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; @@ -778,7 +783,7 @@ test_accum_overlap_clean(void) /* Case 9: Start of new piece aligns with end of clean accumulated data */ /* Write 3 9's at address 80 */ /* @0:| 88883334666511111999| */ - if(accum_flush() < 0) FAIL_STACK_ERROR; + if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; for(i = 0; i < 3; i++) wbuf[i] = 9; if(accum_write(80, 3 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; @@ -788,7 +793,7 @@ test_accum_overlap_clean(void) /* Case 10: New piece overlaps end of clean accumulated data */ /* Write 3 2's at address 88 */ /* @0:| 888833346665111119922| */ - if(accum_flush() < 0) FAIL_STACK_ERROR; + if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; for(i = 0; i < 2; i++) wbuf[i] = 2; if(accum_write(88, 2 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; @@ -826,7 +831,7 @@ test_accum_overlap_clean(void) if(accum_read(12, 22 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, 22 * sizeof(int32_t)) != 0) TEST_ERROR; - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; PASSED(); @@ -861,7 +866,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_accum_non_overlap_size(void) +test_accum_non_overlap_size(const H5F_io_info_t *fio_info) { int i = 0; int32_t *wbuf, *rbuf; @@ -893,7 +898,7 @@ test_accum_non_overlap_size(void) if(accum_read(0, 20 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, 20 * sizeof(int32_t)) != 0) TEST_ERROR; - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; PASSED(); @@ -928,7 +933,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_accum_overlap_size(void) +test_accum_overlap_size(const H5F_io_info_t *fio_info) { int i = 0; int32_t *wbuf, *rbuf; @@ -960,7 +965,7 @@ test_accum_overlap_size(void) if(accum_read(60, 72 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, 72 * sizeof(int32_t)) != 0) TEST_ERROR; - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; PASSED(); @@ -1006,7 +1011,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_accum_adjust(void) +test_accum_adjust(const H5F_io_info_t *fio_info) { int i = 0; int s = 1048576; /* size of buffer */ @@ -1052,7 +1057,7 @@ test_accum_adjust(void) if(HDmemcmp(wbuf, rbuf, 1024) != 0) TEST_ERROR; /* Reset accumulator for next case */ - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; /* ================================================================ */ /* Case 2: Prepending large block to large, fully dirty accumulator */ @@ -1081,7 +1086,7 @@ test_accum_adjust(void) if(HDmemcmp(wbuf, rbuf, 1048571) != 0) TEST_ERROR; /* Reset accumulator for next case */ - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; /* ========================================================= */ /* Case 3: Appending small block to large, clean accumulator */ @@ -1095,7 +1100,7 @@ test_accum_adjust(void) /* Flush the accumulator -- we want to test the case when accumulator contains clean data */ - if(accum_flush() < 0) FAIL_STACK_ERROR + if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR /* Write a small (1KB) block to the end of the accumulator */ /* ==> Accumulator will need more buffer space */ @@ -1116,7 +1121,7 @@ test_accum_adjust(void) if(HDmemcmp(wbuf, rbuf, 1024) != 0) TEST_ERROR; /* Reset accumulator for next case */ - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; /* ==================================================================== */ /* Case 4: Appending small block to large, partially dirty accumulator, */ @@ -1130,7 +1135,7 @@ test_accum_adjust(void) if(accum_write(0, (1024 * 1024) - 5, wbuf) < 0) FAIL_STACK_ERROR; /* Flush the accumulator to clean it */ - if(accum_flush() < 0) FAIL_STACK_ERROR + if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR /* write to part of the accumulator so just the start of it is dirty */ if(accum_write(0, 5, wbuf) < 0) FAIL_STACK_ERROR; @@ -1156,7 +1161,7 @@ test_accum_adjust(void) if(HDmemcmp(wbuf, rbuf, 349523) != 0) TEST_ERROR; /* Reset accumulator for next case */ - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; /* ==================================================================== */ /* Case 5: Appending small block to large, partially dirty accumulator, */ @@ -1167,7 +1172,7 @@ test_accum_adjust(void) if(accum_write(0, (1024 * 1024) - 5, wbuf) < 0) FAIL_STACK_ERROR; /* Flush the accumulator to clean it */ - if(accum_flush() < 0) FAIL_STACK_ERROR + if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR /* write to part of the accumulator so it's dirty, but not entirely dirty */ /* (just the begging few bytes will be clean) */ @@ -1193,7 +1198,7 @@ test_accum_adjust(void) if(HDmemcmp(wbuf, rbuf, 10) != 0) TEST_ERROR; /* Reset accumulator for next case */ - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; /* ================================================================= */ /* Case 6: Appending small block to large, fully dirty accumulator */ @@ -1224,7 +1229,7 @@ test_accum_adjust(void) if(accum_read(1048571, 349523, rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, 349523) != 0) TEST_ERROR; - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; PASSED(); @@ -1262,7 +1267,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_read_after(void) +test_read_after(const H5F_io_info_t *fio_info) { int i = 0; int s = 128; /* size of buffer */ @@ -1307,7 +1312,7 @@ test_read_after(void) if(accum_read(512, 512, rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, 128) != 0) TEST_ERROR; - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; PASSED(); @@ -1341,7 +1346,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_big(void) +test_big(const H5F_io_info_t *fio_info) { uint8_t *wbuf, *wbuf2, *rbuf, *zbuf; /* Buffers for reading & writing, etc */ unsigned u; /* Local index variable */ @@ -1377,7 +1382,7 @@ test_big(void) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, BIG_BUF_SIZE); - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; /* Write small section to middle of accumulator */ @@ -1396,7 +1401,7 @@ test_big(void) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(1024, 1024, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, BIG_BUF_SIZE); - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; /* Write small section to overlap with end of "big" region */ @@ -1414,7 +1419,7 @@ test_big(void) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(BIG_BUF_SIZE - 512, 1024, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, BIG_BUF_SIZE); - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; /* Write small section to overlap with beginning of "big" region */ @@ -1432,7 +1437,7 @@ test_big(void) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, 1024, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, BIG_BUF_SIZE); - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; /* Write small section to middle of accumulator */ @@ -1454,7 +1459,7 @@ test_big(void) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, BIG_BUF_SIZE); - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; /* Write small section to overlap with end of "big" region */ @@ -1477,7 +1482,7 @@ test_big(void) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, BIG_BUF_SIZE + 512, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, BIG_BUF_SIZE + 512); - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; /* Write small section to be past "big" region */ @@ -1505,7 +1510,7 @@ test_big(void) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, BIG_BUF_SIZE + 1536, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, BIG_BUF_SIZE + 1024); - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; /* Write small section to be past "big" region */ @@ -1533,7 +1538,7 @@ test_big(void) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(1536, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, BIG_BUF_SIZE + 1536); - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; /* Write small section before "big" region */ @@ -1560,7 +1565,7 @@ test_big(void) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(512, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, BIG_BUF_SIZE + 512); - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; /* Write small section before "big" region */ @@ -1588,7 +1593,7 @@ test_big(void) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, BIG_BUF_SIZE + 1536, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, BIG_BUF_SIZE + 1536); - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; /* Write small section before "big" region */ @@ -1612,7 +1617,7 @@ test_big(void) if(HDmemcmp(wbuf2, rbuf + 512, BIG_BUF_SIZE) != 0) TEST_ERROR; - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; PASSED(); @@ -1649,7 +1654,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_random_write(void) +test_random_write(const H5F_io_info_t *fio_info) { uint8_t *wbuf, *rbuf; /* Buffers for reading & writing */ unsigned seed = 0; /* Random # seed */ @@ -1749,7 +1754,7 @@ HDfprintf(stderr, "Random # seed was: %u\n", seed); /* Verify data read back in */ if(HDmemcmp(wbuf, rbuf, RANDOM_BUF_SIZE) != 0) TEST_ERROR; - if(accum_reset() < 0) FAIL_STACK_ERROR; + if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; PASSED(); diff --git a/test/dsets.c b/test/dsets.c index 5f44ce2..3cd303f 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -6677,8 +6677,17 @@ test_zero_dims(hid_t file) if(H5Pset_chunk(dcpl, 1, &csize) < 0) FAIL_STACK_ERROR if((d = H5Dcreate2(file, ZERODIM_DATASET, H5T_NATIVE_INT, s, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - /* Just a no-op */ + /* Various no-op writes */ if(H5Dwrite(d, H5T_NATIVE_INT, s, s, H5P_DEFAULT, (void*)911) < 0) FAIL_STACK_ERROR + if(H5Dwrite(d, H5T_NATIVE_INT, s, s, H5P_DEFAULT, NULL) < 0) FAIL_STACK_ERROR + if(H5Dwrite(d, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void*)911) < 0) FAIL_STACK_ERROR + if(H5Dwrite(d, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, NULL) < 0) FAIL_STACK_ERROR + + /* Various no-op reads */ + if(H5Dread(d, H5T_NATIVE_INT, s, s, H5P_DEFAULT, (void*)911) < 0) FAIL_STACK_ERROR + if(H5Dread(d, H5T_NATIVE_INT, s, s, H5P_DEFAULT, NULL) < 0) FAIL_STACK_ERROR + if(H5Dread(d, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void*)911) < 0) FAIL_STACK_ERROR + if(H5Dread(d, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, NULL) < 0) FAIL_STACK_ERROR if(H5Dclose(d) < 0) FAIL_STACK_ERROR if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR diff --git a/test/enc_dec_plist.c b/test/enc_dec_plist.c index 2d0d732..4832767 100644 --- a/test/enc_dec_plist.c +++ b/test/enc_dec_plist.c @@ -18,6 +18,7 @@ */ #include "h5test.h" +#include "H5ACprivate.h" #include "H5Pprivate.h" static int @@ -381,6 +382,8 @@ main(void) FAIL_STACK_ERROR if((H5Pset_mdc_config(fapl, &my_cache_config)) < 0) FAIL_STACK_ERROR + if((H5Pset_core_write_tracking(fapl, TRUE, 1024 * 1024)) < 0) + FAIL_STACK_ERROR /* Test encoding & decoding property list */ if(test_encode_decode(fapl) < 0) diff --git a/test/gen_bogus.c b/test/gen_bogus.c index 7456ae6..7d8d073 100644 --- a/test/gen_bogus.c +++ b/test/gen_bogus.c @@ -20,7 +20,7 @@ * Purpose: This program is run to generate an HDF5 data file with several * datasets that have "bogus" messages in their object header. */ -
+ #include "H5private.h" #include "hdf5.h" #include "H5Oprivate.h" diff --git a/test/gen_plist.c b/test/gen_plist.c index b4da261..acc5f3e 100644 --- a/test/gen_plist.c +++ b/test/gen_plist.c @@ -327,6 +327,8 @@ main(void) assert(ret > 0); if((ret = H5Pset_mdc_config(fapl1, &my_cache_config)) < 0) assert(ret > 0); + if((ret = H5Pset_core_write_tracking(fapl1, TRUE, (size_t)(1024 * 1024))) < 0) + assert(ret > 0); if((ret = encode_plist(fapl1, little_endian, "testfiles/plist_files/fapl_le", "testfiles/plist_files/fapl_be")) < 0) assert(ret > 0); diff --git a/test/h5test.c b/test/h5test.c index 9fe05ae..769e03f 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -511,64 +511,71 @@ h5_fileaccess(void) /* First use the environment variable, then the constant */ val = HDgetenv("HDF5_DRIVER"); #ifdef HDF5_DRIVER - if (!val) val = HDF5_DRIVER; + if (!val) + val = HDF5_DRIVER; #endif - if ((fapl=H5Pcreate(H5P_FILE_ACCESS))<0) return -1; - if (!val || !*val) return fapl; /*use default*/ + 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; + /* 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; + /* Standard C fread() and fwrite() system calls */ + if (H5Pset_fapl_stdio(fapl)<0) return -1; } else if (!HDstrcmp(name, "core")) { - /* In-core temporary file with 1MB increment */ - if (H5Pset_fapl_core(fapl, (size_t)1, TRUE)<0) return -1; - } else if (!HDstrcmp(name, "split")) { - /* Split meta data and raw data each using default driver */ - if (H5Pset_fapl_split(fapl, + /* 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; + 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][1024]; - haddr_t memb_addr[H5FD_MEM_NTYPES]; + /* 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][1024]; + 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); - - 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; - sprintf(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; - } + HDmemset(memb_map, 0, sizeof memb_map); + HDmemset(memb_fapl, 0, sizeof memb_fapl); + HDmemset(memb_name, 0, sizeof memb_name); + HDmemset(memb_addr, 0, sizeof memb_addr); + + HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) { + memb_fapl[mt] = H5P_DEFAULT; + sprintf(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; + } } 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) + /* 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; @@ -578,20 +585,21 @@ h5_fileaccess(void) log_flags = (unsigned)HDstrtol(val, NULL, 0); if (H5Pset_fapl_log(fapl, NULL, log_flags, (size_t)0) < 0) - return -1; + 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; + /* 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) + /* use the latest format */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) return -1; } else { - /* Unknown driver */ - return -1; + /* Unknown driver */ + return -1; } return fapl; diff --git a/test/testfiles/plist_files/fapl_be b/test/testfiles/plist_files/fapl_be Binary files differindex 8fcefa2..0b050d0 100644 --- a/test/testfiles/plist_files/fapl_be +++ b/test/testfiles/plist_files/fapl_be diff --git a/test/testfiles/plist_files/fapl_le b/test/testfiles/plist_files/fapl_le Binary files differindex 8fcefa2..0b050d0 100644 --- a/test/testfiles/plist_files/fapl_le +++ b/test/testfiles/plist_files/fapl_le diff --git a/test/testfiles/plist_files/lapl_be b/test/testfiles/plist_files/lapl_be Binary files differindex 30f52a4..e58bfb4 100644 --- a/test/testfiles/plist_files/lapl_be +++ b/test/testfiles/plist_files/lapl_be diff --git a/test/testfiles/plist_files/lapl_le b/test/testfiles/plist_files/lapl_le Binary files differindex 30f52a4..e58bfb4 100644 --- a/test/testfiles/plist_files/lapl_le +++ b/test/testfiles/plist_files/lapl_le diff --git a/test/tmisc.c b/test/tmisc.c index 486bdba..f1e5daf 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -316,6 +316,15 @@ unsigned m13_rdata[MISC13_DIM1][MISC13_DIM2]; /* Data read from dataset /* Definitions for misc. test #30 */ #define MISC30_FILE "tmisc30.h5" +/* Definitions for misc. test #31 */ +#define MISC31_FILE "tmisc31.h5" +#define MISC31_DSETNAME "dset" +#define MISC31_ATTRNAME1 "attr1" +#define MISC31_ATTRNAME2 "attr2" +#define MISC31_GROUPNAME "group" +#define MISC31_PROPNAME "misc31_prop" +#define MISC31_DTYPENAME "dtype" + /**************************************************************** ** ** test_misc1(): test unlinking a dataset from a group and immediately @@ -5195,6 +5204,105 @@ test_misc30(void) VERIFY(file_size[0], file_size[1], "test_misc30"); } /* end test_misc30() */ + +/**************************************************************** +** +** test_misc31(): Test reentering library through deprecated +* routines that register an id after calling +* H5close(). +** +****************************************************************/ +static void +test_misc31(void) +{ + hid_t file_id; /* File id */ + hid_t space_id; /* Dataspace id */ + hid_t dset_id; /* Dataset id */ + hid_t attr_id; /* Attribute id */ + hid_t group_id; /* Group id */ + hid_t dtype_id; /* Datatype id */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(5, ("Deprecated routines initialize after H5close()\n")); + +#ifndef H5_NO_DEPRECATED_SYMBOLS + file_id = H5Fcreate(MISC31_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + CHECK(file_id, FAIL, "H5Fcreate"); + + /* Test dataset package */ + space_id = H5Screate(H5S_SCALAR); + CHECK(space_id, FAIL, "H5Screate"); + dset_id = H5Dcreate1(file_id, MISC31_DSETNAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dcreate1"); + ret = H5close(); + CHECK(ret, FAIL, "H5close"); + file_id = H5Fopen(MISC31_FILE, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(file_id, FAIL, "H5Fopen"); + dset_id = H5Dopen1(file_id, MISC31_DSETNAME); + CHECK(dset_id, FAIL, "H5Dopen1"); + + /* Test attribute package */ + space_id = H5Screate(H5S_SCALAR); + CHECK(space_id, FAIL, "H5Screate"); + attr_id = H5Acreate1(dset_id, MISC31_ATTRNAME1, H5T_NATIVE_INT, space_id, H5P_DEFAULT); + CHECK(attr_id, FAIL, "H5Acreate1"); + ret = H5close(); + CHECK(ret, FAIL, "H5close"); + file_id = H5Fopen(MISC31_FILE, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(file_id, FAIL, "H5Fopen"); + dset_id = H5Dopen1(file_id, MISC31_DSETNAME); + CHECK(dset_id, FAIL, "H5Dopen1"); + space_id = H5Screate(H5S_SCALAR); + CHECK(space_id, FAIL, "H5Screate"); + attr_id = H5Acreate1(dset_id, MISC31_ATTRNAME2, H5T_NATIVE_INT, space_id, H5P_DEFAULT); + CHECK(attr_id, FAIL, "H5Acreate1"); + + /* Test group package */ + group_id = H5Gcreate1(file_id, MISC31_GROUPNAME, 0); + CHECK(group_id, FAIL, "H5Gcreate1"); + ret = H5close(); + CHECK(ret, FAIL, "H5close"); + file_id = H5Fopen(MISC31_FILE, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(file_id, FAIL, "H5Fopen"); + group_id = H5Gopen1(file_id, MISC31_GROUPNAME); + CHECK(group_id, FAIL, "H5Gopen1"); + + /* Test property list package */ + ret = H5Pregister1(H5P_OBJECT_CREATE, MISC31_PROPNAME, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + CHECK(ret, FAIL, "H5Pregister1"); + ret = H5close(); + CHECK(ret, FAIL, "H5close"); + ret = H5Pregister1(H5P_OBJECT_CREATE, MISC31_PROPNAME, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + CHECK(ret, FAIL, "H5Pregister1"); + ret = H5close(); + CHECK(ret, FAIL, "H5close"); + + /* Test datatype package */ + file_id = H5Fopen(MISC31_FILE, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(file_id, FAIL, "H5Fopen"); + dtype_id = H5Tcopy(H5T_NATIVE_INT); + CHECK(dtype_id, FAIL, "H5Tcopy"); + ret = H5Tcommit1(file_id, MISC31_DTYPENAME, dtype_id); + CHECK(ret, FAIL, "H5Tcommit1"); + ret = H5close(); + CHECK(ret, FAIL, "H5close"); + file_id = H5Fopen(MISC31_FILE, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(file_id, FAIL, "H5Fopen"); + dtype_id = H5Topen1(file_id, MISC31_DTYPENAME); + CHECK(ret, FAIL, "H5Topen1"); + ret = H5Fclose(file_id); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Tclose(dtype_id); + CHECK(ret, FAIL, "H5Tclose"); + +#else /* H5_NO_DEPRECATED_SYMBOLS */ + /* Output message about test being skipped */ + MESSAGE(5, (" ...Skipped")); +#endif /* H5_NO_DEPRECATED_SYMBOLS */ +} /* end test_misc31() */ + + /**************************************************************** ** ** test_misc(): Main misc. test routine. @@ -5240,6 +5348,7 @@ test_misc(void) test_misc28(); /* Test that chunks are cached appropriately */ test_misc29(); /* Test that speculative metadata reads are handled correctly */ test_misc30(); /* Exercise local heap loading bug where free lists were getting dropped */ + test_misc31(); /* Test Reentering library through deprecated routines after H5close() */ } /* test_misc() */ @@ -5296,5 +5405,6 @@ cleanup_misc(void) HDremove(MISC28_FILE); HDremove(MISC29_COPY_FILE); HDremove(MISC30_FILE); + HDremove(MISC31_FILE); } diff --git a/test/tselect.c b/test/tselect.c index fed405c..d5a1f4c 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -292,11 +292,15 @@ test_select_hyper(hid_t xfer_plist) ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,xfer_plist,wbuf); CHECK(ret, FAIL, "H5Dwrite"); - /* Exercise check for NULL buffer and valid selection */ + /* Exercise checks for NULL buffer and valid selection */ H5E_BEGIN_TRY { ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,xfer_plist,NULL); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Dwrite"); + H5E_BEGIN_TRY { + ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,H5S_ALL,H5S_ALL,xfer_plist,NULL); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Dwrite"); /* Close memory dataspace */ ret = H5Sclose(sid2); @@ -326,11 +330,15 @@ test_select_hyper(hid_t xfer_plist) ret=H5Dread(dataset,H5T_NATIVE_UCHAR,sid2,sid1,xfer_plist,rbuf); CHECK(ret, FAIL, "H5Dread"); - /* Exercise check for NULL buffer and valid selection */ + /* Exercise checks for NULL buffer and valid selection */ H5E_BEGIN_TRY { ret=H5Dread(dataset,H5T_NATIVE_UCHAR,sid2,sid1,xfer_plist,NULL); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Dread"); + H5E_BEGIN_TRY { + ret=H5Dread(dataset,H5T_NATIVE_UCHAR,H5S_ALL,H5S_ALL,xfer_plist,NULL); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Dread"); /* Check that the values match with a dataset iterator */ tbuf=wbuf+(15*SPACE2_DIM2); @@ -28,6 +28,7 @@ #define FAMILY_SIZE2 (5*KB) #define MULTI_SIZE 128 #define CORE_INCREMENT (4*KB) +#define CORE_PAGE_SIZE (1024 * 1024) #define DSET1_NAME "dset1" #define DSET1_DIM1 1024 #define DSET1_DIM2 32 @@ -376,6 +377,8 @@ test_core(void) char filename[1024]; void *fhandle=NULL; hsize_t file_size; + hbool_t use_write_tracking; + size_t write_tracking_page_size; int *points = NULL, *check = NULL, *p1, *p2; hid_t dset1=-1, space1=-1; hsize_t dims1[2]; @@ -387,6 +390,8 @@ test_core(void) fapl = h5_fileaccess(); if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, TRUE) < 0) TEST_ERROR; + if(H5Pset_core_write_tracking(fapl, TRUE, CORE_PAGE_SIZE) < 0) + TEST_ERROR; h5_fixname(FILENAME[1], fapl, filename, sizeof filename); if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) @@ -400,6 +405,14 @@ test_core(void) if(H5FD_CORE != H5Pget_driver(access_fapl)) TEST_ERROR; + /* Check that the backing store write tracking info was saved */ + if(H5Pget_core_write_tracking(fapl, &use_write_tracking, &write_tracking_page_size) < 0) + TEST_ERROR; + if(TRUE != use_write_tracking) + TEST_ERROR; + if(CORE_PAGE_SIZE != write_tracking_page_size) + TEST_ERROR; + /* ...and close the property list */ if (H5Pclose(access_fapl) < 0) TEST_ERROR; |