diff options
author | James Laird <jlaird@hdfgroup.org> | 2006-07-05 19:01:50 (GMT) |
---|---|---|
committer | James Laird <jlaird@hdfgroup.org> | 2006-07-05 19:01:50 (GMT) |
commit | 801ca2f9cb803b368b36a6c280684c1f6624f169 (patch) | |
tree | ed2543e9bc1f2beb9857f442fc8b52b3c371299f /test/tmisc.c | |
parent | d582c7bc8ac8679911e4787f5f92cc37b1c9989c (diff) | |
download | hdf5-801ca2f9cb803b368b36a6c280684c1f6624f169.zip hdf5-801ca2f9cb803b368b36a6c280684c1f6624f169.tar.gz hdf5-801ca2f9cb803b368b36a6c280684c1f6624f169.tar.bz2 |
[svn-r12452] Purpose:
Feature
Description:
Revised Link APIs.
Solution:
New link APIs use H5L*
H5*create_expand do not create links to the objects created; this must
be done manually with H5Llink.
Added APIs to link an object given its ID (H5Llink), to copy links (H5Lcopy),
and changed creation APIs (H5Lcreate_hard and H5Lcreate_soft) and query
API (H5Lget_linkinfo instead of H5Gget_objinfo).
All old APIs are still supported in H5Gdeprec.c .
Platforms tested:
sol, mir, copper
Misc. update:
Forgot to update MANIFEST and release docs. Will do after checkin.
Diffstat (limited to 'test/tmisc.c')
-rw-r--r-- | test/tmisc.c | 89 |
1 files changed, 66 insertions, 23 deletions
diff --git a/test/tmisc.c b/test/tmisc.c index ca405c7..7f39cf3 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -3830,8 +3830,8 @@ test_misc23(void) * test H5Gcreate_expand() **********************************************************************/ - /* Create group creation property list */ - create_id = H5Pcreate(H5P_GROUP_CREATE); + /* Create link creation property list */ + create_id = H5Pcreate(H5P_LINK_CREATE); CHECK(create_id, FAIL, "H5Pcreate"); /* Set flag for intermediate group creation */ @@ -3839,9 +3839,12 @@ test_misc23(void) CHECK(status, FAIL, "H5Pset_create_intermediate_group"); - tmp_id = H5Gcreate_expand(file_id, "/A/B01/grp", create_id, access_id); + tmp_id = H5Gcreate_expand(file_id, H5P_DEFAULT, access_id); CHECK(tmp_id, FAIL, "H5Gcreate_expand"); + status = H5Llink(file_id, "/A/B01/grp", tmp_id, create_id); + CHECK(status, FAIL, "H5Llink"); + /* Query that the name of the new group is correct */ status = H5Iget_name( tmp_id, objname, (size_t)MISC23_NAME_BUF_SIZE ); CHECK(status, FAIL, "H5Iget_name"); @@ -3862,30 +3865,42 @@ test_misc23(void) CHECK(status, FAIL, "H5Gclose"); - tmp_id = H5Gcreate_expand(file_id, "/A/B02/C02/grp", create_id, access_id); + tmp_id = H5Gcreate_expand(file_id, H5P_DEFAULT, access_id); CHECK(tmp_id, FAIL, "H5Gcreate_expand"); + status = H5Llink(file_id, "/A/B02/C02/grp", tmp_id, create_id); + CHECK(status, FAIL, "H5Llink"); + status = H5Gclose(tmp_id); CHECK(status, FAIL, "H5Gclose"); - tmp_id = H5Gcreate_expand(group_id, "B03/grp/", create_id, access_id); + tmp_id = H5Gcreate_expand(group_id, H5P_DEFAULT, access_id); CHECK(tmp_id, FAIL, "H5Gcreate_expand"); + status = H5Llink(group_id, "B03/grp/", tmp_id, create_id); + CHECK(status, FAIL, "H5Llink"); + status = H5Gclose(tmp_id); CHECK(status, FAIL, "H5Gclose"); - if ( (tmp_id = H5Gcreate_expand(group_id, "/A/B04/grp/", create_id, access_id)) < 0) + if ( (tmp_id = H5Gcreate_expand(group_id, H5P_DEFAULT, access_id)) < 0) CHECK(tmp_id, FAIL, "H5Gcreate_expand"); + status = H5Llink(group_id, "/A/B04/grp/", tmp_id, create_id); + CHECK(status, FAIL, "H5Llink"); + status = H5Gclose(tmp_id); CHECK(status, FAIL, "H5Gclose"); - if ( (tmp_id = H5Gcreate_expand(file_id, "/A/B05/C05/A", create_id, access_id)) < 0) + if ( (tmp_id = H5Gcreate_expand(file_id, H5P_DEFAULT, access_id)) < 0) CHECK(tmp_id, FAIL, "H5Gcreate_expand"); + status = H5Llink(file_id, "/A/B05/C05/A", tmp_id, create_id); + CHECK(status, FAIL, "H5Llink"); + status = H5Gclose(tmp_id); CHECK(status, FAIL, "H5Gclose"); @@ -3898,8 +3913,8 @@ test_misc23(void) * test new H5Dcreate **********************************************************************/ - /* Create dataset creation property list */ - create_id = H5Pcreate(H5P_DATASET_CREATE); + /* Create link creation property list */ + create_id = H5Pcreate(H5P_LINK_CREATE); CHECK(create_id, FAIL, "H5Pcreate"); /* Set flag for intermediate group creation */ @@ -3907,37 +3922,52 @@ test_misc23(void) CHECK(status, FAIL, "H5Pset_create_intermediate_group"); - tmp_id = H5Dcreate(file_id, "/A/B06/dset", type_id, space_id, create_id); + tmp_id = H5Dcreate_expand(file_id, type_id, space_id, H5P_DEFAULT); CHECK(tmp_id, FAIL, "H5Dcreate"); + status = H5Llink(file_id, "/A/B06/dset", tmp_id, create_id); + CHECK(status, FAIL, "H5Llink"); + status = H5Dclose(tmp_id); CHECK(status, FAIL, "H5Dclose"); - tmp_id = H5Dcreate(file_id, "/A/B07/B07/dset", type_id, space_id, create_id); + tmp_id = H5Dcreate_expand(file_id, type_id, space_id, H5P_DEFAULT); CHECK(tmp_id, FAIL, "H5Dcreate"); + status = H5Llink(file_id, "/A/B07/B07/dset", tmp_id, create_id); + CHECK(status, FAIL, "H5Llink"); + status = H5Dclose(tmp_id); CHECK(status, FAIL, "H5Dclose"); - tmp_id = H5Dcreate(group_id, "B08/dset", type_id, space_id, create_id); + tmp_id = H5Dcreate_expand(group_id, type_id, space_id, H5P_DEFAULT); CHECK(tmp_id, FAIL, "H5Dcreate"); + status = H5Llink(group_id, "B08/dset", tmp_id, create_id); + CHECK(status, FAIL, "H5Llink"); + status = H5Dclose(tmp_id); CHECK(status, FAIL, "H5Dclose"); - tmp_id = H5Dcreate(group_id, "/A/B09/dset", type_id, space_id, create_id); + tmp_id = H5Dcreate_expand(group_id, type_id, space_id, H5P_DEFAULT); CHECK(tmp_id, FAIL, "H5Dcreate"); + status = H5Llink(group_id, "/A/B09/dset", tmp_id, create_id); + CHECK(status, FAIL, "H5Llink"); + status = H5Dclose(tmp_id); CHECK(status, FAIL, "H5Dclose"); - tmp_id = H5Dcreate(file_id, "/A/B10/C10/A/dset", type_id, space_id, create_id); + tmp_id = H5Dcreate_expand(file_id, type_id, space_id, H5P_DEFAULT); CHECK(tmp_id, FAIL, "H5Dcreate"); + status = H5Llink(file_id, "/A/B10/C10/A/dset", tmp_id, create_id); + CHECK(status, FAIL, "H5Llink"); + status = H5Dclose(tmp_id); CHECK(status, FAIL, "H5Dclose"); @@ -3948,7 +3978,6 @@ test_misc23(void) status = H5Sclose(space_id); CHECK(status, FAIL, "H5Sclose"); - status = H5Pclose(create_id); CHECK(status, FAIL, "H5Pclose"); @@ -3957,21 +3986,23 @@ test_misc23(void) * test new H5Tcommit **********************************************************************/ - /* Create datatype creation property list */ - create_id = H5Pcreate(H5P_DATATYPE_CREATE); + /* Create link creation property list */ + create_id = H5Pcreate(H5P_LINK_CREATE); CHECK(create_id, FAIL, "H5Pcreate"); /* Set flag for intermediate group creation */ status = H5Pset_create_intermediate_group(create_id, TRUE); CHECK(status, FAIL, "H5Pset_create_intermediate_group"); - tmp_id = H5Tcopy(H5T_NATIVE_INT16); CHECK(tmp_id, FAIL, "H5Tcopy"); - status = H5Tcommit_expand(file_id, "/A/B11/dtype", tmp_id, create_id, access_id); + status = H5Tcommit_expand(file_id, tmp_id, H5P_DEFAULT, access_id); CHECK(status, FAIL, "H5Tcommit_expand"); + status = H5Llink(file_id, "/A/B11/dtype", tmp_id, create_id); + CHECK(status, FAIL, "H5Llink"); + status = H5Tclose(tmp_id); CHECK(status, FAIL, "H5Tclose"); @@ -3979,9 +4010,12 @@ test_misc23(void) tmp_id = H5Tcopy(H5T_NATIVE_INT32); CHECK(tmp_id, FAIL, "H5Tcopy"); - status = H5Tcommit_expand(file_id, "/A/B12/C12/dtype", tmp_id, create_id, access_id); + status = H5Tcommit_expand(file_id, tmp_id, H5P_DEFAULT, access_id); CHECK(status, FAIL, "H5Tcommit_expand"); + status = H5Llink(file_id, "/A/B12/C12/dtype", tmp_id, create_id); + CHECK(status, FAIL, "H5Llink"); + status = H5Tclose(tmp_id); CHECK(status, FAIL, "H5Tclose"); @@ -3989,8 +4023,11 @@ test_misc23(void) tmp_id = H5Tcopy(H5T_NATIVE_INT64); CHECK(tmp_id, FAIL, "H5Tcopy"); - status = H5Tcommit_expand(group_id, "B13/dtype", tmp_id, create_id, access_id); + status = H5Tcommit_expand(group_id, tmp_id, H5P_DEFAULT, access_id); CHECK(status, FAIL, "H5Tcommit_expand"); + + status = H5Llink(group_id, "B13/C12/dtype", tmp_id, create_id); + CHECK(status, FAIL, "H5Llink"); status = H5Tclose(tmp_id); CHECK(status, FAIL, "H5Tclose"); @@ -3999,9 +4036,12 @@ test_misc23(void) tmp_id = H5Tcopy(H5T_NATIVE_FLOAT); CHECK(tmp_id, FAIL, "H5Tcopy"); - status = H5Tcommit_expand(group_id, "/A/B14/dtype", tmp_id, create_id, access_id); + status = H5Tcommit_expand(group_id, tmp_id, H5P_DEFAULT, access_id); CHECK(status, FAIL, "H5Tcommit_expand"); + status = H5Llink(group_id, "/A/B14/dtype", tmp_id, create_id); + CHECK(status, FAIL, "H5Llink"); + status = H5Tclose(tmp_id); CHECK(status, FAIL, "H5Tclose"); @@ -4009,9 +4049,12 @@ test_misc23(void) tmp_id = H5Tcopy(H5T_NATIVE_DOUBLE); CHECK(tmp_id, FAIL, "H5Tcopy"); - status = H5Tcommit_expand(file_id, "/A/B15/C15/A/dtype", tmp_id, create_id, access_id); + status = H5Tcommit_expand(file_id, tmp_id, H5P_DEFAULT, access_id); CHECK(status, FAIL, "H5Tcommit_expand"); + status = H5Llink(file_id, "/A/B15/C15/A/dtype", tmp_id, create_id); + CHECK(status, FAIL, "H5Llink"); + status = H5Tclose(tmp_id); CHECK(status, FAIL, "H5Tclose"); |