From c2e60909e35d988e86d78b7c8bfc0d2d51c4e75f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 22 Nov 2016 15:04:26 -0600 Subject: Add test to memcheck ignore and increase cache test timeout --- config/cmake/CTestCustom.cmake | 1 + test/CMakeTests.cmake | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 481873e..f9431e7 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -211,6 +211,7 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5REPACK_VERIFY_LAYOUT_ALL-layout_long_switches #uses grepTest.cmake H5REPACK_VERIFY_LAYOUT_ALL-layout_short_switches #uses grepTest.cmake H5REPACK-plugin + H5REPACK_CMP-plugin_zero ######### tools/h5stat ######### H5STAT-clearall-objects ######### tools/misc ######### diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index f4b37f3..5cca2d2 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -581,7 +581,7 @@ endforeach (test ${H5TEST_TESTS}) 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-big PROPERTIES TIMEOUT 3600) set_tests_properties (H5TEST-btree2 PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-objcopy PROPERTIES TIMEOUT 2400) @@ -612,7 +612,7 @@ if (BUILD_SHARED_LIBS) 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-big PROPERTIES TIMEOUT 3600) set_tests_properties (H5TEST-shared-btree2 PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-shared-objcopy PROPERTIES TIMEOUT 2400) endif (BUILD_SHARED_LIBS) @@ -638,7 +638,7 @@ if (NOT CYGWIN) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) - set_tests_properties (H5TEST-cache PROPERTIES TIMEOUT 2400) + set_tests_properties (H5TEST-cache PROPERTIES TIMEOUT 3600) endif (NOT CYGWIN) #-- Adding test for err_compat @@ -745,7 +745,7 @@ if (BUILD_SHARED_LIBS) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - set_tests_properties (H5TEST-shared-cache PROPERTIES TIMEOUT 2400) + set_tests_properties (H5TEST-shared-cache PROPERTIES TIMEOUT 3600) endif (NOT CYGWIN) #-- Adding test for err_compat @@ -1072,7 +1072,7 @@ if (HDF5_TEST_VFD) set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES TIMEOUT 10) set_tests_properties (VFD-${vfdname}-istore PROPERTIES TIMEOUT 1800) if (NOT CYGWIN) - set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT 1800) + set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT 3600) endif (NOT CYGWIN) if (BUILD_SHARED_LIBS) set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES DEPENDS VFD-${vfdname}-flush1-shared) @@ -1080,7 +1080,7 @@ if (HDF5_TEST_VFD) set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES TIMEOUT 10) set_tests_properties (VFD-${vfdname}-istore-shared PROPERTIES TIMEOUT 1800) if (NOT CYGWIN) - set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 1800) + set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 3600) endif (NOT CYGWIN) endif (BUILD_SHARED_LIBS) if (HDF5_TEST_FHEAP_VFD) -- cgit v0.12 From e2863ca880a6983558d3ba3e5219164a57287f04 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 22 Nov 2016 20:55:03 -0500 Subject: Fixed a few memory problems in test/cache_logging.c and test/h5test.c (which show up in test/vfd.c). --- test/cache_logging.c | 1 + test/h5test.c | 33 ++++++++++++++++++++++----------- test/vfd.c | 2 +- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/test/cache_logging.c b/test/cache_logging.c index a5e399c..9190a8a 100644 --- a/test/cache_logging.c +++ b/test/cache_logging.c @@ -132,6 +132,7 @@ test_logging_api(void) TEST_ERROR; /* Clean up */ + HDfree(location); if(H5Fclose(fid) < 0) TEST_ERROR; diff --git a/test/h5test.c b/test/h5test.c index c126da8..f85e96c 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -1584,32 +1584,43 @@ h5_make_local_copy(const char *origfilename, const char *local_copy_name) { int fd_old = (-1), fd_new = (-1); /* File descriptors for copying data */ ssize_t nread; /* Number of bytes read in */ - void *buf; /* Buffer for copying data */ - const char *filename = H5_get_srcdir_filename(origfilename);; /* Get the test file name to copy */ + void *buf = NULL; /* Buffer for copying data */ + const char *filename = H5_get_srcdir_filename(origfilename); /* Get the test file name to copy */ /* Allocate copy buffer */ - if(NULL == (buf = HDmalloc(READ_BUF_SIZE))) - return -1; + if(NULL == (buf = HDcalloc((size_t)1, (size_t)READ_BUF_SIZE))) + goto error; /* Copy old file into temporary file */ if((fd_old = HDopen(filename, O_RDONLY, 0666)) < 0) - return -1; + goto error; if((fd_new = HDopen(local_copy_name, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0) - return -1; + goto error; /* Copy data */ while((nread = HDread(fd_old, buf, (size_t)READ_BUF_SIZE)) > 0) if(HDwrite(fd_new, buf, (size_t)nread) < 0) - return -1; + goto error; + /* Close files */ + if(HDclose(fd_old) < 0) + goto error; + if(HDclose(fd_new) < 0) + goto error; + /* Release memory */ HDfree(buf); - /* Close files */ - if(HDclose(fd_old) < 0) return -1; - if(HDclose(fd_new) < 0) return -1; - return 0; + +error: + /* ignore return values since we're already noted the problem */ + if(fd_old > 0) + HDclose(fd_old); + if(fd_new > 0) + HDclose(fd_new); + HDfree(buf); + return -1; } /* end h5_make_local_copy() */ diff --git a/test/vfd.c b/test/vfd.c index c19e0d0..a215264 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -997,7 +997,7 @@ test_family_compat(void) counter++; HDsnprintf(newname_individual, sizeof(newname_individual), newname, counter); HDsnprintf(pathname_individual, sizeof(pathname_individual), pathname, counter); - } + } /* end while */ /* Make sure we can open the file. Use the read and write mode to flush the * superblock. */ -- cgit v0.12