Skip to content

Commit

Permalink
test2
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisHeimbigner committed Aug 2, 2023
1 parent 249de27 commit 359d2d9
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions nc_test4/tst_filter_vlen.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ defvar(nc_type xtype)
static int
reopen(void)
{
int i;
size_t i;

CHECK(nc_open(testfile, NC_NETCDF4, &ncid));
for(i=0;i<ndims;i++) {
Expand All @@ -122,20 +122,21 @@ static int
test_test1(void)
{
int ok = 1;
int id = -1;
size_t nparams;
size_t nfilters = 0;
unsigned filterids[64];

fprintf(stderr,"test4: filter on a variable length type.\n");
create();
defvar(NC_STRING);
/* Do explicit filter; should never fail, but may produce log warning */
CHECK(nc_def_var_filter(ncid,varid,H5Z_FILTER_BZIP2,0,NULL));
/* Now see if filter was defined or not */
CHECK(nc_inq_var_filter(ncid,varid,&id,&nparams,NULL));
if(id <= 0) {
ok = 0;
} else {
fprintf(stderr,"*** id=%d\n",id);
memset(filterids,0,sizeof(filterids));
CHECK(nc_inq_var_filter_ids(ncid,varid,&nfilters,filterids));
fprintf(stderr,"test_test1: nc_var_filter_ids: nfilters=%u filterids[0]=%d\n",(unsigned)nfilters,filterids[0]);
if(nfilters != 1 && filterids[0] != H5Z_FILTER_BZIP2) {
fprintf(stderr,"test_test1: nc_var_filter_ids: failed\n");
ok = 0;
}
return ok;
}
Expand Down Expand Up @@ -192,7 +193,7 @@ test_test3(void)
int stat = NC_NOERR;
int ok = 1;
size_t i,nfilters;
int filterids[64];
unsigned filterids[64];

fprintf(stderr,"test4: re-open variable with filter on a variable length type and verify state.\n");

Expand All @@ -201,8 +202,9 @@ test_test3(void)
/* verify filter state */
memset(filterids,0,sizeof(filterids));
CHECK(nc_inq_var_filter_ids(ncid,varid,&nfilters,filterids));
fprintf(stderr,"test_test3: nc_var_filter_ids: nfilters=%u filterids[0]=%d\n",(unsigned)nfilters,filterids[0]);
if(nfilters != 1 && filterids[0] != H5Z_FILTER_BZIP2) {
fprintf(stderr,"test_test3: nc_var_filter_ids: nfilters=%u filterids[0]=%d\n",(unsigned)nfilters,filterids[0]);
fprintf(stderr,"test_test3: nc_var_filter_ids: failed\n");
ok = 0;
goto done;
}
Expand Down

0 comments on commit 359d2d9

Please sign in to comment.