summaryrefslogtreecommitdiffstats
path: root/test/dtypes.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2011-11-04 22:58:49 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2011-11-04 22:58:49 (GMT)
commit92e5075da873b21f3a8b1d85ae04a300ddd56901 (patch)
treefc56eef71d89b8f859bc3462c97641410098fd02 /test/dtypes.c
parent141383fb261f02c5fab510ffa9b2ff8be11f1cec (diff)
downloadhdf5-92e5075da873b21f3a8b1d85ae04a300ddd56901.zip
hdf5-92e5075da873b21f3a8b1d85ae04a300ddd56901.tar.gz
hdf5-92e5075da873b21f3a8b1d85ae04a300ddd56901.tar.bz2
[svn-r21718] Issue 7618 - the library had seg fault when it tried to shrink the size of compound data type through H5Tset_size immedia
tely after the type was created. I'm bringing the fix from the trunk that I committed a while ago. My real changes are in test/dtypes.c, src/H5T.c, and release_docs/RELEASE.txt. All other changes are property changes. Tested on jam. But I tested the same fix in the trunk on jam, koala, and linew.
Diffstat (limited to 'test/dtypes.c')
-rw-r--r--test/dtypes.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/dtypes.c b/test/dtypes.c
index aca1403..802ce4a 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -523,6 +523,12 @@ test_compound_1(void)
if ((complex_id = H5Tcreate(H5T_COMPOUND, sizeof(complex_t))) < 0)
goto error;
+ /* Try to shrink and expand the size */
+ if(H5Tset_size(complex_id, sizeof(double)) < 0)
+ goto error;
+ if(H5Tset_size(complex_id, sizeof(complex_t)) < 0)
+ goto error;
+
/* Attempt to add the new compound datatype as a field within itself */
H5E_BEGIN_TRY {
ret=H5Tinsert(complex_id, "compound", (size_t)0, complex_id);
@@ -538,6 +544,14 @@ test_compound_1(void)
goto error;
/* Test some functions that aren't supposed to work for compound type */
+ /* Tries to shrink the size and trail the last member */
+ H5E_BEGIN_TRY {
+ ret=H5Tset_size(complex_id, sizeof(double));
+ } H5E_END_TRY;
+ if (ret>=0) {
+ FAIL_PUTS_ERROR("Operation not allowed for this type.");
+ } /* end if */
+
H5E_BEGIN_TRY {
size=H5Tget_precision(complex_id);
} H5E_END_TRY;