diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2009-10-27 21:33:12 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2009-10-27 21:33:12 (GMT) |
commit | b080ca4806226a13fa5c336b58a3cf96f0b127e4 (patch) | |
tree | 2b15644f2da7159cc81dfac9affee4bfb6eddf14 /test/dtypes.c | |
parent | 22eb024930bc6bc01de150347bc7ec6aa59b8400 (diff) | |
download | hdf5-b080ca4806226a13fa5c336b58a3cf96f0b127e4.zip hdf5-b080ca4806226a13fa5c336b58a3cf96f0b127e4.tar.gz hdf5-b080ca4806226a13fa5c336b58a3cf96f0b127e4.tar.bz2 |
[svn-r17757] Purpose: Fix assertion failure caused by H5Tcommit1/2
Description:
Calling H5Tcommit_anon on a file with read only access would cause an
assertion failure. Added a check to H5T_commit to return a failure in
this case. Removed redundant check in H5T_commit_named.
Tested: Fedora 11 (very minor change)
Diffstat (limited to 'test/dtypes.c')
-rw-r--r-- | test/dtypes.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/dtypes.c b/test/dtypes.c index 72151bc..803d840 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -3728,6 +3728,17 @@ test_named (hid_t fapl) goto error; } + /* Verify that H5Tcommit_anon returns an error */ + if((type = H5Tcopy(H5T_NATIVE_INT)) < 0) goto error; + H5E_BEGIN_TRY { + status = H5Tcommit_anon(file, type, H5P_DEFAULT, H5P_DEFAULT); + } H5E_END_TRY; + if(status >= 0) { + H5_FAILED(); + HDputs (" Types should not be committable to a read-only file!"); + goto error; + } + /* Close */ if(H5Tclose(type) < 0) goto error; if(H5Fclose(file) < 0) goto error; |