diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2006-01-28 22:09:27 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2006-01-28 22:09:27 (GMT) |
commit | 6e0ea943fa2c76b0da164b87e68db4d708cbeec5 (patch) | |
tree | 04f6a8a9fc4f07563f600392afbe14b852f1b339 /test/tmisc.c | |
parent | d579d6aa5eff6674ae523da1dc35b1bd0d63deee (diff) | |
download | hdf5-6e0ea943fa2c76b0da164b87e68db4d708cbeec5.zip hdf5-6e0ea943fa2c76b0da164b87e68db4d708cbeec5.tar.gz hdf5-6e0ea943fa2c76b0da164b87e68db4d708cbeec5.tar.bz2 |
[svn-r11901] Purpose:
Bug fix/additional tests
Description:
Add additional tests for holding open an object of a given type (dataset,
group, etc) while incorrectly trying to open that object with a different
type of API routine (i.e. using the group open call on a dataset, etc.)
Platforms tested:
FreeBSD 4.11 (sleipnir)
Too minor to require h5committest
Diffstat (limited to 'test/tmisc.c')
-rw-r--r-- | test/tmisc.c | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/test/tmisc.c b/test/tmisc.c index 44df4ce..357291b 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -4133,6 +4133,88 @@ test_misc24(void) } H5E_END_TRY; VERIFY(tmp_id, FAIL, "H5Dopen"); + /* Try again, with the object already open through valid call */ + /* Open group */ + group_id = H5Gopen(file_id, MISC24_GROUP_NAME); + CHECK(group_id, FAIL, "H5Gopen"); + + H5E_BEGIN_TRY { + tmp_id = H5Dopen(file_id, MISC24_GROUP_NAME); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Dopen"); + + H5E_BEGIN_TRY { + tmp_id = H5Dopen(file_id, MISC24_GROUP_LINK); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Dopen"); + + H5E_BEGIN_TRY { + tmp_id = H5Topen(file_id, MISC24_GROUP_NAME); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Topen"); + + H5E_BEGIN_TRY { + tmp_id = H5Topen(file_id, MISC24_GROUP_LINK); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Topen"); + + ret = H5Gclose(group_id); + CHECK(ret, FAIL, "H5Gclose"); + + /* Open dataset */ + dset_id = H5Dopen(file_id, MISC24_DATASET_NAME); + CHECK(dset_id, FAIL, "H5Dopen"); + + H5E_BEGIN_TRY { + tmp_id = H5Gopen(file_id, MISC24_DATASET_NAME); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Gopen"); + + H5E_BEGIN_TRY { + tmp_id = H5Gopen(file_id, MISC24_DATASET_LINK); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Gopen"); + + H5E_BEGIN_TRY { + tmp_id = H5Topen(file_id, MISC24_DATASET_NAME); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Topen"); + + H5E_BEGIN_TRY { + tmp_id = H5Topen(file_id, MISC24_DATASET_LINK); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Topen"); + + ret = H5Dclose(dset_id); + CHECK(ret, FAIL, "H5Dclose"); + + /* Open named datatype */ + type_id = H5Topen(file_id, MISC24_DATATYPE_NAME); + CHECK(ret, FAIL, "H5Topen"); + + H5E_BEGIN_TRY { + tmp_id = H5Gopen(file_id, MISC24_DATATYPE_NAME); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Gopen"); + + H5E_BEGIN_TRY { + tmp_id = H5Gopen(file_id, MISC24_DATATYPE_LINK); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Gopen"); + + H5E_BEGIN_TRY { + tmp_id = H5Dopen(file_id, MISC24_DATATYPE_NAME); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Dopen"); + + H5E_BEGIN_TRY { + tmp_id = H5Dopen(file_id, MISC24_DATATYPE_LINK); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Dopen"); + + ret = H5Tclose(type_id); + CHECK(ret, FAIL, "H5Tclose"); + /* Close file */ ret = H5Fclose(file_id); CHECK(ret, FAIL, "H5Fclose"); |