undid unneeded nc_test changes

This commit is contained in:
Ed Hartnett 2018-08-13 09:15:50 -06:00
parent b29cc1b94f
commit 8b26c83379
4 changed files with 13 additions and 7 deletions

View File

@ -97,14 +97,16 @@ NC_get_vara(int ncid, int varid,
void *value, nc_type memtype)
{
NC* ncp;
int ndims;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
if(edges == NULL) {
size_t shape[NC_MAX_VAR_DIMS];
int ndims;
if(edges == NULL || start == NULL) {
stat = nc_inq_varndims(ncid, varid, &ndims);
if(stat != NC_NOERR) return stat;
}
if(start == NULL && ndims > 0) return NC_EINVALCOORDS;
if(edges == NULL) {
size_t shape[NC_MAX_VAR_DIMS];
stat = NC_getshape(ncid,varid,ndims,shape);
if(stat != NC_NOERR) return stat;
stat = ncp->dispatch->get_vara(ncid,varid,start,shape,value,memtype);
@ -218,6 +220,10 @@ NCDEFAULT_get_vars(int ncid, int varid, const size_t * start,
status = nc_inq_varndims(ncid, varid, &rank);
if(status != NC_NOERR) return status;
/* Start array is always required for non-scalar vars. */
if(rank > 0 && start == NULL)
return NC_EINVALCOORDS;
/* Get variable dimension sizes */
isrecvar = NC_is_recvar(ncid,varid,&numrecs);
NC_getshape(ncid,varid,rank,varshape);

View File

@ -198,7 +198,7 @@ NCDEFAULT_put_vars(int ncid, int varid, const size_t * start,
if(status != NC_NOERR) return status;
/* Start array is always required for non-scalar vars. */
if (rank > 0 && !start)
if(rank > 0 && start == NULL)
return NC_EINVALCOORDS;
/* Get variable dimension sizes */

View File

@ -912,7 +912,7 @@ TestFunc(vars)_$1(VarArgs)
ELSE_NOK
/* check if can detect a bad variable ID */
err = PutVars($1)(ncid, BAD_VARID, start, NULL, NULL, NULL);
err = PutVars($1)(ncid, BAD_VARID, NULL, NULL, NULL, NULL);
IF (err != NC_ENOTVAR)
EXPECT_ERR(NC_ENOTVAR, err)
ELSE_NOK

View File

@ -1160,7 +1160,7 @@ TestFunc(put_vars)(VarArgs)
ELSE_NOK
/* check if can detect a bad variable ID */
err = PutVars(ncid, BAD_VARID, start, NULL, NULL, NULL, 1, MPI_DATATYPE_NULL);
err = PutVars(ncid, BAD_VARID, NULL, NULL, NULL, NULL, 1, MPI_DATATYPE_NULL);
IF (err != NC_ENOTVAR)
EXPECT_ERR(NC_ENOTVAR, err)
ELSE_NOK