diff --git a/libdap2/cache.c b/libdap2/cache.c index b058700580..88fc6221ea 100644 --- a/libdap2/cache.c +++ b/libdap2/cache.c @@ -151,8 +151,10 @@ nclog(NCLOGDBG,"prefetch: %s",var->ncfullname); newconstraint->selections = dceclonelist(urlconstraint->selections); for(i=0;iinvisible) continue; /* convert var to a projection */ ncstat = dapvar2projection(var,&varprojection); if(ncstat != NC_NOERR) {THROWCHK(ncstat); goto done;} diff --git a/ncdap_test/CMakeLists.txt b/ncdap_test/CMakeLists.txt index 3030f79f3e..4f10939956 100644 --- a/ncdap_test/CMakeLists.txt +++ b/ncdap_test/CMakeLists.txt @@ -36,6 +36,7 @@ IF(ENABLE_TESTS) IF(BUILD_UTILITIES) add_sh_test(ncdap tst_ber) add_sh_test(ncdap tst_remote3) + add_sh_test(ncdap tst_zero_len_var) # not yet add_sh_test(ncdap tst_hyrax) add_sh_test(ncdap tst_fillmismatch) IF(ENABLE_DAP_LONG_TESTS) diff --git a/ncdap_test/Makefile.am b/ncdap_test/Makefile.am index 1e38959b12..1fa5b50236 100644 --- a/ncdap_test/Makefile.am +++ b/ncdap_test/Makefile.am @@ -42,7 +42,7 @@ check_PROGRAMS += findtestserver findtestserver_SOURCES = findtestserver.c if BUILD_UTILITIES -TESTS += tst_ber.sh tst_remote3.sh tst_formatx.sh testurl.sh tst_fillmismatch.sh +TESTS += tst_ber.sh tst_remote3.sh tst_formatx.sh testurl.sh tst_fillmismatch.sh tst_zero_len_var.sh endif TESTS += test_partvar @@ -83,6 +83,7 @@ SUBDIRS = testdata3 expected3 expectremote3 EXTRA_DIST = tst_ncdap3.sh \ tst_remote3.sh \ tst_longremote3.sh \ + tst_zero_len_var.sh \ tst_filelists.sh tst_urls.sh tst_utils.sh \ t_dap.c CMakeLists.txt tst_formatx.sh testauth.sh testurl.sh \ t_ncf330.c tst_ber.sh tst_fillmismatch.sh \ diff --git a/ncdap_test/tst_zero_len_var.sh b/ncdap_test/tst_zero_len_var.sh new file mode 100755 index 0000000000..22ef9b7df8 --- /dev/null +++ b/ncdap_test/tst_zero_len_var.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +if test "x$SETX" != x ; then set -x; fi +set -e + +if test "x$srcdir" = x ; then srcdir=`pwd`; fi +. ../test_common.sh + +## +# If the bug referenced in https://github.com/Unidata/netcdf-c/issues/1300 +# reoccurs, then the following command would fail. + +${NCDUMP} http://test.opendap.org/opendap/data/nc/zero_length_array.nc > tst_zero_len_var.cdl + +RES=$? + +if [ $RES -ne 0 ]; then + echo "Error $RES" + exit $RES +fi + +rm -f tst_zero_len_var.cdl + +exit 0