mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-31 17:10:47 +08:00
[svn-r12860] Description:
Update H5Iget_name() tests to reflect that the name of the object for an ID can be found in many more situations now. Tested on: FreeBSD/32 4.11 (sleipnir)
This commit is contained in:
parent
5a77933fd5
commit
d60efe3336
@ -768,7 +768,7 @@ int main( void )
|
||||
|
||||
|
||||
/* Verify */
|
||||
if(check_name(group_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(group_id, "/g14/g3/g4", "") < 0) TEST_ERROR;
|
||||
|
||||
/* Close */
|
||||
H5Gclose( group_id );
|
||||
@ -793,7 +793,7 @@ int main( void )
|
||||
if (H5Funmount(group2_id, "g1")<0) TEST_ERROR;
|
||||
|
||||
/* Verify */
|
||||
if(check_name(group_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(group_id, "/g14/g3/g4", "") < 0) TEST_ERROR;
|
||||
if(check_name(group3_id, "/g14/g3/g4", "/g14/g3/g4") < 0) TEST_ERROR;
|
||||
|
||||
/* Close */
|
||||
@ -817,7 +817,7 @@ int main( void )
|
||||
if (H5Funmount(group2_id, ".")<0) TEST_ERROR;
|
||||
|
||||
/* Verify */
|
||||
if(check_name(group_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(group_id, "/g14/g3/g4", "") < 0) TEST_ERROR;
|
||||
if(check_name(group2_id, "", "") < 0) TEST_ERROR;
|
||||
|
||||
/* Close */
|
||||
@ -967,7 +967,7 @@ int main( void )
|
||||
if(check_name(group_id, "/g15/g1/g2/g3", "/g15/g1/g2/g3") < 0) TEST_ERROR;
|
||||
|
||||
/* Verify */
|
||||
if(check_name(group2_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(group2_id, "/g16/g4/g5", "") < 0) TEST_ERROR;
|
||||
|
||||
/* Close */
|
||||
H5Gclose( group_id );
|
||||
@ -1028,7 +1028,7 @@ int main( void )
|
||||
if((type_id=H5Dget_type(dataset_id))<0) TEST_ERROR;
|
||||
|
||||
/* Verify */
|
||||
if(check_name(type_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(type_id, "/g17/t", "") < 0) TEST_ERROR;
|
||||
|
||||
/* Close */
|
||||
H5Dclose( dataset_id );
|
||||
@ -1314,10 +1314,10 @@ PASSED();
|
||||
if(check_name(dataset_id, "/g18/d2", "/g18/d2") < 0) TEST_ERROR;
|
||||
if(check_name(type_id, "/g18/t2", "/g18/t2") < 0) TEST_ERROR;
|
||||
|
||||
/* Get name for the IDs of the second file, should be "" */
|
||||
if(check_name(group6_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(dataset2_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(type2_id, "", "") < 0) TEST_ERROR;
|
||||
/* Get name for the IDs of the second file, should be local names now */
|
||||
if(check_name(group6_id, "/g18/g2", "") < 0) TEST_ERROR;
|
||||
if(check_name(dataset2_id, "/g18/d2", "") < 0) TEST_ERROR;
|
||||
if(check_name(type2_id, "/g18/t2", "") < 0) TEST_ERROR;
|
||||
|
||||
H5Tclose( type_id );
|
||||
H5Tclose( type2_id );
|
||||
@ -1559,7 +1559,7 @@ PASSED();
|
||||
if (H5Gunlink( file_id, "/g19/g3")<0) TEST_ERROR;
|
||||
|
||||
/* Verify */
|
||||
if(check_name(group4_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(group4_id, "/g19/g1", "") < 0) TEST_ERROR;
|
||||
if(check_name(group2_id, "/g19/g1", "/g19/g1") < 0) TEST_ERROR;
|
||||
if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR;
|
||||
|
||||
@ -1579,7 +1579,7 @@ PASSED();
|
||||
if (H5Gunlink( group_id, "g3")<0) TEST_ERROR;
|
||||
|
||||
/* Verify */
|
||||
if(check_name(group4_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(group4_id, "/g19/g1", "") < 0) TEST_ERROR;
|
||||
if(check_name(group2_id, "/g19/g1", "/g19/g1") < 0) TEST_ERROR;
|
||||
if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR;
|
||||
|
||||
@ -1757,11 +1757,11 @@ PASSED();
|
||||
/* Open the group */
|
||||
if ((group3_id = H5Gopen( file_id, "/g24/g2" ))<0) TEST_ERROR;
|
||||
|
||||
/* Delete group */
|
||||
/* Delete symbolic link */
|
||||
if (H5Gunlink( file_id, "/g24/g2")<0) TEST_ERROR;
|
||||
|
||||
/* Verify */
|
||||
if(check_name(group3_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(group3_id, "/g24/g1", "") < 0) TEST_ERROR;
|
||||
|
||||
/* Close */
|
||||
H5Gclose( group_id );
|
||||
@ -1868,7 +1868,7 @@ PASSED();
|
||||
if (H5Funmount(file_id, "/g25/g1/g26/g3/g27/g5")<0) TEST_ERROR;
|
||||
|
||||
/* Verify */
|
||||
if(check_name(group4_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(group4_id, "/g28/g7/g8", "") < 0) TEST_ERROR;
|
||||
if(check_name(group3_id, "/g25/g1/g26/g3/g27/g5/g6", "/g25/g1/g26/g3/g27/g5/g6") < 0) TEST_ERROR;
|
||||
if(check_name(group2_id, "", "/g25/g1/g26/g3/g4") < 0) TEST_ERROR;
|
||||
if(check_name(group_id, "", "/g25/g1/g2") < 0) TEST_ERROR;
|
||||
@ -1880,7 +1880,7 @@ PASSED();
|
||||
if (H5Funmount(file_id, "/g25/g1/g26/g3")<0) TEST_ERROR;
|
||||
|
||||
/* Verify */
|
||||
if(check_name(group3_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(group3_id, "/g27/g5/g6", "") < 0) TEST_ERROR;
|
||||
if(check_name(group2_id, "/g25/g1/g26/g3/g4", "/g25/g1/g26/g3/g4") < 0) TEST_ERROR;
|
||||
if(check_name(group_id, "", "/g25/g1/g2") < 0) TEST_ERROR;
|
||||
|
||||
@ -1891,7 +1891,7 @@ PASSED();
|
||||
if (H5Funmount(file_id, "/g25/g1")<0) TEST_ERROR;
|
||||
|
||||
/* Verify */
|
||||
if(check_name(group2_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(group2_id, "/g26/g3/g4", "") < 0) TEST_ERROR;
|
||||
if(check_name(group_id, "/g25/g1/g2", "/g25/g1/g2") < 0) TEST_ERROR;
|
||||
|
||||
/* Close */
|
||||
@ -2046,7 +2046,7 @@ PASSED();
|
||||
if (H5Funmount(file_id, "/g30")<0) TEST_ERROR;
|
||||
|
||||
/* Verify */
|
||||
if(check_name(group4_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(group4_id, "/g33/g7/g8", "") < 0) TEST_ERROR;
|
||||
if(check_name(group3_id, "/g30/g1/g31/g3/g32/g5/g6", "/g30/g1/g31/g3/g32/g5/g6") < 0) TEST_ERROR;
|
||||
if(check_name(group2_id, "", "/g30/g1/g31/g3/g4") < 0) TEST_ERROR;
|
||||
if(check_name(group_id, "", "/g30/g1/g2") < 0) TEST_ERROR;
|
||||
@ -2055,8 +2055,8 @@ PASSED();
|
||||
if (H5Funmount(file_id, "/g30/g1/g31/g3")<0) TEST_ERROR;
|
||||
|
||||
/* Verify */
|
||||
if(check_name(group4_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(group3_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(group4_id, "/g33/g7/g8", "") < 0) TEST_ERROR;
|
||||
if(check_name(group3_id, "/g32/g5/g6", "") < 0) TEST_ERROR;
|
||||
if(check_name(group2_id, "/g30/g1/g31/g3/g4", "/g30/g1/g31/g3/g4") < 0) TEST_ERROR;
|
||||
if(check_name(group_id, "", "/g30/g1/g2") < 0) TEST_ERROR;
|
||||
|
||||
@ -2064,9 +2064,9 @@ PASSED();
|
||||
if (H5Funmount(file_id, "/g30/g1")<0) TEST_ERROR;
|
||||
|
||||
/* Verify */
|
||||
if(check_name(group4_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(group3_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(group2_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(group4_id, "/g33/g7/g8", "") < 0) TEST_ERROR;
|
||||
if(check_name(group3_id, "/g32/g5/g6", "") < 0) TEST_ERROR;
|
||||
if(check_name(group2_id, "/g31/g3/g4", "") < 0) TEST_ERROR;
|
||||
if(check_name(group_id, "/g30/g1/g2", "/g30/g1/g2") < 0) TEST_ERROR;
|
||||
|
||||
/* Close groups */
|
||||
@ -2295,14 +2295,14 @@ PASSED();
|
||||
if (H5Funmount(file3_id, "/g40/g5")<0) TEST_ERROR;
|
||||
|
||||
/* Verify */
|
||||
if(check_name(group2_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(group2_id, "/g38/g1/g39/g3/g4", "") < 0) TEST_ERROR;
|
||||
if(check_name(group_id, "/g38/g1/g39/g3/g4", "/g38/g1/g39/g3/g4") < 0) TEST_ERROR;
|
||||
|
||||
/* Unmount second file */
|
||||
if (H5Funmount(file1_id, "/g38/g1")<0) TEST_ERROR;
|
||||
|
||||
/* Verify */
|
||||
if(check_name(group_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(group_id, "/g39/g3/g4", "") < 0) TEST_ERROR;
|
||||
|
||||
/* Close */
|
||||
H5Gclose( group_id );
|
||||
@ -2358,7 +2358,7 @@ PASSED();
|
||||
if ((group2_id = H5Gopen( group_id, "g4" ))<0) TEST_ERROR;
|
||||
|
||||
/* Verify */
|
||||
if(check_name(group2_id, "", "") < 0) TEST_ERROR;
|
||||
if(check_name(group2_id, "/g42/g3/g4", "") < 0) TEST_ERROR;
|
||||
|
||||
/* Close */
|
||||
H5Gclose( group_id );
|
||||
@ -2368,7 +2368,7 @@ PASSED();
|
||||
|
||||
PASSED();
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
/*-------------------------------------------------------------------------
|
||||
* end tests
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
26
test/links.c
26
test/links.c
@ -1756,7 +1756,7 @@ external_link_path(hid_t fapl, hbool_t new_format)
|
||||
|
||||
/* Check name */
|
||||
if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
|
||||
if(name_len != 0) TEST_ERROR
|
||||
if(HDstrcmp(objname, "/A/B/C")) TEST_ERROR
|
||||
|
||||
/* Create object in external file */
|
||||
if((gid2 = H5Gcreate(gid, "new_group", (size_t)0)) < 0) TEST_ERROR
|
||||
@ -1903,7 +1903,7 @@ external_link_mult(hid_t fapl, hbool_t new_format)
|
||||
|
||||
/* Check name */
|
||||
if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
|
||||
if(name_len != 0) TEST_ERROR
|
||||
if(HDstrcmp(objname, "/A/B/C")) TEST_ERROR
|
||||
|
||||
/* Create object in external file */
|
||||
if((gid2 = H5Gcreate(gid, "new_group", (size_t)0)) < 0) TEST_ERROR
|
||||
@ -2029,7 +2029,7 @@ external_link_self(hid_t fapl, hbool_t new_format)
|
||||
|
||||
/* Check name */
|
||||
if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
|
||||
if(name_len != 0) TEST_ERROR
|
||||
if(HDstrcmp(objname, "/X")) TEST_ERROR
|
||||
|
||||
/* Create object through external link */
|
||||
if((gid2 = H5Gcreate(gid, "new_group", (size_t)0)) < 0) TEST_ERROR
|
||||
@ -2195,7 +2195,7 @@ external_link_pingpong(hid_t fapl, hbool_t new_format)
|
||||
|
||||
/* Check name */
|
||||
if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
|
||||
if(name_len != 0) TEST_ERROR
|
||||
if(HDstrcmp(objname, "/final")) TEST_ERROR
|
||||
|
||||
/* Create object in external file */
|
||||
if((gid2 = H5Gcreate(gid, "new_group", (size_t)0)) < 0) TEST_ERROR
|
||||
@ -2358,7 +2358,7 @@ external_link_toomany(hid_t fapl, hbool_t new_format)
|
||||
|
||||
/* Check name */
|
||||
if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
|
||||
if(name_len != 0) TEST_ERROR
|
||||
if(HDstrcmp(objname, "/final")) TEST_ERROR
|
||||
|
||||
/* Create object in external file */
|
||||
if((gid2 = H5Gcreate(gid, "new_group", (size_t)0)) < 0) TEST_ERROR
|
||||
@ -2971,7 +2971,7 @@ external_link_move(hid_t fapl, hbool_t new_format)
|
||||
|
||||
/* Check name */
|
||||
if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
|
||||
if(name_len != 0) TEST_ERROR
|
||||
if(HDstrcmp(objname, "/dst")) TEST_ERROR
|
||||
|
||||
/* Create object in external file */
|
||||
if((gid2 = H5Gcreate(gid, "new_group", (size_t)0)) < 0) TEST_ERROR
|
||||
@ -3016,7 +3016,7 @@ external_link_move(hid_t fapl, hbool_t new_format)
|
||||
|
||||
/* Check name */
|
||||
if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
|
||||
if(name_len != 0) TEST_ERROR
|
||||
if(HDstrcmp(objname, "/dst")) TEST_ERROR
|
||||
|
||||
/* Create object in external file */
|
||||
if((gid2 = H5Gcreate(gid, "new_group2", (size_t)0)) < 0) TEST_ERROR
|
||||
@ -3052,14 +3052,14 @@ external_link_move(hid_t fapl, hbool_t new_format)
|
||||
|
||||
/* Check name */
|
||||
if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
|
||||
if(name_len != 0) TEST_ERROR
|
||||
if(HDstrcmp(objname, "/dst")) TEST_ERROR
|
||||
|
||||
/* Move external link back to original location */
|
||||
if(H5Gmove(fid, "/group2/src3", "/src") < 0) TEST_ERROR
|
||||
|
||||
/* Check name */
|
||||
if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
|
||||
if(name_len != 0) TEST_ERROR
|
||||
if(HDstrcmp(objname, "/dst")) TEST_ERROR
|
||||
|
||||
/* Create object in external file */
|
||||
if((gid2 = H5Gcreate(gid, "new_group3", (size_t)0)) < 0) TEST_ERROR
|
||||
@ -3204,7 +3204,7 @@ external_link_ride(hid_t fapl, hbool_t new_format)
|
||||
|
||||
/* Check name */
|
||||
if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
|
||||
if(name_len != 0) TEST_ERROR
|
||||
if(HDstrcmp(objname, "/dst")) TEST_ERROR
|
||||
|
||||
/* Create object in external file */
|
||||
if((gid2 = H5Gcreate(gid, "new_group", (size_t)0)) < 0) TEST_ERROR
|
||||
@ -3239,7 +3239,7 @@ external_link_ride(hid_t fapl, hbool_t new_format)
|
||||
|
||||
/* Check name */
|
||||
if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
|
||||
if(name_len != 0) TEST_ERROR
|
||||
if(HDstrcmp(objname, "/dst")) TEST_ERROR
|
||||
|
||||
/* Create object in external file */
|
||||
if((gid2 = H5Gcreate(gid, "new_group2", (size_t)0)) < 0) TEST_ERROR
|
||||
@ -3818,7 +3818,7 @@ ud_hard_links(hid_t fapl)
|
||||
|
||||
/* Check name */
|
||||
if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
|
||||
if(name_len != 0) TEST_ERROR
|
||||
if(HDstrcmp(objname, "/group")) TEST_ERROR
|
||||
|
||||
/* Create object in group */
|
||||
if((gid2 = H5Gcreate(gid, "new_group", (size_t)0)) < 0) TEST_ERROR
|
||||
@ -4004,7 +4004,7 @@ ud_link_reregister(hid_t fapl)
|
||||
|
||||
/* Check name */
|
||||
if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
|
||||
if(name_len != 0) TEST_ERROR
|
||||
if(HDstrcmp(objname, "/" REREG_TARGET_NAME)) TEST_ERROR
|
||||
|
||||
/* Create object in group */
|
||||
if((gid2 = H5Gcreate(gid, "new_group", (size_t)0)) < 0) TEST_ERROR
|
||||
|
18
test/mount.c
18
test/mount.c
@ -1438,14 +1438,14 @@ test_mount_after_unmount(hid_t fapl)
|
||||
TEST_ERROR
|
||||
|
||||
/* Unmount second file */
|
||||
if (H5Funmount(fid1, "/A/M")<0)
|
||||
if(H5Funmount(fid1, "/A/M")<0)
|
||||
TEST_ERROR
|
||||
|
||||
/* Check name */
|
||||
*objname = '\0';
|
||||
if(H5Iget_name( gidAMXMY, objname, (size_t)NAME_BUF_SIZE ) < 0)
|
||||
TEST_ERROR
|
||||
if(HDstrcmp(objname, ""))
|
||||
if(HDstrcmp(objname, "/X/M/Y"))
|
||||
TEST_ERROR
|
||||
|
||||
/* Rename object in file #3 that is "disconnected" from name hiearchy */
|
||||
@ -1465,7 +1465,7 @@ test_mount_after_unmount(hid_t fapl)
|
||||
*objname = '\0';
|
||||
if(H5Iget_name( gidAMXMY, objname, (size_t)NAME_BUF_SIZE ) < 0)
|
||||
TEST_ERROR
|
||||
if(HDstrcmp(objname, ""))
|
||||
if(HDstrcmp(objname, "/X/M/Z"))
|
||||
TEST_ERROR
|
||||
|
||||
/* Mount fourth file */
|
||||
@ -3173,10 +3173,10 @@ test_close_parent(hid_t fapl)
|
||||
if(H5Funmount(gidM, "/A") < 0)
|
||||
TEST_ERROR
|
||||
|
||||
/* Check the name of "M" is not defined any longer */
|
||||
/* Check the name of "M" is defined in its file */
|
||||
if((name_len = H5Iget_name(gidM, name, (size_t)NAME_BUF_SIZE )) < 0)
|
||||
TEST_ERROR
|
||||
if(name_len != 0)
|
||||
if(name_len == 0 || HDstrcmp(name, "/M"))
|
||||
TEST_ERROR
|
||||
|
||||
/* Just file #2's underlying shared file should be open still */
|
||||
@ -3547,10 +3547,10 @@ test_cut_graph(hid_t fapl)
|
||||
if(H5Gclose(gidO) < 0)
|
||||
TEST_ERROR
|
||||
|
||||
/* Check the name of "M" is not defined any longer */
|
||||
/* Check the name of "M" is defined in its file */
|
||||
if((name_len = H5Iget_name(gidM, name, (size_t)NAME_BUF_SIZE )) < 0)
|
||||
TEST_ERROR
|
||||
if(name_len != 0)
|
||||
if(name_len == 0 || HDstrcmp(name, "/E/M"))
|
||||
TEST_ERROR
|
||||
|
||||
/* Check the name of "Q" is still defined */
|
||||
@ -3580,10 +3580,10 @@ test_cut_graph(hid_t fapl)
|
||||
if(H5F_sfile_assert_num(3) != 0)
|
||||
TEST_ERROR
|
||||
|
||||
/* Check the name of "Q" is not defined any longer */
|
||||
/* Check the name of "Q" is defined in its file */
|
||||
if((name_len = H5Iget_name(gidQ, name, (size_t)NAME_BUF_SIZE )) < 0)
|
||||
TEST_ERROR
|
||||
if(name_len != 0)
|
||||
if(name_len == 0 || HDstrcmp(name, "/I/Q"))
|
||||
TEST_ERROR
|
||||
|
||||
/* Open object in file #6 from file #7 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user