Skip to content

Commit

Permalink
test1
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisHeimbigner committed Jul 31, 2023
1 parent 6e1895f commit f791b1d
Show file tree
Hide file tree
Showing 25 changed files with 64 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
name: Run macOS-based netCDF Tests


on: [pull_request,workflow_dispatch]
on: [push,pull_request,workflow_dispatch]

jobs:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

name: Run S3 netCDF Tests (under Ubuntu Linux)

on: [workflow_dispatch]
on: [push,workflow_dispatch]

jobs:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

name: Run Ubuntu/Linux netCDF Tests

on: [pull_request, workflow_dispatch]
on: [push,pull_request, workflow_dispatch]

jobs:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_win_cygwin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Run Cygwin-based tests

on: [pull_request,workflow_dispatch]
on: [push,pull_request,workflow_dispatch]

env:
SHELLOPTS: igncr
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_win_mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: Run MSYS2, MinGW64-based Tests
env:
CPPFLAGS: "-D_BSD_SOURCE"

on: [pull_request,workflow_dispatch]
on: [push,pull_request,workflow_dispatch]

jobs:

Expand Down
3 changes: 2 additions & 1 deletion include/netcdf.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ extern "C" {
* the same type as the variable and this reserved name. The value you
* give the attribute will be used as the fill value for that
* variable. */
#define _FillValue "_FillValue"
#define NC_FillValue "_FillValue"
#define _FillValue "_FillValue" /* deprecated because it is a technically unacceptable C identifier */
#define NC_FILL 0 /**< Argument to nc_set_fill() to clear NC_NOFILL */
#define NC_NOFILL 0x100 /**< Argument to nc_set_fill() to turn off filling of data. */

Expand Down
2 changes: 1 addition & 1 deletion libdispatch/dattinq.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ nc_inq_att(int ncid, int varid, const char *name, nc_type *xtypep,
if (nc_def_var(ncid, VAR_NAME, NC_BYTE, NUM_DIMS, dimids, &varid)) ERR;
for (a = 0; a < NUM_LEADERS; a++)
if (nc_put_att_short(ncid, varid, leader[a], NC_SHORT, 1, &hair_length[a])) ERR;
if (nc_put_att_schar(ncid, varid, _FillValue, NC_BYTE, 1, &fill_value)) ERR;
if (nc_put_att_schar(ncid, varid, NC_FillValue, NC_BYTE, 1, &fill_value)) ERR;
if (nc_close(ncid)) ERR;
if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
Expand Down
6 changes: 3 additions & 3 deletions libhdf5/hdf5var.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,17 +672,17 @@ nc_def_var_extra(int ncid, int varid, int *shuffle, int *unused1,
var->hdr.name));

/* If there's a _FillValue attribute, delete it. */
retval = NC4_HDF5_del_att(ncid, varid, _FillValue);
retval = NC4_HDF5_del_att(ncid, varid, NC_FillValue);
if (retval && retval != NC_ENOTATT)
return retval;

/* Create a _FillValue attribute; will also fill in var->fill_value */
if ((retval = nc_put_att(ncid, varid, _FillValue, var->type_info->hdr.id,
if ((retval = nc_put_att(ncid, varid, NC_FillValue, var->type_info->hdr.id,
1, fill_value)))
return retval;
} else if (var->fill_value && no_fill && (*no_fill)) { /* Turning off fill value? */
/* If there's a _FillValue attribute, delete it. */
retval = NC4_HDF5_del_att(ncid, varid, _FillValue);
retval = NC4_HDF5_del_att(ncid, varid, NC_FillValue);
if (retval && retval != NC_ENOTATT) return retval;
if((retval = NC_reclaim_data_all(h5->controller,var->type_info->hdr.id,var->fill_value,1))) return retval;
var->fill_value = NULL;
Expand Down
6 changes: 3 additions & 3 deletions libnczarr/zattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ ncz_put_att(NC_GRP_INFO_T* grp, int varid, const char *name, nc_type file_type,
* copy the value to the fill_value pointer of the NC_VAR_INFO_T
* struct for this var. (But ignore a global _FillValue
* attribute). Also kill the cache fillchunk as no longer valid */
if (!strcmp(att->hdr.name, _FillValue) && varid != NC_GLOBAL)
if (!strcmp(att->hdr.name, NC_FillValue) && varid != NC_GLOBAL)
{
/* Fill value must have exactly one value */
if (len != 1)
Expand Down Expand Up @@ -991,12 +991,12 @@ ncz_create_fillvalue(NC_VAR_INFO_T* var)
/* Make sure _FillValue does not exist */
for(i=0;i<ncindexsize(var->att);i++) {
fv = (NC_ATT_INFO_T*)ncindexith(var->att,i);
if(strcmp(fv->hdr.name,_FillValue)==0) break;
if(strcmp(fv->hdr.name,NC_FillValue)==0) break;
fv = NULL;
}
if(fv == NULL) {
/* Create it */
if((stat = ncz_makeattr((NC_OBJ*)var,var->att,_FillValue,var->type_info->hdr.id,1,var->fill_value,&fv)))
if((stat = ncz_makeattr((NC_OBJ*)var,var->att,NC_FillValue,var->type_info->hdr.id,1,var->fill_value,&fv)))
goto done;
}
}
Expand Down
6 changes: 3 additions & 3 deletions libnczarr/zvar.c
Original file line number Diff line number Diff line change
Expand Up @@ -731,19 +731,19 @@ ncz_def_var_extra(int ncid, int varid, int *shuffle, int *unused1,
var->hdr.name));

/* If there's a _FillValue attribute, delete it. */
retval = NCZ_del_att(ncid, varid, _FillValue);
retval = NCZ_del_att(ncid, varid, NC_FillValue);
if (retval && retval != NC_ENOTATT)
goto done;

/* Create a _FillValue attribute; will also fill in var->fill_value */
if ((retval = nc_put_att(ncid, varid, _FillValue, var->type_info->hdr.id,
if ((retval = nc_put_att(ncid, varid, NC_FillValue, var->type_info->hdr.id,
1, fill_value)))
goto done;
/* Reclaim any existing fill_chunk */
if((retval = NCZ_reclaim_fill_chunk(zvar->cache))) goto done;
} else if (var->fill_value && no_fill && (*no_fill)) { /* Turning off fill value? */
/* If there's a _FillValue attribute, delete it. */
retval = NCZ_del_att(ncid, varid, _FillValue);
retval = NCZ_del_att(ncid, varid, NC_FillValue);
if (retval && retval != NC_ENOTATT) return retval;
if((retval = NCZ_reclaim_fill_value(var))) return retval;
}
Expand Down
2 changes: 1 addition & 1 deletion libsrc/nc3internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1723,7 +1723,7 @@ NC3_inq_var_fill(const NC_var *varp, void *fill_value)
/*
* find fill value
*/
attrpp = NC_findattr(&varp->attrs, _FillValue);
attrpp = NC_findattr(&varp->attrs, NC_FillValue);
if ( attrpp != NULL ) {
const void *xp;
/* User defined fill value */
Expand Down
2 changes: 1 addition & 1 deletion libsrc/putget.m4
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ fill_NC_var(NC3_INFO* ncp, const NC_var *varp, long long varsize, size_t recno)
/*
* Set up fill value
*/
attrpp = NC_findattr(&varp->attrs, _FillValue);
attrpp = NC_findattr(&varp->attrs, NC_FillValue);
if( attrpp != NULL )
{
/* User defined fill value */
Expand Down
6 changes: 3 additions & 3 deletions libsrc/var.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ NC3_inq_var(int ncid,
if (no_fillp != NULL) *no_fillp = varp->no_fill;

if (fill_valuep != NULL) {
status = nc_get_att(ncid, varid, _FillValue, fill_valuep);
status = nc_get_att(ncid, varid, NC_FillValue, fill_valuep);
if (status != NC_NOERR && status != NC_ENOTATT)
return status;
if (status == NC_ENOTATT) {
Expand Down Expand Up @@ -850,12 +850,12 @@ NC3_def_var_fill(int ncid,
if (fill_value != NULL && !varp->no_fill) {

/* If there's a _FillValue attribute, delete it. */
status = NC3_del_att(ncid, varid, _FillValue);
status = NC3_del_att(ncid, varid, NC_FillValue);
if (status != NC_NOERR && status != NC_ENOTATT)
return status;

/* Create/overwrite attribute _FillValue */
status = NC3_put_att(ncid, varid, _FillValue, varp->type, 1, fill_value, varp->type);
status = NC3_put_att(ncid, varid, NC_FillValue, varp->type, 1, fill_value, varp->type);
if (status != NC_NOERR) return status;
}

Expand Down
6 changes: 3 additions & 3 deletions nc_test/t_nc.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static const char * const reqattr[] = {
"SCALEMIN",
"SCALEMAX",
"FIELDNAM",
_FillValue
NC_FillValue
};
#define NUM_RATTRS 6

Expand Down Expand Up @@ -398,9 +398,9 @@ main(int argc, char *argv[])
{
int ifill = -1; double dfill = -9999;
assert( nc_put_att_int(id, Long_id,
_FillValue, NC_INT, 1, &ifill) == NC_NOERR);
NC_FillValue, NC_INT, 1, &ifill) == NC_NOERR);
assert( nc_put_att_double(id, Double_id,
_FillValue, NC_DOUBLE, 1, &dfill) == NC_NOERR);
NC_FillValue, NC_DOUBLE, 1, &dfill) == NC_NOERR);
}

#ifdef REDEF
Expand Down
6 changes: 3 additions & 3 deletions nc_test/t_nc_p5.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static const char * const reqattr[] = {
"SCALEMIN",
"SCALEMAX",
"FIELDNAM",
_FillValue
NC_FillValue
};
#define NUM_RATTRS 6

Expand Down Expand Up @@ -388,9 +388,9 @@ main(int argc, char *argv[])
{
int ifill = -1; double dfill = -9999;
assert( nc_put_att_int(id, Long_id,
_FillValue, NC_INT, 1, &ifill) == NC_NOERR);
NC_FillValue, NC_INT, 1, &ifill) == NC_NOERR);
assert( nc_put_att_double(id, Double_id,
_FillValue, NC_DOUBLE, 1, &dfill) == NC_NOERR);
NC_FillValue, NC_DOUBLE, 1, &dfill) == NC_NOERR);
}

#ifdef REDEF
Expand Down
2 changes: 1 addition & 1 deletion nc_test4/tst_elatefill.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ main(int argc, char **argv)

/* try put attribute _FillValue and expect NC_ELATEFILL */
fillv = 9;
err = nc_put_att_int(ncid, varid, _FillValue, NC_INT, 1, &fillv);
err = nc_put_att_int(ncid, varid, NC_FillValue, NC_INT, 1, &fillv);
if (err != NC_ELATEFILL)
printf("line %d expecting NC_ELATEFILL but got %d\n",__LINE__,err);
err = nc_close(ncid); ERR_CHK;
Expand Down
6 changes: 3 additions & 3 deletions nc_test4/tst_h_scalar.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,14 +360,14 @@ main()

/* Write to the variable's fill-value */
vlstr = NULL;
if (nc_put_att(ncid, varid, _FillValue, NC_STRING, 1, &vlstr)) ERR;
if (nc_put_att(ncid, varid, NC_FillValue, NC_STRING, 1, &vlstr)) ERR;

vlstr = malloc(10);
*vlstr = '\0';
if (nc_put_att(ncid, varid, _FillValue, NC_STRING, 1, &vlstr)) ERR;
if (nc_put_att(ncid, varid, NC_FillValue, NC_STRING, 1, &vlstr)) ERR;

strcpy(vlstr, "foo");
if (nc_put_att(ncid, varid, _FillValue, NC_STRING, 1, &vlstr)) ERR;
if (nc_put_att(ncid, varid, NC_FillValue, NC_STRING, 1, &vlstr)) ERR;
free(vlstr);


Expand Down
4 changes: 2 additions & 2 deletions nc_test4/tst_quantize.c
Original file line number Diff line number Diff line change
Expand Up @@ -1005,9 +1005,9 @@ main(int argc, char **argv)
if (nc_create(FILE_NAME, mode, &ncid)) ERR;
if (nc_def_dim(ncid, DIM_NAME_1, DIM_LEN_5, &dimid)) ERR;
if (nc_def_var(ncid, VAR_NAME_1, NC_FLOAT, NDIM1, &dimid, &varid1)) ERR;
if (nc_put_att_float(ncid, varid1, _FillValue, NC_FLOAT, 1, &custom_fill_float)) ERR;
if (nc_put_att_float(ncid, varid1, NC_FillValue, NC_FLOAT, 1, &custom_fill_float)) ERR;
if (nc_def_var(ncid, VAR_NAME_2, NC_DOUBLE, NDIM1, &dimid, &varid2)) ERR;
if (nc_put_att_double(ncid, varid2, _FillValue, NC_DOUBLE, 1, &custom_fill_double)) ERR;
if (nc_put_att_double(ncid, varid2, NC_FillValue, NC_DOUBLE, 1, &custom_fill_double)) ERR;

/* Turn on quantize for both vars. */
if (nc_def_var_quantize(ncid, varid1, quantize_mode[q], NSD_3)) ERR;
Expand Down
2 changes: 1 addition & 1 deletion nc_test4/tst_strings.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ main(int argc, char **argv)
/* Create a scalar variable for the empty string. */
if (nc_def_var(ncid, VAR_NAME2, NC_STRING, 0, NULL, &varid2)) ERR;
if (dim_combo == 3)
if (nc_put_att(ncid, varid, _FillValue, NC_STRING, 1, my_string_fill)) ERR;
if (nc_put_att(ncid, varid, NC_FillValue, NC_STRING, 1, my_string_fill)) ERR;

/* Check some stuff. */
if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
Expand Down
4 changes: 2 additions & 2 deletions nc_test4/tst_vars.c
Original file line number Diff line number Diff line change
Expand Up @@ -1080,9 +1080,9 @@ main(int argc, char **argv)
if (nc_def_var(ncid, VAR7_NAME, NC_USHORT, NDIMS, dimids, &varid)) ERR;
if (nc_def_var(ncid, VAR8_NAME, NC_USHORT, NDIMS, dimids, &varid2)) ERR;
if (nc_def_var(ncid, VAR9_NAME, NC_USHORT, NDIMS, dimids, &varid3)) ERR;
if (nc_put_att(ncid, varid3, _FillValue, NC_USHORT, 1, &my_fill_value2)) ERR;
if (nc_put_att(ncid, varid3, NC_FillValue, NC_USHORT, 1, &my_fill_value2)) ERR;
if (nc_def_var(ncid, VAR10_NAME, NC_USHORT, NDIMS, dimids, &varid4)) ERR;
if (nc_put_att(ncid, varid4, _FillValue, NC_USHORT, 1, &my_fill_value2)) ERR;
if (nc_put_att(ncid, varid4, NC_FillValue, NC_USHORT, 1, &my_fill_value2)) ERR;

/* Check stuff. */
if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in,
Expand Down
Loading

0 comments on commit f791b1d

Please sign in to comment.