Merge branch 'master' into nc_open_mem_fix

This commit is contained in:
Ward Fisher 2017-05-04 13:51:05 -06:00 committed by GitHub
commit 756dca55ac
8 changed files with 8583 additions and 7 deletions

View File

@ -7,10 +7,11 @@ This file contains a high-level description of this package's evolution. Release
## 4.4.2 - TBD
* [Bug Fix] Corrected an issue with diskless file access, see [Pull Request #400](https://github.com/Unidata/netcdf-c/issues/400) and [Pull Request #403](https://github.com/Unidata/netcdf-c/issues/403) for more information.
* [Enhancement] DAP4 is now included. Since dap2 is the default for urls, dap4 must be specified by
(1) using "dap4:" as the url protocol, or
(2) appending "#protocol=dap4" to the end of the url, or
(3) appending "#dap4" to the end of the url
(3) appending "#dap4" to the end of the url
Note that dap4 is enabled by default but remote-testing is
disbled until the testserver situation is resolved.
* [Enhancement] The remote testing server can now be specified with the '--with-testserver" option to ./configure.

View File

@ -385,6 +385,10 @@ fprintf(stderr,"memio_open: initial memory: %lu/%lu\n",(unsigned long)memio->mem
/* Use half the filesize as the blocksize ; why? */
sizehint = filesize/2;
/* sizehint must be multiple of 8 */
sizehint = (sizehint / 8) * 8;
if(sizehint < 8) sizehint = 8;
fd = nc__pseudofd();
*((int* )&nciop->fd) = fd;

View File

@ -373,6 +373,10 @@ fprintf(stderr,"mmapio_open: initial memory: %lu/%lu\n",(unsigned long)mmapio->m
/* Use half the filesize as the blocksize */
sizehint = filesize/2;
/* sizehint must be multiple of 8 */
sizehint = (sizehint / 8) * 8;
if(sizehint < 8) sizehint = 8;
fd = nc__pseudofd();
*((int* )&nciop->fd) = fd;

View File

@ -59,7 +59,7 @@ IF(LARGE_FILE_TESTS)
ENDIF()
IF(BUILD_DISKLESS)
SET(TESTFILES ${TESTFILES} tst_diskless tst_diskless3 tst_diskless4)
SET(TESTFILES ${TESTFILES} tst_diskless tst_diskless3 tst_diskless4 tst_diskless5)
IF(USE_NETCDF4)
SET(TESTFILES ${TESTFILES} tst_diskless2)
ENDIF()
@ -87,6 +87,7 @@ IF(BUILD_UTILITIES)
IF(LARGE_FILE_TESTS)
add_sh_test(nc_test run_diskless2)
ENDIF(LARGE_FILE_TESTS)
add_sh_test(nc_test run_diskless5)
ENDIF(BUILD_DISKLESS)
ENDIF(BUILD_UTILITIES)
@ -102,5 +103,5 @@ ENDIF()
## Specify files to be distributed by 'make dist'
FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.c ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.sh)
SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am)
SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} test_get.m4 test_put.m4 test_read.m4 test_write.m4 ref_tst_diskless2.cdl)
SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} test_get.m4 test_put.m4 test_read.m4 test_write.m4 ref_tst_diskless2.cdl tst_diskless5.cdl)
ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")

View File

@ -59,7 +59,7 @@ check_PROGRAMS += $(TESTPROGRAMS)
# Build Diskless test helpers
if BUILD_DISKLESS
check_PROGRAMS += tst_diskless tst_diskless3 tst_diskless4
check_PROGRAMS += tst_diskless tst_diskless3 tst_diskless4 tst_diskless5
if USE_NETCDF4
check_PROGRAMS += tst_diskless2
endif
@ -69,7 +69,7 @@ TESTS = $(TESTPROGRAMS)
if BUILD_UTILITIES
if BUILD_DISKLESS
TESTS += run_diskless.sh
TESTS += run_diskless.sh run_diskless5.sh
if BUILD_MMAP
TESTS += run_mmap.sh
endif
@ -97,11 +97,12 @@ endif # USE_VALGRIND_TESTS
# Distribute the .c files so that m4 isn't required on the users
# machine.
EXTRA_DIST = test_get.m4 test_put.m4 run_valgrind_tests.sh \
run_diskless.sh run_diskless2.sh run_mmap.sh run_pnetcdf_test.sh \
run_diskless.sh run_diskless2.sh run_diskless5.sh \
run_mmap.sh run_pnetcdf_test.sh \
test_read.m4 test_write.m4
# ref_tst_diskless2.cdl is for diff comparison and to produce tst_diskless2.c
EXTRA_DIST += ref_tst_diskless2.cdl CMakeLists.txt
EXTRA_DIST += ref_tst_diskless2.cdl tst_diskless5.cdl CMakeLists.txt
# Only clean these on maintainer-clean, because they require m4 to
# regenerate.

23
nc_test/run_diskless5.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/sh
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh
set -e
#Constants
CDL5=tst_diskless5.cdl
FILE5=tst_diskless5.nc
echo ""
rm -f $FILE5
# Generate FILE5
${NCGEN} -3 -lb -o ${FILE5} ${srcdir}/${CDL5}
echo ""
${execdir}/tst_diskless5
# cleanup
rm -f $FILE5
exit

4336
nc_test/tst_diskless5.c Normal file

File diff suppressed because it is too large Load Diff

4206
nc_test/tst_diskless5.cdl Normal file

File diff suppressed because it is too large Load Diff