checking 3D file again after close

This commit is contained in:
Edward Hartnett 2020-02-12 08:18:41 -07:00
parent 6e316f44a6
commit fe70e818e8

View File

@ -246,6 +246,19 @@ main(int argc, char **argv)
if (data_in != NC_FILL_INT) ERR; if (data_in != NC_FILL_INT) ERR;
if (nc_close(ncid)) ERR; if (nc_close(ncid)) ERR;
/* Reopen file and check again. */
if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
if (nc_inq_dim(ncid, 0, NULL, &len_in)) ERR;
if (len_in != 2) ERR;
if (nc_inq_dim(ncid, 1, NULL, &len_in)) ERR;
if (len_in != 2) ERR;
if (nc_inq_dim(ncid, 2, NULL, &len_in)) ERR;
if (len_in != 2) ERR;
if (nc_get_vara_int(ncid, 0, start, count, &data_in)) ERR;
if (data_in != data) ERR;
if (nc_get_vara_int(ncid, 1, start, count, &data_in)) ERR;
if (data_in != NC_FILL_INT) ERR;
if (nc_close(ncid)) ERR;
} }
SUMMARIZE_ERR; SUMMARIZE_ERR;
FINAL_RESULTS; FINAL_RESULTS;