This commit is contained in:
Dennis Heimbigner 2021-05-29 16:52:41 -06:00
parent c361c1056d
commit 2cb7f4768b
5 changed files with 68 additions and 14 deletions

View File

@ -26,7 +26,10 @@ IF(ENABLE_TESTS)
# keep it from being too bad.
# Binary Test Macro
add_sh_test(ncdap tst_ncdap3)
IF(BUILD_UTILITIES)
add_sh_test(ncdap tst_ncdap3)
add_sh_test(ncdap testpathcvt)
ENDIF()
IF(NOT MSVC)
add_bin_env_test(ncdap t_dap3a)

View File

@ -32,15 +32,17 @@ check_PROGRAMS += t_dap3a test_cvt3 test_vara
TESTS += t_dap3a test_cvt3 test_vara
if BUILD_UTILITIES
TESTS += tst_ncdap3.sh
TESTS += testpathcvt.sh
endif
# remote tests are optional
# because the server may be down or inaccessible
if ENABLE_DAP_REMOTE_TESTS
noinst_PROGRAMS = findtestserver pingurl
noinst_PROGRAMS = findtestserver pingurl pathcvt
findtestserver_SOURCES = findtestserver.c
pingurl_SOURCES = pingurl.c
pathcvt_SOURCES = pathcvt.c
endif
if ENABLE_DAP_REMOTE_TESTS
@ -90,10 +92,10 @@ EXTRA_DIST = tst_ncdap3.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 tst_encode.sh \
findtestserver.c.in
t_ncf330.c tst_ber.sh tst_fillmismatch.sh tst_encode.sh testpathcvt.sh \
findtestserver.c.in ref_pathcvt.txt
CLEANFILES = test_varm3 test_cvt3 file_results/* remote_results/* datadds* t_dap3a test_nstride_cached *.exe
CLEANFILES = test_varm3 test_cvt3 file_results/* remote_results/* datadds* t_dap3a test_nstride_cached *.exe tmp*.txt
# This should only be left behind if using parallel io
CLEANFILES += tmp_*

View File

@ -0,0 +1,40 @@
path: /xxx/a/b:
/xxx/a/b
/cygdrive/c/xxx/a/b
/c/xxx/a/b
c:\xxx\a\b
path: d:/x/y:
/d/x/y
/cygdrive/d/x/y
/d/x/y
d:\x\y
path: d:\x\y:
/d/x/y
/cygdrive/d/x/y
/d/x/y
d:\x\y
path: /cygdrive/d/x/y:
/d/x/y
/cygdrive/d/x/y
/d/x/y
d:\x\y
path: /d/x/y:
/d/x/y
/cygdrive/d/x/y
/d/x/y
d:\x\y
path: /cygdrive/d:
/d
/cygdrive/d
/d
d:
path: /d:
/d
/cygdrive/d
/d
d:
path: /cygdrive/d/git/netcdf-c/dap4_test/test_anon_dim.2.syn:
/d/git/netcdf-c/dap4_test/test_anon_dim.2.syn
/cygdrive/d/git/netcdf-c/dap4_test/test_anon_dim.2.syn
/d/git/netcdf-c/dap4_test/test_anon_dim.2.syn
d:\git\netcdf-c\dap4_test\test_anon_dim.2.syn

View File

@ -39,9 +39,14 @@ fi
LOCALRCFILES="$WD/.dodsrc $WD/.daprc $WD/.ncrc $WD/$NETRC $WD/$NETRCIMP"
HOMERCFILES="$HOME/.dodsrc $HOME/.daprc $HOME/.ncrc $HOME/$NETRC $HOME/$NETRCIMP"
NETRCFILE=$WD/$NETRC
DAPRCFILE=$WD/$RC
if test "x$FPISMSVC" = x1 ; then
LOCALRCFILES=`${execdir}/pathcvt -w "$LOCALRCFILES"`
HOMERCFILES=`${execdir}/pathcvt -w "$HOMERCFILES"`
NETRCFILE=`${execdir}/pathcvt -w "$NETRCFILE"`
DAPRCFILE=`${execdir}/pathcvt -w "$DAPRCFILE"`
fi
HOMENETRCFILE=$HOME/$NETRC
HOMEDAPRCFILE=$HOME/$RC

View File

@ -21,13 +21,17 @@ echo "path: $1:"
testcase1 "-w" "$1"
}
testcase "/xxx/a/b"
testcase "d:/x/y"
testcase "d:\\x\\y"
testcase "/cygdrive/d/x/y"
testcase "/d/x/y"
testcase "/cygdrive/d"
testcase "/d"
testcase "/cygdrive/d/git/netcdf-c/dap4_test/test_anon_dim.2.syn"
rm -f tmp_pathcvt.txt
testcase "/xxx/a/b" >> tmp_pathcvt.txt
testcase "d:/x/y" >> tmp_pathcvt.txt
testcase "d:\\x\\y" >> tmp_pathcvt.txt
testcase "/cygdrive/d/x/y" >> tmp_pathcvt.txt
testcase "/d/x/y" >> tmp_pathcvt.txt
testcase "/cygdrive/d" >> tmp_pathcvt.txt
testcase "/d" >> tmp_pathcvt.txt
testcase "/cygdrive/d/git/netcdf-c/dap4_test/test_anon_dim.2.syn" >> tmp_pathcvt.txt
diff -w ${srcdir}/ref_pathcvt.txt ./tmp_pathcvt.txt
exit 0