diff options
-rw-r--r-- | src/H5S.c | 3 | ||||
-rw-r--r-- | test/th5s.c | 12 |
2 files changed, 15 insertions, 0 deletions
@@ -1367,6 +1367,9 @@ H5S_set_extent_simple (H5S_t *space, unsigned rank, const hsize_t *dims, space->extent.max = H5FL_ARR_MALLOC(hsize_t,rank); HDmemcpy(space->extent.max, max, sizeof(hsize_t) * rank); } /* end if */ + else { + space->extent.max = NULL; + } } /* Selection related cleanup */ diff --git a/test/th5s.c b/test/th5s.c index f77f0cd..a7f5296 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -137,6 +137,18 @@ test_h5s_basic(void) VERIFY(HDmemcmp(tmax, max2, SPACE2_RANK * sizeof(hsize_t)), 0, "H5Sget_simple_extent_dims"); + /* Change max dims from zero to non-zero and back again */ + ret = H5Sset_extent_simple(sid1, SPACE1_RANK, dims1, max2); + CHECK(ret, FAIL, "H5Sset_extent_simple"); + ret = H5Sset_extent_simple(sid1, SPACE1_RANK, dims1, NULL); + CHECK(ret, FAIL, "H5Sset_extent_simple"); + rank = H5Sget_simple_extent_dims(sid1, tdims, tmax); + CHECK(rank, FAIL, "H5Sget_simple_extent_dims"); + VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0, + "H5Sget_simple_extent_dims"); + VERIFY(HDmemcmp(tmax, dims1, SPACE1_RANK * sizeof(hsize_t)), 0, + "H5Sget_simple_extent_dims"); + ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); |