summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2004-07-20 16:26:40 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2004-07-20 16:26:40 (GMT)
commit129f72fb3ed868fab0fa1cd71854aa1aad366336 (patch)
tree19b518f2ea800b1ddc22c9624918495cd64ba8fe /test
parent24d36e1613a38a6d99e9c81ecd6d83063aec11b3 (diff)
downloadhdf5-129f72fb3ed868fab0fa1cd71854aa1aad366336.zip
hdf5-129f72fb3ed868fab0fa1cd71854aa1aad366336.tar.gz
hdf5-129f72fb3ed868fab0fa1cd71854aa1aad366336.tar.bz2
[svn-r8899]
Purpose: Bug Fix Description: Calling H5Sset_extent_simple to change a dataspace's maxdims from nonzero to zero causes errors (infinite loops, seg faults, asserts) because the pointer to the maximum size isn't cleaned up properly Solution: Clean up that pointer. Added a test for this case. Platforms tested: sleipnir (very minor change)
Diffstat (limited to 'test')
-rw-r--r--test/th5s.c12
1 files changed, 12 insertions, 0 deletions
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");