silence warnings from Travis CI

This commit is contained in:
Wei-keng Liao 2017-03-11 12:51:04 -06:00
parent af258dcec9
commit 01cf5f4339
4 changed files with 41 additions and 26 deletions

View File

@ -10,7 +10,7 @@ dnl
* Copyright (C) 2003, Northwestern University and Argonne National Laboratory
* See COPYRIGHT notice in top-level directory.
*/
/* $Id: test_get.m4 2630 2016-11-17 06:35:10Z wkliao $ */
/* $Id: test_get.m4 2672 2016-12-03 19:23:53Z wkliao $ */
dnl
dnl The command-line m4 macro "PNETCDF" is to differentiate PnetCDF and netCDF
@ -1228,7 +1228,7 @@ int
TestFunc(att)_$1(AttVarArgs)
{
int i, j, err, ncid, cdf_format;
IntType k;
IntType k, ndx[1];
int allInExtRange;
int allInIntRange;
int canConvert; /* Both text or both numeric */
@ -1276,7 +1276,8 @@ ifdef(`PNETCDF',,``#'endif')
allInExtRange = allInIntRange = 1;
for (k = 0; k < ATT_LEN(i,j); k++) {
expect[k] = hash4(cdf_format, ATT_TYPE(i,j), -1, &k, NCT_ITYPE($1));
ndx[0] = k;
expect[k] = hash4(cdf_format, ATT_TYPE(i,j), -1, ndx, NCT_ITYPE($1));
if (inRange3(cdf_format, expect[k],ATT_TYPE(i,j),NCT_ITYPE($1))) {
/* netCDF specification make a special case for type
* conversion between uchar and scahr: do not check for

View File

@ -10,7 +10,7 @@ dnl
* Copyright (C) 2003, Northwestern University and Argonne National Laboratory
* See COPYRIGHT notice in top-level directory.
*/
/* $Id: test_put.m4 2655 2016-11-25 21:03:48Z wkliao $ */
/* $Id: test_put.m4 2672 2016-12-03 19:23:53Z wkliao $ */
dnl
dnl The command-line m4 macro "PNETCDF" is to differentiate PnetCDF and netCDF
@ -267,7 +267,7 @@ check_atts_$1(int ncid, int numGatts, int numVars)
int i, j, cdf_format, err;
int canConvert; /* Both text or both numeric */
int nok = 0; /* count of valid comparisons */
IntType k, length;
IntType k, length, ndx[1];
nc_type datatype;
IntType nInExtRange; /* number values within external range */
IntType nInIntRange; /* number values within internal range */
@ -293,7 +293,8 @@ check_atts_$1(int ncid, int numGatts, int numVars)
assert(length <= MAX_NELS);
nInIntRange = nInExtRange = 0;
for (k = 0; k < length; k++) {
expect[k] = hash4(cdf_format, datatype, -1, &k, NCT_ITYPE($1));
ndx[0] = k;
expect[k] = hash4(cdf_format, datatype, -1, ndx, NCT_ITYPE($1));
if (inRange3(cdf_format, expect[k], datatype, NCT_ITYPE($1))) {
++nInExtRange;
if (CheckRange($1, expect[k]))
@ -1381,7 +1382,7 @@ int
TestFunc(att)_text(AttVarArgs)
{
int i, j, err, ncid, nok=0;
IntType k;
IntType k, ndx[1];
text value[MAX_NELS];
err = FileCreate(scratch, NC_NOCLOBBER);
@ -1424,7 +1425,8 @@ TestFunc(att)_text(AttVarArgs)
ELSE_NOK
for (k = 0; k < ATT_LEN(i,j); k++) {
double dtmp = hash(ATT_TYPE(i,j), -1, &k);
ndx[0] = k;
double dtmp = hash(ATT_TYPE(i,j), -1, ndx);
value[k] = (text)dtmp;
}
err = PutAtt(text)(ncid, i, ATT_NAME(i,j), ATT_LEN(i,j), value);
@ -1456,7 +1458,7 @@ TestFunc(att)_$1(AttVarArgs)
{
int i, j, err, ncid, cdf_format, nok=0;
int allInExtRange; /* all values within external range? */
IntType k;
IntType k, ndx[1];
$1 value[MAX_NELS];
err = FileCreate(scratch, NC_NOCLOBBER);
@ -1506,7 +1508,8 @@ TestFunc(att)_$1(AttVarArgs)
ELSE_NOK
for (allInExtRange = 1, k = 0; k < ATT_LEN(i,j); k++) {
value[k] = hash_$1(cdf_format,ATT_TYPE(i,j), -1, &k, NCT_ITYPE($1));
ndx[0] = k;
value[k] = hash_$1(cdf_format,ATT_TYPE(i,j), -1, ndx, NCT_ITYPE($1));
IfCheckTextChar($1, ATT_TYPE(i,j))
allInExtRange &= inRange3(cdf_format, (double)value[k], ATT_TYPE(i,j), NCT_ITYPE($1));
}

View File

@ -10,7 +10,7 @@ dnl
* Copyright (C) 2003, Northwestern University and Argonne National Laboratory
* See COPYRIGHT notice in top-level directory.
*/
/* $Id: test_read.m4 2640 2016-11-18 21:08:08Z wkliao $ */
/* $Id: test_read.m4 2861 2017-02-09 19:38:02Z wkliao $ */
dnl
dnl The command-line m4 macro "PNETCDF" is to differentiate PnetCDF and netCDF
@ -142,17 +142,24 @@ ifdef(`PNETCDF', ``#'if 1', ``#'if 0')
/* Try to open a nonexistent file */
err = FileOpen("tooth-fairy.nc", NC_NOWRITE, &ncid); /* should fail */
/* on some systems, opening an nonexisting file will actually create the
* file. In this case, we print the error messages on screen and move on
* to the next test, instead of aborting the entire test.
/* on some systems (such as Lustre), opening an nonexisting file will
* actually create the file. In this case, we print the error messages on
* screen and move on to the next test, instead of aborting the entire test.
* The created file will be of zero-length and PnetCDF should complain it
* is not an NC file, i.e. NC_ENOTNC.
*/
IF (err == NC_NOERR)
IF (err == NC_NOERR) {
error("opening a nonexistent file expects to fail, but got NC_NOERR\n");
}
ifdef(`PNETCDF',
`else IF (err != NC_ENOENT && err != NC_EFILE)
`else IF (err == NC_ENOTNC) {
error("opening a nonexistent file actually creates the file, indicating an MPI-IO internal error\n");
}
else IF (err != NC_ENOENT && err != NC_EFILE) {
/* older version of OpenMPI and MPICH may return MPI_ERR_IO instead of
* MPI_ERR_NO_SUCH_FILE */
error("expecting NC_ENOENT or NC_EFILE but got %s", nc_err_code_name(err));
error("expecting NC_ENOENT or NC_EFILE but got %s, indicating an MPI-IO internal error", nc_err_code_name(err));
}
else {
nok++;
}', `
@ -1735,7 +1742,7 @@ TestFunc(get_att)(AttVarArgs)
int ncid;
int i;
int j;
IntType k;
IntType k, ndx[1];
int err;
double buf[MAX_NELS]; /* (void *) buffer */
char *p; /* (void *) pointer */
@ -1767,7 +1774,8 @@ TestFunc(get_att)(AttVarArgs)
} else {
nok++;
for (k = 0; k < ATT_LEN(i,j); k++) {
expect = hash(ATT_TYPE(i,j), -1, &k);
ndx[0] = k;
expect = hash(ATT_TYPE(i,j), -1, ndx);
p = (char *) buf;
p += k * (IntType)nctypelen(ATT_TYPE(i,j));
err = nc2dbl( ATT_TYPE(i,j), p, &got );

View File

@ -10,7 +10,7 @@ dnl
* Copyright (C) 2003, Northwestern University and Argonne National Laboratory
* See COPYRIGHT notice in top-level directory.
*/
/* $Id: test_write.m4 2655 2016-11-25 21:03:48Z wkliao $ */
/* $Id: test_write.m4 2687 2016-12-08 18:32:13Z wkliao $ */
dnl
dnl The command-line m4 macro "PNETCDF" is to differentiate PnetCDF and netCDF
@ -1650,7 +1650,7 @@ TestFunc(put_att)(AttVarArgs)
int varid;
int i;
int j;
IntType k;
IntType k, ndx[1];
int err;
double buf[MAX_NELS]; /* (void *) buffer */
char *p; /* (void *) pointer */
@ -1691,7 +1691,8 @@ TestFunc(put_att)(AttVarArgs)
ELSE_NOK
p = (char *) buf;
for (k=0; k<length; k++) {
value = hash(datatype, -1, &k);
ndx[0] = k;
value = hash(datatype, -1, ndx);
if (!inRange(value, datatype))
value = 0;
err = dbl2nc(value, datatype, p);
@ -1783,7 +1784,7 @@ TestFunc(copy_att)(AttVarArgs)
IF (err != NC_NOERR)
error("copy_att: %s", APIFunc(strerror)(err));
ELSE_NOK
err = APIFunc(copy_att)(ncid_in, varid, name, ncid_out, varid);
err = APIFunc(copy_att)(ncid_out, varid, name, ncid_out, varid);
IF (err != NC_NOERR)
error("source = target: %s", APIFunc(strerror)(err));
ELSE_NOK
@ -1888,7 +1889,7 @@ TestFunc(rename_att)(AttVarArgs)
int err;
int i;
int j;
IntType k;
IntType k, ndx[1];
int attnum;
char *attname;
char name[NC_MAX_NAME];
@ -1975,7 +1976,8 @@ TestFunc(rename_att)(AttVarArgs)
IF (err != NC_NOERR)
error("get_att_text: %s", APIFunc(strerror)(err));
for (k = 0; k < attlength; k++) {
expect = hash(datatype, -1, &k);
ndx[0] = k;
expect = hash(datatype, -1, ndx);
IF (text[k] != (char)expect)
error("get_att_text: unexpected value");
}
@ -1984,7 +1986,8 @@ TestFunc(rename_att)(AttVarArgs)
IF (err != NC_NOERR)
error("get_att_double: %s", APIFunc(strerror)(err));
for (k = 0; k < attlength; k++) {
expect = hash(datatype, -1, &k);
ndx[0] = k;
expect = hash(datatype, -1, ndx);
if (inRange(expect, datatype)) {
IF (!equal(value[k],expect,datatype,NCT_DOUBLE))
error("get_att_double: unexpected value");