Skip to content

Commit 4ad4545

Browse files
authored
Merge pull request #2253 from DennisHeimbigner/daptestfixes.dmh
Clean up some ncdap tests.
2 parents e6853c2 + 0b60b72 commit 4ad4545

File tree

13 files changed

+23
-37
lines changed

13 files changed

+23
-37
lines changed

libdispatch/dinfermodel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ check_file_type(const char *path, int omode, int use_parallel,
11601160
if((status = openmagic(&magicinfo))) goto done;
11611161

11621162
/* Verify we have a large enough file */
1163-
if(magicinfo.filelen < (long long)MAGIC_NUMBER_LEN)
1163+
if(magicinfo.filelen < (unsigned long long)MAGIC_NUMBER_LEN)
11641164
{status = NC_ENOTNC; goto done;}
11651165
if((status = readmagic(&magicinfo,0L,magic)) != NC_NOERR) {
11661166
status = NC_ENOTNC;

nc_test4/tst_broken_files.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ main() {
2222
printf("\n*** Testing NetCDF-4 with truncated (broken) sample file.\n");
2323
{
2424
printf("*** testing via file on file-system ...\n");
25-
FILE *fp = fopen(FILE_NAME, "w");
25+
#if defined _WIN32 || defined __MINGW32__
26+
FILE *fp = fopen(FILE_NAME, "wb");
27+
#else
28+
FILE *fp = fopen(FILE_NAME, "w");
29+
#endif
2630
if(!fp) ERR;
2731
if(fwrite(TRUNCATED_FILE_CONTENT, sizeof(char), sizeof(TRUNCATED_FILE_CONTENT), fp) != sizeof(TRUNCATED_FILE_CONTENT)) ERR;
2832
fclose(fp);

ncdap_test/tst_filelists.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ kwcase.nc"
4040
# only to detect which are considered XFAIL tests.
4141
XFAILTESTS=
4242

43-
# For now, remove some tests from windows platform.
44-
#if test "x$platform" != xmingw ; then
45-
XFAILTESTS="$XFAILTESTS EOSDB OverideExample SimpleDrdsExample test.67 test.gr5 123bears.nc 123.nc bears.nc ber-2002-10-01 data.nc in1.nc in_2.nc in_no_three_double_dmn.nc test.nc text.nc test.22 test.23 test.gr1 in.nc ber-2002-10-01.nc kwcase.nc"
46-
#fi
43+
XFAILTESTS="$XFAILTESTS EOSDB OverideExample SimpleDrdsExample test.67 test.gr5 123bears.nc 123.nc bears.nc ber-2002-10-01 data.nc in1.nc in_2.nc in_no_three_double_dmn.nc test.nc text.nc test.22 test.23 test.gr1 in.nc ber-2002-10-01.nc kwcase.nc"
4744

4845
FILETESTS="${SYNTHETICDATA} ${SOURCEFILES}"
4946
#DDSTESTS intersect FILETESTS should be empty

ncdap_test/tst_ncdap3.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#!/bin/sh
22

3-
if test "x$SETX" = x1 ; then set -x ; fi
4-
53
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
64
. ../test_common.sh
5+
76
set -e
87

98
. ${srcdir}/tst_utils.sh

ncdap_test/tst_ncdap_shared.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ kwcase.nc"
4747
XFAILTESTS=""
4848

4949
# For now, remove some tests from windows platform.
50-
if [ `uname | cut -d "_" -f 1` = "MINGW32" ]; then
50+
if test "x$FP_ISMINGW" == xyes || test "x$FP_ISMSVC" == xyes ; then
5151
XFAILTESTS="$XFAILTESTS EOSDB OverideExample SimpleDrdsExample test.67 test.gr5 123bears.nc 123.nc bears.nc ber-2002-10-01 data.nc in1.nc in_2.nc in_no_three_double_dmn.nc test.nc text.nc test.22 test.23 test.gr1 in.nc ber-2002-10-01.nc kwcase.nc"
5252
fi
5353

ncdap_test/tst_nocache3.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ srcdir=`pwd`
1919
# Do a hack to remove e.g. c: for CYGWIN
2020
builddir=`pwd`/..
2121
# Hack for CYGWIN
22-
if [ `uname | cut -d "_" -f 1` = "MINGW32" ]; then
22+
if test "x$FP_ISMINGW" = yes ; then
2323
srcdir=`pwd | sed 's/\/c\//c:\//g'`
2424
builddir="$srcdir"/..
2525
fi

ncdap_test/tst_remote.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ fi
1717
PARAMS="[log]"
1818
#PARAMS="${PARAMS}[show=fetch]"
1919

20-
# Determine If we're on OSX or Linux
21-
22-
myplatform=`uname -a | cut -d" " -f 1`
23-
2420
#OCLOGFILE=/dev/null
2521
OCLOGFILE="" ; export OCLOGFILE
2622

@@ -147,8 +143,8 @@ REMOTETESTSCB="dods"
147143
# Known to fail
148144

149145
XFAILTESTS3=""
150-
# For now, remove some tests from windows platform.
151-
if [ `uname | cut -d "_" -f 1` = "MINGW32" ]; then
146+
# For now, remove some tests from mingw platform.
147+
if test "x$FP_ISMINGW" = xyes ; then
152148
XFAILTESTS3="$XFAILTESTS3 test.67"
153149
fi
154150

@@ -239,7 +235,7 @@ for t in ${TESTSET} ; do
239235
#index=`expr index "${t}" ";"`
240236

241237
#echo index: $index
242-
if [ "$myplatform" = "Darwin" ]; then
238+
if test "x$FP_ISOSX" = xyes ; then
243239
index=`echo "${t}" | sed -n "s/;.*//p" | wc -c`
244240
if (( $index == 0 )) ; then
245241
constrained=0

ncdap_test/tst_remote3.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/bin/bash
22

3-
if test "x$SETX" = x1 ; then set -x ; fi
4-
53
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
64
. ../test_common.sh
75

ncdap_test/tst_tds.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ srcdir=`pwd`
1919
# compute the build directory
2020
builddir=`pwd`/..
2121
# Hack for CYGWIN
22-
if [ `uname | cut -d "_" -f 1` = "MINGW32" ]; then
22+
if test "x$FP_ISMINGW" = xyes ; then
2323
srcdir=`pwd | sed 's/\/c\//c:\//g'`
2424
builddir="$srcdir"/..
2525
fi

ncdap_test/tst_urls.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ for x in ${REMOTETESTS} ; do
155155
if test "x$quiet" = "x0" ; then echo "*** Testing: ${name} ; url=$url" ; fi
156156
# determine if this is an xfailtest
157157
isxfail=0
158-
if test "x${XFAILTESTS}" != x ; then
159-
if IGNORE=`echo -n " ${XFAILTESTS} " | fgrep " ${name} "`; then isxfail=1; fi
160-
fi
158+
for xf in $XFAILTESTS ; do
159+
if test "x$xf" = "x${name}" ; then isxfail=1; fi
160+
done
161161
ok=1
162162
if ${NCDUMP} ${DUMPFLAGS} "${url}" | sed 's/\\r//g' > ${name}.dmp ; then ok=$ok; else ok=0; fi
163163
# compare with expected

0 commit comments

Comments
 (0)