diff --git a/configure.ac b/configure.ac index 025803bfd..726c0bda4 100644 --- a/configure.ac +++ b/configure.ac @@ -171,14 +171,6 @@ if test "x$enable_jna" = xyes ; then AC_DEFINE([JNA], [1], [if true, include jna bug workaround code]) fi -# Does the user want to run extra tests with valgrind? -AC_MSG_CHECKING([whether extra valgrind tests should be run]) -AC_ARG_ENABLE([valgrind-tests], - [AS_HELP_STRING([--enable-valgrind-tests], - [build with valgrind-tests (valgrind is required, static builds only)])]) -test "x$enable_valgrind_tests" = xyes || enable_valgrind_tests=no -AC_MSG_RESULT($enable_valgrind_tests) - # Does the user want to build netcdf-4? AC_MSG_CHECKING([whether we should build netCDF-4]) AC_ARG_ENABLE([netcdf-4], [AS_HELP_STRING([--disable-netcdf-4], @@ -669,14 +661,6 @@ AC_MSG_NOTICE([setting up libtool]) LT_PREREQ([2.2]) LT_INIT() -# Valgrind tests don't work with shared builds because of some libtool -# weirdness. -if test "x$enable_shared" = xyes; then - if test $enable_valgrind_tests = yes; then - AC_MSG_ERROR([No valgrind tests with shared libraries]) - fi -fi - AC_MSG_NOTICE([finding other utilities]) # Is m4 installed? If not, bail. @@ -1212,7 +1196,6 @@ AM_CONDITIONAL(USE_SZIP, [test "x$ac_cv_func_H5Z_SZIP" = xyes]) AM_CONDITIONAL(USE_PNETCDF_DIR, [test ! "x$PNETCDFDIR" = x]) AM_CONDITIONAL(USE_LOGGING, [test "x$enable_logging" = xyes]) AM_CONDITIONAL(CROSS_COMPILING, [test "x$cross_compiling" = xyes]) -AM_CONDITIONAL(USE_VALGRIND_TESTS, [test "x$enable_valgrind_tests" = xyes]) AM_CONDITIONAL(USE_NETCDF4, [test x$enable_netcdf_4 = xyes]) AM_CONDITIONAL(USE_HDF4, [test x$enable_hdf4 = xyes]) AM_CONDITIONAL(USE_HDF4_FILE_TESTS, [test x$enable_hdf4_file_tests = xyes]) diff --git a/examples/C/Makefile.am b/examples/C/Makefile.am index e39debb1f..77013f7c9 100644 --- a/examples/C/Makefile.am +++ b/examples/C/Makefile.am @@ -48,22 +48,10 @@ if USE_NETCDF4 TESTS += run_examples4.sh endif #USE_NETCDF4 -# This will run a bunch of the test programs with valgrind, the memory -# checking tool. (Valgrind must be present for this to work.) -if USE_VALGRIND_TESTS -TESTS += run_valgrind_tests.sh -endif # USE_VALGRIND_TESTS -if USE_NETCDF4 -if USE_VALGRIND_TESTS -TESTS += run_nc4_valgrind_tests.sh -endif # USE_VALGRIND_TESTS -endif # USE_NETCDF4 - # These files are created by the tests. CLEANFILES = *.nc -EXTRA_DIST = run_valgrind_tests.sh run_nc4_valgrind_tests.sh \ -CMakeLists.txt run_examples.sh run_examples4.sh +EXTRA_DIST = CMakeLists.txt run_examples.sh run_examples4.sh if ENABLE_FILTER_TESTING # => shared and netcdf-4 BUILT_SOURCES = findplugin.sh diff --git a/examples/C/run_nc4_valgrind_tests.sh b/examples/C/run_nc4_valgrind_tests.sh deleted file mode 100755 index 42f89773d..000000000 --- a/examples/C/run_nc4_valgrind_tests.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -# This shell runs the tests with valgrind, for netCDF-4. - -# $Id: run_valgrind_tests.sh,v 1.9 2010/01/26 20:24:18 ed Exp $ - -set -e -echo "" -echo "Testing netCDF-4 test programs with valgrind..." - -# These are my test programs. -list='simple_nc4_wr simple_nc4_rd simple_xy_nc4_wr '\ -'simple_xy_nc4_rd ' - -for tst in $list; do - echo "" - cmd1="valgrind -q --error-exitcode=2 --leak-check=full ./$tst" - echo "$cmd1:" - $cmd1 -done - -echo "SUCCESS!!!" - -exit 0 diff --git a/examples/C/run_valgrind_tests.sh b/examples/C/run_valgrind_tests.sh deleted file mode 100755 index 3b2b9cd3a..000000000 --- a/examples/C/run_valgrind_tests.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -# This shell runs the tests with valgrind. - -# $Id: run_valgrind_tests.sh,v 1.9 2010/01/26 20:24:18 ed Exp $ - -set -e -echo "" -echo "Testing programs with valgrind..." - -# These are my test programs. -list='simple_xy_wr simple_xy_rd sfc_pres_temp_wr '\ -'sfc_pres_temp_rd pres_temp_4D_wr pres_temp_4D_rd ' - -for tst in $list; do - echo "" - cmd1="valgrind -q --error-exitcode=2 --leak-check=full ./$tst" - echo "$cmd1:" - $cmd1 -done - -echo "SUCCESS!!!" - -exit 0 diff --git a/h5_test/Makefile.am b/h5_test/Makefile.am index 18e168b1f..f114d7ceb 100644 --- a/h5_test/Makefile.am +++ b/h5_test/Makefile.am @@ -38,17 +38,10 @@ check_PROGRAMS += tst_h_par TESTS += run_par_tests.sh endif -# This will run a bunch of the test programs with valgrind, the memory -# checking tool. (Valgrind must be present for this to work.) -if USE_VALGRIND_TESTS -TESTS += run_valgrind_tests.sh -endif # USE_VALGRIND_TESTS - # We must include these files in the distribution. -EXTRA_DIST = run_par_tests.sh run_valgrind_tests.sh \ -ref_tst_h_compounds.h5 ref_tst_h_compounds2.h5 run_par_tests.sh \ -run_valgrind_tests.sh ref_tst_compounds.nc h5_err_macros.h \ -CMakeLists.txt +EXTRA_DIST = run_par_tests.sh ref_tst_h_compounds.h5 \ +ref_tst_h_compounds2.h5 run_par_tests.sh ref_tst_compounds.nc \ +h5_err_macros.h CMakeLists.txt # Clean up test results. CLEANFILES = tst_h_*.h5 diff --git a/h5_test/run_valgrind_tests.sh b/h5_test/run_valgrind_tests.sh deleted file mode 100755 index 9fa2568e4..000000000 --- a/h5_test/run_valgrind_tests.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -if test "x$srcdir" = x ; then srcdir=`pwd`; fi -. ../test_common.sh - -# This shell runs the tests with valgrind. - -set -e -echo "" -echo "Testing programs with valgrind..." - -# These are my test programs. -list='tst_h_files tst_h_files2 tst_h_files4 tst_h_atts '\ -'tst_h_atts3 tst_h_atts4 tst_h_vars tst_h_vars2 tst_h_vars3 tst_h_grps '\ -'tst_h_compounds tst_h_compounds2 tst_h_wrt_cmp tst_h_rd_cmp tst_h_vl '\ -'tst_h_opaques tst_h_strings tst_h_strings1 tst_h_strings2 tst_h_ints '\ -'tst_h_dimscales tst_h_dimscales1 tst_h_dimscales2 tst_h_dimscales3 '\ -'tst_h_enums' - -for tst in $list; do - echo "" - cmd1="valgrind -q --error-exitcode=2 --leak-check=full ./$tst" - echo "$cmd1:" - $cmd1 -done - -echo "SUCCESS!!!" - -exit 0 diff --git a/include/onstack.h b/include/onstack.h index a85e00b70..29d84d8c4 100644 --- a/include/onstack.h +++ b/include/onstack.h @@ -37,7 +37,7 @@ # define alloca __builtin_alloca # endif #else -# if HAVE_ALLOCA_H +# ifdef HAVE_ALLOCA_H # include # elif defined(_AIX) # pragma alloca diff --git a/libdispatch/nclistmgr.c b/libdispatch/nclistmgr.c index 13679f0eb..5bb4fe756 100644 --- a/libdispatch/nclistmgr.c +++ b/libdispatch/nclistmgr.c @@ -88,6 +88,11 @@ find_in_NCList(int ext_ncid) unsigned int ncid = ((unsigned int)ext_ncid) >> ID_SHIFT; if(numfiles > 0 && nc_filelist != NULL && ncid < NCFILELISTLENGTH) f = nc_filelist[ncid]; + + /* for classic files, ext_ncid must be a multiple of (1<model == NC_FORMATX_NC3 && (ext_ncid % (1<