mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
undid unneeded nc_test changes
This commit is contained in:
parent
b29cc1b94f
commit
8b26c83379
@ -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);
|
||||
|
@ -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 */
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user