You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* Open this dataset if necessary, also checking for a weird case:
* a non-coordinate (and non-scalar) variable that has the same
* name as a dimension. */
if (var->hdf5_name && strlen(var->hdf5_name) >= strlen(NON_COORD_PREPEND) &&
strncmp(var->hdf5_name, NON_COORD_PREPEND, strlen(NON_COORD_PREPEND)) == 0 &&
var->ndims)
name_to_use = var->hdf5_name;
else
name_to_use = var->hdr.name;
Test coverage shows we are not testing the first half of this if statement. We need to test the case of a dataset which has the same name as a dimension, but is not a coordinate variable. I will add this test.
The text was updated successfully, but these errors were encountered:
edhartnett
changed the title
Case of netcdf-4 var name same as dim name needs test
Incorrect handling of NULL count for nc_get/put_vars*() for netCDF-4 files
Aug 8, 2018
After some investigation, it turns out this code was never executed anyway. In all cases var->hdf4_datasetid was already set by the time the if statement is reached. I have replaced it with an assert.
However, this lead to another discovery. We also had this code in both put and get vars:
In nc4_get_vars() (in libhdf5/nc4hdf5.c) we have:
Test coverage shows we are not testing the first half of this if statement. We need to test the case of a dataset which has the same name as a dimension, but is not a coordinate variable. I will add this test.
The text was updated successfully, but these errors were encountered: