diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/dangle.c | 11 | ||||
-rw-r--r-- | test/flush2.c | 33 | ||||
-rw-r--r-- | test/gen_mergemsg.c | 12 | ||||
-rw-r--r-- | test/gen_nullspace.c | 4 | ||||
-rw-r--r-- | test/getname.c | 1442 | ||||
-rw-r--r-- | test/links.c | 258 | ||||
-rw-r--r-- | test/mount.c | 749 | ||||
-rwxr-xr-x | test/objcopy.c | 68 | ||||
-rw-r--r-- | test/stab.c | 23 | ||||
-rw-r--r-- | test/tattr.c | 24 | ||||
-rw-r--r-- | test/tfile.c | 32 | ||||
-rw-r--r-- | test/th5o.c | 24 | ||||
-rw-r--r-- | test/titerate.c | 8 | ||||
-rw-r--r-- | test/tmisc.c | 96 | ||||
-rw-r--r-- | test/tsohm.c | 40 | ||||
-rw-r--r-- | test/tvlstr.c | 8 | ||||
-rw-r--r-- | test/unlink.c | 31 | ||||
-rw-r--r-- | test/vfd.c | 4 |
18 files changed, 1412 insertions, 1455 deletions
diff --git a/test/dangle.c b/test/dangle.c index 4e1154a..2f6ad7b 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -186,13 +186,12 @@ test_dangle_group(H5F_close_degree_t degree) if(gid >= 0) TEST_ERROR /* Leave open a _lot_ of objects */ - for(u=0; u<MAX_DANGLE; u++) { - if((gid = H5Gopen (fid, GROUPNAME))<0) - TEST_ERROR; - } /* end for */ + for(u = 0; u < MAX_DANGLE; u++) + if((gid = H5Gopen2(fid, GROUPNAME, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR - if((gid = H5Gopen (fid, GROUPNAME))<0) - TEST_ERROR; + if((gid = H5Gopen2(fid, GROUPNAME, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR if(degree==H5F_CLOSE_SEMI) { H5E_BEGIN_TRY { diff --git a/test/flush2.c b/test/flush2.c index 6a07c78..46f61da 100644 --- a/test/flush2.c +++ b/test/flush2.c @@ -90,7 +90,7 @@ error: return 1; } - + /*------------------------------------------------------------------------- * Function: check_file * @@ -112,33 +112,31 @@ check_file(char* filename, hid_t fapl, int flag) char name[1024]; int i; - if ((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl))<0) goto error; + if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) goto error; if(check_dset(file, "dset")) goto error; /* Open some groups */ - if ((groups=H5Gopen(file, "some_groups"))<0) goto error; - for (i=0; i<100; i++) { + if((groups = H5Gopen2(file, "some_groups", H5P_DEFAULT)) < 0) goto error; + for(i = 0; i < 100; i++) { sprintf(name, "grp%02u", (unsigned)i); - if ((grp=H5Gopen(groups, name))<0) goto error; - if (H5Gclose(grp)<0) goto error; - } + if((grp = H5Gopen2(groups, name, H5P_DEFAULT)) < 0) goto error; + if(H5Gclose(grp) < 0) goto error; + } /* end for */ /* Check to see if that last added dataset in the third file is accessible * (it shouldn't be...but it might. Flag an error in case it is for now */ - if(flag) - { - if(check_dset(file, "dset2")) goto error; - } + if(flag && check_dset(file, "dset2")) goto error; + + if(H5Gclose(groups) < 0) goto error; + if(H5Fclose(file) < 0) goto error; - if (H5Gclose(groups)<0) goto error; - if (H5Fclose(file)<0) goto error; return 0; + error: return 1; +} /* end check_file() */ - -} - + /*------------------------------------------------------------------------- * Function: main * @@ -177,8 +175,7 @@ main(void) if (HDstrcmp(envval, "core") && HDstrcmp(envval, "split")) { /* Check the case where the file was flushed */ h5_fixname(FILENAME[0], fapl, name, sizeof name); - if(check_file(name, fapl, FALSE)) - { + if(check_file(name, fapl, FALSE)) { H5_FAILED() goto error; } diff --git a/test/gen_mergemsg.c b/test/gen_mergemsg.c index f070901..c543c4c 100644 --- a/test/gen_mergemsg.c +++ b/test/gen_mergemsg.c @@ -77,7 +77,7 @@ int main() assert(fid > 0); /* Re-open first group */ - gid = H5Gopen(fid, GROUP1); + gid = H5Gopen2(fid, GROUP1, H5P_DEFAULT); assert(gid > 0); /* Create dataspace for attribute */ @@ -154,7 +154,7 @@ int main() assert(ret >= 0); /* Re-open first group */ - gid = H5Gopen(fid, GROUP1); + gid = H5Gopen2(fid, GROUP1, H5P_DEFAULT); assert(gid > 0); /* Delete 2nd attribute */ @@ -177,7 +177,7 @@ int main() assert(fid > 0); /* Re-open first group */ - gid = H5Gopen(fid, GROUP1); + gid = H5Gopen2(fid, GROUP1, H5P_DEFAULT); assert(gid > 0); /* Create dataspace for 3rd attribute */ @@ -221,7 +221,7 @@ int main() assert(fid > 0); /* Re-open first group */ - gid = H5Gopen(fid, GROUP1); + gid = H5Gopen2(fid, GROUP1, H5P_DEFAULT); assert(gid > 0); /* Delete 3rd attribute */ @@ -268,7 +268,7 @@ int main() assert(fid > 0); /* Re-open first group */ - gid = H5Gopen(fid, GROUP1); + gid = H5Gopen2(fid, GROUP1, H5P_DEFAULT); assert(gid > 0); /* Delete 2nd attribute */ @@ -289,7 +289,7 @@ int main() assert(fid > 0); /* Re-open first group */ - gid = H5Gopen(fid, GROUP1); + gid = H5Gopen2(fid, GROUP1, H5P_DEFAULT); assert(gid > 0); /* Create dataspace for 3rd attribute */ diff --git a/test/gen_nullspace.c b/test/gen_nullspace.c index 2d2bf15..80e5590 100644 --- a/test/gen_nullspace.c +++ b/test/gen_nullspace.c @@ -59,8 +59,8 @@ main(void) assert(ret>=0); /* Open the root group */ - gid = H5Gopen(fid,"/"); - assert(gid>0); + gid = H5Gopen2(fid, "/", H5P_DEFAULT); + assert(gid > 0); /* Create an attribute for the group */ attr=H5Acreate(gid,NULLATTR,H5T_NATIVE_INT,sid,H5P_DEFAULT); diff --git a/test/getname.c b/test/getname.c index 9700df3..8348362 100644 --- a/test/getname.c +++ b/test/getname.c @@ -118,10 +118,10 @@ test_main(hid_t file_id, hid_t fapl) if((group_id = H5Gcreate2(file_id, "/g0", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "/g0", "/g0") < 0) TEST_ERROR; + if(check_name(group_id, "/g0", "/g0") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); + H5Gclose(group_id); PASSED(); @@ -140,40 +140,40 @@ test_main(hid_t file_id, hid_t fapl) if((group2_id = H5Gcreate2(file_id, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "/g1", "/g1") < 0) TEST_ERROR; + if(check_name(group_id, "/g1", "/g1") < 0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "/g1/g2", "/g1/g2") < 0) TEST_ERROR; + if(check_name(group2_id, "/g1/g2", "/g1/g2") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); + H5Gclose(group_id); + H5Gclose(group2_id); PASSED(); /*------------------------------------------------------------------------- - * Test H5Iget_name with H5Gopen + * Test H5Iget_name with H5Gopen2 *------------------------------------------------------------------------- */ - TESTING("H5Iget_name with H5Gopen"); + TESTING("H5Iget_name with H5Gopen2"); /* Reopen the group */ - if ((group_id = H5Gopen( file_id, "/g1" ))<0) TEST_ERROR; + if((group_id = H5Gopen2(file_id, "/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Reopen the group */ - if ((group2_id = H5Gopen( file_id, "/g1/g2" ))<0) TEST_ERROR; + if((group2_id = H5Gopen2(file_id, "/g1/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "/g1", "/g1") < 0) TEST_ERROR; + if(check_name(group_id, "/g1", "/g1") < 0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "/g1/g2", "/g1/g2") < 0) TEST_ERROR; + if(check_name(group2_id, "/g1/g2", "/g1/g2") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR PASSED(); @@ -188,30 +188,30 @@ test_main(hid_t file_id, hid_t fapl) TESTING("H5Iget_name with H5Dcreate"); /* Create the dataspace */ - if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) TEST_ERROR; + if((space_id = H5Screate_simple(1, dims, NULL))<0) TEST_ERROR /* Create a new dataset */ - if ((dataset_id = H5Dcreate( file_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) TEST_ERROR; + if((dataset_id = H5Dcreate(file_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT))<0) TEST_ERROR /* Verify */ - if(check_name(dataset_id, "/d1", "/d1") < 0) TEST_ERROR; + if(check_name(dataset_id, "/d1", "/d1") < 0) TEST_ERROR /* Close */ - H5Dclose( dataset_id ); + if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR /* Reopen the group */ - if ((group_id = H5Gopen( file_id, "g1" ))<0) TEST_ERROR; + if((group_id = H5Gopen2(file_id, "g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create a new dataset inside "g1" */ - if ((dataset_id = H5Dcreate( group_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) TEST_ERROR; + if((dataset_id = H5Dcreate(group_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(dataset_id, "/g1/d1", "/g1/d1") < 0) TEST_ERROR; + if(check_name(dataset_id, "/g1/d1", "/g1/d1") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Dclose( dataset_id ); - H5Sclose( space_id ); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR + if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR + if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR PASSED(); @@ -225,27 +225,27 @@ test_main(hid_t file_id, hid_t fapl) TESTING("H5Iget_name with H5Dopen"); /* Reopen the dataset */ - if ((dataset_id = H5Dopen( file_id, "d1"))<0) TEST_ERROR; + if((dataset_id = H5Dopen(file_id, "d1"))<0) TEST_ERROR /* Verify */ - if(check_name(dataset_id, "/d1", "/d1") < 0) TEST_ERROR; + if(check_name(dataset_id, "/d1", "/d1") < 0) TEST_ERROR /* Close */ - H5Dclose( dataset_id ); + H5Dclose(dataset_id); /* Reopen the group */ - if ((group_id = H5Gopen( file_id, "g1" ))<0) TEST_ERROR; + if((group_id = H5Gopen2(file_id, "g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Reopen the dataset */ - if ((dataset_id = H5Dopen( group_id, "d1"))<0) TEST_ERROR; + if((dataset_id = H5Dopen(group_id, "d1")) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(dataset_id, "/g1/d1", "/g1/d1") < 0) TEST_ERROR; + if(check_name(dataset_id, "/g1/d1", "/g1/d1") < 0) TEST_ERROR /* Close */ - H5Dclose( dataset_id ); - H5Gclose( group_id ); + if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR PASSED(); @@ -264,24 +264,24 @@ test_main(hid_t file_id, hid_t fapl) if((group3_id = H5Gcreate2(file_id, "g2/bar/baz", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create a dataset */ - if((space_id = H5Screate_simple( 1, dims, NULL ))<0) TEST_ERROR; - if((dataset_id = H5Dcreate(group3_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) TEST_ERROR; + if((space_id = H5Screate_simple(1, dims, NULL))<0) TEST_ERROR + if((dataset_id = H5Dcreate(group3_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT))<0) TEST_ERROR /* Close */ - H5Dclose( dataset_id ); - H5Sclose( space_id ); - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Dclose(dataset_id); + H5Sclose(space_id); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); /* Reopen the dataset */ - if ((dataset_id = H5Dopen( file_id, "/g2/bar/baz/d1"))<0) TEST_ERROR; + if((dataset_id = H5Dopen(file_id, "/g2/bar/baz/d1"))<0) TEST_ERROR /* Verify */ - if(check_name(dataset_id, "/g2/bar/baz/d1", "/g2/bar/baz/d1") < 0) TEST_ERROR; + if(check_name(dataset_id, "/g2/bar/baz/d1", "/g2/bar/baz/d1") < 0) TEST_ERROR /* Close */ - H5Dclose( dataset_id ); + H5Dclose(dataset_id); PASSED(); @@ -294,18 +294,18 @@ test_main(hid_t file_id, hid_t fapl) TESTING("H5Iget_name with H5Tcommit"); /* Create a datatype */ - if ((type_id = H5Tcreate (H5T_COMPOUND, sizeof(s1_t)))<0) TEST_ERROR; + if((type_id = H5Tcreate(H5T_COMPOUND, sizeof(s1_t)))<0) TEST_ERROR /* Insert fields */ - if (H5Tinsert (type_id, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT)<0) TEST_ERROR; - if (H5Tinsert (type_id, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT)<0) TEST_ERROR; - if (H5Tinsert (type_id, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT)<0) TEST_ERROR; + if(H5Tinsert(type_id, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT)<0) TEST_ERROR + if(H5Tinsert(type_id, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT)<0) TEST_ERROR + if(H5Tinsert(type_id, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT)<0) TEST_ERROR /* Save datatype for later */ - if (H5Tcommit (file_id, "t1", type_id)<0) TEST_ERROR; + if(H5Tcommit(file_id, "t1", type_id)<0) TEST_ERROR /* Verify */ - if(check_name(type_id, "/t1", "/t1") < 0) TEST_ERROR; + if(check_name(type_id, "/t1", "/t1") < 0) TEST_ERROR /* Close datatype */ H5Tclose(type_id); @@ -320,10 +320,10 @@ test_main(hid_t file_id, hid_t fapl) TESTING("H5Iget_name with H5Topen"); /* Open the named datatype */ - if((type_id=H5Topen(file_id, "t1"))<0) TEST_ERROR; + if((type_id=H5Topen(file_id, "t1"))<0) TEST_ERROR /* Verify */ - if(check_name(type_id, "/t1", "/t1") < 0) TEST_ERROR; + if(check_name(type_id, "/t1", "/t1") < 0) TEST_ERROR /* Close datatype */ H5Tclose(type_id); @@ -332,24 +332,24 @@ test_main(hid_t file_id, hid_t fapl) -/*------------------------------------------------------------------------- - * Test H5Iget_name with H5Gmove and H5Gopen + /*------------------------------------------------------------------------- + * Test H5Iget_name with H5Gmove and H5Gopen2 *------------------------------------------------------------------------- */ - TESTING("H5Iget_name with H5Gmove and H5Gopen"); + TESTING("H5Iget_name with H5Gmove and H5Gopen2"); /* Reopen the group */ - if ((group_id = H5Gopen( file_id, "/g1" ))<0) TEST_ERROR; + if((group_id = H5Gopen2(file_id, "/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Rename group */ - if (H5Gmove( file_id, "/g1", "/g1a" )<0) TEST_ERROR; + if(H5Gmove(file_id, "/g1", "/g1a") < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "/g1a", "/g1a") < 0) TEST_ERROR; + if(check_name(group_id, "/g1a", "/g1a") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR PASSED(); @@ -364,16 +364,16 @@ test_main(hid_t file_id, hid_t fapl) TESTING("H5Iget_name with H5Gmove and H5Dopen"); /* Reopen the dataset */ - if ((dataset_id = H5Dopen( file_id, "/d1"))<0) TEST_ERROR; + if((dataset_id = H5Dopen(file_id, "/d1"))<0) TEST_ERROR /* Rename dataset */ - if (H5Gmove( file_id, "/d1", "/d1a" )<0) TEST_ERROR; + if(H5Gmove(file_id, "/d1", "/d1a")<0) TEST_ERROR /* Verify */ - if(check_name(dataset_id, "/d1a", "/d1a") < 0) TEST_ERROR; + if(check_name(dataset_id, "/d1a", "/d1a") < 0) TEST_ERROR /* Close */ - H5Dclose( dataset_id ); + H5Dclose(dataset_id); PASSED(); @@ -388,13 +388,13 @@ test_main(hid_t file_id, hid_t fapl) TESTING("H5Iget_name with H5Gmove and H5Topen"); /* Open the named datatype */ - if((type_id=H5Topen(file_id, "/t1"))<0) TEST_ERROR; + if((type_id=H5Topen(file_id, "/t1"))<0) TEST_ERROR /* Rename datatype */ - if (H5Gmove( file_id, "/t1", "/t1a" )<0) TEST_ERROR; + if(H5Gmove(file_id, "/t1", "/t1a")<0) TEST_ERROR /* Verify */ - if(check_name(type_id, "/t1a", "/t1a") < 0) TEST_ERROR; + if(check_name(type_id, "/t1a", "/t1a") < 0) TEST_ERROR /* Close datatype */ H5Tclose(type_id); @@ -415,36 +415,36 @@ test_main(hid_t file_id, hid_t fapl) if((group2_id = H5Gcreate2(file_id, "/g3/foo1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Open group "/g3/foo" again */ - if ((group3_id = H5Gopen( file_id, "/g3/foo1"))<0) TEST_ERROR; + if((group3_id = H5Gopen2(file_id, "/g3/foo1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Rename group */ - if (H5Gmove( group_id, "foo1", "foo2" )<0) TEST_ERROR; + if(H5Gmove(group_id, "foo1", "foo2") < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "/g3", "/g3") < 0) TEST_ERROR; + if(check_name(group_id, "/g3", "/g3") < 0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "/g3/foo2", "/g3/foo2") < 0) TEST_ERROR; + if(check_name(group2_id, "/g3/foo2", "/g3/foo2") < 0) TEST_ERROR /* Verify */ - if(check_name(group3_id, "/g3/foo2", "/g3/foo2") < 0) TEST_ERROR; + if(check_name(group3_id, "/g3/foo2", "/g3/foo2") < 0) TEST_ERROR /* Rename group again */ - if (H5Gmove( file_id, "g3/foo2", "g3/foo1" )<0) TEST_ERROR; + if(H5Gmove(file_id, "g3/foo2", "g3/foo1") < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "/g3", "/g3") < 0) TEST_ERROR; + if(check_name(group_id, "/g3", "/g3") < 0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "/g3/foo1", "/g3/foo1") < 0) TEST_ERROR; + if(check_name(group2_id, "/g3/foo1", "/g3/foo1") < 0) TEST_ERROR /* Verify */ - if(check_name(group3_id, "/g3/foo1", "/g3/foo1") < 0) TEST_ERROR; + if(check_name(group3_id, "/g3/foo1", "/g3/foo1") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); PASSED(); @@ -468,35 +468,35 @@ test_main(hid_t file_id, hid_t fapl) if((group5_id = H5Gcreate2(file_id, "g5/C", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group3_id, "/g4/A/B", "/g4/A/B") < 0) TEST_ERROR; + if(check_name(group3_id, "/g4/A/B", "/g4/A/B") < 0) TEST_ERROR /* Move group "B" to "D"*/ - if (H5Gmove( file_id, "/g4/A/B", "/g5/C/D" )<0) TEST_ERROR; + if(H5Gmove(file_id, "/g4/A/B", "/g5/C/D")<0) TEST_ERROR /* Verify */ - if(check_name(group3_id, "/g5/C/D", "/g5/C/D") < 0) TEST_ERROR; + if(check_name(group3_id, "/g5/C/D", "/g5/C/D") < 0) TEST_ERROR /* Move group "/g5/C/D" back to "/g4/A/B" using relative name */ - if (H5Gmove2( group5_id, "D", group2_id, "B" )<0) TEST_ERROR; + if(H5Gmove2(group5_id, "D", group2_id, "B")<0) TEST_ERROR /* Verify */ - if(check_name(group3_id, "/g4/A/B", "/g4/A/B") < 0) TEST_ERROR; + if(check_name(group3_id, "/g4/A/B", "/g4/A/B") < 0) TEST_ERROR /* Move group "/g4/A/B" to "/g4/F/B" using relative name */ - if (H5Gmove2( group_id, "A", group_id, "F")<0) TEST_ERROR; + if(H5Gmove2(group_id, "A", group_id, "F")<0) TEST_ERROR /* Verify */ - if(check_name(group3_id, "/g4/F/B", "/g4/F/B") < 0) TEST_ERROR; + if(check_name(group3_id, "/g4/F/B", "/g4/F/B") < 0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "/g4/F", "/g4/F") < 0) TEST_ERROR; + if(check_name(group2_id, "/g4/F", "/g4/F") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); - H5Gclose( group4_id ); - H5Gclose( group5_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); + H5Gclose(group4_id); + H5Gclose(group5_id); PASSED(); @@ -515,22 +515,22 @@ test_main(hid_t file_id, hid_t fapl) if((group4_id = H5Gcreate2(file_id, "g7", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group3_id, "/g6/A/B", "/g6/A/B") < 0) TEST_ERROR; + if(check_name(group3_id, "/g6/A/B", "/g6/A/B") < 0) TEST_ERROR /* Move group "A" to "C"*/ - if (H5Gmove( file_id, "/g6/A", "/g7/C" )<0) TEST_ERROR; + if(H5Gmove(file_id, "/g6/A", "/g7/C")<0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "/g7/C", "/g7/C") < 0) TEST_ERROR; + if(check_name(group2_id, "/g7/C", "/g7/C") < 0) TEST_ERROR /* Verify */ - if(check_name(group3_id, "/g7/C/B", "/g7/C/B") < 0) TEST_ERROR; + if(check_name(group3_id, "/g7/C/B", "/g7/C/B") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); - H5Gclose( group4_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); + H5Gclose(group4_id); PASSED(); @@ -545,13 +545,13 @@ test_main(hid_t file_id, hid_t fapl) if((group_id = H5Gcreate2(file_id, "/g8", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete */ - if (H5Gunlink( file_id, "/g8")<0) TEST_ERROR; + if(H5Gunlink(file_id, "/g8")<0) TEST_ERROR /* Verify */ - if(check_name(group_id, "", "") < 0) TEST_ERROR; + if(check_name(group_id, "", "") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); + H5Gclose(group_id); PASSED(); @@ -568,37 +568,37 @@ test_main(hid_t file_id, hid_t fapl) if((group3_id = H5Gcreate2(file_id, "g9/a/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete */ - if (H5Gunlink( file_id, "/g9/a")<0) TEST_ERROR; + if(H5Gunlink(file_id, "/g9/a")<0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "", "") < 0) TEST_ERROR; + if(check_name(group2_id, "", "") < 0) TEST_ERROR /* Verify */ - if(check_name(group3_id, "", "") < 0) TEST_ERROR; + if(check_name(group3_id, "", "") < 0) TEST_ERROR /* Close */ - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group2_id); + H5Gclose(group3_id); /* Recreate groups */ if((group2_id = H5Gcreate2(group_id, "a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((group3_id = H5Gcreate2(group_id, "a/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete, using relative path */ - if (H5Gunlink( group_id, "a")<0) TEST_ERROR; + if(H5Gunlink(group_id, "a")<0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "", "") < 0) TEST_ERROR; + if(check_name(group2_id, "", "") < 0) TEST_ERROR /* Verify */ - if(check_name(group3_id, "", "") < 0) TEST_ERROR; + if(check_name(group3_id, "", "") < 0) TEST_ERROR /* Close */ - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group2_id); + H5Gclose(group3_id); /* Close */ - H5Gclose( group_id ); + H5Gclose(group_id); /* Create group "g10/a/b" */ if((group_id = H5Gcreate2(file_id, "g10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -606,29 +606,29 @@ test_main(hid_t file_id, hid_t fapl) if((group3_id = H5Gcreate2(file_id, "g10/a/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete */ - if (H5Gunlink( file_id, "/g10/a/b")<0) TEST_ERROR; + if(H5Gunlink(file_id, "/g10/a/b")<0) TEST_ERROR /* Verify */ - if(check_name(group3_id, "", "") < 0) TEST_ERROR; + if(check_name(group3_id, "", "") < 0) TEST_ERROR /* Close */ - H5Gclose( group3_id ); + H5Gclose(group3_id); /* Recreate group */ if((group3_id = H5Gcreate2(group_id, "a/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete, using relative path */ - if (H5Gunlink( group_id, "a/b")<0) TEST_ERROR; + if(H5Gunlink(group_id, "a/b")<0) TEST_ERROR /* Verify */ - if(check_name(group3_id, "", "") < 0) TEST_ERROR; + if(check_name(group3_id, "", "") < 0) TEST_ERROR /* Close */ - H5Gclose( group3_id ); + H5Gclose(group3_id); /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); + H5Gclose(group_id); + H5Gclose(group2_id); PASSED(); @@ -645,25 +645,25 @@ test_main(hid_t file_id, hid_t fapl) if((group2_id = H5Gcreate2(file_id, "g11/g", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create two datasets "g11/d" and "g11/g/d"*/ - if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) TEST_ERROR; - if ((dataset_id = H5Dcreate( group_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) TEST_ERROR; - if ((dataset2_id = H5Dcreate( group2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) TEST_ERROR; + if((space_id = H5Screate_simple(1, dims, NULL))<0) TEST_ERROR + if((dataset_id = H5Dcreate(group_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT))<0) TEST_ERROR + if((dataset2_id = H5Dcreate(group2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT))<0) TEST_ERROR /* Delete */ - if (H5Gunlink( file_id, "/g11/d")<0) TEST_ERROR; + if(H5Gunlink(file_id, "/g11/d")<0) TEST_ERROR /* Verify */ - if(check_name(dataset_id, "", "") < 0) TEST_ERROR; + if(check_name(dataset_id, "", "") < 0) TEST_ERROR /* Verify */ - if(check_name(dataset2_id, "/g11/g/d", "/g11/g/d") < 0) TEST_ERROR; + if(check_name(dataset2_id, "/g11/g/d", "/g11/g/d") < 0) TEST_ERROR /* Close */ - H5Dclose( dataset_id ); - H5Dclose( dataset2_id ); - H5Sclose( space_id ); - H5Gclose( group_id ); - H5Gclose( group2_id ); + H5Dclose(dataset_id); + H5Dclose(dataset2_id); + H5Sclose(space_id); + H5Gclose(group_id); + H5Gclose(group2_id); PASSED(); @@ -679,35 +679,35 @@ test_main(hid_t file_id, hid_t fapl) if((group_id = H5Gcreate2(file_id, "/g12", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose( group_id ); + H5Gclose(group_id); /* Create second file and dataset "d" in it */ file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); /* Create a dataspace */ - if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) TEST_ERROR; + if((space_id = H5Screate_simple(1, dims, NULL))<0) TEST_ERROR /* Create the dataset */ - if ((dataset_id = H5Dcreate( file1_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) TEST_ERROR; + if((dataset_id = H5Dcreate(file1_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT))<0) TEST_ERROR /* Close */ - H5Dclose( dataset_id ); + H5Dclose(dataset_id); /* Mount second file under "g12" in the first file */ - if (H5Fmount(file_id, "/g12", file1_id, H5P_DEFAULT)<0) TEST_ERROR; + if(H5Fmount(file_id, "/g12", file1_id, H5P_DEFAULT)<0) TEST_ERROR /* Access dataset D in the first file under "/G/D" name */ - if ((dataset_id = H5Dopen( file_id, "/g12/d"))<0) TEST_ERROR; + if((dataset_id = H5Dopen(file_id, "/g12/d"))<0) TEST_ERROR /* Verify */ - if(check_name(dataset_id, "/g12/d", "/g12/d") < 0) TEST_ERROR; + if(check_name(dataset_id, "/g12/d", "/g12/d") < 0) TEST_ERROR - if (H5Funmount(file_id, "/g12")<0) TEST_ERROR; + if(H5Funmount(file_id, "/g12")<0) TEST_ERROR /* Close */ - H5Dclose( dataset_id ); - H5Fclose( file1_id ); - H5Sclose( space_id ); + H5Dclose(dataset_id); + H5Fclose(file1_id); + H5Sclose(space_id); PASSED(); @@ -726,9 +726,9 @@ test_main(hid_t file_id, hid_t fapl) if((group3_id = H5Gcreate2(file_id, "/g13/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); /* Create second file and group "g" in it */ file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); @@ -738,165 +738,165 @@ test_main(hid_t file_id, hid_t fapl) if((group3_id = H5Gcreate2(file1_id, "/g14/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR /* Mount second file under "/g13/g1" in the first file */ - if (H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR; + if(H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Access group in the first file */ - if ((group_id = H5Gopen( file_id, "/g13/g1/g14/g3/g4"))<0) TEST_ERROR; + if((group_id = H5Gopen2(file_id, "/g13/g1/g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR; + if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR - if (H5Funmount(file_id, "/g13/g1")<0) TEST_ERROR; + if(H5Funmount(file_id, "/g13/g1") < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "/g14/g3/g4", "") < 0) TEST_ERROR; + if(check_name(group_id, "/g14/g3/g4", "") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR /* Access group in the file to mount */ - if ((group3_id = H5Gopen( file1_id, "/g14/g3/g4"))<0) TEST_ERROR; + if((group3_id = H5Gopen2(file1_id, "/g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - /* Mount second file under "/g13/g1" in the first file (again) */ - if (H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR; + /* Mount second file under "/g13/g1" in the first file(again) */ + if(H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Get a group ID for the parent of the newly mounted group */ - if ((group2_id = H5Gopen( file_id, "/g13"))<0) TEST_ERROR; + if((group2_id = H5Gopen2(file_id, "/g13", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Access group in the first file */ - if ((group_id = H5Gopen( file_id, "/g13/g1/g14/g3/g4"))<0) TEST_ERROR; + if((group_id = H5Gopen2(file_id, "/g13/g1/g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR; - if(check_name(group3_id, "/g14/g3/g4", "/g14/g3/g4") < 0) TEST_ERROR; + if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR + if(check_name(group3_id, "/g14/g3/g4", "/g14/g3/g4") < 0) TEST_ERROR - if (H5Funmount(group2_id, "g1")<0) TEST_ERROR; + if(H5Funmount(group2_id, "g1") < 0) FAIL_STACK_ERROR /* Verify */ - 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; + 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 */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR - /* Mount second file under "/g13/g1" in the first file (again) */ - if (H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR; + /* Mount second file under "/g13/g1" in the first file(again) */ + if(H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Get a group ID for the newly mounted group */ - if ((group2_id = H5Gopen( file_id, "/g13/g1"))<0) TEST_ERROR; + if((group2_id = H5Gopen2(file_id, "/g13/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Access group in the first file */ - if ((group_id = H5Gopen( file_id, "/g13/g1/g14/g3/g4"))<0) TEST_ERROR; + if((group_id = H5Gopen2(file_id, "/g13/g1/g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR; - if(check_name(group2_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR; + if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR + if(check_name(group2_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR - if (H5Funmount(group2_id, ".")<0) TEST_ERROR; + if(H5Funmount(group2_id, ".") < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "/g14/g3/g4", "") < 0) TEST_ERROR; - if(check_name(group2_id, "/", "") < 0) TEST_ERROR; + if(check_name(group_id, "/g14/g3/g4", "") < 0) TEST_ERROR + if(check_name(group2_id, "/", "") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR /* Mount second file under "/g13/g1" in the first file, using relative path */ - if ((group3_id = H5Gopen( file_id, "/g13"))<0) TEST_ERROR; + if((group3_id = H5Gopen2(file_id, "/g13", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group3_id, "/g13", "/g13") < 0) TEST_ERROR; + if(check_name(group3_id, "/g13", "/g13") < 0) TEST_ERROR - if (H5Fmount(group3_id, "g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR; + if(H5Fmount(group3_id, "g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Get a group ID for the newly mounted group */ - if ((group2_id = H5Gopen( file_id, "/g13/g1"))<0) TEST_ERROR; + if((group2_id = H5Gopen2(file_id, "/g13/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group2_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR; + if(check_name(group2_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR /* Access group in the first file */ - if ((group_id = H5Gopen( file_id, "/g13/g1/g14/g3/g4"))<0) TEST_ERROR; + if((group_id = H5Gopen2(file_id, "/g13/g1/g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR; + if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR /* Access group in the first file, with relative path */ - if ((group_id = H5Gopen( group2_id, "g14/g3/g4"))<0) TEST_ERROR; + if((group_id = H5Gopen2(group2_id, "g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR; + if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR - if (H5Funmount(group2_id, ".")<0) TEST_ERROR; + if(H5Funmount(group2_id, ".") < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group2_id, "/", "") < 0) TEST_ERROR; + if(check_name(group2_id, "/", "") < 0) TEST_ERROR /* Close */ - H5Gclose( group2_id ); - H5Gclose( group3_id ); + if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR /* Mount second file under "/g13/g1" in the first file, using relative path */ - if ((group3_id = H5Gopen( file_id, "/g13/g1"))<0) TEST_ERROR; + if((group3_id = H5Gopen2(file_id, "/g13/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group3_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR; + if(check_name(group3_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR - if (H5Fmount(group3_id, ".", file1_id, H5P_DEFAULT)<0) TEST_ERROR; + if(H5Fmount(group3_id, ".", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Get a group ID for the newly mounted group */ - if ((group2_id = H5Gopen( file_id, "/g13/g1"))<0) TEST_ERROR; + if((group2_id = H5Gopen2(file_id, "/g13/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group2_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR; + if(check_name(group2_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR /* Access group in the first file */ - if ((group_id = H5Gopen( file_id, "/g13/g1/g14/g3/g4"))<0) TEST_ERROR; + if((group_id = H5Gopen2(file_id, "/g13/g1/g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR; + if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR /* Access group in the first file, with relative path */ - if ((group_id = H5Gopen( group2_id, "g14/g3/g4"))<0) TEST_ERROR; + if((group_id = H5Gopen2(group2_id, "g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR; + if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR - if (H5Funmount(group2_id, ".")<0) TEST_ERROR; + if(H5Funmount(group2_id, ".") < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group2_id, "/", "") < 0) TEST_ERROR; - if(check_name(group3_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR; + if(check_name(group2_id, "/", "") < 0) TEST_ERROR + if(check_name(group3_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR /* Close */ - H5Gclose( group2_id ); - H5Gclose( group3_id ); + if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR - H5Fclose( file1_id ); + if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR PASSED(); @@ -916,10 +916,10 @@ test_main(hid_t file_id, hid_t fapl) if((group4_id = H5Gcreate2(file_id, "/g15/g1/g2/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); - H5Gclose( group4_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); + H5Gclose(group4_id); /* Create second file and group "g" in it */ file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); @@ -929,37 +929,37 @@ test_main(hid_t file_id, hid_t fapl) if((group3_id = H5Gcreate2(file1_id, "/g16/g4/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR /* Access group in the first file */ - if ((group_id = H5Gopen( file_id, "/g15/g1/g2/g3"))<0) TEST_ERROR; + if((group_id = H5Gopen2(file_id, "/g15/g1/g2/g3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Mount second file under "/g13/g1" in the first file */ - if (H5Fmount(file_id, "/g15/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR; + if(H5Fmount(file_id, "/g15/g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Access group in the second file */ - if ((group2_id = H5Gopen( file_id, "/g15/g1/g16/g4/g5"))<0) TEST_ERROR; + if((group2_id = H5Gopen2(file_id, "/g15/g1/g16/g4/g5", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "", "/g15/g1/g2/g3") < 0) TEST_ERROR; + if(check_name(group_id, "", "/g15/g1/g2/g3") < 0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "/g15/g1/g16/g4/g5", "/g15/g1/g16/g4/g5") < 0) TEST_ERROR; + if(check_name(group2_id, "/g15/g1/g16/g4/g5", "/g15/g1/g16/g4/g5") < 0) TEST_ERROR - if (H5Funmount(file_id, "/g15/g1")<0) TEST_ERROR; + if(H5Funmount(file_id, "/g15/g1") < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "/g15/g1/g2/g3", "/g15/g1/g2/g3") < 0) TEST_ERROR; + if(check_name(group_id, "/g15/g1/g2/g3", "/g15/g1/g2/g3") < 0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "/g16/g4/g5", "") < 0) TEST_ERROR; + if(check_name(group2_id, "/g16/g4/g5", "") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Fclose( file1_id ); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR + if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR PASSED(); @@ -973,53 +973,53 @@ test_main(hid_t file_id, hid_t fapl) TESTING("H5Iget_name with a defined type dataset"); /* Create a datatype */ - if ((type_id = H5Tcreate (H5T_COMPOUND, sizeof(s1_t)))<0) TEST_ERROR; + if((type_id = H5Tcreate(H5T_COMPOUND, sizeof(s1_t)))<0) TEST_ERROR /* Insert fields */ - if (H5Tinsert (type_id, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT)<0) TEST_ERROR; - if (H5Tinsert (type_id, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT)<0) TEST_ERROR; - if (H5Tinsert (type_id, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT)<0) TEST_ERROR; + if(H5Tinsert(type_id, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT)<0) TEST_ERROR + if(H5Tinsert(type_id, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT)<0) TEST_ERROR + if(H5Tinsert(type_id, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT)<0) TEST_ERROR /* Create group "g17" */ if((group_id = H5Gcreate2(file_id, "g17", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Save datatype for later */ - if (H5Tcommit (group_id, "t", type_id)<0) TEST_ERROR; + if(H5Tcommit(group_id, "t", type_id)<0) TEST_ERROR /* Create a dataspace */ - if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) TEST_ERROR; + if((space_id = H5Screate_simple(1, dims, NULL))<0) TEST_ERROR /* Create a new dataset */ - if ((dataset_id = H5Dcreate( group_id , "d", type_id, space_id, - H5P_DEFAULT ))<0) TEST_ERROR; + if((dataset_id = H5Dcreate(group_id , "d", type_id, space_id, + H5P_DEFAULT))<0) TEST_ERROR /* Close */ - H5Dclose( dataset_id ); - H5Tclose( type_id ); - H5Sclose( space_id ); - H5Gclose( group_id ); + H5Dclose(dataset_id); + H5Tclose(type_id); + H5Sclose(space_id); + H5Gclose(group_id); /* Open the named datatype */ - if((type_id=H5Topen(file_id, "/g17/t"))<0) TEST_ERROR; + if((type_id=H5Topen(file_id, "/g17/t"))<0) TEST_ERROR /* Verify */ - if(check_name(type_id, "/g17/t", "/g17/t") < 0) TEST_ERROR; + if(check_name(type_id, "/g17/t", "/g17/t") < 0) TEST_ERROR /* Close datatype */ H5Tclose(type_id); /* Reopen the dataset */ - if ((dataset_id = H5Dopen( file_id, "/g17/d"))<0) TEST_ERROR; + if((dataset_id = H5Dopen(file_id, "/g17/d"))<0) TEST_ERROR /* Get datatype*/ - if((type_id=H5Dget_type(dataset_id))<0) TEST_ERROR; + if((type_id=H5Dget_type(dataset_id))<0) TEST_ERROR /* Verify */ - if(check_name(type_id, "/g17/t", "/g17/t") < 0) TEST_ERROR; + if(check_name(type_id, "/g17/t", "/g17/t") < 0) TEST_ERROR /* Close */ - H5Dclose( dataset_id ); - H5Tclose( type_id ); + H5Dclose(dataset_id); + H5Tclose(type_id); PASSED(); @@ -1032,18 +1032,18 @@ test_main(hid_t file_id, hid_t fapl) TESTING("H5Iget_name with datasets that have two names"); /* Open dataset named "d"*/ -if ((dataset_id = H5Dopen( file_id, "/g17/d"))<0) TEST_ERROR; +if((dataset_id = H5Dopen(file_id, "/g17/d"))<0) TEST_ERROR /* Create link to dataset named "link" */ -if (H5Glink2(dataset_id,".",H5G_LINK_HARD,file_id,"/g17/link")<0) TEST_ERROR; -if ((dataset2_id = H5Dopen( file_id, "/g17/link"))<0) TEST_ERROR; +if(H5Glink2(dataset_id,".",H5G_LINK_HARD,file_id,"/g17/link")<0) TEST_ERROR +if((dataset2_id = H5Dopen(file_id, "/g17/link"))<0) TEST_ERROR /* Make sure that the two IDs use two different names */ - if(check_name(dataset_id, "/g17/d", "/g17/d") < 0) TEST_ERROR; - if(check_name(dataset2_id, "/g17/link", "/g17/link") < 0) TEST_ERROR; + if(check_name(dataset_id, "/g17/d", "/g17/d") < 0) TEST_ERROR + if(check_name(dataset2_id, "/g17/link", "/g17/link") < 0) TEST_ERROR -if(H5Dclose(dataset_id)<0) TEST_ERROR; -if(H5Dclose(dataset2_id)<0) TEST_ERROR; +if(H5Dclose(dataset_id)<0) TEST_ERROR +if(H5Dclose(dataset2_id)<0) TEST_ERROR PASSED(); @@ -1055,35 +1055,35 @@ PASSED(); TESTING("H5Iget_name with different files"); /* Create a new file using default properties. */ - if ((file2_id = H5Fcreate( filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl ))<0) TEST_ERROR; + if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Create a new file using default properties. */ - if ((file3_id = H5Fcreate( filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl ))<0) TEST_ERROR; + if((file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Create the dataspace */ - if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) TEST_ERROR; + if((space_id = H5Screate_simple(1, dims, NULL))<0) TEST_ERROR /* Create a new dataset */ - if ((dataset_id = H5Dcreate( file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) TEST_ERROR; + if((dataset_id = H5Dcreate(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT))<0) TEST_ERROR /* Create a new dataset */ - if ((dataset2_id = H5Dcreate( file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) TEST_ERROR; + if((dataset2_id = H5Dcreate(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT))<0) TEST_ERROR /* Delete */ - if (H5Gunlink( file2_id, "/d")<0) TEST_ERROR; + if(H5Gunlink(file2_id, "/d")<0) TEST_ERROR /* Verify */ - if(check_name(dataset_id, "", "") < 0) TEST_ERROR; + if(check_name(dataset_id, "", "") < 0) TEST_ERROR /* Verify */ - if(check_name(dataset2_id, "/d", "/d") < 0) TEST_ERROR; + if(check_name(dataset2_id, "/d", "/d") < 0) TEST_ERROR /* Close */ - H5Dclose( dataset_id ); - H5Dclose( dataset2_id ); - H5Sclose( space_id ); - H5Fclose( file2_id ); - H5Fclose( file3_id ); + H5Dclose(dataset_id); + H5Dclose(dataset2_id); + H5Sclose(space_id); + H5Fclose(file2_id); + H5Fclose(file3_id); PASSED(); @@ -1096,35 +1096,35 @@ PASSED(); TESTING("H5Iget_name with different files #2"); /* Create a new file using default properties. */ - if ((file2_id = H5Fcreate( filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl ))<0) TEST_ERROR; + if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Create a new file using default properties. */ - if ((file3_id = H5Fcreate( filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl ))<0) TEST_ERROR; + if((file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR /* Create the dataspace */ - if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) TEST_ERROR; + if((space_id = H5Screate_simple(1, dims, NULL))<0) TEST_ERROR /* Create a new dataset */ - if ((dataset_id = H5Dcreate( file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) TEST_ERROR; + if((dataset_id = H5Dcreate(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT))<0) TEST_ERROR /* Create a new dataset */ - if ((dataset2_id = H5Dcreate( file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) TEST_ERROR; + if((dataset2_id = H5Dcreate(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT))<0) TEST_ERROR /* Delete */ - if (H5Gunlink( file3_id, "/d")<0) TEST_ERROR; + if(H5Gunlink(file3_id, "/d")<0) TEST_ERROR /* Verify */ - if(check_name(dataset_id, "/d", "/d") < 0) TEST_ERROR; + if(check_name(dataset_id, "/d", "/d") < 0) TEST_ERROR /* Verify */ - if(check_name(dataset2_id, "", "") < 0) TEST_ERROR; + if(check_name(dataset2_id, "", "") < 0) TEST_ERROR /* Close */ - H5Dclose( dataset_id ); - H5Dclose( dataset2_id ); - H5Sclose( space_id ); - H5Fclose( file2_id ); - H5Fclose( file3_id ); + H5Dclose(dataset_id); + H5Dclose(dataset2_id); + H5Sclose(space_id); + H5Fclose(file2_id); + H5Fclose(file3_id); PASSED(); @@ -1136,25 +1136,25 @@ PASSED(); TESTING("H5Iget_name with a small buffer for name"); /* Reopen the group */ - if ((group_id = H5Gopen( file_id, "/g17" ))<0) TEST_ERROR; + if((group_id = H5Gopen2(file_id, "/g17", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR { /*small buffer to hold name and its size */ char name2[SMALL_NAME_BUF_SIZE]; /* Get name */ - name_len=H5Iget_name( group_id, name2, SMALL_NAME_BUF_SIZE ); + name_len=H5Iget_name(group_id, name2, SMALL_NAME_BUF_SIZE); /* Check that name is longer */ - if(name_len <= SMALL_NAME_BUF_SIZE) TEST_ERROR; - if(HDstrcmp(name2, "/")) TEST_ERROR; + if(name_len <= SMALL_NAME_BUF_SIZE) TEST_ERROR + if(HDstrcmp(name2, "/")) TEST_ERROR } /* Verify */ - if(check_name(group_id, "/g17", "/g17") < 0) TEST_ERROR; + if(check_name(group_id, "/g17", "/g17") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); + H5Gclose(group_id); PASSED(); @@ -1167,7 +1167,7 @@ PASSED(); TESTING("H5Iget_name with a dynamic buffer for name"); /* Reopen the group */ - if ((group_id = H5Gopen( file_id, "/g17" ))<0) TEST_ERROR; + if((group_id = H5Gopen2(file_id, "/g17", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Get name */ name_len = H5Iget_name(group_id, NULL, NAME_BUF_SIZE); @@ -1178,26 +1178,26 @@ PASSED(); /* Include the extra null character */ name3 = HDmalloc(name_len + 1); - if(!name3) TEST_ERROR; + if(!name3) TEST_ERROR /* Get name with dynamic buffer */ - if(H5Iget_name(group_id, name3, name_len + 1) < 0) TEST_ERROR; + if(H5Iget_name(group_id, name3, name_len + 1) < 0) TEST_ERROR /* Verify */ - if(HDstrcmp(name3, "/g17")) TEST_ERROR; + if(HDstrcmp(name3, "/g17")) TEST_ERROR *name3 = '\0'; /* Get name with smaller buffer */ - if(H5Iget_name(group_id, name3, 3) < 0) TEST_ERROR; + if(H5Iget_name(group_id, name3, 3) < 0) TEST_ERROR /* Verify */ - if(HDstrcmp(name3, "/g")) TEST_ERROR; + if(HDstrcmp(name3, "/g")) TEST_ERROR HDfree(name3); } /* Close */ - H5Gclose( group_id ); + H5Gclose(group_id); PASSED(); @@ -1211,32 +1211,32 @@ PASSED(); TESTING("H5Iget_name with invalid IDs"); /* Create a dataspace */ - if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) TEST_ERROR; + if((space_id = H5Screate_simple(1, dims, NULL))<0) TEST_ERROR /* Define a datatype */ - if ((type_id = H5Tcopy(H5T_NATIVE_INT))<0) TEST_ERROR; + if((type_id = H5Tcopy(H5T_NATIVE_INT))<0) TEST_ERROR /* Create a new dataset */ - if ((dataset_id = H5Dcreate( file_id , "d2", type_id, space_id, H5P_DEFAULT ))<0) TEST_ERROR; + if((dataset_id = H5Dcreate(file_id , "d2", type_id, space_id, H5P_DEFAULT))<0) TEST_ERROR { char name[NAME_BUF_SIZE]; /* Buffer to hold name and its size */ /* Get name for non commited datatype, it should fail */ H5E_BEGIN_TRY { - if(H5Iget_name( type_id, name, NAME_BUF_SIZE) > 0) TEST_ERROR; + if(H5Iget_name(type_id, name, NAME_BUF_SIZE) > 0) TEST_ERROR } H5E_END_TRY; /* Get name for dataspace, it should fail */ H5E_BEGIN_TRY { - if(H5Iget_name( space_id, name, NAME_BUF_SIZE) > 0) TEST_ERROR; + if(H5Iget_name(space_id, name, NAME_BUF_SIZE) > 0) TEST_ERROR } H5E_END_TRY; } /* Close */ - H5Dclose( dataset_id ); - H5Sclose( space_id ); - H5Tclose( type_id ); + H5Dclose(dataset_id); + H5Sclose(space_id); + H5Tclose(type_id); PASSED(); @@ -1253,12 +1253,12 @@ PASSED(); if((group2_id = H5Gcreate2(file_id, "/g18/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Also create a dataset and a datatype */ - if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) TEST_ERROR; - if ((type_id = H5Tcopy(H5T_NATIVE_INT))<0) TEST_ERROR; - if ((dataset_id = H5Dcreate( file_id, "g18/d2", type_id, space_id, - H5P_DEFAULT ))<0) TEST_ERROR; + if((space_id = H5Screate_simple(1, dims, NULL))<0) TEST_ERROR + if((type_id = H5Tcopy(H5T_NATIVE_INT))<0) TEST_ERROR + if((dataset_id = H5Dcreate(file_id, "g18/d2", type_id, space_id, + H5P_DEFAULT))<0) TEST_ERROR - if (H5Tcommit(file_id, "g18/t2", type_id) <0) TEST_ERROR; + if(H5Tcommit(file_id, "g18/t2", type_id) <0) TEST_ERROR /* Create second file and group "/g3/g4/g5" in it */ file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); @@ -1267,56 +1267,56 @@ PASSED(); if((group5_id = H5Gcreate2(file1_id, "/g3/g4/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Mount first file at "g3/g4" in the second file */ - if (H5Fmount(file1_id, "/g3/g4", file_id, H5P_DEFAULT)<0) TEST_ERROR; + if(H5Fmount(file1_id, "/g3/g4", file_id, H5P_DEFAULT)<0) TEST_ERROR /* Get name for the group ID in the first file, should be "/g18/g2" still */ - if(check_name(group2_id, "/g18/g2", "/g18/g2") < 0) TEST_ERROR; + if(check_name(group2_id, "/g18/g2", "/g18/g2") < 0) TEST_ERROR /* Get name for the dataset ID in the first file, should be "/g18/g2/d2" still */ - if(check_name(dataset_id, "/g18/d2", "/g18/d2") < 0) TEST_ERROR; + if(check_name(dataset_id, "/g18/d2", "/g18/d2") < 0) TEST_ERROR /* Get name for the datatype ID in the first file, should be "/g18/g2/t2" still */ - if(check_name(type_id, "/g18/t2", "/g18/t2") < 0) TEST_ERROR; + if(check_name(type_id, "/g18/t2", "/g18/t2") < 0) TEST_ERROR /* Open the mounted group, dataset, and datatype through their new names */ - if ((group6_id = H5Gopen( file1_id, "/g3/g4/g18/g2" ))<0) TEST_ERROR; - if ((dataset2_id = H5Dopen( file1_id, "/g3/g4/g18/d2" ))<0) TEST_ERROR; - if ((type2_id = H5Topen( file1_id, "/g3/g4/g18/t2" ))<0) TEST_ERROR; + if((group6_id = H5Gopen2(file1_id, "/g3/g4/g18/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((dataset2_id = H5Dopen(file1_id, "/g3/g4/g18/d2")) < 0) FAIL_STACK_ERROR + if((type2_id = H5Topen(file1_id, "/g3/g4/g18/t2")) < 0) FAIL_STACK_ERROR /* Verify names */ - if(check_name(group6_id, "/g3/g4/g18/g2", "/g3/g4/g18/g2") < 0) TEST_ERROR; - if(check_name(dataset2_id, "/g3/g4/g18/d2", "/g3/g4/g18/d2") < 0) TEST_ERROR; - if(check_name(type2_id, "/g3/g4/g18/t2", "/g3/g4/g18/t2") < 0) TEST_ERROR; + if(check_name(group6_id, "/g3/g4/g18/g2", "/g3/g4/g18/g2") < 0) TEST_ERROR + if(check_name(dataset2_id, "/g3/g4/g18/d2", "/g3/g4/g18/d2") < 0) TEST_ERROR + if(check_name(type2_id, "/g3/g4/g18/t2", "/g3/g4/g18/t2") < 0) TEST_ERROR /* Verify that old IDs still refer to objects by their old names */ - if(check_name(group2_id, "/g18/g2", "/g18/g2") < 0) TEST_ERROR; - if(check_name(dataset_id, "/g18/d2", "/g18/d2") < 0) TEST_ERROR; - if(check_name(type_id, "/g18/t2", "/g18/t2") < 0) TEST_ERROR; + if(check_name(group2_id, "/g18/g2", "/g18/g2") < 0) TEST_ERROR + if(check_name(dataset_id, "/g18/d2", "/g18/d2") < 0) TEST_ERROR + if(check_name(type_id, "/g18/t2", "/g18/t2") < 0) TEST_ERROR /* Unmount */ - if (H5Funmount(file1_id, "/g3/g4")<0) TEST_ERROR; + if(H5Funmount(file1_id, "/g3/g4")<0) TEST_ERROR /* Get name for the IDs of the first file, should be unchanged */ - if(check_name(group2_id, "/g18/g2", "/g18/g2") < 0) TEST_ERROR; - if(check_name(dataset_id, "/g18/d2", "/g18/d2") < 0) TEST_ERROR; - if(check_name(type_id, "/g18/t2", "/g18/t2") < 0) TEST_ERROR; + if(check_name(group2_id, "/g18/g2", "/g18/g2") < 0) TEST_ERROR + 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 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 ); - H5Dclose( dataset_id ); - H5Dclose( dataset2_id ); - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); - H5Gclose( group4_id ); - H5Gclose( group5_id ); - H5Gclose( group6_id ); - H5Fclose( file1_id ); + 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); + H5Dclose(dataset_id); + H5Dclose(dataset2_id); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); + H5Gclose(group4_id); + H5Gclose(group5_id); + H5Gclose(group6_id); + H5Fclose(file1_id); PASSED(); @@ -1334,17 +1334,17 @@ PASSED(); if((group2_id = H5Gcreate2(file1_id, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group2_id, "/g1/g2", "/g1/g2") < 0) TEST_ERROR; + if(check_name(group2_id, "/g1/g2", "/g1/g2") < 0) TEST_ERROR /* Close file */ - H5Fclose( file1_id ); + H5Fclose(file1_id); /* Verify */ - if(check_name(group2_id, "/g1/g2", "/g1/g2") < 0) TEST_ERROR; + if(check_name(group2_id, "/g1/g2", "/g1/g2") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); + H5Gclose(group_id); + H5Gclose(group2_id); PASSED(); @@ -1362,36 +1362,36 @@ PASSED(); if((group2_id = H5Gcreate2(file1_id, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create a new file and group "/g3/g4" in it */ - if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl )) < 0) FAIL_STACK_ERROR + if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR if((group3_id = H5Gcreate2(file2_id, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((group4_id = H5Gcreate2(file2_id, "/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Mount first file at "/g3/g4" in the second file */ - if(H5Fmount(file2_id, "/g3/g4", file1_id, H5P_DEFAULT)<0) TEST_ERROR; + if(H5Fmount(file2_id, "/g3/g4", file1_id, H5P_DEFAULT)<0) TEST_ERROR /* Open the mounted group */ - if ((group5_id = H5Gopen( file2_id, "/g3/g4/g1/g2" ))<0) TEST_ERROR; + if((group5_id = H5Gopen2(file2_id, "/g3/g4/g1/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0) TEST_ERROR; + if(check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0) TEST_ERROR /* Delete */ - if (H5Gunlink( file1_id, "/g3/g4/g1/g2")<0) TEST_ERROR; + if(H5Gunlink(file1_id, "/g3/g4/g1/g2")<0) TEST_ERROR /* Verify */ - if(check_name(group5_id, "", "") < 0) TEST_ERROR; + if(check_name(group5_id, "", "") < 0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "", "") < 0) TEST_ERROR; + if(check_name(group2_id, "", "") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); - H5Gclose( group4_id ); - H5Gclose( group5_id ); - H5Fclose( file1_id ); - H5Fclose( file2_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); + H5Gclose(group4_id); + H5Gclose(group5_id); + H5Fclose(file1_id); + H5Fclose(file2_id); PASSED(); @@ -1410,89 +1410,89 @@ PASSED(); if((group2_id = H5Gcreate2(file1_id, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create a new file and group "/g3/g4" in it */ - if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl )) < 0) FAIL_STACK_ERROR + if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR if((group3_id = H5Gcreate2(file2_id, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((group4_id = H5Gcreate2(file2_id, "/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Mount first file at "g3/g4" in the second file */ - if(H5Fmount(file2_id, "/g3/g4", file1_id, H5P_DEFAULT)<0) TEST_ERROR; + if(H5Fmount(file2_id, "/g3/g4", file1_id, H5P_DEFAULT)<0) TEST_ERROR /* Verify */ - if(check_name(group4_id, "/g3/g4", "/g3/g4") < 0) TEST_ERROR; + if(check_name(group4_id, "/g3/g4", "/g3/g4") < 0) TEST_ERROR /* Open the mounted group */ - if ((group5_id = H5Gopen( file2_id, "/g3/g4/g1/g2" ))<0) TEST_ERROR; + if((group5_id = H5Gopen2(file2_id, "/g3/g4/g1/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0) TEST_ERROR; + if(check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0) TEST_ERROR /* Open another mounted group, in the middle of the path */ - if ((group6_id = H5Gopen( file2_id, "/g3/g4/g1" ))<0) TEST_ERROR; + if((group6_id = H5Gopen2(file2_id, "/g3/g4/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0) TEST_ERROR; + if(check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0) TEST_ERROR /* Rename group */ - if (H5Gmove( file2_id, "/g3/g4/g1/g2", "/g3/g4/g1/g5" )<0) TEST_ERROR; + if(H5Gmove(file2_id, "/g3/g4/g1/g2", "/g3/g4/g1/g5")<0) TEST_ERROR /* Verify */ - if(check_name(group5_id, "/g3/g4/g1/g5", "/g3/g4/g1/g5") < 0) TEST_ERROR; - if(check_name(group2_id, "/g1/g5", "/g1/g5") < 0) TEST_ERROR; + if(check_name(group5_id, "/g3/g4/g1/g5", "/g3/g4/g1/g5") < 0) TEST_ERROR + if(check_name(group2_id, "/g1/g5", "/g1/g5") < 0) TEST_ERROR /* Rename group */ - if (H5Gmove( file2_id, "/g3/g4/g1", "/g3/g4/g1a" )<0) TEST_ERROR; + if(H5Gmove(file2_id, "/g3/g4/g1", "/g3/g4/g1a")<0) TEST_ERROR /* Verify */ - if(check_name(group5_id, "/g3/g4/g1a/g5", "/g3/g4/g1a/g5") < 0) TEST_ERROR; - if(check_name(group2_id, "/g1a/g5", "/g1a/g5") < 0) TEST_ERROR; + if(check_name(group5_id, "/g3/g4/g1a/g5", "/g3/g4/g1a/g5") < 0) TEST_ERROR + if(check_name(group2_id, "/g1a/g5", "/g1a/g5") < 0) TEST_ERROR /* Verify */ - if(check_name(group6_id, "/g3/g4/g1a", "/g3/g4/g1a") < 0) TEST_ERROR; - if(check_name(group_id, "/g1a", "/g1a") < 0) TEST_ERROR; + if(check_name(group6_id, "/g3/g4/g1a", "/g3/g4/g1a") < 0) TEST_ERROR + if(check_name(group_id, "/g1a", "/g1a") < 0) TEST_ERROR /* Rename middle group back, using relative path */ - if (H5Gmove( group3_id, "g4/g1a", "g4/g1" )<0) TEST_ERROR; + if(H5Gmove(group3_id, "g4/g1a", "g4/g1")<0) TEST_ERROR /* Verify */ - if(check_name(group5_id, "/g3/g4/g1/g5", "/g3/g4/g1/g5") < 0) TEST_ERROR; - if(check_name(group2_id, "/g1/g5", "/g1/g5") < 0) TEST_ERROR; - if(check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0) TEST_ERROR; - if(check_name(group_id, "/g1", "/g1") < 0) TEST_ERROR; + if(check_name(group5_id, "/g3/g4/g1/g5", "/g3/g4/g1/g5") < 0) TEST_ERROR + if(check_name(group2_id, "/g1/g5", "/g1/g5") < 0) TEST_ERROR + if(check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0) TEST_ERROR + if(check_name(group_id, "/g1", "/g1") < 0) TEST_ERROR /* Rename end group back, using relative path */ - if (H5Gmove( group3_id, "g4/g1/g5", "g4/g1/g2" )<0) TEST_ERROR; + if(H5Gmove(group3_id, "g4/g1/g5", "g4/g1/g2")<0) TEST_ERROR /* Verify */ - if(check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0) TEST_ERROR; - if(check_name(group2_id, "/g1/g2", "/g1/g2") < 0) TEST_ERROR; - if(check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0) TEST_ERROR; - if(check_name(group_id, "/g1", "/g1") < 0) TEST_ERROR; + if(check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0) TEST_ERROR + if(check_name(group2_id, "/g1/g2", "/g1/g2") < 0) TEST_ERROR + if(check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0) TEST_ERROR + if(check_name(group_id, "/g1", "/g1") < 0) TEST_ERROR /* Rename mount point */ - if (H5Gmove( file2_id, "/g3/g4", "/g3/g4a" )<0) TEST_ERROR; + if(H5Gmove(file2_id, "/g3/g4", "/g3/g4a")<0) TEST_ERROR /* Verify */ - if(check_name(group4_id, "/g3/g4a", "/g3/g4a") < 0) TEST_ERROR; - if(check_name(group5_id, "/g3/g4a/g1/g2", "/g3/g4a/g1/g2") < 0) TEST_ERROR; - if(check_name(group6_id, "/g3/g4a/g1", "/g3/g4a/g1") < 0) TEST_ERROR; + if(check_name(group4_id, "/g3/g4a", "/g3/g4a") < 0) TEST_ERROR + if(check_name(group5_id, "/g3/g4a/g1/g2", "/g3/g4a/g1/g2") < 0) TEST_ERROR + if(check_name(group6_id, "/g3/g4a/g1", "/g3/g4a/g1") < 0) TEST_ERROR /* Rename mount point back, using relative path*/ - if (H5Gmove( group3_id, "g4a", "g4" )<0) TEST_ERROR; + if(H5Gmove(group3_id, "g4a", "g4")<0) TEST_ERROR /* Verify */ - if(check_name(group4_id, "/g3/g4", "/g3/g4") < 0) TEST_ERROR; - if(check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0) TEST_ERROR; - if(check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0) TEST_ERROR; + if(check_name(group4_id, "/g3/g4", "/g3/g4") < 0) TEST_ERROR + if(check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0) TEST_ERROR + if(check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); - H5Gclose( group4_id ); - H5Gclose( group5_id ); - H5Gclose( group6_id ); - H5Fclose( file1_id ); - H5Fclose( file2_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); + H5Gclose(group4_id); + H5Gclose(group5_id); + H5Gclose(group6_id); + H5Fclose(file1_id); + H5Fclose(file2_id); PASSED(); @@ -1508,75 +1508,75 @@ PASSED(); if((group2_id = H5Gcreate2(file_id, "/g19/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create hard link to "g19/g1/ group */ - if (H5Glink(file_id, H5G_LINK_HARD, "/g19/g1", "/g19/g2")<0) TEST_ERROR; + if(H5Glink(file_id, H5G_LINK_HARD, "/g19/g1", "/g19/g2")<0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "/g19/g1", "/g19/g1") < 0) TEST_ERROR; + if(check_name(group2_id, "/g19/g1", "/g19/g1") < 0) TEST_ERROR /* Open the group */ - if ((group3_id = H5Gopen( file_id, "/g19/g2" ))<0) TEST_ERROR; + if((group3_id = H5Gopen2(file_id, "/g19/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR; + if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR /* Rename original group */ - if (H5Gmove( file_id, "/g19/g1", "/g19/g3" )<0) TEST_ERROR; + if(H5Gmove(file_id, "/g19/g1", "/g19/g3")<0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "/g19/g3", "/g19/g3") < 0) TEST_ERROR; - if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR; + if(check_name(group2_id, "/g19/g3", "/g19/g3") < 0) TEST_ERROR + if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR /* Rename original group back, using relative path */ - if (H5Gmove( group_id, "g3", "g1" )<0) TEST_ERROR; + if(H5Gmove(group_id, "g3", "g1")<0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "/g19/g1", "/g19/g1") < 0) TEST_ERROR; - if(check_name(group3_id, "/g19/g2", "/g19/g2") < 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 /* Create another hard link to "/g19/g1" group */ - if (H5Glink(file_id, H5G_LINK_HARD, "/g19/g1", "/g19/g3")<0) TEST_ERROR; + if(H5Glink(file_id, H5G_LINK_HARD, "/g19/g1", "/g19/g3")<0) TEST_ERROR /* Open the group */ - if ((group4_id = H5Gopen( file_id, "/g19/g3" ))<0) TEST_ERROR; + if((group4_id = H5Gopen2(file_id, "/g19/g3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group4_id, "/g19/g3", "/g19/g3") < 0) TEST_ERROR; + if(check_name(group4_id, "/g19/g3", "/g19/g3") < 0) TEST_ERROR /* Delete group */ - if (H5Gunlink( file_id, "/g19/g3")<0) TEST_ERROR; + if(H5Gunlink(file_id, "/g19/g3")<0) TEST_ERROR /* Verify */ - 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; + 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 /* Close the unlinked group */ - H5Gclose( group4_id ); + H5Gclose(group4_id); /* Create another hard link to "/g19/g1" group */ - if (H5Glink(file_id, H5G_LINK_HARD, "/g19/g1", "/g19/g3")<0) TEST_ERROR; + if(H5Glink(file_id, H5G_LINK_HARD, "/g19/g1", "/g19/g3")<0) TEST_ERROR /* Open the group */ - if ((group4_id = H5Gopen( file_id, "/g19/g3" ))<0) TEST_ERROR; + if((group4_id = H5Gopen2(file_id, "/g19/g3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group4_id, "/g19/g3", "/g19/g3") < 0) TEST_ERROR; + if(check_name(group4_id, "/g19/g3", "/g19/g3") < 0) TEST_ERROR /* Delete group, using relative path */ - if (H5Gunlink( group_id, "g3")<0) TEST_ERROR; + if(H5Gunlink(group_id, "g3")<0) TEST_ERROR /* Verify */ - 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; + 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 /* Close the unlinked group */ - H5Gclose( group4_id ); + H5Gclose(group4_id); /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); PASSED(); @@ -1594,21 +1594,21 @@ PASSED(); if((group2_id = H5Gcreate2(file_id, "/g20/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create symbolic link to "g20/g1/ group */ - if (H5Glink(file_id, H5G_LINK_SOFT, "/g20/g1", "/g20/g2")<0) TEST_ERROR; + if(H5Glink(file_id, H5G_LINK_SOFT, "/g20/g1", "/g20/g2")<0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "/g20/g1", "/g20/g1") < 0) TEST_ERROR; + if(check_name(group2_id, "/g20/g1", "/g20/g1") < 0) TEST_ERROR /* Open the group */ - if ((group3_id = H5Gopen( file_id, "/g20/g2" ))<0) TEST_ERROR; + if((group3_id = H5Gopen2(file_id, "/g20/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group3_id, "/g20/g2", "/g20/g2") < 0) TEST_ERROR; + if(check_name(group3_id, "/g20/g2", "/g20/g2") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); PASSED(); @@ -1625,25 +1625,25 @@ PASSED(); if((group2_id = H5Gcreate2(file_id, "/g21/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create symbolic link to "g21/g1/ group */ - if (H5Glink(file_id, H5G_LINK_SOFT, "/g21/g1", "/g21/g2")<0) TEST_ERROR; + if(H5Glink(file_id, H5G_LINK_SOFT, "/g21/g1", "/g21/g2")<0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "/g21/g1", "/g21/g1") < 0) TEST_ERROR; + if(check_name(group2_id, "/g21/g1", "/g21/g1") < 0) TEST_ERROR /* Open the group */ - if ((group3_id = H5Gopen( file_id, "/g21/g2" ))<0) TEST_ERROR; + if((group3_id = H5Gopen2(file_id, "/g21/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Rename group */ - if (H5Gmove( file_id, "/g21/g1", "/g21/g3" )<0) TEST_ERROR; + if(H5Gmove(file_id, "/g21/g1", "/g21/g3")<0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "/g21/g3", "/g21/g3") < 0) TEST_ERROR; - if(check_name(group3_id, "/g21/g2", "/g21/g2") < 0) TEST_ERROR; + if(check_name(group2_id, "/g21/g3", "/g21/g3") < 0) TEST_ERROR + if(check_name(group3_id, "/g21/g2", "/g21/g2") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); PASSED(); @@ -1660,32 +1660,32 @@ PASSED(); if((group2_id = H5Gcreate2(file_id, "/g22/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create symbolic link to "g22/g1/ group */ - if (H5Glink(file_id, H5G_LINK_SOFT, "/g22/g1", "/g22/g2")<0) TEST_ERROR; + if(H5Glink(file_id, H5G_LINK_SOFT, "/g22/g1", "/g22/g2")<0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "/g22/g1", "/g22/g1") < 0) TEST_ERROR; + if(check_name(group2_id, "/g22/g1", "/g22/g1") < 0) TEST_ERROR /* Open the group */ - if ((group3_id = H5Gopen( file_id, "/g22/g2" ))<0) TEST_ERROR; + if((group3_id = H5Gopen2(file_id, "/g22/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Rename soft link */ - if (H5Gmove( file_id, "/g22/g2", "/g22/g3" )<0) TEST_ERROR; + if(H5Gmove(file_id, "/g22/g2", "/g22/g3")<0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "/g22/g1", "/g22/g1") < 0) TEST_ERROR; - if(check_name(group3_id, "/g22/g3", "/g22/g3") < 0) TEST_ERROR; + if(check_name(group2_id, "/g22/g1", "/g22/g1") < 0) TEST_ERROR + if(check_name(group3_id, "/g22/g3", "/g22/g3") < 0) TEST_ERROR /* Rename soft link, using relative paths */ - if (H5Gmove( group_id, "g3", "g2" )<0) TEST_ERROR; + if(H5Gmove(group_id, "g3", "g2")<0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "/g22/g1", "/g22/g1") < 0) TEST_ERROR; - if(check_name(group3_id, "/g22/g2", "/g22/g2") < 0) TEST_ERROR; + if(check_name(group2_id, "/g22/g1", "/g22/g1") < 0) TEST_ERROR + if(check_name(group3_id, "/g22/g2", "/g22/g2") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); PASSED(); @@ -1703,24 +1703,24 @@ PASSED(); if((group2_id = H5Gcreate2(file_id, "/g23/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create symbolic link to "g23/g1/ group */ - if (H5Glink(file_id, H5G_LINK_SOFT, "/g23/g1", "/g23/g2")<0) TEST_ERROR; + if(H5Glink(file_id, H5G_LINK_SOFT, "/g23/g1", "/g23/g2")<0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "/g23/g1", "/g23/g1") < 0) TEST_ERROR; + if(check_name(group2_id, "/g23/g1", "/g23/g1") < 0) TEST_ERROR /* Open the group */ - if ((group3_id = H5Gopen( file_id, "/g23/g2" ))<0) TEST_ERROR; + if((group3_id = H5Gopen2(file_id, "/g23/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete group */ - if (H5Gunlink( file_id, "/g23/g1")<0) TEST_ERROR; + if(H5Gunlink(file_id, "/g23/g1")<0) TEST_ERROR /* Verify */ - if(check_name(group3_id, "/g23/g2", "/g23/g2") < 0) TEST_ERROR; + if(check_name(group3_id, "/g23/g2", "/g23/g2") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); PASSED(); @@ -1736,24 +1736,24 @@ PASSED(); if((group2_id = H5Gcreate2(file_id, "/g24/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create symbolic link to "g24/g1/ group */ - if (H5Glink(file_id, H5G_LINK_SOFT, "/g24/g1", "/g24/g2")<0) TEST_ERROR; + if(H5Glink(file_id, H5G_LINK_SOFT, "/g24/g1", "/g24/g2")<0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "/g24/g1", "/g24/g1") < 0) TEST_ERROR; + if(check_name(group2_id, "/g24/g1", "/g24/g1") < 0) TEST_ERROR /* Open the group */ - if ((group3_id = H5Gopen( file_id, "/g24/g2" ))<0) TEST_ERROR; + if((group3_id = H5Gopen2(file_id, "/g24/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete symbolic link */ - if (H5Gunlink( file_id, "/g24/g2")<0) TEST_ERROR; + if(H5Gunlink(file_id, "/g24/g2")<0) TEST_ERROR /* Verify */ - if(check_name(group3_id, "/g24/g1", "") < 0) TEST_ERROR; + if(check_name(group3_id, "/g24/g1", "") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); PASSED(); @@ -1770,9 +1770,9 @@ PASSED(); if((group3_id = H5Gcreate2(file_id, "/g25/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); /* Create second file and group "/g26/g3/g4" in it */ file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); @@ -1782,9 +1782,9 @@ PASSED(); if((group3_id = H5Gcreate2(file1_id, "/g26/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); /* Create third file and group "/g27/g5/g6" in it */ file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); @@ -1794,9 +1794,9 @@ PASSED(); if((group3_id = H5Gcreate2(file2_id, "/g27/g5/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); /* Create fourth file and group "/g28/g5/g6" in it */ file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); @@ -1806,85 +1806,85 @@ PASSED(); if((group3_id = H5Gcreate2(file3_id, "/g28/g7/g8", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); /* Access group which will be hidden in the first file */ - if ((group_id = H5Gopen( file_id, "/g25/g1/g2"))<0) TEST_ERROR; + if((group_id = H5Gopen2(file_id, "/g25/g1/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "/g25/g1/g2", "/g25/g1/g2") < 0) TEST_ERROR; + if(check_name(group_id, "/g25/g1/g2", "/g25/g1/g2") < 0) TEST_ERROR /* Mount second file under "/g25/g1" in the first file */ - if (H5Fmount(file_id, "/g25/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR; + if(H5Fmount(file_id, "/g25/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR /* Verify */ - if(check_name(group_id, "", "/g25/g1/g2") < 0) TEST_ERROR; + if(check_name(group_id, "", "/g25/g1/g2") < 0) TEST_ERROR /* Access group which will be hidden in the second file */ - if ((group2_id = H5Gopen( file_id, "/g25/g1/g26/g3/g4"))<0) TEST_ERROR; + if((group2_id = H5Gopen2(file_id, "/g25/g1/g26/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group2_id, "/g25/g1/g26/g3/g4", "/g25/g1/g26/g3/g4") < 0) TEST_ERROR; + if(check_name(group2_id, "/g25/g1/g26/g3/g4", "/g25/g1/g26/g3/g4") < 0) TEST_ERROR /* Mount third file under "/g25/g1/g26/g3" in the first file */ - if (H5Fmount(file_id, "/g25/g1/g26/g3", file2_id, H5P_DEFAULT)<0) TEST_ERROR; + if(H5Fmount(file_id, "/g25/g1/g26/g3", file2_id, H5P_DEFAULT)<0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "", "/g25/g1/g26/g3/g4") < 0) TEST_ERROR; + if(check_name(group2_id, "", "/g25/g1/g26/g3/g4") < 0) TEST_ERROR /* Access group in the third file */ - if ((group3_id = H5Gopen( file_id, "/g25/g1/g26/g3/g27/g5/g6"))<0) TEST_ERROR; + if((group3_id = H5Gopen2(file_id, "/g25/g1/g26/g3/g27/g5/g6", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - 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(group3_id, "/g25/g1/g26/g3/g27/g5/g6", "/g25/g1/g26/g3/g27/g5/g6") < 0) TEST_ERROR /* Mount fourth file under "/g25/g1/g26/g3/g27/g5" in the first file */ - if (H5Fmount(file_id, "/g25/g1/g26/g3/g27/g5", file3_id, H5P_DEFAULT)<0) TEST_ERROR; + if(H5Fmount(file_id, "/g25/g1/g26/g3/g27/g5", file3_id, H5P_DEFAULT)<0) TEST_ERROR /* Verify */ - if(check_name(group3_id, "", "/g25/g1/g26/g3/g27/g5/g6") < 0) TEST_ERROR; + if(check_name(group3_id, "", "/g25/g1/g26/g3/g27/g5/g6") < 0) TEST_ERROR /* Access group in the fourth file */ - if ((group4_id = H5Gopen( file_id, "/g25/g1/g26/g3/g27/g5/g28/g7/g8"))<0) TEST_ERROR; + if((group4_id = H5Gopen2(file_id, "/g25/g1/g26/g3/g27/g5/g28/g7/g8", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group4_id, "/g25/g1/g26/g3/g27/g5/g28/g7/g8", "/g25/g1/g26/g3/g27/g5/g28/g7/g8") < 0) TEST_ERROR; + if(check_name(group4_id, "/g25/g1/g26/g3/g27/g5/g28/g7/g8", "/g25/g1/g26/g3/g27/g5/g28/g7/g8") < 0) TEST_ERROR - if (H5Funmount(file_id, "/g25/g1/g26/g3/g27/g5")<0) TEST_ERROR; + if(H5Funmount(file_id, "/g25/g1/g26/g3/g27/g5")<0) TEST_ERROR /* Verify */ - 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; + 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 /* Close */ - H5Gclose( group4_id ); - H5Fclose( file3_id ); + H5Gclose(group4_id); + H5Fclose(file3_id); - if (H5Funmount(file_id, "/g25/g1/g26/g3")<0) TEST_ERROR; + if(H5Funmount(file_id, "/g25/g1/g26/g3")<0) TEST_ERROR /* Verify */ - 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; + 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 /* Close */ - H5Gclose( group3_id ); - H5Fclose( file2_id ); + H5Gclose(group3_id); + H5Fclose(file2_id); - if (H5Funmount(file_id, "/g25/g1")<0) TEST_ERROR; + if(H5Funmount(file_id, "/g25/g1")<0) TEST_ERROR /* Verify */ - 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; + 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 */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Fclose( file1_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Fclose(file1_id); PASSED(); @@ -1905,31 +1905,31 @@ PASSED(); if((group5_id = H5Gcreate2(file_id, "/g29/g1/g2/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Rename group */ - if (H5Gmove( file_id, "/g29/g1/g2/g1/g2", "/g29/g1/g2/g1/g3" )<0) TEST_ERROR; + if(H5Gmove(file_id, "/g29/g1/g2/g1/g2", "/g29/g1/g2/g1/g3")<0) TEST_ERROR /* Verify */ - if(check_name(group5_id, "/g29/g1/g2/g1/g3", "/g29/g1/g2/g1/g3") < 0) TEST_ERROR; + if(check_name(group5_id, "/g29/g1/g2/g1/g3", "/g29/g1/g2/g1/g3") < 0) TEST_ERROR /* Rename group in middle of path, keeping within the same group */ - if (H5Gmove( file_id, "/g29/g1/g2/g1", "/g29/g1/g2/g3" )<0) TEST_ERROR; + if(H5Gmove(file_id, "/g29/g1/g2/g1", "/g29/g1/g2/g3")<0) TEST_ERROR /* Verify */ - if(check_name(group4_id, "/g29/g1/g2/g3", "/g29/g1/g2/g3") < 0) TEST_ERROR; - if(check_name(group5_id, "/g29/g1/g2/g3/g3", "/g29/g1/g2/g3/g3") < 0) TEST_ERROR; + if(check_name(group4_id, "/g29/g1/g2/g3", "/g29/g1/g2/g3") < 0) TEST_ERROR + if(check_name(group5_id, "/g29/g1/g2/g3/g3", "/g29/g1/g2/g3/g3") < 0) TEST_ERROR /* Rename group in middle of path, moving to another group in file */ - if (H5Gmove( file_id, "/g29/g1/g2/g3", "/g29/g3" )<0) TEST_ERROR; + if(H5Gmove(file_id, "/g29/g1/g2/g3", "/g29/g3")<0) TEST_ERROR /* Verify */ - if(check_name(group4_id, "/g29/g3", "/g29/g3") < 0) TEST_ERROR; - if(check_name(group5_id, "/g29/g3/g3", "/g29/g3/g3") < 0) TEST_ERROR; + if(check_name(group4_id, "/g29/g3", "/g29/g3") < 0) TEST_ERROR + if(check_name(group5_id, "/g29/g3/g3", "/g29/g3/g3") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); - H5Gclose( group4_id ); - H5Gclose( group5_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); + H5Gclose(group4_id); + H5Gclose(group5_id); PASSED(); @@ -1947,9 +1947,9 @@ PASSED(); if((group3_id = H5Gcreate2(file_id, "/g30/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); /* Create second file and group "/g31/g3/g4" in it */ file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); @@ -1959,9 +1959,9 @@ PASSED(); if((group3_id = H5Gcreate2(file1_id, "/g31/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); /* Create third file and group "/g32/g5/g6" in it */ file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); @@ -1971,9 +1971,9 @@ PASSED(); if((group3_id = H5Gcreate2(file2_id, "/g32/g5/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); /* Create fourth file and group "/g33/g5/g6" in it */ file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); @@ -1983,89 +1983,89 @@ PASSED(); if((group3_id = H5Gcreate2(file3_id, "/g33/g7/g8", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); /* Access group which will be hidden in the first file */ - if ((group_id = H5Gopen( file_id, "/g30/g1/g2"))<0) TEST_ERROR; + if((group_id = H5Gopen2(file_id, "/g30/g1/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "/g30/g1/g2", "/g30/g1/g2") < 0) TEST_ERROR; + if(check_name(group_id, "/g30/g1/g2", "/g30/g1/g2") < 0) TEST_ERROR /* Mount second file under "/g30/g1" in the first file */ - if (H5Fmount(file_id, "/g30/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR; + if(H5Fmount(file_id, "/g30/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR /* Verify */ - if(check_name(group_id, "", "/g30/g1/g2") < 0) TEST_ERROR; + if(check_name(group_id, "", "/g30/g1/g2") < 0) TEST_ERROR /* Access group which will be hidden in the second file */ - if ((group2_id = H5Gopen( file_id, "/g30/g1/g31/g3/g4"))<0) TEST_ERROR; + if((group2_id = H5Gopen2(file_id, "/g30/g1/g31/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group2_id, "/g30/g1/g31/g3/g4", "/g30/g1/g31/g3/g4") < 0) TEST_ERROR; + if(check_name(group2_id, "/g30/g1/g31/g3/g4", "/g30/g1/g31/g3/g4") < 0) TEST_ERROR /* Mount third file under "/g30/g1/g31/g3" in the first file */ - if (H5Fmount(file_id, "/g30/g1/g31/g3", file2_id, H5P_DEFAULT)<0) TEST_ERROR; + if(H5Fmount(file_id, "/g30/g1/g31/g3", file2_id, H5P_DEFAULT)<0) TEST_ERROR /* Verify */ - if(check_name(group2_id, "", "/g30/g1/g31/g3/g4") < 0) TEST_ERROR; + if(check_name(group2_id, "", "/g30/g1/g31/g3/g4") < 0) TEST_ERROR /* Access group which will be hidden in the third file */ - if ((group3_id = H5Gopen( file_id, "/g30/g1/g31/g3/g32/g5/g6"))<0) TEST_ERROR; + if((group3_id = H5Gopen2(file_id, "/g30/g1/g31/g3/g32/g5/g6", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - 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(group3_id, "/g30/g1/g31/g3/g32/g5/g6", "/g30/g1/g31/g3/g32/g5/g6") < 0) TEST_ERROR /* Mount fourth file under "/g30" in the first file, hiding the files below it */ - if (H5Fmount(file_id, "/g30", file3_id, H5P_DEFAULT)<0) TEST_ERROR; + if(H5Fmount(file_id, "/g30", file3_id, H5P_DEFAULT)<0) TEST_ERROR /* Verify */ - if(check_name(group3_id, "", "/g30/g1/g31/g3/g32/g5/g6") < 0) TEST_ERROR; + if(check_name(group3_id, "", "/g30/g1/g31/g3/g32/g5/g6") < 0) TEST_ERROR /* Access group which will be in the fourth file */ - if ((group4_id = H5Gopen( file_id, "/g30/g33/g7/g8"))<0) TEST_ERROR; + if((group4_id = H5Gopen2(file_id, "/g30/g33/g7/g8", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group4_id, "/g30/g33/g7/g8", "/g30/g33/g7/g8") < 0) TEST_ERROR; + if(check_name(group4_id, "/g30/g33/g7/g8", "/g30/g33/g7/g8") < 0) TEST_ERROR /* Unmount fourth file */ - if (H5Funmount(file_id, "/g30")<0) TEST_ERROR; + if(H5Funmount(file_id, "/g30")<0) TEST_ERROR /* Verify */ - 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; + 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 /* Unmount third file */ - if (H5Funmount(file_id, "/g30/g1/g31/g3")<0) TEST_ERROR; + if(H5Funmount(file_id, "/g30/g1/g31/g3")<0) TEST_ERROR /* Verify */ - 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; + 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 /* Unmount second file */ - if (H5Funmount(file_id, "/g30/g1")<0) TEST_ERROR; + if(H5Funmount(file_id, "/g30/g1")<0) TEST_ERROR /* Verify */ - 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; + 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 */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); - H5Gclose( group4_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); + H5Gclose(group4_id); /* Close files */ - H5Fclose( file1_id ); - H5Fclose( file2_id ); - H5Fclose( file3_id ); + H5Fclose(file1_id); + H5Fclose(file2_id); + H5Fclose(file3_id); PASSED(); @@ -2085,9 +2085,9 @@ PASSED(); if((group3_id = H5Gcreate2(file1_id, "/g35/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); /* Create group "/g34/g1/g2" in first file */ if((group_id = H5Gcreate2(file_id, "/g34", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -2095,37 +2095,37 @@ PASSED(); if((group3_id = H5Gcreate2(file_id, "/g34/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create hard link to "/g34/g1/g2 group */ - if (H5Glink(file_id, H5G_LINK_HARD, "/g34/g1/g2", "/g34/g2a")<0) TEST_ERROR; + if(H5Glink(file_id, H5G_LINK_HARD, "/g34/g1/g2", "/g34/g2a")<0) TEST_ERROR /* Verify */ - if(check_name(group3_id, "/g34/g1/g2", "/g34/g1/g2") < 0) TEST_ERROR; + if(check_name(group3_id, "/g34/g1/g2", "/g34/g1/g2") < 0) TEST_ERROR /* Open the link to the group */ - if ((group4_id = H5Gopen( file_id, "/g34/g2a" ))<0) TEST_ERROR; + if((group4_id = H5Gopen2(file_id, "/g34/g2a", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group4_id, "/g34/g2a", "/g34/g2a") < 0) TEST_ERROR; + if(check_name(group4_id, "/g34/g2a", "/g34/g2a") < 0) TEST_ERROR /* Mount second file under "/g34/g1" in the first file */ - if (H5Fmount(file_id, "/g34/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR; + if(H5Fmount(file_id, "/g34/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR /* Verify */ - if(check_name(group3_id, "", "/g34/g1/g2") < 0) TEST_ERROR; - if(check_name(group4_id, "/g34/g2a", "/g34/g2a") < 0) TEST_ERROR; + if(check_name(group3_id, "", "/g34/g1/g2") < 0) TEST_ERROR + if(check_name(group4_id, "/g34/g2a", "/g34/g2a") < 0) TEST_ERROR /* Unmount second file */ - if (H5Funmount(file_id, "/g34/g1")<0) TEST_ERROR; + if(H5Funmount(file_id, "/g34/g1")<0) TEST_ERROR /* Verify */ - if(check_name(group3_id, "/g34/g1/g2", "/g34/g1/g2") < 0) TEST_ERROR; - if(check_name(group4_id, "/g34/g2a", "/g34/g2a") < 0) TEST_ERROR; + if(check_name(group3_id, "/g34/g1/g2", "/g34/g1/g2") < 0) TEST_ERROR + if(check_name(group4_id, "/g34/g2a", "/g34/g2a") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); - H5Gclose( group4_id ); - H5Fclose( file1_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); + H5Gclose(group4_id); + H5Fclose(file1_id); PASSED(); @@ -2144,9 +2144,9 @@ PASSED(); if((group3_id = H5Gcreate2(file_id, "/g36/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); /* Create second file and group "/g37/g4" in it */ file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); @@ -2157,62 +2157,62 @@ PASSED(); if((group4_id = H5Gcreate2(file1_id, "/g37/g4/g5b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Mount second file under "/g36/g1" in the first file */ - if (H5Fmount(file_id, "/g36/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR; + if(H5Fmount(file_id, "/g36/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR /* Open group in mounted file */ - if ((group5_id = H5Gopen( file_id, "/g36/g1/g37/" ))<0) TEST_ERROR; + if((group5_id = H5Gopen2(file_id, "/g36/g1/g37/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group5_id, "/g36/g1/g37", "/g36/g1/g37") < 0) TEST_ERROR; + if(check_name(group5_id, "/g36/g1/g37", "/g36/g1/g37") < 0) TEST_ERROR /* Open group to delete in mounted file */ - if ((group6_id = H5Gopen( file_id, "/g36/g1/g37/g4/g5a" ))<0) TEST_ERROR; + if((group6_id = H5Gopen2(file_id, "/g36/g1/g37/g4/g5a", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group6_id, "/g36/g1/g37/g4/g5a", "/g36/g1/g37/g4/g5a") < 0) TEST_ERROR; + if(check_name(group6_id, "/g36/g1/g37/g4/g5a", "/g36/g1/g37/g4/g5a") < 0) TEST_ERROR /* Delete end group in mounted file, using relative paths */ - if (H5Gunlink( group5_id, "g4/g5a")<0) TEST_ERROR; + if(H5Gunlink(group5_id, "g4/g5a")<0) TEST_ERROR /* Verify */ - if(check_name(group6_id, "", "") < 0) TEST_ERROR; - if(check_name(group3_id, "", "") < 0) TEST_ERROR; + if(check_name(group6_id, "", "") < 0) TEST_ERROR + if(check_name(group3_id, "", "") < 0) TEST_ERROR /* Close deleted group */ - H5Gclose( group6_id ); + H5Gclose(group6_id); /* Open groups to delete in mounted file */ - if ((group6_id = H5Gopen( file_id, "/g36/g1/g37/g4" ))<0) TEST_ERROR; - if ((group7_id = H5Gopen( file_id, "/g36/g1/g37/g4/g5b" ))<0) TEST_ERROR; + if((group6_id = H5Gopen2(file_id, "/g36/g1/g37/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((group7_id = H5Gopen2(file_id, "/g36/g1/g37/g4/g5b", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group6_id, "/g36/g1/g37/g4", "/g36/g1/g37/g4") < 0) TEST_ERROR; - if(check_name(group7_id, "/g36/g1/g37/g4/g5b", "/g36/g1/g37/g4/g5b") < 0) TEST_ERROR; + if(check_name(group6_id, "/g36/g1/g37/g4", "/g36/g1/g37/g4") < 0) TEST_ERROR + if(check_name(group7_id, "/g36/g1/g37/g4/g5b", "/g36/g1/g37/g4/g5b") < 0) TEST_ERROR /* Delete middle group in mounted file, using relative paths */ - if (H5Gunlink( group5_id, "g4")<0) TEST_ERROR; + if(H5Gunlink(group5_id, "g4")<0) TEST_ERROR /* Verify */ - if(check_name(group6_id, "", "") < 0) TEST_ERROR; - if(check_name(group2_id, "", "") < 0) TEST_ERROR; - if(check_name(group7_id, "", "") < 0) TEST_ERROR; - if(check_name(group4_id, "", "") < 0) TEST_ERROR; + if(check_name(group6_id, "", "") < 0) TEST_ERROR + if(check_name(group2_id, "", "") < 0) TEST_ERROR + if(check_name(group7_id, "", "") < 0) TEST_ERROR + if(check_name(group4_id, "", "") < 0) TEST_ERROR /* Close deleted groups */ - H5Gclose( group6_id ); - H5Gclose( group7_id ); + H5Gclose(group6_id); + H5Gclose(group7_id); /* Close group in mounted file */ - H5Gclose( group5_id ); + H5Gclose(group5_id); - if (H5Funmount(file_id, "/g36/g1")<0) TEST_ERROR; + if(H5Funmount(file_id, "/g36/g1")<0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); - H5Gclose( group4_id ); - H5Fclose( file1_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); + H5Gclose(group4_id); + H5Fclose(file1_id); PASSED(); @@ -2233,9 +2233,9 @@ PASSED(); if((group3_id = H5Gcreate2(file1_id, "/g38/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); /* Create second file and group "/g39/g1/g2" in it */ file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); @@ -2245,9 +2245,9 @@ PASSED(); if((group3_id = H5Gcreate2(file2_id, "/g39/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); /* Create third file and group "/g40/g5/g6" in it */ file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); @@ -2257,46 +2257,46 @@ PASSED(); if((group3_id = H5Gcreate2(file3_id, "/g40/g5/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); /* Mount second file under "/g38/g1" in the first file */ - if (H5Fmount(file1_id, "/g38/g1", file2_id, H5P_DEFAULT)<0) TEST_ERROR; + if(H5Fmount(file1_id, "/g38/g1", file2_id, H5P_DEFAULT)<0) TEST_ERROR - if ((group_id = H5Gopen( file1_id, "/g38/g1/g39/g3/g4" ))<0) TEST_ERROR; + if((group_id = H5Gopen2(file1_id, "/g38/g1/g39/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "/g38/g1/g39/g3/g4", "/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 /* Mount first file under "/g40/g5" in the third file */ - if (H5Fmount(file3_id, "/g40/g5", file1_id, H5P_DEFAULT)<0) TEST_ERROR; + if(H5Fmount(file3_id, "/g40/g5", file1_id, H5P_DEFAULT)<0) TEST_ERROR - if ((group2_id = H5Gopen( file3_id, "/g40/g5/g38/g1/g39/g3/g4" ))<0) TEST_ERROR; + if((group2_id = H5Gopen2(file3_id, "/g40/g5/g38/g1/g39/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group2_id, "/g40/g5/g38/g1/g39/g3/g4", "/g40/g5/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; + if(check_name(group2_id, "/g40/g5/g38/g1/g39/g3/g4", "/g40/g5/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 first file */ - if (H5Funmount(file3_id, "/g40/g5")<0) TEST_ERROR; + if(H5Funmount(file3_id, "/g40/g5")<0) TEST_ERROR /* Verify */ - 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; + 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; + if(H5Funmount(file1_id, "/g38/g1")<0) TEST_ERROR /* Verify */ - if(check_name(group_id, "/g39/g3/g4", "") < 0) TEST_ERROR; + if(check_name(group_id, "/g39/g3/g4", "") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Fclose( file1_id ); - H5Fclose( file2_id ); - H5Fclose( file3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Fclose(file1_id); + H5Fclose(file2_id); + H5Fclose(file3_id); PASSED(); @@ -2315,9 +2315,9 @@ PASSED(); if((group3_id = H5Gcreate2(file1_id, "/g41/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); /* Create second file and group "/g42/g1/g2" in it */ file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); @@ -2327,31 +2327,31 @@ PASSED(); if((group3_id = H5Gcreate2(file2_id, "/g42/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Gclose( group3_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Gclose(group3_id); /* Mount second file under "/g41/g1" in the first file */ - if (H5Fmount(file1_id, "/g41/g1", file2_id, H5P_DEFAULT)<0) TEST_ERROR; + if(H5Fmount(file1_id, "/g41/g1", file2_id, H5P_DEFAULT)<0) TEST_ERROR - if ((group_id = H5Gopen( file1_id, "/g41/g1/g42/g3" ))<0) TEST_ERROR; + if((group_id = H5Gopen2(file1_id, "/g41/g1/g42/g3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group_id, "/g41/g1/g42/g3", "/g41/g1/g42/g3") < 0) TEST_ERROR; + if(check_name(group_id, "/g41/g1/g42/g3", "/g41/g1/g42/g3") < 0) TEST_ERROR /* Unmount file */ - if (H5Funmount(file1_id, "/g41/g1")<0) TEST_ERROR; + if(H5Funmount(file1_id, "/g41/g1")<0) TEST_ERROR - if ((group2_id = H5Gopen( group_id, "g4" ))<0) TEST_ERROR; + if((group2_id = H5Gopen2(group_id, "g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ - if(check_name(group2_id, "/g42/g3/g4", "") < 0) TEST_ERROR; + if(check_name(group2_id, "/g42/g3/g4", "") < 0) TEST_ERROR /* Close */ - H5Gclose( group_id ); - H5Gclose( group2_id ); - H5Fclose( file1_id ); - H5Fclose( file2_id ); + H5Gclose(group_id); + H5Gclose(group2_id); + H5Fclose(file1_id); + H5Fclose(file2_id); PASSED(); @@ -2401,7 +2401,7 @@ test_obj_ref(hid_t fapl) if(H5Dclose(dataset) < 0) TEST_ERROR - /* Create a dataset (inside Group1) */ + /* Create a dataset(inside Group1) */ if((dataset = H5Dcreate(group, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT)) < 0) TEST_ERROR @@ -2417,7 +2417,7 @@ test_obj_ref(hid_t fapl) if(H5Dclose(dataset) < 0) TEST_ERROR - /* Create another dataset (inside Group1) */ + /* Create another dataset(inside Group1) */ if((dataset = H5Dcreate(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT)) < 0) TEST_ERROR @@ -2467,8 +2467,8 @@ test_obj_ref(hid_t fapl) TEST_ERROR /* Open up that hard link and make a new dataset there */ - if((group = H5Gopen(fid1, "/Group1/Group2/Link")) < 0) - TEST_ERROR + if((group = H5Gopen2(fid1, "/Group1/Group2/Link", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR if((dataset = H5Dcreate(group, "Dataset5", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT)) < 0) TEST_ERROR @@ -2515,81 +2515,81 @@ test_obj_ref(hid_t fapl) TESTING("getting path to normal dataset in root group"); if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[0])) < 0) TEST_ERROR - i = H5Iget_name(dataset2, (char*)buf, sizeof(buf)); + i = H5Iget_name(dataset2,(char*)buf, sizeof(buf)); if(H5Dclose(dataset2) < 0) TEST_ERROR - if(!((HDstrcmp(buf, "/Dataset3") == 0) && (i == 9))) TEST_ERROR - i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], (char*)buf, sizeof(buf)); - if(!((HDstrcmp(buf, "/Dataset3") == 0) && (i == 9))) TEST_ERROR + if(!((HDstrcmp(buf, "/Dataset3") == 0) &&(i == 9))) TEST_ERROR + i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0],(char*)buf, sizeof(buf)); + if(!((HDstrcmp(buf, "/Dataset3") == 0) &&(i == 9))) TEST_ERROR PASSED() HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to dataset in /Group1"); if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[1])) < 0) TEST_ERROR - i = H5Iget_name(dataset2, (char*)buf, sizeof(buf)); + i = H5Iget_name(dataset2,(char*)buf, sizeof(buf)); if(H5Dclose(dataset2) < 0) TEST_ERROR - if(!((HDstrcmp(buf, "/Group1/Dataset2") == 0) && (i == 16))) TEST_ERROR - i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[1], (char*)buf, sizeof(buf)); - if(!((HDstrcmp(buf, "/Group1/Dataset2") == 0) && (i == 16))) TEST_ERROR + if(!((HDstrcmp(buf, "/Group1/Dataset2") == 0) &&(i == 16))) TEST_ERROR + i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[1],(char*)buf, sizeof(buf)); + if(!((HDstrcmp(buf, "/Group1/Dataset2") == 0) &&(i == 16))) TEST_ERROR PASSED() HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to /Group1"); if((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[2])) < 0) TEST_ERROR - i = H5Iget_name(group, (char*)buf, sizeof(buf)); + i = H5Iget_name(group,(char*)buf, sizeof(buf)); if(H5Gclose(group) < 0) TEST_ERROR - if(!((HDstrcmp(buf, "/Group1") == 0) && (i == 7))) TEST_ERROR - i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[2], (char*)buf, sizeof(buf)); - if(!((HDstrcmp(buf, "/Group1") == 0) && (i == 7))) TEST_ERROR + if(!((HDstrcmp(buf, "/Group1") == 0) &&(i == 7))) TEST_ERROR + i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[2],(char*)buf, sizeof(buf)); + if(!((HDstrcmp(buf, "/Group1") == 0) &&(i == 7))) TEST_ERROR PASSED() HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to datatype in /Group1"); if((tid1 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[3])) < 0) TEST_ERROR - i = H5Iget_name(tid1, (char*)buf, sizeof(buf)); + i = H5Iget_name(tid1,(char*)buf, sizeof(buf)); if(H5Tclose(tid1) < 0) TEST_ERROR - if(!((HDstrcmp(buf, "/Group1/Datatype1") == 0) && (i == 17))) TEST_ERROR - i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[3], (char*)buf, sizeof(buf)); - if(!((HDstrcmp(buf, "/Group1/Datatype1") == 0) && (i == 17))) TEST_ERROR + if(!((HDstrcmp(buf, "/Group1/Datatype1") == 0) &&(i == 17))) TEST_ERROR + i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[3],(char*)buf, sizeof(buf)); + if(!((HDstrcmp(buf, "/Group1/Datatype1") == 0) &&(i == 17))) TEST_ERROR PASSED() HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to dataset in nested group"); if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[4])) < 0) TEST_ERROR - i = H5Iget_name(dataset2, (char*)buf, sizeof(buf)); + i = H5Iget_name(dataset2,(char*)buf, sizeof(buf)); if(H5Dclose(dataset2) < 0) TEST_ERROR - if(!((HDstrcmp(buf, "/Group1/Group2/Dataset4") == 0) && (i == 23))) TEST_ERROR - i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[4], (char*)buf, sizeof(buf)); - if(!((HDstrcmp(buf, "/Group1/Group2/Dataset4") == 0) && (i == 23))) TEST_ERROR + if(!((HDstrcmp(buf, "/Group1/Group2/Dataset4") == 0) &&(i == 23))) TEST_ERROR + i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[4],(char*)buf, sizeof(buf)); + if(!((HDstrcmp(buf, "/Group1/Group2/Dataset4") == 0) &&(i == 23))) TEST_ERROR PASSED() HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to nested group"); if((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[5])) < 0) TEST_ERROR - i = H5Iget_name(group, (char*)buf, sizeof(buf)); + i = H5Iget_name(group,(char*)buf, sizeof(buf)); if(H5Gclose(group) < 0) TEST_ERROR - if(!((HDstrcmp(buf, "/Group1/Group2") == 0) && (i == 14))) TEST_ERROR - i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[5], (char*)buf, sizeof(buf)); - if(!((HDstrcmp(buf, "/Group1/Group2") == 0) && (i == 14))) TEST_ERROR + if(!((HDstrcmp(buf, "/Group1/Group2") == 0) &&(i == 14))) TEST_ERROR + i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[5],(char*)buf, sizeof(buf)); + if(!((HDstrcmp(buf, "/Group1/Group2") == 0) &&(i == 14))) TEST_ERROR PASSED() HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to dataset created via hard link"); if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[6])) < 0) TEST_ERROR - i = H5Iget_name(dataset2, (char*)buf, sizeof(buf)); + i = H5Iget_name(dataset2,(char*)buf, sizeof(buf)); if(H5Dclose(dataset2) < 0) TEST_ERROR - if(!((HDstrcmp(buf, "/Group1/Dataset5") == 0) && (i == 16))) TEST_ERROR - i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[6], (char*)buf, sizeof(buf)); - if(!((HDstrcmp(buf, "/Group1/Dataset5") == 0) && (i == 16))) TEST_ERROR + if(!((HDstrcmp(buf, "/Group1/Dataset5") == 0) &&(i == 16))) TEST_ERROR + i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[6],(char*)buf, sizeof(buf)); + if(!((HDstrcmp(buf, "/Group1/Dataset5") == 0) &&(i == 16))) TEST_ERROR PASSED() HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to root group"); if((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[7])) < 0) TEST_ERROR - i = H5Iget_name(group, (char*)buf, sizeof(buf)); + i = H5Iget_name(group,(char*)buf, sizeof(buf)); if(H5Gclose(group) < 0) TEST_ERROR - if(!((HDstrcmp(buf, "/") == 0) && (i == 1))) TEST_ERROR - i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[7], (char*)buf, sizeof(buf)); - if(!((HDstrcmp(buf, "/") == 0) && (i == 1))) TEST_ERROR + if(!((HDstrcmp(buf, "/") == 0) &&(i == 1))) TEST_ERROR + i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[7],(char*)buf, sizeof(buf)); + if(!((HDstrcmp(buf, "/") == 0) &&(i == 1))) TEST_ERROR PASSED() /* Now we mount fid2 at /Group2 and look for dataset4. It shouldn't be found */ @@ -2598,10 +2598,10 @@ test_obj_ref(hid_t fapl) TESTING("getting path to dataset hidden by a mounted file"); if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[4])) < 0) TEST_ERROR - i = H5Iget_name(dataset2, (char*)buf, sizeof(buf)); + i = H5Iget_name(dataset2,(char*)buf, sizeof(buf)); if(H5Dclose(dataset2) < 0) TEST_ERROR if(i != 0) TEST_ERROR - i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[4], (char*)buf, sizeof(buf)); + i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[4],(char*)buf, sizeof(buf)); if(i != 0) TEST_ERROR PASSED() @@ -2612,10 +2612,10 @@ test_obj_ref(hid_t fapl) TEST_ERROR TESTING("getting path to dataset that has been unlinked"); - i = H5Iget_name(dataset2, (char*)buf, sizeof(buf)); + i = H5Iget_name(dataset2,(char*)buf, sizeof(buf)); if(H5Dclose(dataset2) < 0) TEST_ERROR if(i != 0) TEST_ERROR - i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[1], (char*)buf, sizeof(buf)); + i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[1],(char*)buf, sizeof(buf)); if(i != 0) TEST_ERROR PASSED() @@ -2704,7 +2704,7 @@ test_reg_ref(hid_t fapl) /* Create a reference to elements selection */ if((status = H5Sselect_none(space_id)) < 0) TEST_ERROR - if((status = H5Sselect_elements(space_id, H5S_SELECT_SET, num_points, (const hsize_t **)coord)) < 0) + if((status = H5Sselect_elements(space_id, H5S_SELECT_SET, num_points,(const hsize_t **)coord)) < 0) TEST_ERROR if((status = H5Rcreate(&ref[1], file_id, REFREG_DSETNAMEV, H5R_DATASET_REGION, space_id)) < 0) TEST_ERROR @@ -2736,38 +2736,38 @@ test_reg_ref(hid_t fapl) TEST_ERROR /* Get name of the dataset the first region reference points to using H5Rget_name */ - TESTING("H5Rget_name to get name from region reference (hyperslab)"); - name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], (char*)buf1, NAME_BUF_SIZE); - if(!((HDstrcmp(buf1, "/MATRIX") == 0) && (name_size1 == 7))) TEST_ERROR + TESTING("H5Rget_name to get name from region reference(hyperslab)"); + name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0],(char*)buf1, NAME_BUF_SIZE); + if(!((HDstrcmp(buf1, "/MATRIX") == 0) &&(name_size1 == 7))) TEST_ERROR PASSED() - TESTING("H5Iget_name to get name from region reference (hyperslab)"); + TESTING("H5Iget_name to get name from region reference(hyperslab)"); /* Dereference the first reference */ dsetv_id = H5Rdereference(dsetr_id, H5R_DATASET_REGION, &ref_out[0]); /* Get name of the dataset the first region reference points using H5Iget_name */ - name_size2 = H5Iget_name(dsetv_id, (char*)buf2, NAME_BUF_SIZE); - if(!((HDstrcmp(buf2, "/MATRIX") == 0) && (name_size2 == 7))) TEST_ERROR + name_size2 = H5Iget_name(dsetv_id,(char*)buf2, NAME_BUF_SIZE); + if(!((HDstrcmp(buf2, "/MATRIX") == 0) &&(name_size2 == 7))) TEST_ERROR if((status = H5Dclose(dsetv_id)) < 0) TEST_ERROR PASSED() /* Get name of the dataset the second region reference points to using H5Rget_name */ - TESTING("H5Rget_name to get name from region reference (pnt selec)"); - name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[1], (char*)buf1, NAME_BUF_SIZE); - if(!((HDstrcmp(buf1, "/MATRIX") == 0) && (name_size1 == 7))) TEST_ERROR + TESTING("H5Rget_name to get name from region reference(pnt selec)"); + name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[1],(char*)buf1, NAME_BUF_SIZE); + if(!((HDstrcmp(buf1, "/MATRIX") == 0) &&(name_size1 == 7))) TEST_ERROR PASSED() - TESTING("H5Iget_name to get name from region reference (pnt selec)"); + TESTING("H5Iget_name to get name from region reference(pnt selec)"); /* Dereference the second reference */ if((dsetv_id = H5Rdereference(dsetr_id, H5R_DATASET_REGION, &ref_out[1])) < 0) TEST_ERROR /* Get name of the dataset the first region reference points using H5Iget_name */ - name_size2 = H5Iget_name(dsetv_id, (char*)buf2, NAME_BUF_SIZE); - if(!((HDstrcmp(buf2, "/MATRIX") == 0) && (name_size2 == 7))) TEST_ERROR + name_size2 = H5Iget_name(dsetv_id,(char*)buf2, NAME_BUF_SIZE); + if(!((HDstrcmp(buf2, "/MATRIX") == 0) &&(name_size2 == 7))) TEST_ERROR if((status = H5Dclose(dsetv_id)) < 0) TEST_ERROR @@ -2787,7 +2787,7 @@ error: int main(void) { - hid_t file_id = (-1); + hid_t file_id =(-1); int nerrors = 0; hid_t fapl; char filename0[1024]; @@ -2800,7 +2800,7 @@ main(void) /* Create a new file_id using default create property but vfd access * property. */ - if((file_id = H5Fcreate(filename0,H5F_ACC_TRUNC, H5P_DEFAULT, fapl )) < 0) TEST_ERROR + if((file_id = H5Fcreate(filename0,H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Call "main" test routine */ nerrors += test_main(file_id, fapl); diff --git a/test/links.c b/test/links.c index 45baae6..9fd6c09 100644 --- a/test/links.c +++ b/test/links.c @@ -631,7 +631,7 @@ toomany(hid_t fapl, hbool_t new_format) if((fid=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR /* Open object through last hard link */ - if((gid = H5Gopen(fid, "hard21")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "hard21", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -648,16 +648,16 @@ toomany(hid_t fapl, hbool_t new_format) /* Open object through too deep soft link */ H5E_BEGIN_TRY { - gid = H5Gopen(fid, "soft17"); + gid = H5Gopen2(fid, "soft17", H5P_DEFAULT); } H5E_END_TRY; - if (gid >= 0) { + if(gid >= 0) { H5_FAILED(); puts(" Should have failed for sequence of too many nested links."); TEST_ERROR - } + } /* end if */ /* Open object through lesser soft link */ - if((gid = H5Gopen(fid, "soft16")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "soft16", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -1039,25 +1039,29 @@ test_move(hid_t fapl, hbool_t new_format) TEST_ERROR /* Open the group just moved to the new location. */ - if((moved_grp = H5Gopen(grp_2, "group_new_name")) < 0) - TEST_ERROR + if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR if( H5Gclose(moved_grp) < 0) TEST_ERROR /* Verify that the group is no longer in the original location */ H5E_BEGIN_TRY { - if((moved_grp = H5Gopen(grp_1, "group_move"))>=0) - TEST_ERROR + moved_grp = H5Gopen2(grp_1, "group_move", H5P_DEFAULT); } H5E_END_TRY; + if(moved_grp >= 0) { + H5_FAILED(); + puts(" Group still in original location?"); + TEST_ERROR + } /* end if */ /* Use H5Lmove to rename a group without moving it. */ if(H5Lmove(grp_2, "group_new_name", H5L_SAME_LOC, "group_newer_name", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Open the group. */ - if((moved_grp = H5Gopen(grp_2, "group_newer_name")) < 0) - TEST_ERROR - if( H5Gclose(moved_grp) < 0) + if((moved_grp = H5Gopen2(grp_2, "group_newer_name", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR /* Use H5Lmove to move a group without renaming it. */ @@ -1065,9 +1069,9 @@ test_move(hid_t fapl, hbool_t new_format) TEST_ERROR /* Open the group . */ - if((moved_grp = H5Gopen(grp_1, "group_newer_name")) < 0) - TEST_ERROR - if( H5Gclose(moved_grp) < 0) + if((moved_grp = H5Gopen2(grp_1, "group_newer_name", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR /* Move the group while giving long paths. */ @@ -1075,22 +1079,22 @@ test_move(hid_t fapl, hbool_t new_format) TEST_ERROR /* Open the group just moved to the new location. */ - if((moved_grp = H5Gopen(grp_2, "group_newest_name")) < 0) - TEST_ERROR + if((moved_grp = H5Gopen2(grp_2, "group_newest_name", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR - if( H5Gclose(moved_grp) < 0) + if(H5Gclose(moved_grp) < 0) TEST_ERROR /* Verify that the group is in no previous locations */ H5E_BEGIN_TRY { - if((moved_grp = H5Gopen(grp_1, "group_newer_name"))>=0) - TEST_ERROR - if((moved_grp = H5Gopen(grp_2, "group_newer_name"))>=0) - TEST_ERROR - if((moved_grp = H5Gopen(grp_2, "group_new_name"))>=0) - TEST_ERROR - if((moved_grp = H5Gopen(grp_1, "group_copy"))>=0) - TEST_ERROR + if((moved_grp = H5Gopen2(grp_1, "group_newer_name", H5P_DEFAULT)) >= 0) + FAIL_STACK_ERROR + if((moved_grp = H5Gopen2(grp_2, "group_newer_name", H5P_DEFAULT)) >= 0) + FAIL_STACK_ERROR + if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) >= 0) + FAIL_STACK_ERROR + if((moved_grp = H5Gopen2(grp_1, "group_copy", H5P_DEFAULT)) >= 0) + FAIL_STACK_ERROR } H5E_END_TRY; H5Gclose(grp_1); @@ -1181,15 +1185,15 @@ test_copy(hid_t fapl, hbool_t new_format) TEST_ERROR /* Open the group just moved to the new location. */ - if((moved_grp = H5Gopen(grp_2, "group_new_name")) < 0) - TEST_ERROR - if( H5Gclose(moved_grp) < 0) + if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR /* Verify that the group is also in the original location */ - if((moved_grp = H5Gopen(grp_1, "group_copy")) < 0) - TEST_ERROR - if( H5Gclose(moved_grp) < 0) + if((moved_grp = H5Gopen2(grp_1, "group_copy", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR /* Use H5Lcopy to create a group in the same location with a different name. */ @@ -1197,14 +1201,14 @@ test_copy(hid_t fapl, hbool_t new_format) TEST_ERROR /* Open the group. */ - if((moved_grp = H5Gopen(grp_2, "group_newer_name")) < 0) - TEST_ERROR - if( H5Gclose(moved_grp) < 0) + if((moved_grp = H5Gopen2(grp_2, "group_newer_name", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR /* Verify that the group is also in the original location */ - if((moved_grp = H5Gopen(grp_2, "group_new_name")) < 0) - TEST_ERROR - if( H5Gclose(moved_grp) < 0) + if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR /* Use H5Lcopy to copy to a different location with the same name. */ @@ -1212,14 +1216,14 @@ test_copy(hid_t fapl, hbool_t new_format) TEST_ERROR /* Open the group . */ - if((moved_grp = H5Gopen(grp_1, "group_newer_name")) < 0) - TEST_ERROR - if( H5Gclose(moved_grp) < 0) + if((moved_grp = H5Gopen2(grp_1, "group_newer_name", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR /* Verify that the group is still in the previous location */ - if((moved_grp = H5Gopen(grp_2, "group_new_name")) < 0) - TEST_ERROR - if( H5Gclose(moved_grp) < 0) + if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR /* Copy the group while giving long paths. */ @@ -1227,27 +1231,27 @@ test_copy(hid_t fapl, hbool_t new_format) TEST_ERROR /* Open the group just moved to the new location. */ - if((moved_grp = H5Gopen(grp_2, "group_newest_name")) < 0) - TEST_ERROR - if( H5Gclose(moved_grp) < 0) + if((moved_grp = H5Gopen2(grp_2, "group_newest_name", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR /* Verify that the group is still in all previous original locations */ - if((moved_grp = H5Gopen(grp_1, "group_newer_name")) < 0) - TEST_ERROR - if( H5Gclose(moved_grp) < 0) + if((moved_grp = H5Gopen2(grp_1, "group_newer_name", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR - if((moved_grp = H5Gopen(grp_2, "group_newer_name")) < 0) - TEST_ERROR - if( H5Gclose(moved_grp) < 0) + if((moved_grp = H5Gopen2(grp_2, "group_newer_name", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR - if((moved_grp = H5Gopen(grp_2, "group_new_name")) < 0) - TEST_ERROR - if( H5Gclose(moved_grp) < 0) + if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR - if((moved_grp = H5Gopen(grp_1, "group_copy")) < 0) - TEST_ERROR - if( H5Gclose(moved_grp) < 0) + if((moved_grp = H5Gopen2(grp_1, "group_copy", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if(H5Gclose(moved_grp) < 0) TEST_ERROR H5Gclose(grp_1); @@ -1531,8 +1535,8 @@ test_compat(hid_t fapl, hbool_t new_format) if(H5Gclose(group2_id) < 0) TEST_ERROR if(H5Gclose(group1_id) < 0) TEST_ERROR - if((group1_id = H5Gopen(file_id, "moved_group1")) < 0) TEST_ERROR - if((group2_id = H5Gopen(file_id, "moved_group1/moved_group2")) < 0) TEST_ERROR + if((group1_id = H5Gopen2(file_id, "moved_group1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((group2_id = H5Gopen2(file_id, "moved_group1/moved_group2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close open IDs */ if(H5Gclose(group2_id) < 0) TEST_ERROR @@ -1542,7 +1546,7 @@ test_compat(hid_t fapl, hbool_t new_format) if(H5Gunlink(file_id, "moved_group1/moved_group2") < 0) TEST_ERROR H5E_BEGIN_TRY { - if(H5Gopen(file_id, "moved_group1/moved_group2") >=0) TEST_ERROR + if(H5Gopen2(file_id, "moved_group1/moved_group2", H5P_DEFAULT) >=0) TEST_ERROR } H5E_END_TRY; if(H5Fclose(file_id) < 0) TEST_ERROR @@ -1639,7 +1643,7 @@ external_link_root(hid_t fapl, hbool_t new_format) /* Open object through external link */ - if((gid = H5Gopen(fid, "ext_link")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -1667,8 +1671,8 @@ external_link_root(hid_t fapl, hbool_t new_format) if((fid = H5Fopen(filename1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR /* Open objects created through external link */ - if((gid = H5Gopen(fid, "new_group")) < 0) TEST_ERROR - if((gid2 = H5Gopen(fid, "newer_group")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((gid2 = H5Gopen2(fid, "newer_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check names */ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -1769,7 +1773,7 @@ external_link_path(hid_t fapl, hbool_t new_format) if(H5Lcreate_external(filename1, "/A/B/C", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Open object through external link */ - if((gid = H5Gopen(fid, "ext_link")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -1792,7 +1796,7 @@ external_link_path(hid_t fapl, hbool_t new_format) if((fid = H5Fopen(filename1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR /* Open object created through external link */ - if((gid = H5Gopen(fid, "/A/B/C/new_group")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "/A/B/C/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -1916,7 +1920,7 @@ external_link_mult(hid_t fapl, hbool_t new_format) if(H5Lcreate_external(filename3, "/G/H/I", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Open object through external link */ - if((gid = H5Gopen(fid, "ext_link")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -1939,7 +1943,7 @@ external_link_mult(hid_t fapl, hbool_t new_format) if((fid = H5Fopen(filename1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR /* Open object created through external link */ - if((gid = H5Gopen(fid, "/A/B/C/new_group")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "/A/B/C/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -1954,14 +1958,14 @@ external_link_mult(hid_t fapl, hbool_t new_format) /* Open an object through external links */ if((fid = H5Fopen(filename4, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR - if((gid = H5Gopen(fid, "ext_link")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* The intermediate files should not stay open. Replace one of them with a new file. */ - if((fid2=H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR if(H5Fclose(fid2) < 0) TEST_ERROR /* Open the other with write access and delete the external link in it */ - if((fid2=H5Fopen(filename3, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR + if((fid2 = H5Fopen(filename3, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR if(H5Ldelete(fid2, "G/H/I", H5P_DEFAULT) < 0) TEST_ERROR if(H5Fclose(fid2) < 0) TEST_ERROR @@ -2040,7 +2044,7 @@ external_link_self(hid_t fapl, hbool_t new_format) if(H5Lcreate_external(filename1, "/X", fid, "A/B/C", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Open object through external link */ - if((gid = H5Gopen(fid, "A/B/C/")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "A/B/C/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -2056,7 +2060,7 @@ external_link_self(hid_t fapl, hbool_t new_format) if(H5Gclose(gid) < 0) TEST_ERROR /* Check on object created */ - if((gid = H5Gopen(fid, "X/new_group")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "X/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -2099,7 +2103,7 @@ external_link_self(hid_t fapl, hbool_t new_format) /* Re-open file2 and traverse through file1 (with its recursive extlink) to file3 */ if((fid=H5Fopen(filename2, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) TEST_ERROR - if((gid=H5Gopen(fid, "ext_link/B/C/Y/Z/end")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "ext_link/B/C/Y/Z/end", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create object through external link */ if((gid2 = H5Gcreate2(gid, "newer_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -2110,9 +2114,9 @@ external_link_self(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR /* Open up file3 and make sure the object was created successfully */ - if((fid=H5Fopen(filename3, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) TEST_ERROR + if((fid = H5Fopen(filename3, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if((gid=H5Gopen(fid, "end/newer_group")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "end/newer_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Cleanup */ if(H5Gclose(gid) < 0) TEST_ERROR @@ -2206,7 +2210,7 @@ external_link_pingpong(hid_t fapl, hbool_t new_format) if((fid=H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR /* Open object through external link */ - if((gid = H5Gopen(fid, "link1")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "link1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -2229,7 +2233,7 @@ external_link_pingpong(hid_t fapl, hbool_t new_format) if((fid = H5Fopen(filename1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR /* Open object created through external link */ - if((gid = H5Gopen(fid, "/final/new_group")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "/final/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -2360,7 +2364,7 @@ external_link_toomany(hid_t fapl, hbool_t new_format) /* Open object through external link */ H5E_BEGIN_TRY { - gid = H5Gopen(fid, "link1"); + gid = H5Gopen2(fid, "link1", H5P_DEFAULT); } H5E_END_TRY; if (gid >= 0) { H5_FAILED(); @@ -2369,7 +2373,7 @@ external_link_toomany(hid_t fapl, hbool_t new_format) } /* Open object through external link */ - if((gid = H5Gopen(fid, "link3")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "link3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -2457,7 +2461,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format) /* Open object through dangling file external link */ H5E_BEGIN_TRY { - gid = H5Gopen(fid, "no_file"); + gid = H5Gopen2(fid, "no_file", H5P_DEFAULT); } H5E_END_TRY; if (gid >= 0) { H5_FAILED(); @@ -2467,7 +2471,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format) /* Open object through dangling object external link */ H5E_BEGIN_TRY { - gid = H5Gopen(fid, "no_object"); + gid = H5Gopen2(fid, "no_object", H5P_DEFAULT); } H5E_END_TRY; if (gid >= 0) { H5_FAILED(); @@ -2536,7 +2540,7 @@ external_link_recursive(hid_t fapl, hbool_t new_format) /* Open object through dangling file external link */ H5E_BEGIN_TRY { - gid = H5Gopen(fid, "recursive"); + gid = H5Gopen2(fid, "recursive", H5P_DEFAULT); } H5E_END_TRY; if (gid >= 0) { H5_FAILED(); @@ -2754,7 +2758,7 @@ external_link_unlink_compact(hid_t fapl, hbool_t new_format) if((fid = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR /* Open group for external link */ - if((gid = H5Gopen(fid, "dst")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "dst", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close group */ if(H5Gclose(gid) < 0) TEST_ERROR @@ -2815,7 +2819,7 @@ external_link_unlink_dense(hid_t fapl, hbool_t new_format) if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Open root group */ - if((gid = H5Gopen(fid, "/")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check on root group's status */ if(H5G_is_empty_test(gid) != TRUE) TEST_ERROR @@ -2872,7 +2876,7 @@ external_link_unlink_dense(hid_t fapl, hbool_t new_format) if((fid = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR /* Open root group */ - if((gid = H5Gopen(fid, "/")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Unlink external link */ if(H5Gunlink(fid, "src") < 0) TEST_ERROR @@ -2900,7 +2904,7 @@ external_link_unlink_dense(hid_t fapl, hbool_t new_format) if((fid = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR /* Open group for external link (should be unaffected) */ - if((gid = H5Gopen(fid, "dst")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "dst", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close group */ if(H5Gclose(gid) < 0) TEST_ERROR @@ -2982,7 +2986,7 @@ external_link_move(hid_t fapl, hbool_t new_format) if(H5Gmove(fid, "src", "src2") < 0) TEST_ERROR /* Open object through external link */ - if((gid = H5Gopen(fid, "src2")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "src2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -3004,7 +3008,7 @@ external_link_move(hid_t fapl, hbool_t new_format) if((fid = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR /* Open group created through external link */ - if((gid = H5Gopen(fid, "dst/new_group")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "dst/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close group */ if(H5Gclose(gid) < 0) TEST_ERROR @@ -3027,7 +3031,7 @@ external_link_move(hid_t fapl, hbool_t new_format) if(H5Gclose(gid) < 0) TEST_ERROR /* Open object through external link */ - if((gid = H5Gopen(fid, "/group2/src3")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "/group2/src3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -3049,7 +3053,7 @@ external_link_move(hid_t fapl, hbool_t new_format) if((fid = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR /* Open group created through external link */ - if((gid = H5Gopen(fid, "dst/new_group2")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "dst/new_group2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close group */ if(H5Gclose(gid) < 0) TEST_ERROR @@ -3063,7 +3067,7 @@ external_link_move(hid_t fapl, hbool_t new_format) if((fid = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR /* Open object through external link */ - if((gid = H5Gopen(fid, "/group2/src3")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "/group2/src3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -3092,7 +3096,7 @@ external_link_move(hid_t fapl, hbool_t new_format) if((fid = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR /* Open group created through external link */ - if((gid = H5Gopen(fid, "dst/new_group3")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "dst/new_group3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close group */ if(H5Gclose(gid) < 0) TEST_ERROR @@ -3155,7 +3159,7 @@ external_link_ride(hid_t fapl, hbool_t new_format) if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Open root group */ - if((gid = H5Gopen(fid, "/")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check on root group's status */ if(H5G_is_empty_test(gid) != TRUE) TEST_ERROR @@ -3215,7 +3219,7 @@ external_link_ride(hid_t fapl, hbool_t new_format) if((fid = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR /* Open object through external link */ - if((gid = H5Gopen(fid, "src")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "src", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -3231,7 +3235,7 @@ external_link_ride(hid_t fapl, hbool_t new_format) if(H5Gclose(gid) < 0) TEST_ERROR /* Open root group */ - if((gid = H5Gopen(fid, "/")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Remove enough objects in the root group to change it into a "compact" group */ for(u = 0; u < ((max_compact - min_dense) + 3); u++) { @@ -3250,7 +3254,7 @@ external_link_ride(hid_t fapl, hbool_t new_format) if(H5Gclose(gid) < 0) TEST_ERROR /* Open object through external link */ - if((gid = H5Gopen(fid, "src")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "src", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -3272,13 +3276,13 @@ external_link_ride(hid_t fapl, hbool_t new_format) if((fid = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR /* Open group created through external link */ - if((gid = H5Gopen(fid, "dst/new_group")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "dst/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close group */ if(H5Gclose(gid) < 0) TEST_ERROR /* Open group created through external link */ - if((gid = H5Gopen(fid, "dst/new_group2")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "dst/new_group2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close group */ if(H5Gclose(gid) < 0) TEST_ERROR @@ -3413,7 +3417,7 @@ external_link_closing(hid_t fapl, hbool_t new_format) if(H5Gget_comment(fid1, "elink/elink/elink/group1_moved", sizeof(buf), buf) < 0) TEST_ERROR /* Test H5*open */ - if((gid = H5Gopen(fid1, "elink/elink/elink/group1_moved")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid1, "elink/elink/elink/group1_moved", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((tid = H5Topen(fid1, "elink/elink/elink/type1_moved")) < 0) TEST_ERROR if((did = H5Dopen(fid1, "elink/elink/elink/dataset1_moved")) < 0) TEST_ERROR /* Close objects */ @@ -3422,7 +3426,7 @@ external_link_closing(hid_t fapl, hbool_t new_format) if(H5Dclose(did) < 0) TEST_ERROR /* Test H5*open2 */ - if((gid = H5Gopen2(fid1, "elink/elink/elink/group1_moved", H5P_DEFAULT)) < 0) TEST_ERROR + if((gid = H5Gopen2(fid1, "elink/elink/elink/group1_moved", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((tid = H5Topen2(fid1, "elink/elink/elink/type1_moved", H5P_DEFAULT)) < 0) TEST_ERROR if((did = H5Dopen2(fid1, "elink/elink/elink/dataset1_moved", H5P_DEFAULT)) < 0) TEST_ERROR /* Close objects */ @@ -3586,7 +3590,7 @@ external_link_endian(hid_t fapl, hbool_t new_format) if((gid = H5Oopen(fid, "ext_link", lapl_id)) < 0) TEST_ERROR /* Open a group in the external file using that group ID */ - if((gid2 = H5Gopen(gid, "subgroup")) < 0) TEST_ERROR + if((gid2 = H5Gopen2(gid, "subgroup", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close the IDs */ if(H5Gclose(gid2) < 0) TEST_ERROR @@ -3602,7 +3606,7 @@ external_link_endian(hid_t fapl, hbool_t new_format) if((gid = H5Oopen(fid, "ext_link", lapl_id)) < 0) TEST_ERROR /* Open a group in the external file using that group ID */ - if((gid2 = H5Gopen(gid, "subgroup")) < 0) TEST_ERROR + if((gid2 = H5Gopen2(gid, "subgroup", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close the IDs */ if(H5Gclose(gid2) < 0) TEST_ERROR @@ -3683,7 +3687,7 @@ external_link_strong(hid_t fapl, hbool_t new_format) /* Access external link from file #1 */ if((fid2 = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR - if((gid2 = H5Gopen(fid2, "/W/X/DLINK")) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid2, "/W/X/DLINK", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((name_len = H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR if(HDstrcmp(objname, "/A/B/C")) TEST_ERROR if(H5Gclose(gid2) < 0) TEST_ERROR @@ -3909,7 +3913,7 @@ ud_hard_links(hid_t fapl) if((fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) TEST_ERROR /* Open group through UD link */ - if((gid = H5Gopen(fid, "ud_link")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -3923,7 +3927,7 @@ ud_hard_links(hid_t fapl) if(H5Gclose(gid) < 0) TEST_ERROR /* Re-open group without using ud link to check that it was created properly */ - if((gid = H5Gopen(fid, "group/new_group")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "group/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -3947,7 +3951,7 @@ ud_hard_links(hid_t fapl) if(H5Gunlink(fid, "/group") < 0) TEST_ERROR /* Ensure we can open the group through the UD link */ - if((gid = H5Gopen(fid, "ud_link")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Unlink the group contained within it. */ if(H5Gunlink(gid, "new_group") < 0) TEST_ERROR @@ -4077,7 +4081,7 @@ ud_link_reregister(hid_t fapl) /* Verify that we can't traverse the ud link anymore */ H5E_BEGIN_TRY { - if((gid = H5Gopen(fid, "ud_link")) >= 0) TEST_ERROR + if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) >= 0) TEST_ERROR } H5E_END_TRY /* Verify that we can't create any new links of this type */ @@ -4096,7 +4100,7 @@ ud_link_reregister(hid_t fapl) /* Open a group through the ud link (now a different class of link). * It should be a different group * than the UD hard link pointed to */ - if((gid = H5Gopen(fid, "ud_link")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -4110,7 +4114,7 @@ ud_link_reregister(hid_t fapl) if(H5Gclose(gid) < 0) TEST_ERROR /* Re-open group without using ud link to check that it was created properly */ - if((gid = H5Gopen(fid, "rereg_target/new_group")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "rereg_target/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR @@ -4131,7 +4135,7 @@ ud_link_reregister(hid_t fapl) /* Ensure we can open the group through the UD link (now that UD hard * links have been registered) */ - if((gid = H5Gopen(fid, "ud_link")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Gclose(gid) < 0) TEST_ERROR /* Delete the UD hard link. This should cause the group to be @@ -4346,7 +4350,7 @@ ud_callbacks(hid_t fapl, hbool_t new_format) if(H5Gclose(gid) < 0) TEST_ERROR /* Try opening group through UD link */ - if((gid = H5Gopen(fid, UD_CB_LINK_NAME)) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, UD_CB_LINK_NAME, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Gclose(gid) < 0) TEST_ERROR /* Query the link to test its query callback */ @@ -4366,7 +4370,7 @@ ud_callbacks(hid_t fapl, hbool_t new_format) if(H5Gmove(fid, UD_CB_LINK_NAME, NEW_UD_CB_LINK_NAME) < 0) TEST_ERROR /* Re-open group to ensure that move worked */ - if((gid = H5Gopen(fid, NEW_UD_CB_LINK_NAME)) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, NEW_UD_CB_LINK_NAME, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Gclose(gid) < 0) TEST_ERROR /* Remove UD link */ @@ -4394,7 +4398,7 @@ ud_callbacks(hid_t fapl, hbool_t new_format) if(H5Lcreate_ud(fid, NEW_UD_CB_LINK_NAME, UD_CB_TYPE, ud_target_name, (size_t)UD_CB_TARGET_LEN, H5P_DEFAULT, H5P_DEFAULT) >= 0) TEST_ERROR if(H5Gmove(fid, UD_CB_LINK_NAME, NEW_UD_CB_LINK_NAME) >= 0) TEST_ERROR if(H5Gunlink(fid, UD_CB_LINK_NAME) >= 0) TEST_ERROR - if((gid = H5Gopen(gid, UD_CB_LINK_NAME)) >= 0) TEST_ERROR + if((gid = H5Gopen2(gid, UD_CB_LINK_NAME, H5P_DEFAULT)) >= 0) FAIL_STACK_ERROR if(H5Gunlink(fid, UD_CB_LINK_NAME) >= 0) TEST_ERROR } H5E_END_TRY @@ -4530,7 +4534,7 @@ lapl_udata(hid_t fapl, hbool_t new_format) if(H5Gclose(gid) < 0) TEST_ERROR /* Verify that we can open the new group without using the ud link */ - if((gid2 = H5Gopen(fid, "/group_a/subgroup_a")) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid, "/group_a/subgroup_a", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Gclose(gid2) < 0) TEST_ERROR /* Now use the same ud link to access group_b */ @@ -4544,7 +4548,7 @@ lapl_udata(hid_t fapl, hbool_t new_format) if(H5Gclose(gid) < 0) TEST_ERROR /* Verify that we can open the new group without using the ud link */ - if((gid2 = H5Gopen(fid, "/group_b/subgroup_b")) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid, "/group_b/subgroup_b", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Gclose(gid2) < 0) TEST_ERROR /* Close property list */ @@ -4814,7 +4818,7 @@ ud_link_errors(hid_t fapl, hbool_t new_format) if(H5Lcreate_ud(fid, "/ud_link", UD_CBFAIL_TYPE, &group_name, HDstrlen(group_name) + 1, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Open the group through the ud link */ - if((gid = H5Gopen(fid, "ud_link")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Gclose(gid) < 0) TEST_ERROR /* Now test that each of the callbacks will cause a failure if it returns -1 */ @@ -4826,7 +4830,7 @@ ud_link_errors(hid_t fapl, hbool_t new_format) if(H5Lcopy(fid, "ud_link", fid, "copy_fail", H5P_DEFAULT, H5P_DEFAULT) >= 0) TEST_ERROR /* The traversal callback will fail if we remove its target */ if(H5Gunlink(fid, "group") < 0) TEST_ERROR - if((gid = H5Gopen(gid, "ud_link")) >= 0) TEST_ERROR + if((gid = H5Gopen2(gid, "ud_link", H5P_DEFAULT)) >= 0) FAIL_STACK_ERROR /* The deletion callback will always fail */ if(H5Gunlink(fid, "ud_link") >= 0) TEST_ERROR /* The query callback will fail */ @@ -5088,7 +5092,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) /* We should now be able to use these property lists to open each kind * of object. */ - if((gid = H5Gopen2(fid, "soft17", gapl)) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "soft17", gapl)) < 0) FAIL_STACK_ERROR if((tid = H5Topen2(fid, "soft17/datatype", tapl)) < 0) TEST_ERROR if((did = H5Dopen2(fid, "soft17/dataset", dapl)) < 0) TEST_ERROR @@ -5342,7 +5346,7 @@ corder_create_empty(hid_t fapl) if((file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR /* Open group created */ - if((group_id = H5Gopen(file_id, CORDER_GROUP_NAME)) < 0) TEST_ERROR + if((group_id = H5Gopen2(file_id, CORDER_GROUP_NAME, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check on group's status */ if(H5G_is_empty_test(group_id) != TRUE) TEST_ERROR @@ -5453,7 +5457,7 @@ corder_create_compact(hid_t fapl) if((file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR /* Open group created */ - if((group_id = H5Gopen(file_id, CORDER_GROUP_NAME)) < 0) TEST_ERROR + if((group_id = H5Gopen2(file_id, CORDER_GROUP_NAME, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify state of group */ if(H5G_has_links_test(group_id, &nlinks) != TRUE) TEST_ERROR @@ -5587,7 +5591,7 @@ corder_create_dense(hid_t fapl) if((file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR /* Open group created */ - if((group_id = H5Gopen(file_id, CORDER_GROUP_NAME)) < 0) TEST_ERROR + if((group_id = H5Gopen2(file_id, CORDER_GROUP_NAME, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify state of group */ if(H5G_has_links_test(group_id, NULL) == TRUE) TEST_ERROR @@ -5698,7 +5702,7 @@ corder_transition(hid_t fapl) if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR /* Open group created */ - if((group_id = H5Gopen(file_id, CORDER_GROUP_NAME)) < 0) TEST_ERROR + if((group_id = H5Gopen2(file_id, CORDER_GROUP_NAME, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create several links, up to limit of compact form */ for(u = 0; u < max_compact; u++) { @@ -5773,7 +5777,7 @@ corder_transition(hid_t fapl) if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR /* Open group created */ - if((group_id = H5Gopen(file_id, CORDER_GROUP_NAME)) < 0) TEST_ERROR + if((group_id = H5Gopen2(file_id, CORDER_GROUP_NAME, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify state of group */ if(H5G_has_links_test(group_id, NULL) == TRUE) TEST_ERROR @@ -9466,8 +9470,8 @@ timestamps(hid_t fapl) if((file_id = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR /* Open groups */ - if((group_id = H5Gopen(file_id, TIMESTAMP_GROUP_1)) < 0) TEST_ERROR - if((group_id2 = H5Gopen(file_id, TIMESTAMP_GROUP_2)) < 0) TEST_ERROR + if((group_id = H5Gopen2(file_id, TIMESTAMP_GROUP_1, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((group_id2 = H5Gopen2(file_id, TIMESTAMP_GROUP_2, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Retrieve the groups' creation properties */ if((gcpl_id = H5Gget_create_plist(group_id)) < 0) TEST_ERROR diff --git a/test/mount.c b/test/mount.c index 11c769d..4ffbbce 100644 --- a/test/mount.c +++ b/test/mount.c @@ -96,7 +96,7 @@ error: H5Fclose(file); } H5E_END_TRY; return -1; -} +} /* end setup() */ /*------------------------------------------------------------------------- @@ -119,28 +119,22 @@ error: static int test_basic(hid_t fapl) { - hid_t file1=-1, file2=-1, grp=-1; + hid_t file1 = -1, file2 = -1, grp = -1; char filename1[1024], filename2[1024]; TESTING("basic functionality"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - if ((file1 = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0 || - (file2 = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) - TEST_ERROR - if (H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) - TEST_ERROR - if ((grp = H5Gopen(file1, "/mnt1/file2")) < 0) - TEST_ERROR - if (H5Gclose(grp) < 0) - TEST_ERROR - if (H5Funmount(file1, "/mnt1") < 0) - TEST_ERROR - if (H5Fclose(file1) < 0) - TEST_ERROR - if (H5Fclose(file2) < 0) - TEST_ERROR + if((file1 = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0 || + (file2 = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) + FAIL_STACK_ERROR + if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR + if((grp = H5Gopen2(file1, "/mnt1/file2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Gclose(grp) < 0) FAIL_STACK_ERROR + if(H5Funmount(file1, "/mnt1") < 0) FAIL_STACK_ERROR + if(H5Fclose(file1) < 0) FAIL_STACK_ERROR + if(H5Fclose(file2) < 0) FAIL_STACK_ERROR PASSED(); return 0; @@ -151,7 +145,7 @@ test_basic(hid_t fapl) H5Fclose(file2); } H5E_END_TRY; return 1; -} +} /* end test_basic() */ /*------------------------------------------------------------------------- @@ -174,7 +168,7 @@ test_basic(hid_t fapl) static int test_illegal(hid_t fapl) { - hid_t file1=-1, file2=-1, file3=-1, mnt=-1; + hid_t file1 = -1, file2 = -1, file3 = -1, mnt = -1; herr_t status; char filename1[1024], filename2[1024], filename3[1024]; @@ -185,48 +179,49 @@ test_illegal(hid_t fapl) /* Open the files */ - if ((file1=H5Fopen(filename1, H5F_ACC_RDONLY, fapl))<0 || - (file2=H5Fopen(filename2, H5F_ACC_RDONLY, fapl))<0 || - (file3=H5Fopen(filename3, H5F_ACC_RDONLY, fapl))<0) - goto error; + if((file1 = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0 || + (file2 = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0 || + (file3 = H5Fopen(filename3, H5F_ACC_RDONLY, fapl)) < 0) + FAIL_STACK_ERROR /* Try mounting a file on itself */ H5E_BEGIN_TRY { status = H5Fmount(file1, "/mnt1", file1, H5P_DEFAULT); } H5E_END_TRY; - if (status>=0) { + if(status >= 0) { H5_FAILED(); puts(" Mounting a file on itself should have failed."); - goto error; - } + TEST_ERROR + } /* end if */ /* * Try mounting two files at the same place. We have to open the mount * point before we mount the first file or we'll end up mounting file3 at * the root of file2 and the mount will succeed. */ - if ((mnt=H5Gopen(file1, "/mnt1"))<0) goto error; - if (H5Fmount(mnt, ".", file2, H5P_DEFAULT)<0) goto error; + if((mnt = H5Gopen2(file1, "/mnt1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Fmount(mnt, ".", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR H5E_BEGIN_TRY { status = H5Fmount(mnt, ".", file3, H5P_DEFAULT); } H5E_END_TRY; - if (status>=0) { + if(status >= 0) { H5_FAILED(); puts(" Mounting two files at one mount point should have failed."); - goto error; - } - if (H5Funmount(mnt, ".")<0) goto error; - if (H5Gclose(mnt)<0) goto error; + TEST_ERROR + } /* end if */ + if(H5Funmount(mnt, ".") < 0) FAIL_STACK_ERROR + if(H5Gclose(mnt) < 0) FAIL_STACK_ERROR /* Close everything and return */ - if (H5Fclose(file1)<0) goto error; - if (H5Fclose(file2)<0) goto error; - if (H5Fclose(file3)<0) goto error; + if(H5Fclose(file1) < 0) FAIL_STACK_ERROR + if(H5Fclose(file2) < 0) FAIL_STACK_ERROR + if(H5Fclose(file3) < 0) FAIL_STACK_ERROR + PASSED(); return 0; - error: +error: H5E_BEGIN_TRY { H5Gclose(mnt); H5Fclose(file1); @@ -234,7 +229,7 @@ test_illegal(hid_t fapl) H5Fclose(file3); } H5E_END_TRY; return 1; -} +} /* end test_illegal() */ /*------------------------------------------------------------------------- @@ -258,7 +253,7 @@ test_illegal(hid_t fapl) static int test_hide(hid_t fapl) { - hid_t file1=-1, file2=-1, grp=-1; + hid_t file1 = -1, file2 = -1, grp = -1; H5G_stat_t sb1, sb2; char filename1[1024], filename2[1024]; @@ -266,52 +261,53 @@ test_hide(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - if ((file1=H5Fopen(filename1, H5F_ACC_RDONLY, fapl))<0 || - (file2=H5Fopen(filename2, H5F_ACC_RDONLY, fapl))<0) - goto error; + if((file1 = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0 || + (file2 = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) + FAIL_STACK_ERROR /* Get information about file1:/mnt1/file1 for later */ - if (H5Gget_objinfo(file1, "/mnt1/file1", TRUE, &sb1)<0) goto error; + if(H5Gget_objinfo(file1, "/mnt1/file1", TRUE, &sb1) < 0) FAIL_STACK_ERROR /* Build the virtual file */ - if (H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT)<0) goto error; + if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Original names under file1:/mnt1 should not be accessible */ H5E_BEGIN_TRY { - grp = H5Gopen(file1, "/mnt1/file1"); + grp = H5Gopen2(file1, "/mnt1/file1", H5P_DEFAULT); } H5E_END_TRY; - if (grp>=0) { + if(grp >= 0) { H5_FAILED(); puts(" Name is still accessible under mount point."); - goto error; - } + TEST_ERROR + } /* end if */ /* * The original objects under file1:/mnt1 are still accessible by their * other names. This is a rather stupid test but demonstrates a point. */ - if (H5Gget_objinfo(file1, "/file1", TRUE, &sb2)<0) goto error; - if (HDmemcmp(&sb1.fileno, &sb2.fileno, sizeof(sb1.fileno)) || HDmemcmp(&sb1.objno, &sb2.objno, sizeof(sb1.objno))) { + if(H5Gget_objinfo(file1, "/file1", TRUE, &sb2) < 0) FAIL_STACK_ERROR + if(HDmemcmp(&sb1.fileno, &sb2.fileno, sizeof(sb1.fileno)) || HDmemcmp(&sb1.objno, &sb2.objno, sizeof(sb1.objno))) { H5_FAILED(); puts(" Hard link failed for hidden object."); - goto error; - } + TEST_ERROR + } /* end if */ /* Unmount and close objects */ - if (H5Funmount(file1, "/mnt1")<0) goto error; - H5Fclose(file1); - H5Fclose(file2); + if(H5Funmount(file1, "/mnt1") < 0) FAIL_STACK_ERROR + if(H5Fclose(file1) < 0) FAIL_STACK_ERROR + if(H5Fclose(file2) < 0) FAIL_STACK_ERROR + PASSED(); return 0; - error: +error: H5E_BEGIN_TRY { H5Gclose(grp); H5Fclose(file1); H5Fclose(file2); } H5E_END_TRY; return 1; -} +} /* end test_hide() */ /*------------------------------------------------------------------------- @@ -345,36 +341,30 @@ test_assoc(hid_t fapl) /* Open the files */ if((file1 = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0 || (file2 = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Get information about the root of file2 */ - if(H5Gget_objinfo(file2, "/", TRUE, &sb1) < 0) - TEST_ERROR + if(H5Gget_objinfo(file2, "/", TRUE, &sb1) < 0) FAIL_STACK_ERROR /* Create the virtual file */ - if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* * Get info about the mount point -- should be the same as the root group * of file2. */ - if(H5Gget_objinfo(file1, "/mnt1", TRUE, &sb2) < 0) - TEST_ERROR + if(H5Gget_objinfo(file1, "/mnt1", TRUE, &sb2) < 0) FAIL_STACK_ERROR if(HDmemcmp(&sb1.fileno, &sb2.fileno, sizeof(sb1.fileno)) || HDmemcmp(&sb1.objno, &sb2.objno, sizeof(sb1.objno))) { H5_FAILED(); puts(" Association failed."); - AT(); - goto error; - } + TEST_ERROR + } /* end if */ /* Shut down */ - if(H5Funmount(file1, "/mnt1_link") < 0) - TEST_ERROR - if(H5Fclose(file1) < 0) - TEST_ERROR - if(H5Fclose(file2) < 0) - TEST_ERROR + if(H5Funmount(file1, "/mnt1_link") < 0) FAIL_STACK_ERROR + if(H5Fclose(file1) < 0) FAIL_STACK_ERROR + if(H5Fclose(file2) < 0) FAIL_STACK_ERROR + PASSED(); return 0; @@ -384,7 +374,7 @@ error: H5Fclose(file1); } H5E_END_TRY; return 1; -} +} /* end test_assoc() */ /*------------------------------------------------------------------------- @@ -408,7 +398,7 @@ error: static int test_mntlnk(hid_t fapl) { - hid_t file1=-1, file2=-1, grp=-1; + hid_t file1 = -1, file2 = -1, grp = -1; char filename1[1024], filename2[1024]; TESTING("multi-linked mount point"); @@ -417,35 +407,36 @@ test_mntlnk(hid_t fapl) /* Build the virtual file */ - if ((file1=H5Fopen(filename1, H5F_ACC_RDONLY, fapl))<0 || - (file2=H5Fopen(filename2, H5F_ACC_RDONLY, fapl))<0) - goto error; - if (H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT)<0) goto error; + if((file1 = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0 || + (file2 = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) + FAIL_STACK_ERROR + if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* * Can we see file2:/file2 as both file1:/mnt1/file2 and * file1:/mnt1_link/file2? */ - if ((grp=H5Gopen(file1, "/mnt1/file2"))<0) goto error; - if (H5Gclose(grp)<0) goto error; - if ((grp=H5Gopen(file1, "/mnt1_link/file2"))<0) goto error; - if (H5Gclose(grp)<0) goto error; + if((grp = H5Gopen2(file1, "/mnt1/file2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Gclose(grp) < 0) FAIL_STACK_ERROR + if((grp = H5Gopen2(file1, "/mnt1_link/file2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Gclose(grp) < 0) FAIL_STACK_ERROR /* Unlink using second name */ - if (H5Funmount(file1, "/mnt1_link")<0) goto error; - if (H5Fclose(file1)<0) goto error; - if (H5Fclose(file2)<0) goto error; + if(H5Funmount(file1, "/mnt1_link") < 0) FAIL_STACK_ERROR + if(H5Fclose(file1) < 0) FAIL_STACK_ERROR + if(H5Fclose(file2) < 0) FAIL_STACK_ERROR + PASSED(); return 0; - error: +error: H5E_BEGIN_TRY { H5Gclose(grp); H5Fclose(file1); H5Fclose(file2); } H5E_END_TRY; return 1; -} +} /* end test_mntlnk() */ /*------------------------------------------------------------------------- @@ -469,7 +460,7 @@ test_mntlnk(hid_t fapl) static int test_move(hid_t fapl) { - hid_t file1=-1, file2=-1; + hid_t file1 = -1, file2 = -1; herr_t status; char filename1[1024], filename2[1024]; @@ -478,36 +469,37 @@ test_move(hid_t fapl) h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); /* Build the virtual file */ - if ((file1=H5Fopen(filename1, H5F_ACC_RDWR, fapl))<0 || - (file2=H5Fopen(filename2, H5F_ACC_RDWR, fapl))<0) - goto error; - if (H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT)<0) goto error; + if((file1 = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0 || + (file2 = H5Fopen(filename2, H5F_ACC_RDWR, fapl)) < 0) + FAIL_STACK_ERROR + if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* First rename an object in the mounted file, then try it across files */ - if (H5Lmove(file1, "/mnt1/rename_a/x", H5L_SAME_LOC, "/mnt1/rename_b/y", H5P_DEFAULT, H5P_DEFAULT)<0) goto error; + if(H5Lmove(file1, "/mnt1/rename_a/x", H5L_SAME_LOC, "/mnt1/rename_b/y", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR H5E_BEGIN_TRY { status = H5Lmove(file1, "/mnt1/rename_b/y", H5L_SAME_LOC, "/y", H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; - if (status>=0) { + if(status >= 0) { H5_FAILED(); puts(" Moving an object across files should't have been possible"); - goto error; - } + TEST_ERROR + } /* end if */ /* Shut down */ - if (H5Funmount(file1, "/mnt1")<0) goto error; - if (H5Fclose(file1)<0) goto error; - if (H5Fclose(file2)<0) goto error; + if(H5Funmount(file1, "/mnt1") < 0) FAIL_STACK_ERROR + if(H5Fclose(file1) < 0) FAIL_STACK_ERROR + if(H5Fclose(file2) < 0) FAIL_STACK_ERROR + PASSED(); return 0; - error: +error: H5E_BEGIN_TRY { H5Fclose(file1); H5Fclose(file2); } H5E_END_TRY; return 1; -} +} /* end test_move() */ /*------------------------------------------------------------------------- @@ -530,42 +522,43 @@ test_move(hid_t fapl) static int test_preopen(hid_t fapl) { - hid_t file1=-1, file2=-1, grp=-1; + hid_t file1 = -1, file2 = -1, grp = -1; char filename1[1024], filename2[1024]; TESTING("preopening objects under the mount point"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - if ((file1=H5Fopen(filename1, H5F_ACC_RDONLY, fapl))<0 || - (file2=H5Fopen(filename2, H5F_ACC_RDONLY, fapl))<0) - goto error; + if((file1 = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0 || + (file2 = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) + FAIL_STACK_ERROR /* Open something under the mount point */ - if ((grp=H5Gopen(file1, "/mnt1/file1"))<0) goto error; + if((grp = H5Gopen2(file1, "/mnt1/file1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Build the virtual file */ - if (H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT)<0) goto error; + if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Now access the thing we previously opened */ - if (H5Gget_objinfo(grp, ".", TRUE, NULL)<0) goto error; + if(H5Gget_objinfo(grp, ".", TRUE, NULL) < 0) FAIL_STACK_ERROR /* Shut down */ - if (H5Funmount(file1, "/mnt1")<0) goto error; - if (H5Gclose(grp)<0) goto error; - if (H5Fclose(file1)<0) goto error; - if (H5Fclose(file2)<0) goto error; + if(H5Funmount(file1, "/mnt1") < 0) FAIL_STACK_ERROR + if(H5Gclose(grp) < 0) FAIL_STACK_ERROR + if(H5Fclose(file1) < 0) FAIL_STACK_ERROR + if(H5Fclose(file2) < 0) FAIL_STACK_ERROR + PASSED(); return 0; - error: +error: H5E_BEGIN_TRY { H5Gclose(grp); H5Fclose(file2); H5Fclose(file1); } H5E_END_TRY; return 1; -} +} /* end test_preopen() */ /*------------------------------------------------------------------------- @@ -590,7 +583,7 @@ static int test_postopen(hid_t fapl) { - hid_t file1=-1, file2=-1, grp=-1; + hid_t file1 = -1, file2 = -1, grp = -1; char filename1[1024], filename2[1024]; TESTING("open object access after unmount"); @@ -598,38 +591,39 @@ test_postopen(hid_t fapl) h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); /* Create the virtual file */ - if ((file1=H5Fopen(filename1, H5F_ACC_RDONLY, fapl))<0 || - (file2=H5Fopen(filename2, H5F_ACC_RDONLY, fapl))<0) - goto error; - if (H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT)<0) goto error; + if((file1 = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0 || + (file2 = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) + FAIL_STACK_ERROR + if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Open some object in the mounted file */ - if ((grp=H5Gopen(file1, "/mnt1/file2"))<0) goto error; + if((grp = H5Gopen2(file1, "/mnt1/file2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Unmount the file */ - if (H5Funmount(file1, "/mnt1")<0) goto error; + if(H5Funmount(file1, "/mnt1") < 0) FAIL_STACK_ERROR /* Now access the thing we previously opened */ - if (H5Gget_objinfo(grp, ".", TRUE, NULL)<0) goto error; + if(H5Gget_objinfo(grp, ".", TRUE, NULL) < 0) FAIL_STACK_ERROR /* Try accessing it from the file */ - if (H5Gget_objinfo(file2, "/file2", TRUE, NULL)<0) goto error; + if(H5Gget_objinfo(file2, "/file2", TRUE, NULL) < 0) FAIL_STACK_ERROR /* Shut down */ - if (H5Gclose(grp)<0) goto error; - if (H5Fclose(file1)<0) goto error; - if (H5Fclose(file2)<0) goto error; + if(H5Gclose(grp) < 0) FAIL_STACK_ERROR + if(H5Fclose(file1) < 0) FAIL_STACK_ERROR + if(H5Fclose(file2) < 0) FAIL_STACK_ERROR + PASSED(); return 0; - error: +error: H5E_BEGIN_TRY { H5Gclose(grp); H5Fclose(file2); H5Fclose(file1); } H5E_END_TRY; return 1; -} +} /* end test_postopen() */ /*------------------------------------------------------------------------- @@ -653,7 +647,7 @@ test_postopen(hid_t fapl) static int test_unlink(hid_t fapl) { - hid_t file1=-1, file2=-1, mnt=-1, root=-1; + hid_t file1 = -1, file2 = -1, mnt = -1, root = -1; herr_t status; char filename1[1024], filename2[1024]; @@ -662,18 +656,18 @@ test_unlink(hid_t fapl) h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); /* Open files */ - if ((file1=H5Fopen(filename1, H5F_ACC_RDWR, fapl))<0 || - (file2=H5Fopen(filename2, H5F_ACC_RDWR, fapl))<0) - goto error; + if((file1 = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0 || + (file2 = H5Fopen(filename2, H5F_ACC_RDWR, fapl)) < 0) + FAIL_STACK_ERROR /* * Opening the mount point before mounting opens the group in the parent * file, but opening the mount point after mounting is the same as * opening the root group of the child file. */ - if ((mnt=H5Gopen(file1, "/mnt_unlink"))<0) goto error; - if (H5Fmount(file1, "/mnt_unlink", file2, H5P_DEFAULT)<0) goto error; - if ((root=H5Gopen(file1, "/mnt_unlink"))<0) goto error; + if((mnt = H5Gopen2(file1, "/mnt_unlink", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Fmount(file1, "/mnt_unlink", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR + if((root = H5Gopen2(file1, "/mnt_unlink", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* * "/file2" of file2 should be visible as an absolute name through either @@ -681,43 +675,43 @@ test_unlink(hid_t fapl) * before the H5Fmount() and thus refers to the mount point itself rather * than the group mounted there. */ - if (H5Gget_objinfo(file1, "/mnt_unlink/file2", TRUE, NULL)<0) goto error; - if (H5Gget_objinfo(mnt, "/mnt_unlink/file2", TRUE, NULL)<0) goto error; - if (H5Gget_objinfo(root, "/mnt_unlink/file2", TRUE, NULL)<0) goto error; - if (H5Gget_objinfo(root, "file2", TRUE, NULL)<0) goto error; + if(H5Gget_objinfo(file1, "/mnt_unlink/file2", TRUE, NULL) < 0) FAIL_STACK_ERROR + if(H5Gget_objinfo(mnt, "/mnt_unlink/file2", TRUE, NULL) < 0) FAIL_STACK_ERROR + if(H5Gget_objinfo(root, "/mnt_unlink/file2", TRUE, NULL) < 0) FAIL_STACK_ERROR + if(H5Gget_objinfo(root, "file2", TRUE, NULL) < 0) FAIL_STACK_ERROR H5E_BEGIN_TRY { status = H5Gget_objinfo(mnt, "file2", TRUE, NULL); } H5E_END_TRY; - if (status>=0) { + if(status >= 0) { H5_FAILED(); puts(" Incorrect traversal from mount point!"); - goto error; - } + TEST_ERROR + } /* end if */ /* Unlink the mount point */ - if (H5Gunlink(file1, "/mnt_unlink")<0) goto error; + if(H5Gunlink(file1, "/mnt_unlink") < 0) FAIL_STACK_ERROR /* * We should still be able to get to "/file2" of file2 by starting at * `root' which is still open, but not by name. */ - if (H5Gget_objinfo(root, "file2", TRUE, NULL)<0) goto error; + if(H5Gget_objinfo(root, "file2", TRUE, NULL) < 0) FAIL_STACK_ERROR H5E_BEGIN_TRY { status = H5Gget_objinfo(mnt, "file2", TRUE, NULL); } H5E_END_TRY; - if (status>=0) { + if(status >= 0) { H5_FAILED(); puts(" Traversal through mount point should not have worked!"); - goto error; - } + TEST_ERROR + } /* end if */ H5E_BEGIN_TRY { status = H5Gget_objinfo(file2, "/mnt_unlink/file2", TRUE, NULL); } H5E_END_TRY; - if (status>=0) { + if(status >= 0) { H5_FAILED(); puts(" Traversal through mount point should not have worked!"); - goto error; - } + TEST_ERROR + } /* end if */ /* * It's no longer possible to unmount the child by supplying the name of @@ -727,30 +721,31 @@ test_unlink(hid_t fapl) H5E_BEGIN_TRY { status = H5Funmount(file1, "/mnt_unlink"); } H5E_END_TRY; - if (status>=0) { + if(status >= 0) { H5_FAILED(); printf(" %d: Unmount by name should not have been allowed!\n",__LINE__); - goto error; - } + TEST_ERROR + } /* end if */ H5E_BEGIN_TRY { status = H5Funmount(file2, "/"); } H5E_END_TRY; - if (status>=0) { + if(status >= 0) { H5_FAILED(); printf(" %d: Unmount by name should not have been allowed!\n",__LINE__); - goto error; - } - if (H5Funmount(mnt, ".")<0) goto error; + TEST_ERROR + } /* end if */ + if(H5Funmount(mnt, ".") < 0) FAIL_STACK_ERROR /* Close files */ - if (H5Gclose(mnt)<0) goto error; - if (H5Gclose(root)<0) goto error; - if (H5Fclose(file1)<0) goto error; - if (H5Fclose(file2)<0) goto error; + if(H5Gclose(mnt) < 0) FAIL_STACK_ERROR + if(H5Gclose(root) < 0) FAIL_STACK_ERROR + if(H5Fclose(file1) < 0) FAIL_STACK_ERROR + if(H5Fclose(file2) < 0) FAIL_STACK_ERROR + PASSED(); return 0; - error: +error: H5E_BEGIN_TRY { H5Gclose(mnt); H5Gclose(root); @@ -758,7 +753,7 @@ test_unlink(hid_t fapl) H5Fclose(file1); } H5E_END_TRY; return 1; -} +} /* end test_unlink() */ /*------------------------------------------------------------------------- @@ -780,7 +775,7 @@ test_unlink(hid_t fapl) static int test_mvmpt(hid_t fapl) { - hid_t file1=-1, file2=-1; + hid_t file1 = -1, file2 = -1; char filename1[1024], filename2[1024]; TESTING("mount point renaming"); @@ -788,32 +783,32 @@ test_mvmpt(hid_t fapl) h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); /* Build the virtual file */ - if ((file1=H5Fopen(filename1, H5F_ACC_RDWR, fapl))<0 || - (file2=H5Fopen(filename2, H5F_ACC_RDWR, fapl))<0) - TEST_ERROR - if (H5Fmount(file1, "/mnt_move_a", file2, H5P_DEFAULT)<0) TEST_ERROR + if((file1 = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0 || + (file2 = H5Fopen(filename2, H5F_ACC_RDWR, fapl)) < 0) + FAIL_STACK_ERROR + if(H5Fmount(file1, "/mnt_move_a", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Rename the mount point */ - if (H5Lmove(file1, "/mnt_move_a", H5L_SAME_LOC, "/mnt_move_b", H5P_DEFAULT, H5P_DEFAULT)<0) TEST_ERROR + if(H5Lmove(file1, "/mnt_move_a", H5L_SAME_LOC, "/mnt_move_b", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Access something under the new name */ - if (H5Gget_objinfo(file1, "/mnt_move_b/file2", TRUE, NULL)<0) TEST_ERROR + if(H5Gget_objinfo(file1, "/mnt_move_b/file2", TRUE, NULL) < 0) FAIL_STACK_ERROR /* Shut down */ - if (H5Funmount(file1, "/mnt_move_b")<0) TEST_ERROR - if (H5Fclose(file1)<0) TEST_ERROR - if (H5Fclose(file2)<0) TEST_ERROR + if(H5Funmount(file1, "/mnt_move_b") < 0) FAIL_STACK_ERROR + if(H5Fclose(file1) < 0) FAIL_STACK_ERROR + if(H5Fclose(file2) < 0) FAIL_STACK_ERROR PASSED(); return 0; - error: +error: H5E_BEGIN_TRY { H5Fclose(file1); H5Fclose(file2); } H5E_END_TRY; return 1; -} +} /* end test_mvmpt() */ /*------------------------------------------------------------------------- @@ -835,7 +830,7 @@ test_mvmpt(hid_t fapl) static int test_interlink(hid_t fapl) { - hid_t file1=-1, file2=-1, type=-1, space=-1, dset=-1; + hid_t file1 = -1, file2 = -1, type = -1, space = -1, dset = -1; char filename1[1024], filename2[1024]; herr_t status; hsize_t cur_dims[1] = {2}; @@ -845,54 +840,55 @@ test_interlink(hid_t fapl) h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); /* Build the virtual file */ - if ((file1=H5Fopen(filename1, H5F_ACC_RDWR, fapl))<0 || - (file2=H5Fopen(filename2, H5F_ACC_RDWR, fapl))<0) - goto error; - if (H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT)<0) goto error; + if((file1 = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0 || + (file2 = H5Fopen(filename2, H5F_ACC_RDWR, fapl)) < 0) + FAIL_STACK_ERROR + if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Try an interfile hard link directly */ H5E_BEGIN_TRY { status = H5Glink(file1, H5L_TYPE_HARD, "/mnt1/file2", "/file2"); } H5E_END_TRY; - if (status>=0) { + if(status >= 0) { H5_FAILED(); puts(" Interfile hard link should not have been allowed!"); - goto error; - } + TEST_ERROR + } /* end if */ /* Try an interfile hard link by renaming something */ H5E_BEGIN_TRY { status = H5Lmove(file1, "/mnt1/file2", H5L_SAME_LOC, "/file2", H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; - if (status>=0) { + if(status >= 0) { H5_FAILED(); puts(" Interfile renaming should not have been allowed!"); - goto error; - } + TEST_ERROR + } /* end if */ /* Try an interfile hard link by sharing a data type */ - if ((type=H5Tcopy(H5T_NATIVE_INT))<0) goto error; - if (H5Tcommit(file1, "/type1", type)<0) goto error; - if ((space=H5Screate_simple(1, cur_dims, NULL))<0) goto error; + if((type = H5Tcopy(H5T_NATIVE_INT)) < 0) FAIL_STACK_ERROR + if(H5Tcommit(file1, "/type1", type) < 0) FAIL_STACK_ERROR + if((space = H5Screate_simple(1, cur_dims, NULL)) < 0) FAIL_STACK_ERROR H5E_BEGIN_TRY { dset = H5Dcreate(file1, "/mnt1/file2/dset", type, space, H5P_DEFAULT); } H5E_END_TRY; - if (dset>=0) { + if(dset >= 0) { H5_FAILED(); puts(" Dataset and shared type must be in the same file!"); - goto error; - } + TEST_ERROR + } /* end if */ /* Shut down */ - if (H5Sclose(space)<0) goto error; - if (H5Tclose(type)<0) goto error; - if (H5Funmount(file1, "/mnt1")<0) goto error; - if (H5Fclose(file1)<0) goto error; - if (H5Fclose(file2)<0) goto error; + if(H5Sclose(space) < 0) FAIL_STACK_ERROR + if(H5Tclose(type) < 0) FAIL_STACK_ERROR + if(H5Funmount(file1, "/mnt1") < 0) FAIL_STACK_ERROR + if(H5Fclose(file1) < 0) FAIL_STACK_ERROR + if(H5Fclose(file2) < 0) FAIL_STACK_ERROR + PASSED(); return 0; - error: +error: H5E_BEGIN_TRY { H5Dclose(dset); H5Sclose(space); @@ -901,7 +897,7 @@ test_interlink(hid_t fapl) H5Fclose(file2); } H5E_END_TRY; return 1; -} +} /* end test_interlink() */ /*------------------------------------------------------------------------- @@ -924,7 +920,7 @@ test_interlink(hid_t fapl) static int test_uniformity(hid_t fapl) { - hid_t file1=-1, file2=-1; + hid_t file1 = -1, file2 = -1; char filename1[1024], filename2[1024]; TESTING("file handle uniformity"); @@ -932,39 +928,40 @@ test_uniformity(hid_t fapl) h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); /* Build the virtual file */ - if ((file1=H5Fopen(filename1, H5F_ACC_RDWR, fapl))<0 || - (file2=H5Fopen(filename2, H5F_ACC_RDWR, fapl))<0) - TEST_ERROR; - if (H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT)<0) TEST_ERROR; + if((file1 = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0 || + (file2 = H5Fopen(filename2, H5F_ACC_RDWR, fapl)) < 0) + FAIL_STACK_ERROR + if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Access some things from the file1 handle */ - if (H5Gget_objinfo(file1, "/", TRUE, NULL)<0) TEST_ERROR; - if (H5Gget_objinfo(file1, "/mnt1", TRUE, NULL)<0) TEST_ERROR; - if (H5Gget_objinfo(file1, "mnt1", TRUE, NULL)<0) TEST_ERROR; - if (H5Gget_objinfo(file1, "/mnt1/file2", TRUE, NULL)<0) TEST_ERROR; - if (H5Gget_objinfo(file1, "mnt1/file2", TRUE, NULL)<0) TEST_ERROR; + if(H5Gget_objinfo(file1, "/", TRUE, NULL) < 0) FAIL_STACK_ERROR + if(H5Gget_objinfo(file1, "/mnt1", TRUE, NULL) < 0) FAIL_STACK_ERROR + if(H5Gget_objinfo(file1, "mnt1", TRUE, NULL) < 0) FAIL_STACK_ERROR + if(H5Gget_objinfo(file1, "/mnt1/file2", TRUE, NULL) < 0) FAIL_STACK_ERROR + if(H5Gget_objinfo(file1, "mnt1/file2", TRUE, NULL) < 0) FAIL_STACK_ERROR /* Access the same things from the file2 handle */ - if (H5Gget_objinfo(file2, "/", TRUE, NULL)<0) TEST_ERROR; - if (H5Gget_objinfo(file2, "/mnt1", TRUE, NULL)<0) TEST_ERROR; - if (H5Gget_objinfo(file2, "mnt1", TRUE, NULL)<0) TEST_ERROR; - if (H5Gget_objinfo(file2, "/mnt1/file2", TRUE, NULL)<0) TEST_ERROR; - if (H5Gget_objinfo(file2, "mnt1/file2", TRUE, NULL)<0) TEST_ERROR; + if(H5Gget_objinfo(file2, "/", TRUE, NULL) < 0) FAIL_STACK_ERROR + if(H5Gget_objinfo(file2, "/mnt1", TRUE, NULL) < 0) FAIL_STACK_ERROR + if(H5Gget_objinfo(file2, "mnt1", TRUE, NULL) < 0) FAIL_STACK_ERROR + if(H5Gget_objinfo(file2, "/mnt1/file2", TRUE, NULL) < 0) FAIL_STACK_ERROR + if(H5Gget_objinfo(file2, "mnt1/file2", TRUE, NULL) < 0) FAIL_STACK_ERROR /* Shut down */ - if (H5Funmount(file1, "/mnt1")<0) TEST_ERROR; - if (H5Fclose(file1)<0) TEST_ERROR; - if (H5Fclose(file2)<0) TEST_ERROR; + if(H5Funmount(file1, "/mnt1") < 0) FAIL_STACK_ERROR + if(H5Fclose(file1) < 0) FAIL_STACK_ERROR + if(H5Fclose(file2) < 0) FAIL_STACK_ERROR + PASSED(); return 0; - error: +error: H5E_BEGIN_TRY { H5Fclose(file1); H5Fclose(file2); } H5E_END_TRY; return 1; -} +} /* end test_uniformity() */ /*------------------------------------------------------------------------- @@ -986,7 +983,7 @@ test_uniformity(hid_t fapl) static int test_close(hid_t fapl) { - hid_t file1=-1, file2=-1; + hid_t file1 = -1, file2 = -1; char filename1[1024], filename2[1024]; TESTING("file handle close"); @@ -994,47 +991,43 @@ test_close(hid_t fapl) h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); /* Build the virtual file */ - if ((file1=H5Fopen(filename1, H5F_ACC_RDWR, fapl))<0 || - (file2=H5Fopen(filename2, H5F_ACC_RDWR, fapl))<0) - goto error; - if (H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT)<0) goto error; + if((file1 = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0 || + (file2 = H5Fopen(filename2, H5F_ACC_RDWR, fapl)) < 0) + FAIL_STACK_ERROR + if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* * Close file1 unmounting it from the virtual file. Objects in file1 are * still accessible through the file2 handle. */ - if (H5Fclose(file1)<0) goto error; + if(H5Fclose(file1) < 0) FAIL_STACK_ERROR if(H5Gget_objinfo(file2, "/mnt1", TRUE, NULL) < 0) { H5_FAILED(); puts(" File1 contents are not accessible!"); - goto error; - } - if (H5Fclose(file2)<0) goto error; + TEST_ERROR + } /* end if */ + if(H5Fclose(file2) < 0) FAIL_STACK_ERROR /* Check that all file IDs have been closed */ - if(H5I_nmembers(H5I_FILE) != 0) - TEST_ERROR - if(H5F_sfile_assert_num(0) != 0) - TEST_ERROR + if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR + if(H5F_sfile_assert_num(0) != 0) TEST_ERROR /* Build the virtual file again */ - if ((file1=H5Fopen(filename1, H5F_ACC_RDWR, fapl))<0 || - (file2=H5Fopen(filename2, H5F_ACC_RDWR, fapl))<0) - goto error; - if (H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT)<0) goto error; + if((file1 = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0 || + (file2 = H5Fopen(filename2, H5F_ACC_RDWR, fapl)) < 0) + FAIL_STACK_ERROR + if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* * Close file2. It is not actually closed because it's a child of file1. */ - if (H5Fclose(file2)<0) goto error; - if (H5Gget_objinfo(file1, "/mnt1/file2", TRUE, NULL)<0) goto error; - if (H5Fclose(file1)<0) goto error; + if(H5Fclose(file2) < 0) FAIL_STACK_ERROR + if(H5Gget_objinfo(file1, "/mnt1/file2", TRUE, NULL) < 0) FAIL_STACK_ERROR + if(H5Fclose(file1) < 0) FAIL_STACK_ERROR /* Check that all file IDs have been closed */ - if(H5I_nmembers(H5I_FILE) != 0) - TEST_ERROR - if(H5F_sfile_assert_num(0) != 0) - TEST_ERROR + if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR + if(H5F_sfile_assert_num(0) != 0) TEST_ERROR /* Shut down */ PASSED(); @@ -1046,7 +1039,7 @@ test_close(hid_t fapl) H5Fclose(file2); } H5E_END_TRY; return 1; -} +} /* end test_close() */ /*------------------------------------------------------------------------- @@ -1069,11 +1062,11 @@ test_close(hid_t fapl) static int test_mount_after_close(hid_t fapl) { - hid_t fid1=-1, fid2=-1; /* File IDs */ - hid_t gidA=-1, gidAB=-1, gidABM=-1, gidX=-1, gidXY=-1; /* Group identifiers */ - hid_t gidABMX=-1, gidABC=-1, gidABT=-1; /* Group IDs for testing */ - hid_t didABMXYD=-1; /* Dataset ID for testing */ - hid_t did=-1, sid=-1; /* Dataset and dataspace identifiers */ + hid_t fid1 = -1, fid2 = -1; /* File IDs */ + hid_t gidA = -1, gidAB = -1, gidABM = -1, gidX = -1, gidXY = -1; /* Group identifiers */ + hid_t gidABMX = -1, gidABC = -1, gidABT = -1; /* Group IDs for testing */ + hid_t didABMXYD = -1; /* Dataset ID for testing */ + hid_t did = -1, sid = -1; /* Dataset and dataspace identifiers */ char filename1[1024], filename2[1024]; /* Name of files to mount */ char objname[NAME_BUF_SIZE]; /* Name of object opened */ hsize_t dims[] = {NX,NY}; /* Dataset dimensions */ @@ -1086,8 +1079,8 @@ test_mount_after_close(hid_t fapl) /* * Initialization of buffer matrix "bm" */ - for(i =0; i<NX; i++) - for(j = 0; j<NY; j++) + for(i =0; i < NX; i++) + for(j = 0; j < NY; j++) bm[i][j] = i + j; /* Create first file and a groups in it. */ @@ -1098,28 +1091,21 @@ test_mount_after_close(hid_t fapl) /A/B/M Group /A/B/T -> /A */ - if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR - if((gidA = H5Gcreate2(fid1, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR - if((gidAB = H5Gcreate2(gidA, "B", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR - if((gidABM = H5Gcreate2(gidAB, "M", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) /* Mount point */ - TEST_ERROR - if(H5Glink(gidAB, H5L_TYPE_SOFT, "./M/X/Y", "C") < 0) /* Soft link */ - TEST_ERROR - if(H5Glink(gidAB, H5L_TYPE_SOFT, "/A", "T") < 0) /* Soft link */ - TEST_ERROR + if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR + if((gidA = H5Gcreate2(fid1, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((gidAB = H5Gcreate2(gidA, "B", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + /* Mount point */ + if((gidABM = H5Gcreate2(gidAB, "M", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + /* Soft link */ + if(H5Glink(gidAB, H5L_TYPE_SOFT, "./M/X/Y", "C") < 0) FAIL_STACK_ERROR + /* Soft link */ + if(H5Glink(gidAB, H5L_TYPE_SOFT, "/A", "T") < 0) FAIL_STACK_ERROR /* Close groups and file */ - if(H5Gclose(gidABM) < 0) - TEST_ERROR - if(H5Gclose(gidAB) < 0) - TEST_ERROR - if(H5Gclose(gidA) < 0) - TEST_ERROR - if(H5Fclose(fid1) < 0) - TEST_ERROR + if(H5Gclose(gidABM) < 0) FAIL_STACK_ERROR + if(H5Gclose(gidAB) < 0) FAIL_STACK_ERROR + if(H5Gclose(gidA) < 0) FAIL_STACK_ERROR + if(H5Fclose(fid1) < 0) FAIL_STACK_ERROR /* Create second file and dataset "D" in it. */ /* h5ls shows: */ @@ -1128,127 +1114,94 @@ test_mount_after_close(hid_t fapl) /X/Y Group /X/Y/D Dataset {4, 5} */ - if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR + if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR dims[0] = NX; dims[1] = NY; - if((sid = H5Screate_simple(RANK, dims, NULL)) < 0) - TEST_ERROR + if((sid = H5Screate_simple(RANK, dims, NULL)) < 0) FAIL_STACK_ERROR - if((gidX = H5Gcreate2(fid2, "/X", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR - if((gidXY = H5Gcreate2(gidX, "Y", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR - if((did = H5Dcreate(gidXY, "D", H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) - TEST_ERROR - if(H5Glink(gidX, H5L_TYPE_SOFT, "./Y", "T") < 0) /* Soft link */ - TEST_ERROR + if((gidX = H5Gcreate2(fid2, "/X", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((gidXY = H5Gcreate2(gidX, "Y", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((did = H5Dcreate(gidXY, "D", H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + /* Soft link */ + if(H5Glink(gidX, H5L_TYPE_SOFT, "./Y", "T") < 0) FAIL_STACK_ERROR /* Write data to the dataset. */ - if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, bm) < 0) - TEST_ERROR + if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, bm) < 0) FAIL_STACK_ERROR /* Close all identifiers. */ - if(H5Sclose(sid) < 0) - TEST_ERROR - if(H5Dclose(did) < 0) - TEST_ERROR - if(H5Gclose(gidXY) < 0) - TEST_ERROR - if(H5Gclose(gidX) < 0) - TEST_ERROR - if(H5Fclose(fid2) < 0) - TEST_ERROR + if(H5Sclose(sid) < 0) FAIL_STACK_ERROR + if(H5Dclose(did) < 0) FAIL_STACK_ERROR + if(H5Gclose(gidXY) < 0) FAIL_STACK_ERROR + if(H5Gclose(gidX) < 0) FAIL_STACK_ERROR + if(H5Fclose(fid2) < 0) FAIL_STACK_ERROR /* Beginning of the actual test code */ /* * Reopen both files */ - if((fid1 = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0) - TEST_ERROR - if((fid2 = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) - TEST_ERROR + if((fid1 = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0) FAIL_STACK_ERROR + if((fid2 = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) FAIL_STACK_ERROR /* * Open /A/B to use as a mount point */ - if((gidAB = H5Gopen(fid1, "/A/B")) < 0) - TEST_ERROR + if((gidAB = H5Gopen2(fid1, "/A/B", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* * Close the parent file. This keeps the file open because of the other handle on the group within */ - if(H5Fclose(fid1) < 0) /* We close the file (it should stay open from the group) */ - TEST_ERROR + /* We close the file (it should stay open from the group) */ + if(H5Fclose(fid1) < 0) FAIL_STACK_ERROR /* * Mount second file under G in the first file. */ - if(H5Fmount(gidAB, "M", fid2, H5P_DEFAULT) < 0) - TEST_ERROR + if(H5Fmount(gidAB, "M", fid2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Open "normal" group in mounted file */ /* (This shows we successfully mounted) */ - if((gidABMX = H5Gopen(gidAB, "M/X")) < 0) - TEST_ERROR + if((gidABMX = H5Gopen2(gidAB, "M/X", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if(H5Iget_name( gidABMX, objname, (size_t)NAME_BUF_SIZE ) < 0) - TEST_ERROR - if(HDstrcmp(objname, "/A/B/M/X")) - TEST_ERROR + if(H5Iget_name(gidABMX, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR + if(HDstrcmp(objname, "/A/B/M/X")) TEST_ERROR /* Close object in mounted file */ - if(H5Gclose(gidABMX) < 0) - TEST_ERROR + if(H5Gclose(gidABMX) < 0) FAIL_STACK_ERROR /* Open group in mounted file through softlink */ - if((gidABC = H5Gopen(gidAB, "C")) < 0) - TEST_ERROR + if((gidABC = H5Gopen2(gidAB, "C", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if(H5Iget_name( gidABC, objname, (size_t)NAME_BUF_SIZE ) < 0) - TEST_ERROR - if(HDstrcmp(objname, "/A/B/C")) - TEST_ERROR + if(H5Iget_name(gidABC, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR + if(HDstrcmp(objname, "/A/B/C")) TEST_ERROR /* Close object in mounted file */ - if(H5Gclose(gidABC) < 0) - TEST_ERROR + if(H5Gclose(gidABC) < 0) FAIL_STACK_ERROR /* Open group in original file through softlink */ - if((gidABT = H5Gopen(gidAB, "T")) < 0) - TEST_ERROR + if((gidABT = H5Gopen2(gidAB, "T", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if(H5Iget_name( gidABT, objname, (size_t)NAME_BUF_SIZE ) < 0) - TEST_ERROR - if(HDstrcmp(objname, "/A/B/T")) - TEST_ERROR + if(H5Iget_name(gidABT, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR + if(HDstrcmp(objname, "/A/B/T")) TEST_ERROR /* Close object in original file */ - if(H5Gclose(gidABT) < 0) - TEST_ERROR + if(H5Gclose(gidABT) < 0) FAIL_STACK_ERROR /* Open "normal" dataset in mounted file */ - if((didABMXYD = H5Dopen(gidAB, "M/X/Y/D")) < 0) - TEST_ERROR + if((didABMXYD = H5Dopen(gidAB, "M/X/Y/D")) < 0) FAIL_STACK_ERROR /* Check name */ - if(H5Iget_name( didABMXYD, objname, (size_t)NAME_BUF_SIZE ) < 0) - TEST_ERROR - if(HDstrcmp(objname, "/A/B/M/X/Y/D")) - TEST_ERROR + if(H5Iget_name(didABMXYD, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR + if(HDstrcmp(objname, "/A/B/M/X/Y/D")) TEST_ERROR /* Close object in mounted file */ - if(H5Dclose(didABMXYD) < 0) - TEST_ERROR + if(H5Dclose(didABMXYD) < 0) FAIL_STACK_ERROR - if(H5Gclose(gidAB) < 0) - TEST_ERROR - if(H5Fclose(fid2) < 0) - TEST_ERROR + if(H5Gclose(gidAB) < 0) FAIL_STACK_ERROR + if(H5Fclose(fid2) < 0) FAIL_STACK_ERROR /* Shut down */ PASSED(); @@ -1271,7 +1224,7 @@ error: H5Fclose(fid2); } H5E_END_TRY; return 1; -} +} /* end test_mount_after_close() */ /*------------------------------------------------------------------------- @@ -1394,9 +1347,9 @@ test_mount_after_unmount(hid_t fapl) /* * Open /A & /B to use as a mount points */ - if((gidA = H5Gopen(fid1, "/A")) < 0) + if((gidA = H5Gopen2(fid1, "/A", H5P_DEFAULT)) < 0) TEST_ERROR - if((gidB = H5Gopen(fid1, "/B")) < 0) + if((gidB = H5Gopen2(fid1, "/B", H5P_DEFAULT)) < 0) TEST_ERROR /* @@ -1407,7 +1360,7 @@ test_mount_after_unmount(hid_t fapl) /* Open group in mounted file */ /* (This shows we successfully mounted) */ - if((gidAMXX = H5Gopen(gidA, "M/X/X")) < 0) + if((gidAMXX = H5Gopen2(gidA, "M/X/X", H5P_DEFAULT)) < 0) TEST_ERROR /* Check name */ @@ -1417,7 +1370,7 @@ test_mount_after_unmount(hid_t fapl) TEST_ERROR /* Open group in mounted file #2 */ - if((gidAMX = H5Gopen(gidA, "M/X")) < 0) + if((gidAMX = H5Gopen2(gidA, "M/X", H5P_DEFAULT)) < 0) TEST_ERROR /* Mount third file */ @@ -1426,7 +1379,7 @@ test_mount_after_unmount(hid_t fapl) /* Open group in mounted file #3 */ /* (This shows we successfully mounted) */ - if((gidAMXMY = H5Gopen(gidAMX, "M/Y")) < 0) + if((gidAMXMY = H5Gopen2(gidAMX, "M/Y", H5P_DEFAULT)) < 0) TEST_ERROR /* Check name */ @@ -1436,7 +1389,7 @@ 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 */ @@ -1456,7 +1409,7 @@ test_mount_after_unmount(hid_t fapl) TEST_ERROR /* Re-open group in file #3 */ - if((gidAMXMY = H5Gopen(gidAMX, "M/Z")) < 0) + if((gidAMXMY = H5Gopen2(gidAMX, "M/Z", H5P_DEFAULT)) < 0) TEST_ERROR /* Check name again */ @@ -1472,7 +1425,7 @@ test_mount_after_unmount(hid_t fapl) /* Open group in mounted file */ /* (This shows we successfully mounted) */ - if((gidBMZ = H5Gopen(gidB, "M/Z")) < 0) + if((gidBMZ = H5Gopen2(gidB, "M/Z", H5P_DEFAULT)) < 0) TEST_ERROR /* Check name */ @@ -1482,11 +1435,11 @@ test_mount_after_unmount(hid_t fapl) TEST_ERROR /* Unmount third file */ - if (H5Funmount(fid2, "/X/M")<0) + if (H5Funmount(fid2, "/X/M") < 0) TEST_ERROR /* Unmount fourth file */ - if (H5Funmount(fid1, "/B/M")<0) + if (H5Funmount(fid1, "/B/M") < 0) TEST_ERROR /* Close objects in mounted files */ @@ -1622,7 +1575,7 @@ test_missing_unmount(hid_t fapl) if((fid1 = H5Fopen(filename1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR - if((gidA = H5Gopen(fid1, "A")) < 0) + if((gidA = H5Gopen2(fid1, "A", H5P_DEFAULT)) < 0) TEST_ERROR /* Close file #1 */ @@ -1636,7 +1589,7 @@ test_missing_unmount(hid_t fapl) TEST_ERROR /* Open group in mounted file */ - if((gidAE = H5Gopen(fid2, "A/E")) < 0) + if((gidAE = H5Gopen2(fid2, "A/E", H5P_DEFAULT)) < 0) TEST_ERROR /* Close file #2 */ @@ -1650,7 +1603,7 @@ test_missing_unmount(hid_t fapl) TEST_ERROR /* Open group in mounted file */ - if((gidAEM = H5Gopen(fid3, "A/E/M")) < 0) + if((gidAEM = H5Gopen2(fid3, "A/E/M", H5P_DEFAULT)) < 0) TEST_ERROR /* Close file #3 */ @@ -1762,7 +1715,7 @@ test_hold_open_file(hid_t fapl) if((fid1 = H5Fopen(filename1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR - if((gidA = H5Gopen(fid1, "A")) < 0) + if((gidA = H5Gopen2(fid1, "A", H5P_DEFAULT)) < 0) TEST_ERROR if((fid2 = H5Fopen(filename2, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) @@ -1771,7 +1724,7 @@ test_hold_open_file(hid_t fapl) if(H5Fmount(gidA, ".", fid2, H5P_DEFAULT) < 0) TEST_ERROR - if((gidAM = H5Gopen(fid1, "A/M")) < 0) + if((gidAM = H5Gopen2(fid1, "A/M", H5P_DEFAULT)) < 0) TEST_ERROR /* Close file #2 */ @@ -1784,7 +1737,7 @@ test_hold_open_file(hid_t fapl) /* Attempt to open group in mounted file */ /* (Should work because file is still mounted) */ - if((gidAM = H5Gopen(fid1, "A/M")) < 0) + if((gidAM = H5Gopen2(fid1, "A/M", H5P_DEFAULT)) < 0) TEST_ERROR /* Close file #1 */ @@ -1797,7 +1750,7 @@ test_hold_open_file(hid_t fapl) /* Attempt to open group in mounted file */ /* (Should work because file is still mounted) */ - if((gidAM = H5Gopen(gidA, "/A/M")) < 0) + if((gidAM = H5Gopen2(gidA, "/A/M", H5P_DEFAULT)) < 0) TEST_ERROR /* Close group in mounted file */ @@ -1895,7 +1848,7 @@ test_hold_open_group(hid_t fapl) if((fid1 = H5Fopen(filename1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR - if((gidA = H5Gopen(fid1, "A")) < 0) + if((gidA = H5Gopen2(fid1, "A", H5P_DEFAULT)) < 0) TEST_ERROR if((fid2 = H5Fopen(filename2, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) @@ -1904,7 +1857,7 @@ test_hold_open_group(hid_t fapl) if(H5Fmount(gidA, ".", fid2, H5P_DEFAULT) < 0) TEST_ERROR - if((gidAM = H5Gopen(fid1, "A/M")) < 0) + if((gidAM = H5Gopen2(fid1, "A/M", H5P_DEFAULT)) < 0) TEST_ERROR /* Close file #2 */ @@ -1919,7 +1872,7 @@ test_hold_open_group(hid_t fapl) /* Retry to opening group in mounted file */ /* (Should work because file is still mounted) */ - if((gidAM2 = H5Gopen(fid1, "A/M")) < 0) + if((gidAM2 = H5Gopen2(fid1, "A/M", H5P_DEFAULT)) < 0) TEST_ERROR /* Close group in mounted file */ @@ -1932,7 +1885,7 @@ test_hold_open_group(hid_t fapl) /* Attempt to open group in mounted file */ /* (Should work because file is still mounted) */ - if((gidAM2 = H5Gopen(fid1, "/A/M")) < 0) + if((gidAM2 = H5Gopen2(fid1, "/A/M", H5P_DEFAULT)) < 0) TEST_ERROR /* Close file #1 */ @@ -1949,7 +1902,7 @@ test_hold_open_group(hid_t fapl) /* Attempt to open group in mounted file */ /* (Should work because file is still mounted) */ - if((gidAM2 = H5Gopen(fid2, "/A/M")) < 0) + if((gidAM2 = H5Gopen2(fid2, "/A/M", H5P_DEFAULT)) < 0) TEST_ERROR /* Close file #2 */ @@ -1958,7 +1911,7 @@ test_hold_open_group(hid_t fapl) /* Attempt to open group in parent file */ /* (Should work because files should be mounted together) */ - if((gid = H5Gopen(gidAM2, "/")) < 0) + if((gid = H5Gopen2(gidAM2, "/", H5P_DEFAULT)) < 0) TEST_ERROR /* Close group in mounted file */ @@ -2056,7 +2009,7 @@ test_fcdegree_same(hid_t fapl) if((fid1 = H5Fopen(filename1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR - if((gidA = H5Gopen(fid1, "A")) < 0) + if((gidA = H5Gopen2(fid1, "A", H5P_DEFAULT)) < 0) TEST_ERROR /* Create FAPL & set file close degree for file #2 to be different */ @@ -2092,7 +2045,7 @@ test_fcdegree_same(hid_t fapl) TEST_ERROR /* Verify opening group in mounted file */ - if((gidAM = H5Gopen(fid1, "A/M")) < 0) + if((gidAM = H5Gopen2(fid1, "A/M", H5P_DEFAULT)) < 0) TEST_ERROR /* Close group in mounted file */ @@ -2209,7 +2162,7 @@ test_fcdegree_semi(hid_t fapl) if((fid1 = H5Fopen(filename1, H5F_ACC_RDONLY, fapl_id)) < 0) TEST_ERROR - if((gidA = H5Gopen(fid1, "A")) < 0) + if((gidA = H5Gopen2(fid1, "A", H5P_DEFAULT)) < 0) TEST_ERROR if((fid2 = H5Fopen(filename2, H5F_ACC_RDONLY, fapl_id)) < 0) @@ -2220,7 +2173,7 @@ test_fcdegree_semi(hid_t fapl) TEST_ERROR /* Verify opening group in mounted file */ - if((gidAM = H5Gopen(fid1, "A/M")) < 0) + if((gidAM = H5Gopen2(fid1, "A/M", H5P_DEFAULT)) < 0) TEST_ERROR /* Close file #1 (should succeed, since file #2 is open still) */ @@ -2351,7 +2304,7 @@ test_fcdegree_strong(hid_t fapl) if((fid1 = H5Fopen(filename1, H5F_ACC_RDONLY, fapl_id)) < 0) TEST_ERROR - if((gidA = H5Gopen(fid1, "A")) < 0) + if((gidA = H5Gopen2(fid1, "A", H5P_DEFAULT)) < 0) TEST_ERROR if((fid2 = H5Fopen(filename2, H5F_ACC_RDONLY, fapl_id)) < 0) @@ -2362,7 +2315,7 @@ test_fcdegree_strong(hid_t fapl) TEST_ERROR /* Open group in mounted file */ - if((gidAM = H5Gopen(fid1, "A/M")) < 0) + if((gidAM = H5Gopen2(fid1, "A/M", H5P_DEFAULT)) < 0) TEST_ERROR /* Close file #1 */ @@ -2486,7 +2439,7 @@ test_acc_perm(hid_t fapl) if((fid1 = H5Fopen(filename1, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) TEST_ERROR - if((gidA = H5Gopen(fid1, "A")) < 0) + if((gidA = H5Gopen2(fid1, "A", H5P_DEFAULT)) < 0) TEST_ERROR /* Get and verify file name */ @@ -2515,7 +2468,7 @@ test_acc_perm(hid_t fapl) TEST_ERROR /* Open group in mounted file */ - if((gidAM = H5Gopen(fid1, "A/M")) < 0) + if((gidAM = H5Gopen2(fid1, "A/M", H5P_DEFAULT)) < 0) TEST_ERROR /* Get and verify file name */ @@ -2723,10 +2676,10 @@ test_mult_mount(hid_t fapl) if((fid1 = H5Fopen(filename1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR - if((gidA = H5Gopen(fid1, "A")) < 0) + if((gidA = H5Gopen2(fid1, "A", H5P_DEFAULT)) < 0) TEST_ERROR - if((gidB = H5Gopen(fid1, "B")) < 0) + if((gidB = H5Gopen2(fid1, "B", H5P_DEFAULT)) < 0) TEST_ERROR if((fid2 = H5Fopen(filename2, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) @@ -2737,7 +2690,7 @@ test_mult_mount(hid_t fapl) TEST_ERROR /* Open group in mounted file */ - if((gidAM = H5Gopen(fid1, "A/M")) < 0) + if((gidAM = H5Gopen2(fid1, "A/M", H5P_DEFAULT)) < 0) TEST_ERROR /* Open file #3 again */ @@ -2757,7 +2710,7 @@ test_mult_mount(hid_t fapl) TEST_ERROR /* Open object in file #3 through file #2 mount path */ - if((gidAMT = H5Gopen(fid1, "A/M/T")) < 0) + if((gidAMT = H5Gopen2(fid1, "A/M/T", H5P_DEFAULT)) < 0) TEST_ERROR /* Check name */ @@ -2774,7 +2727,7 @@ test_mult_mount(hid_t fapl) TEST_ERROR /* Open object in file #3 through file #1 mount path */ - if((gidBS = H5Gopen(fid1, "B/S")) < 0) + if((gidBS = H5Gopen2(fid1, "B/S", H5P_DEFAULT)) < 0) TEST_ERROR /* Check name */ @@ -2784,7 +2737,7 @@ test_mult_mount(hid_t fapl) TEST_ERROR /* Re-open object created in file #3 through file #1 mount path */ - if((gidU = H5Gopen(gidBS, "/B/T/U")) < 0) + if((gidU = H5Gopen2(gidBS, "/B/T/U", H5P_DEFAULT)) < 0) TEST_ERROR if(H5Gclose(gidU) < 0) @@ -2933,7 +2886,7 @@ test_nested_survive(hid_t fapl) if((fid1 = H5Fopen(filename1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR - if((gidA = H5Gopen(fid1, "A")) < 0) + if((gidA = H5Gopen2(fid1, "A", H5P_DEFAULT)) < 0) TEST_ERROR if((fid2 = H5Fopen(filename2, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) @@ -2944,7 +2897,7 @@ test_nested_survive(hid_t fapl) TEST_ERROR /* Open group in mounted file */ - if((gidAM = H5Gopen(fid1, "A/M")) < 0) + if((gidAM = H5Gopen2(fid1, "A/M", H5P_DEFAULT)) < 0) TEST_ERROR /* Open file #3 again */ @@ -2956,7 +2909,7 @@ test_nested_survive(hid_t fapl) TEST_ERROR /* Open object in file #3 through file #1 mount path */ - if((gidAMS = H5Gopen(fid1, "A/M/S")) < 0) + if((gidAMS = H5Gopen2(fid1, "A/M/S", H5P_DEFAULT)) < 0) TEST_ERROR /* Close group in file #3 */ @@ -2981,13 +2934,13 @@ test_nested_survive(hid_t fapl) /* Open object in file #3 through file #1 mount path (should fail) */ H5E_BEGIN_TRY { - gidAMS = H5Gopen(fid1, "A/M/S"); + gidAMS = H5Gopen2(fid1, "A/M/S", H5P_DEFAULT); } H5E_END_TRY; if(gidAMS >= 0) TEST_ERROR /* Open object in file #3 through file #2 mount path */ - if((gidMS = H5Gopen(fid2, "M/S")) < 0) + if((gidMS = H5Gopen2(fid2, "M/S", H5P_DEFAULT)) < 0) TEST_ERROR /* Check name */ @@ -3005,7 +2958,7 @@ test_nested_survive(hid_t fapl) TEST_ERROR /* Open object in file #3 through file #1 mount path again */ - if((gidAMS = H5Gopen(fid1, "A/M/S")) < 0) + if((gidAMS = H5Gopen2(fid1, "A/M/S", H5P_DEFAULT)) < 0) TEST_ERROR /* Check name */ @@ -3129,7 +3082,7 @@ test_close_parent(hid_t fapl) if((fid1 = H5Fopen(filename1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR - if((gidA = H5Gopen(fid1, "A")) < 0) + if((gidA = H5Gopen2(fid1, "A", H5P_DEFAULT)) < 0) TEST_ERROR if((fid2 = H5Fopen(filename2, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) @@ -3140,7 +3093,7 @@ test_close_parent(hid_t fapl) TEST_ERROR /* Open group in mounted file */ - if((gidM = H5Gopen(fid1, "A/M")) < 0) + if((gidM = H5Gopen2(fid1, "A/M", H5P_DEFAULT)) < 0) TEST_ERROR /* Close group in file #1 */ @@ -3443,7 +3396,7 @@ test_cut_graph(hid_t fapl) TEST_ERROR /* Open object in file #5 */ - if((gidM = H5Gopen(fid1, "A/E/M")) < 0) + if((gidM = H5Gopen2(fid1, "A/E/M", H5P_DEFAULT)) < 0) TEST_ERROR /* Check name */ @@ -3453,7 +3406,7 @@ test_cut_graph(hid_t fapl) TEST_ERROR /* Open object in file #7 */ - if((gidQ = H5Gopen(fid1, "B/I/Q")) < 0) + if((gidQ = H5Gopen2(fid1, "B/I/Q", H5P_DEFAULT)) < 0) TEST_ERROR /* Check name */ @@ -3507,13 +3460,13 @@ test_cut_graph(hid_t fapl) /* Attempt to open an object in file #4, from file #1 */ H5E_BEGIN_TRY { - gidK = H5Gopen(gidQ, "/A/D/K"); + gidK = H5Gopen2(gidQ, "/A/D/K", H5P_DEFAULT); } H5E_END_TRY; if(gidK >= 0) TEST_ERROR /* Open object in file #4 from file #5 */ - if((gidK = H5Gopen(gidM, "/D/K")) < 0) + if((gidK = H5Gopen2(gidM, "/D/K", H5P_DEFAULT)) < 0) TEST_ERROR /* Check the name of "K" is correct */ @@ -3527,13 +3480,13 @@ test_cut_graph(hid_t fapl) /* Attempt to open an object in file #6, from file #5 */ H5E_BEGIN_TRY { - gidO = H5Gopen(gidM, "/B/H/O"); + gidO = H5Gopen2(gidM, "/B/H/O", H5P_DEFAULT); } H5E_END_TRY; if(gidO >= 0) TEST_ERROR /* Open object in file #6 from file #7 */ - if((gidO = H5Gopen(gidQ, "/B/H/O")) < 0) + if((gidO = H5Gopen2(gidQ, "/B/H/O", H5P_DEFAULT)) < 0) TEST_ERROR /* Check the name of "O" is correct */ @@ -3585,7 +3538,7 @@ test_cut_graph(hid_t fapl) TEST_ERROR /* Open object in file #6 from file #7 */ - if((gidO = H5Gopen(gidQ, "/H/O")) < 0) + if((gidO = H5Gopen2(gidQ, "/H/O", H5P_DEFAULT)) < 0) TEST_ERROR /* Check the name of "O" is correct */ @@ -3741,7 +3694,7 @@ test_symlink(hid_t fapl) /* Attempt to open an object in file #3 (should fail) */ H5E_BEGIN_TRY { - gidL = H5Gopen(fid1, "L"); + gidL = H5Gopen2(fid1, "L", H5P_DEFAULT); } H5E_END_TRY; if(gidL >= 0) TEST_ERROR @@ -3755,7 +3708,7 @@ test_symlink(hid_t fapl) TEST_ERROR /* Open soft link to object in file #3 */ - if((gidL = H5Gopen(fid1, "L")) < 0) + if((gidL = H5Gopen2(fid1, "L", H5P_DEFAULT)) < 0) TEST_ERROR /* Check the name of "L" is correct */ @@ -3829,7 +3782,7 @@ main(void) if (HDstrcmp(envval, "split") && HDstrcmp(envval, "multi")) { h5_reset(); fapl = h5_fileaccess(); - if (setup(fapl)<0) goto error; + if (setup(fapl) < 0) goto error; nerrors += test_basic(fapl); nerrors += test_illegal(fapl); diff --git a/test/objcopy.c b/test/objcopy.c index 32b0995..8cdca26 100755 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -1334,8 +1334,8 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags) case H5G_GROUP: /* Open groups */ - if((oid = H5Gopen(gid, objname)) < 0) TEST_ERROR - if((oid2 = H5Gopen(gid2, objname2)) < 0) TEST_ERROR + if((oid = H5Gopen2(gid, objname, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((oid2 = H5Gopen2(gid2, objname2, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Compare groups */ if(compare_groups(oid, oid2, pid, depth - 1, copy_flags) != TRUE) TEST_ERROR @@ -3045,10 +3045,10 @@ test_copy_dataset_named_dtype_hier(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Ocopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* open the group for copy */ - if((gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid = H5Gopen2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* open the destination group */ - if((gid2 = H5Gopen(fid_dst, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check if the groups are equal */ if(compare_groups(gid, gid2, H5P_DEFAULT, -1, 0) != TRUE) TEST_ERROR @@ -3184,10 +3184,10 @@ test_copy_dataset_named_dtype_hier_outside(hid_t fcpl_src, hid_t fcpl_dst, hid_t if(H5Ocopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* open the group for copy */ - if((gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid = H5Gopen2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* open the destination group */ - if((gid2 = H5Gopen(fid_dst, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check if the groups are equal */ if(compare_groups(gid, gid2, H5P_DEFAULT, -1, 0) != TRUE) TEST_ERROR @@ -3318,10 +3318,10 @@ test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Ocopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* open the group for copy */ - if((gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid = H5Gopen2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* open the destination group */ - if((gid2 = H5Gopen(fid_dst, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check if the groups are equal */ if(compare_groups(gid, gid2, H5P_DEFAULT, -1, 0) != TRUE) TEST_ERROR @@ -3459,10 +3459,10 @@ test_copy_dataset_attr_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Ocopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* open the group for copy */ - if((gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid = H5Gopen2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* open the destination group */ - if((gid2 = H5Gopen(fid_dst, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check if the groups are equal */ if(compare_groups(gid, gid2, H5P_DEFAULT, -1, 0) != TRUE) TEST_ERROR @@ -4228,10 +4228,10 @@ test_copy_group_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Ocopy(fid_src, NAME_GROUP_EMPTY, fid_dst, NAME_GROUP_EMPTY, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* open the group for copy */ - if((gid = H5Gopen(fid_src, NAME_GROUP_EMPTY)) < 0) TEST_ERROR + if((gid = H5Gopen2(fid_src, NAME_GROUP_EMPTY, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* open the destination group */ - if((gid2 = H5Gopen(fid_dst, NAME_GROUP_EMPTY)) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_EMPTY, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check if the groups are equal */ if(compare_groups(gid, gid2, H5P_DEFAULT, -1, 0) != TRUE) TEST_ERROR @@ -4359,10 +4359,10 @@ test_copy_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Ocopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* open the group for copy */ - if((gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid = H5Gopen2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* open the destination group */ - if((gid2 = H5Gopen(fid_dst, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check if the groups are equal */ if(compare_groups(gid, gid2, H5P_DEFAULT, -1, 0) != TRUE) TEST_ERROR @@ -4492,10 +4492,10 @@ test_copy_root_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Ocopy(fid_src, "/", fid_dst, "/root_from_src", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* open the group for copy */ - if((gid = H5Gopen(fid_src, "/")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid_src, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* open the destination group */ - if((gid2 = H5Gopen(fid_dst, "/root_from_src")) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid_dst, "/root_from_src", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check if the groups are equal */ if(compare_groups(gid, gid2, H5P_DEFAULT, -1, 0) != TRUE) TEST_ERROR @@ -4634,10 +4634,10 @@ test_copy_group_deep(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Ocopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* open the group for copy */ - if((gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid = H5Gopen2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* open the destination group */ - if((gid2 = H5Gopen(fid_dst, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check if the groups are equal */ if(compare_groups(gid, gid2, H5P_DEFAULT, -1, 0) != TRUE) TEST_ERROR @@ -4745,10 +4745,10 @@ test_copy_group_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Ocopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* open the group for copy */ - if((gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid = H5Gopen2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* open the destination group */ - if((gid2 = H5Gopen(fid_dst, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check if the groups are equal */ if(compare_groups(gid, gid2, H5P_DEFAULT, -1, 0) != TRUE) TEST_ERROR @@ -4874,10 +4874,10 @@ test_copy_group_wide_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Ocopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* open the group for copy */ - if((gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid = H5Gopen2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* open the destination group */ - if((gid2 = H5Gopen(fid_dst, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check if the groups are equal */ if(compare_groups(gid, gid2, H5P_DEFAULT, -1, 0) != TRUE) TEST_ERROR @@ -5010,10 +5010,10 @@ test_copy_group_links(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Ocopy(fid_src, NAME_GROUP_LINK, fid_dst, NAME_GROUP_LINK, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* open the group for copy */ - if((gid = H5Gopen(fid_src, NAME_GROUP_LINK)) < 0) TEST_ERROR + if((gid = H5Gopen2(fid_src, NAME_GROUP_LINK, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* open the destination group */ - if((gid2 = H5Gopen(fid_dst, NAME_GROUP_LINK)) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_LINK, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check if the groups are equal */ if(compare_groups(gid, gid2, H5P_DEFAULT, -1, 0) != TRUE) TEST_ERROR @@ -7081,10 +7081,10 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl, unsigned flag, hboo if(H5Pclose(lcpl_id) < 0) TEST_ERROR /* open the group for copy */ - if((gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid = H5Gopen2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* open the destination group */ - if((gid2 = H5Gopen(fid_dst, "/new_g0/new_g00")) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid_dst, "/new_g0/new_g00", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR } else if((flag & H5O_COPY_EXPAND_SOFT_LINK_FLAG) > 0) { if(H5Ocopy(fid_src, NAME_GROUP_LINK, fid_dst, NAME_GROUP_LINK, pid, H5P_DEFAULT) < 0) TEST_ERROR @@ -7094,27 +7094,27 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl, unsigned flag, hboo if(H5Gunlink(fid_src, NAME_DATASET_SUB_SUB) < 0) TEST_ERROR /* open the group for copy */ - if((gid = H5Gopen(fid_src, NAME_GROUP_LINK2)) < 0) TEST_ERROR + if((gid = H5Gopen2(fid_src, NAME_GROUP_LINK2, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* open the destination group */ - if((gid2 = H5Gopen(fid_dst, NAME_GROUP_LINK)) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_LINK, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR } else if(flag & (H5O_COPY_WITHOUT_ATTR_FLAG | H5O_COPY_PRESERVE_NULL_FLAG)) { if(H5Ocopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, pid, H5P_DEFAULT) < 0) TEST_ERROR /* open the group for copy */ - if((gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid = H5Gopen2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* open the destination group */ - if((gid2 = H5Gopen(fid_dst, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR } else if(flag & H5O_COPY_SHALLOW_HIERARCHY_FLAG) { if(H5Ocopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, pid, H5P_DEFAULT) < 0) TEST_ERROR /* open the group for copy */ - if((gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid = H5Gopen2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* open the destination group */ - if((gid2 = H5Gopen(fid_dst, NAME_GROUP_TOP)) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Set the copy depth */ depth = 1; @@ -7122,10 +7122,10 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl, unsigned flag, hboo if(H5Ocopy(fid_src, NAME_GROUP_REF, fid_dst, NAME_GROUP_REF, pid, H5P_DEFAULT) < 0) TEST_ERROR /* open the group for copy */ - if((gid = H5Gopen(fid_src, NAME_GROUP_REF)) < 0) TEST_ERROR + if((gid = H5Gopen2(fid_src, NAME_GROUP_REF, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* open the destination group */ - if((gid2 = H5Gopen(fid_dst, NAME_GROUP_REF)) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_REF, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR } else { /* Unknown flag */ TEST_ERROR diff --git a/test/stab.c b/test/stab.c index f8d452d..d49d3a8 100644 --- a/test/stab.c +++ b/test/stab.c @@ -117,9 +117,9 @@ test_misc(hid_t fapl, hbool_t new_format) if(H5Gclose(g3) < 0) TEST_ERROR /* Open all groups with absolute names to check for exsistence */ - if((g1 = H5Gopen(fid, "/test_1a")) < 0) TEST_ERROR - if((g2 = H5Gopen(fid, "/test_1a/sub_1")) < 0) TEST_ERROR - if((g3 = H5Gopen(fid, "/test_1b")) < 0) TEST_ERROR + if((g1 = H5Gopen2(fid, "/test_1a", H5P_DEFAULT)) < 0) TEST_ERROR + if((g2 = H5Gopen2(fid, "/test_1a/sub_1", H5P_DEFAULT)) < 0) TEST_ERROR + if((g3 = H5Gopen2(fid, "/test_1b", H5P_DEFAULT)) < 0) TEST_ERROR if(H5Gget_comment(g3, "././.", sizeof comment, comment) < 0) TEST_ERROR if(HDstrcmp(comment, "hello world")) { H5_FAILED(); @@ -204,8 +204,8 @@ test_long(hid_t fapl, hbool_t new_format) if(H5Gclose(g2) < 0) TEST_ERROR /* Open groups */ - if((g1 = H5Gopen(fid, name1)) < 0) TEST_ERROR - if((g2 = H5Gopen(fid, name2)) < 0) TEST_ERROR + if((g1 = H5Gopen2(fid, name1, H5P_DEFAULT)) < 0) TEST_ERROR + if((g2 = H5Gopen2(fid, name2, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Gclose(g1) < 0) TEST_ERROR if(H5Gclose(g2) < 0) TEST_ERROR @@ -708,7 +708,7 @@ read_old(hid_t fapl2) if((fid = H5Fopen(filename2, H5F_ACC_RDWR, fapl2)) < 0) TEST_ERROR /* Attempt to open "old" group */ - if((gid = H5Gopen(fid, "old")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "old", H5P_DEFAULT)) < 0) TEST_ERROR /* Check on old group's status */ if(H5G_is_empty_test(gid) == FALSE) TEST_ERROR @@ -929,7 +929,7 @@ gcpl_on_root(hid_t fapl2) if(H5Pclose(fcpl) < 0) TEST_ERROR /* Open the root group */ - if((gid = H5Gopen(fid, "/")) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) TEST_ERROR /* Query the group creation properties */ if((gcpl = H5Gget_create_plist(gid)) < 0) TEST_ERROR @@ -963,7 +963,7 @@ gcpl_on_root(hid_t fapl2) if(H5Gclose(gid2) < 0) TEST_ERROR /* Open the middle group */ - if((gid2 = H5Gopen(fid, GCPL_ON_ROOT_MIDDLE_GROUP)) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid, GCPL_ON_ROOT_MIDDLE_GROUP, H5P_DEFAULT)) < 0) TEST_ERROR /* Query the group creation properties */ if((gcpl = H5Gget_create_plist(gid2)) < 0) TEST_ERROR @@ -1058,6 +1058,12 @@ old_api(hid_t fapl, const char *driver) /* Close group */ if(H5Gclose(gid) < 0) FAIL_STACK_ERROR + /* Re-open group */ + if((gid = H5Gopen1(fid, OLD_API_GROUP)) < 0) FAIL_STACK_ERROR + + /* Close group */ + if(H5Gclose(gid) < 0) FAIL_STACK_ERROR + /* Close file */ if(H5Fclose(fid) < 0) FAIL_STACK_ERROR @@ -1074,6 +1080,7 @@ old_api(hid_t fapl, const char *driver) #else /* H5_NO_DEPRECATED_SYMBOLS */ /* Shut compiler up */ fapl = fapl; + driver = driver; SKIPPED(); puts(" Deprecated API symbols not enabled"); diff --git a/test/tattr.c b/test/tattr.c index 969a0d9..b836d98 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -199,8 +199,8 @@ test_attr_basic_write(hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); /* Open the root group */ - group = H5Gopen(fid1, "/"); - CHECK(group, FAIL, "H5Gopen"); + group = H5Gopen2(fid1, "/", H5P_DEFAULT); + CHECK(group, FAIL, "H5Gopen2"); /* Open attribute again */ attr = H5Aopen_name(group, ATTR1_NAME); @@ -432,8 +432,8 @@ test_attr_basic_read(hid_t fapl) CHECK(ret, FAIL, "H5Dclose"); /* Open the group */ - group = H5Gopen(fid1,GROUP1_NAME); - CHECK(group, FAIL, "H5Gopen"); + group = H5Gopen2(fid1, GROUP1_NAME, H5P_DEFAULT); + CHECK(group, FAIL, "H5Gopen2"); /* Verify the correct number of attributes */ ret=H5Aget_num_attrs(group); @@ -3908,8 +3908,8 @@ test_attr_corder_create_reopen(hid_t fcpl, hid_t fapl) CHECK(fid, FAIL, "H5Fopen"); /* Re-open group */ - gid = H5Gopen(fid, GROUP1_NAME); - CHECK(gid, FAIL, "H5Gopen"); + gid = H5Gopen2(fid, GROUP1_NAME, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); /* Delete attribute */ ret = H5Adelete2(gid, ".", "attr-003", H5P_DEFAULT); @@ -8121,8 +8121,8 @@ test_attr_bug1(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Gclose"); /* Re-open first group */ - gid = H5Gopen(fid, GROUP1_NAME); - CHECK(gid, FAIL, "H5Gopen"); + gid = H5Gopen2(fid, GROUP1_NAME, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); /* Create attribute on first group */ aid = H5Acreate(gid, ATTR7_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT); @@ -8154,8 +8154,8 @@ test_attr_bug1(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Gunlink"); /* Re-open first group */ - gid = H5Gopen(fid, GROUP1_NAME); - CHECK(gid, FAIL, "H5Gopen"); + gid = H5Gopen2(fid, GROUP1_NAME, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); /* Create another attribute on first group */ aid = H5Acreate(gid, ATTR8_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT); @@ -8176,8 +8176,8 @@ test_attr_bug1(hid_t fcpl, hid_t fapl) CHECK(fid, FAIL, "H5Fopen"); /* Re-open first group */ - gid = H5Gopen(fid, GROUP1_NAME); - CHECK(gid, FAIL, "H5Gopen"); + gid = H5Gopen2(fid, GROUP1_NAME, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); /* Delete first attribute */ ret = H5Adelete(gid, ATTR7_NAME); diff --git a/test/tfile.c b/test/tfile.c index 882061f..e477622 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -833,13 +833,13 @@ create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1, if(ret_gid1 != NULL) *ret_gid1 = gid1; - gid2 = H5Gopen(fid2, "/group"); - CHECK(gid2, FAIL, "H5Gopen"); + gid2 = H5Gopen2(fid2, "/group", H5P_DEFAULT); + CHECK(gid2, FAIL, "H5Gopen2"); if(ret_gid2 != NULL) *ret_gid2 = gid2; - gid3 = H5Gopen(fid2, "/group"); - CHECK(gid3, FAIL, "H5Gopen"); + gid3 = H5Gopen2(fid2, "/group", H5P_DEFAULT); + CHECK(gid3, FAIL, "H5Gopen2"); if(ret_gid3 != NULL) *ret_gid3 = gid3; } @@ -917,8 +917,8 @@ test_get_file_id(void) fid = H5Fopen(FILE4, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fcreate"); - group_id = H5Gopen(fid, GRP_NAME); - CHECK(group_id, FAIL, "H5Gopen"); + group_id = H5Gopen2(fid, GRP_NAME, H5P_DEFAULT); + CHECK(group_id, FAIL, "H5Gopen2"); /* Test H5Iget_file_id() */ check_file_id(fid, group_id); @@ -1446,15 +1446,15 @@ test_file_open_dot(void) VERIFY(gid2, FAIL, "H5Gcreate2"); /* Open a group with no name using the file ID (should open the root group) */ - gid2 = H5Gopen(fid, "."); - CHECK(gid2, FAIL, "H5Gopen"); + gid2 = H5Gopen2(fid, ".", H5P_DEFAULT); + CHECK(gid2, FAIL, "H5Gopen2"); ret = H5Gclose(gid2); CHECK(ret, FAIL, "H5Gclose"); /* Open a group with no name using the group ID (should open the group again) */ - gid2 = H5Gopen(gid, "."); - CHECK(gid2, FAIL, "H5Gopen"); + gid2 = H5Gopen2(gid, ".", H5P_DEFAULT); + CHECK(gid2, FAIL, "H5Gopen2"); ret = H5Gclose(gid2); CHECK(ret, FAIL, "H5Gclose"); @@ -1695,10 +1695,10 @@ test_file_double_root_open(void) file2_id = H5Fopen (FILE1, H5F_ACC_RDONLY, H5P_DEFAULT); CHECK(file2_id, FAIL, "H5Fopen"); - grp1_id = H5Gopen(file1_id, "/"); - CHECK(grp1_id, FAIL, "H5Gopen"); - grp2_id = H5Gopen(file2_id, "/"); - CHECK(grp2_id, FAIL, "H5Gopen"); + grp1_id = H5Gopen2(file1_id, "/", H5P_DEFAULT); + CHECK(grp1_id, FAIL, "H5Gopen2"); + grp2_id = H5Gopen2(file2_id, "/", H5P_DEFAULT); + CHECK(grp2_id, FAIL, "H5Gopen2"); /* Note "assymetric" close order */ ret = H5Gclose(grp1_id); @@ -1736,8 +1736,8 @@ test_file_double_group_open(void) grp1_id = H5Gcreate2(file1_id, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(grp1_id, FAIL, "H5Gcreate2"); - grp2_id = H5Gopen(file2_id, GRP_NAME); - CHECK(grp2_id, FAIL, "H5Gopen"); + grp2_id = H5Gopen2(file2_id, GRP_NAME, H5P_DEFAULT); + CHECK(grp2_id, FAIL, "H5Gopen2"); /* Note "assymetric" close order */ ret = H5Gclose(grp1_id); diff --git a/test/th5o.c b/test/th5o.c index e83b920..86c8c84 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -213,8 +213,8 @@ test_h5o_close(void) CHECK(ret, FAIL, "H5Oclose"); /* Make sure H5Oclose can close objects opened with H5*open */ - grp = H5Gopen(fid, "group"); - CHECK(grp, FAIL, "H5Gopen"); + grp = H5Gopen2(fid, "group", H5P_DEFAULT); + CHECK(grp, FAIL, "H5Gopen2"); dtype = H5Topen(fid, "group/datatype"); CHECK(dtype, FAIL, "H5Topen"); dset = H5Dopen(fid, "dataset"); @@ -478,12 +478,12 @@ test_h5o_refcount(void) fid = H5Fopen(TEST_FILENAME, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fopen"); - grp = H5Gopen(fid, "group"); - CHECK(grp, FAIL, "H5Gopen"); + grp = H5Gopen2(fid, "group", H5P_DEFAULT); + CHECK(grp, FAIL, "H5Gopen2"); dtype = H5Topen(fid, "datatype"); - CHECK(dtype, FAIL, "H5Gopen"); + CHECK(dtype, FAIL, "H5Topen"); dset = H5Dopen(fid, "dataset"); - CHECK(dset, FAIL, "H5Gopen"); + CHECK(dset, FAIL, "H5Dopen"); ret = H5Gget_objinfo(fid, "group", FALSE, &sb); CHECK(ret, FAIL, "H5Gget_objinfo"); @@ -516,12 +516,12 @@ test_h5o_refcount(void) fid = H5Fopen(TEST_FILENAME, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fopen"); - grp = H5Gopen(fid, "group"); - CHECK(grp, FAIL, "H5Gopen"); + grp = H5Gopen2(fid, "group", H5P_DEFAULT); + CHECK(grp, FAIL, "H5Gopen2"); dtype = H5Topen(fid, "datatype"); - CHECK(dtype, FAIL, "H5Gopen"); + CHECK(dtype, FAIL, "H5Topen"); dset = H5Dopen(fid, "dataset"); - CHECK(dset, FAIL, "H5Gopen"); + CHECK(dset, FAIL, "H5Dopen"); ret = H5Gget_objinfo(fid, "group", FALSE, &sb); CHECK(ret, FAIL, "H5Gget_objinfo"); @@ -706,8 +706,8 @@ test_h5o_plist(void) CHECK(fid, FAIL, "H5Fopen"); /* Re-open objects */ - grp = H5Gopen(fid, "group"); - CHECK(grp, FAIL, "H5Gopen"); + grp = H5Gopen2(fid, "group", H5P_DEFAULT); + CHECK(grp, FAIL, "H5Gopen2"); dtype = H5Topen(fid, "datatype"); CHECK(dtype, FAIL, "H5Topen"); dset = H5Dopen(fid, "dataset"); diff --git a/test/titerate.c b/test/titerate.c index 5fc568f..289c3bb 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -202,8 +202,8 @@ static void test_iter_group(hid_t fapl, hbool_t new_format) * iterate through B-tree for group members in internal library design. */ { - root_group = H5Gopen(file, "/"); - CHECK(root_group, FAIL, "H5Gopen"); + root_group = H5Gopen2(file, "/", H5P_DEFAULT); + CHECK(root_group, FAIL, "H5Gopen2"); ret = H5Gget_num_objs(root_group, &num_membs); CHECK(ret, FAIL, "H5Gget_num_objs"); @@ -765,8 +765,8 @@ static void test_grp_memb_funcs(hid_t fapl) /* These two functions, H5Gget_num_objs and H5Gget_objname_by_idx, actually * iterate through B-tree for group members in internal library design. */ - root_group = H5Gopen(file, "/"); - CHECK(root_group, FAIL, "H5Gopen"); + root_group = H5Gopen2(file, "/", H5P_DEFAULT); + CHECK(root_group, FAIL, "H5Gopen2"); ret = H5Gget_num_objs(root_group, &num_membs); CHECK(ret, FAIL, "H5Gget_num_objs"); diff --git a/test/tmisc.c b/test/tmisc.c index 58cad14..8320979 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -423,8 +423,8 @@ static void test_misc2_write_attribute(void) file1 = H5Fcreate(MISC2_FILE_1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(file1, FAIL, "H5Fcreate"); - root1 = H5Gopen(file1, "/"); - CHECK(root1, FAIL, "H5Gopen"); + root1 = H5Gopen2(file1, "/", H5P_DEFAULT); + CHECK(root1, FAIL, "H5Gopen2"); att1 = H5Acreate(root1, MISC2_ATT_NAME_1, type, dataspace, H5P_DEFAULT); CHECK(att1, FAIL, "H5Acreate"); @@ -450,8 +450,8 @@ static void test_misc2_write_attribute(void) - root2 = H5Gopen(file2, "/"); - CHECK(root2, FAIL, "H5Gopen"); + root2 = H5Gopen2(file2, "/", H5P_DEFAULT); + CHECK(root2, FAIL, "H5Gopen2"); att2 = H5Acreate(root2, MISC2_ATT_NAME_2, type, dataspace, H5P_DEFAULT); CHECK(att2, FAIL, "H5Acreate"); @@ -499,8 +499,8 @@ static void test_misc2_read_attribute(const char *filename, const char *att_name file = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT); CHECK(file, FAIL, "H5Fopen"); - root = H5Gopen(file, "/"); - CHECK(root, FAIL, "H5Gopen"); + root = H5Gopen2(file, "/", H5P_DEFAULT); + CHECK(root, FAIL, "H5Gopen2"); att = H5Aopen_name(root, att_name); CHECK(att, FAIL, "H5Aopen_name"); @@ -2330,8 +2330,8 @@ verify_file(const char *name, hsize_t blk_size, unsigned check_new_data) CHECK(ret, FAIL, "H5Tclose"); /* Open the first group */ - gid = H5Gopen(fid, MISC13_GROUP1_NAME); - CHECK(gid, FAIL, "H5Gopen"); + gid = H5Gopen2(fid, MISC13_GROUP1_NAME, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); /* Verify the contiguous dataset in the first group */ verify_dataset(gid,MISC13_DSET1_NAME); @@ -2351,8 +2351,8 @@ verify_file(const char *name, hsize_t blk_size, unsigned check_new_data) CHECK(ret, FAIL, "H5Tclose"); /* Open the second group */ - gid2 = H5Gopen(gid, MISC13_GROUP2_NAME); - CHECK(gid2, FAIL, "H5Gopen"); + gid2 = H5Gopen2(gid, MISC13_GROUP2_NAME, H5P_DEFAULT); + CHECK(gid2, FAIL, "H5Gopen2"); /* Close the second group */ ret = H5Gclose(gid2); @@ -3199,8 +3199,8 @@ test_misc19(void) CHECK(fid, FAIL, "H5Fcreate"); /* Open the root group */ - gid = H5Gopen(fid,"/"); - CHECK(gid, FAIL, "H5Gopen"); + gid = H5Gopen2(fid, "/", H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); /* Create a dataspace */ sid = H5Screate(H5S_SCALAR); @@ -3877,8 +3877,8 @@ test_misc23(void) CHECK(status, FAIL, "H5Gclose"); /* Check that intermediate group is set up correctly */ - tmp_id = H5Gopen(file_id, "/A/B01"); - CHECK(tmp_id, FAIL, "H5Gopen"); + tmp_id = H5Gopen2(file_id, "/A/B01", H5P_DEFAULT); + CHECK(tmp_id, FAIL, "H5Gopen2"); status = H5Gget_objinfo(tmp_id, ".", FALSE, &sb); CHECK(status, FAIL, "H5Gget_objinfo"); @@ -4132,14 +4132,14 @@ test_misc24(void) VERIFY(tmp_id, FAIL, "H5Topen"); H5E_BEGIN_TRY { - tmp_id = H5Gopen(file_id, MISC24_DATASET_NAME); + tmp_id = H5Gopen2(file_id, MISC24_DATASET_NAME, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Gopen"); + VERIFY(tmp_id, FAIL, "H5Gopen2"); H5E_BEGIN_TRY { - tmp_id = H5Gopen(file_id, MISC24_DATASET_LINK); + tmp_id = H5Gopen2(file_id, MISC24_DATASET_LINK, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Gopen"); + VERIFY(tmp_id, FAIL, "H5Gopen2"); H5E_BEGIN_TRY { tmp_id = H5Topen(file_id, MISC24_DATASET_NAME); @@ -4152,14 +4152,14 @@ test_misc24(void) VERIFY(tmp_id, FAIL, "H5Topen"); H5E_BEGIN_TRY { - tmp_id = H5Gopen(file_id, MISC24_DATATYPE_NAME); + tmp_id = H5Gopen2(file_id, MISC24_DATATYPE_NAME, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Gopen"); + VERIFY(tmp_id, FAIL, "H5Gopen2"); H5E_BEGIN_TRY { - tmp_id = H5Gopen(file_id, MISC24_DATATYPE_LINK); + tmp_id = H5Gopen2(file_id, MISC24_DATATYPE_LINK, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Gopen"); + VERIFY(tmp_id, FAIL, "H5Gopen2"); H5E_BEGIN_TRY { tmp_id = H5Dopen(file_id, MISC24_DATATYPE_NAME); @@ -4173,8 +4173,8 @@ test_misc24(void) /* 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"); + group_id = H5Gopen2(file_id, MISC24_GROUP_NAME, H5P_DEFAULT); + CHECK(group_id, FAIL, "H5Gopen2"); H5E_BEGIN_TRY { tmp_id = H5Dopen(file_id, MISC24_GROUP_NAME); @@ -4204,14 +4204,14 @@ test_misc24(void) CHECK(dset_id, FAIL, "H5Dopen"); H5E_BEGIN_TRY { - tmp_id = H5Gopen(file_id, MISC24_DATASET_NAME); + tmp_id = H5Gopen2(file_id, MISC24_DATASET_NAME, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Gopen"); + VERIFY(tmp_id, FAIL, "H5Gopen2"); H5E_BEGIN_TRY { - tmp_id = H5Gopen(file_id, MISC24_DATASET_LINK); + tmp_id = H5Gopen2(file_id, MISC24_DATASET_LINK, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Gopen"); + VERIFY(tmp_id, FAIL, "H5Gopen2"); H5E_BEGIN_TRY { tmp_id = H5Topen(file_id, MISC24_DATASET_NAME); @@ -4231,14 +4231,14 @@ test_misc24(void) CHECK(ret, FAIL, "H5Topen"); H5E_BEGIN_TRY { - tmp_id = H5Gopen(file_id, MISC24_DATATYPE_NAME); + tmp_id = H5Gopen2(file_id, MISC24_DATATYPE_NAME, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Gopen"); + VERIFY(tmp_id, FAIL, "H5Gopen2"); H5E_BEGIN_TRY { - tmp_id = H5Gopen(file_id, MISC24_DATATYPE_LINK); + tmp_id = H5Gopen2(file_id, MISC24_DATATYPE_LINK, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Gopen"); + VERIFY(tmp_id, FAIL, "H5Gopen2"); H5E_BEGIN_TRY { tmp_id = H5Dopen(file_id, MISC24_DATATYPE_NAME); @@ -4315,8 +4315,8 @@ test_misc25a(void) CHECK(fid, FAIL, "H5Fopen"); /* Re-open first group */ - gid = H5Gopen(fid, MISC25A_GROUP1_NAME); - CHECK(gid, FAIL, "H5Gopen"); + gid = H5Gopen2(fid, MISC25A_GROUP1_NAME, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); /* Create dataspace for attribute */ sid = H5Screate(H5S_SCALAR); @@ -4392,8 +4392,8 @@ test_misc25a(void) CHECK(ret, FAIL, "H5Gclose"); /* Re-open first group */ - gid = H5Gopen(fid, MISC25A_GROUP1_NAME); - CHECK(gid, FAIL, "H5Gopen"); + gid = H5Gopen2(fid, MISC25A_GROUP1_NAME, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); /* Delete 2nd attribute */ ret = H5Adelete(gid, MISC25A_ATTR2_NAME); @@ -4414,8 +4414,8 @@ test_misc25a(void) CHECK(fid, FAIL, "H5Fopen"); /* Re-open first group */ - gid = H5Gopen(fid, MISC25A_GROUP1_NAME); - CHECK(gid, FAIL, "H5Gopen"); + gid = H5Gopen2(fid, MISC25A_GROUP1_NAME, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); /* Create dataspace for 3rd attribute */ sid = H5Screate(H5S_SCALAR); @@ -4458,8 +4458,8 @@ test_misc25a(void) CHECK(fid, FAIL, "H5Fopen"); /* Re-open first group */ - gid = H5Gopen(fid, MISC25A_GROUP1_NAME); - CHECK(gid, FAIL, "H5Gopen"); + gid = H5Gopen2(fid, MISC25A_GROUP1_NAME, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); /* Delete 3rd attribute */ ret = H5Adelete(gid, MISC25A_ATTR3_NAME); @@ -4505,8 +4505,8 @@ test_misc25a(void) CHECK(fid, FAIL, "H5Fopen"); /* Re-open first group */ - gid = H5Gopen(fid, MISC25A_GROUP1_NAME); - CHECK(gid, FAIL, "H5Gopen"); + gid = H5Gopen2(fid, MISC25A_GROUP1_NAME, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); /* Delete 2nd attribute */ ret = H5Adelete(gid, MISC25A_ATTR2_NAME); @@ -4526,8 +4526,8 @@ test_misc25a(void) CHECK(fid, FAIL, "H5Fopen"); /* Re-open first group */ - gid = H5Gopen(fid, MISC25A_GROUP1_NAME); - CHECK(gid, FAIL, "H5Gopen"); + gid = H5Gopen2(fid, MISC25A_GROUP1_NAME, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); /* Create dataspace for 3rd attribute */ sid = H5Screate(H5S_SCALAR); @@ -4595,8 +4595,8 @@ test_misc25b(void) CHECK(fid, FAIL, "H5Fopen"); /* Re-open group with object header messages that will merge */ - gid = H5Gopen(fid, MISC25B_GROUP); - CHECK(gid, FAIL, "H5Gopen"); + gid = H5Gopen2(fid, MISC25B_GROUP, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); /* Close first group */ ret = H5Gclose(gid); @@ -4721,8 +4721,8 @@ test_misc25c(void) CHECK(fid, FAIL, "H5Fopen"); /* Re-open the dataset group */ - gid = H5Gopen(fid, MISC25C_DSETGRPNAME); - CHECK(gid, FAIL, "H5Gopen"); + gid = H5Gopen2(fid, MISC25C_DSETGRPNAME, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); /* Rename the dataset */ ret = H5Gmove(gid, MISC25C_DSETNAME, MISC25C_DSETNAME2); diff --git a/test/tsohm.c b/test/tsohm.c index 7948443..16acf71 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -1549,8 +1549,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size CHECK_I(ret, "H5Gclose"); file_id = close_reopen_file(file_id, FILENAME, H5P_DEFAULT); CHECK_I(file_id, "H5Fopen"); - group_id = H5Gopen(file_id, "group"); - CHECK_I(group_id, "H5Gopen"); + group_id = H5Gopen2(file_id, "group", H5P_DEFAULT); + CHECK_I(group_id, "H5Gopen2"); } } @@ -1603,8 +1603,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size CHECK_I(ret, "H5Gclose"); file_id = close_reopen_file(file_id, FILENAME, H5P_DEFAULT); CHECK_I(file_id, "H5Fopen"); - group_id = H5Gopen(file_id, "interleaved group"); - CHECK_I(group_id, "H5Gopen"); + group_id = H5Gopen2(file_id, "interleaved group", H5P_DEFAULT); + CHECK_I(group_id, "H5Gopen2"); } } @@ -1620,8 +1620,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size */ file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT); CHECK_I(file_id, "H5Fopen"); - group_id = H5Gopen(file_id, "group"); - CHECK_I(group_id, "H5Gopen"); + group_id = H5Gopen2(file_id, "group", H5P_DEFAULT); + CHECK_I(group_id, "H5Gopen2"); strcpy(attr_name, "00 index"); @@ -1646,8 +1646,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size CHECK_I(ret, "H5Gclose"); file_id = close_reopen_file(file_id, FILENAME, H5P_DEFAULT); CHECK_I(file_id, "H5Fopen"); - group_id = H5Gopen(file_id, "group"); - CHECK_I(group_id, "H5Gopen"); + group_id = H5Gopen2(file_id, "group", H5P_DEFAULT); + CHECK_I(group_id, "H5Gopen2"); } } @@ -1662,8 +1662,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size /* Create all of the attributes again on the other group */ file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT); CHECK_I(file_id, "H5Fopen"); - group_id = H5Gopen(file_id, "interleaved group"); - CHECK_I(group_id, "H5Gopen"); + group_id = H5Gopen2(file_id, "interleaved group", H5P_DEFAULT); + CHECK_I(group_id, "H5Gopen2"); for(x=0; x<NUM_ATTRIBUTES; ++x) { @@ -1686,8 +1686,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size CHECK_I(ret, "H5Gclose"); file_id = close_reopen_file(file_id, FILENAME, H5P_DEFAULT); CHECK_I(file_id, "H5Fopen"); - group_id = H5Gopen(file_id, "interleaved group"); - CHECK_I(group_id, "H5Gopen"); + group_id = H5Gopen2(file_id, "interleaved group", H5P_DEFAULT); + CHECK_I(group_id, "H5Gopen2"); } } /* Close file and get its size now */ @@ -1784,8 +1784,8 @@ static void size2_verify(void) } /* Get property lists from second batch of datasets */ - group1_id = H5Gopen(file_id, "group"); - CHECK_I(group1_id, "H5Gopen"); + group1_id = H5Gopen2(file_id, "group", H5P_DEFAULT); + CHECK_I(group1_id, "H5Gopen2"); for(x=0; x<NUM_DATASETS; ++x) { dset_id = H5Dopen(group1_id, DSETNAME[x]); @@ -1814,8 +1814,8 @@ static void size2_verify(void) CHECK_I(ret, "H5Gclose"); /* Get property lists from interleaved group of datasets */ - group1_id = H5Gopen(file_id, "interleaved group"); - CHECK_I(group1_id, "H5Gopen"); + group1_id = H5Gopen2(file_id, "interleaved group", H5P_DEFAULT); + CHECK_I(group1_id, "H5Gopen2"); for(x = 0; x < NUM_DATASETS; x += 2) { /* First "type 1" dataset */ dset_id = H5Dopen(group1_id, DSETNAME[x]); @@ -1876,10 +1876,10 @@ static void size2_verify(void) CHECK_I(ret, "H5Tset_size"); /* Read attributes on both groups and verify that they are correct */ - group1_id = H5Gopen(file_id, "group"); - CHECK_I(group1_id, "H5Gopen"); - group2_id = H5Gopen(file_id, "interleaved group"); - CHECK_I(group2_id, "H5Gopen"); + group1_id = H5Gopen2(file_id, "group", H5P_DEFAULT); + CHECK_I(group1_id, "H5Gopen2"); + group2_id = H5Gopen2(file_id, "interleaved group", H5P_DEFAULT); + CHECK_I(group2_id, "H5Gopen2"); HDmemset(attr_string, 0, NAME_BUF_SIZE); HDmemset(attr_correct_string, 0, NAME_BUF_SIZE); diff --git a/test/tvlstr.c b/test/tvlstr.c index a73151b..272186b 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -590,8 +590,8 @@ static void test_write_vl_string_attribute(void) ret = H5Tset_size (type, H5T_VARIABLE); CHECK(ret, FAIL, "H5Tset_size"); - root = H5Gopen(file, "/"); - CHECK(root, FAIL, "H5Gopen"); + root = H5Gopen2(file, "/", H5P_DEFAULT); + CHECK(root, FAIL, "H5Gopen2"); dataspace = H5Screate(H5S_SCALAR); CHECK(dataspace, FAIL, "H5Screate"); @@ -676,8 +676,8 @@ static void test_read_vl_string_attribute(void) ret = H5Tset_size (type, H5T_VARIABLE); CHECK(ret, FAIL, "H5Tset_size"); - root = H5Gopen(file, "/"); - CHECK(root, FAIL, "H5Gopen"); + root = H5Gopen2(file, "/", H5P_DEFAULT); + CHECK(root, FAIL, "H5Gopen2"); /* Test reading "normal" sized string attribute */ att = H5Aopen_name(root, "test_scalar"); diff --git a/test/unlink.c b/test/unlink.c index 9a515b3..f2391b1 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -314,7 +314,7 @@ test_rename(hid_t file) if((inner = H5Gcreate2(foo, "inner", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Gclose(inner) < 0) TEST_ERROR if(H5Gclose(foo) < 0) TEST_ERROR - if((inner = H5Gopen(work, "bar/inner")) < 0) TEST_ERROR + if((inner = H5Gopen2(work, "bar/inner", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Gclose(inner) < 0) TEST_ERROR PASSED(); @@ -393,7 +393,7 @@ test_new_move(hid_t fapl) if(H5Gmove2(grp_1, "group_move", grp_2, "group_new_name") < 0) TEST_ERROR /* Open the group just moved to the new location. */ - if((moved_grp = H5Gopen(grp_2, "group_new_name")) < 0) TEST_ERROR + if((moved_grp = H5Gopen2(grp_2, "group_new_name", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Gclose(grp_1) < 0) TEST_ERROR if(H5Gclose(grp_2) < 0) TEST_ERROR @@ -1010,13 +1010,13 @@ test_filespace(hid_t fapl) for(u=FILESPACE_TOP_GROUPS; u>0; u--) { /* Open group */ sprintf(objname,"%s %u",GROUPNAME,(u-1)); - if((group = H5Gopen (file, objname)) < 0) TEST_ERROR + if((group = H5Gopen2(file, objname, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Open nested groups inside top groups */ for(v=0; v<FILESPACE_NESTED_GROUPS; v++) { /* Create group */ sprintf(objname,"%s %u",GROUP2NAME,v); - if((group2 = H5Gopen (group, objname)) < 0) TEST_ERROR + if((group2 = H5Gopen2(group, objname, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Remove datasets inside nested groups */ for(w=0; w<FILESPACE_NDATASETS; w++) { @@ -1400,7 +1400,7 @@ test_unlink_slashes(hid_t fapl) if((fid=H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) TEST_ERROR /* Open the top level group */ - if((gid = H5Gopen(fid, SLASHES_GROUP_NAME)) < 0) TEST_ERROR + if((gid = H5Gopen2(fid, SLASHES_GROUP_NAME, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete the root link */ if(H5Gunlink(gid,SLASHES_ROOTLINK_NAME) < 0) TEST_ERROR @@ -1456,7 +1456,7 @@ static int delete_node (hid_t pid, hid_t id) if(HDstrcmp(name,"/Zone81")==0) { hid_t gid; - if((gid = H5Gopen (pid, "/Zone80")) < 0) return(-1); + if((gid = H5Gopen2(pid, "/Zone80", H5P_DEFAULT)) < 0) return(-1); if(H5Gclose(gid) < 0) return(-1); } /* end if */ @@ -1493,10 +1493,9 @@ test_unlink_rightleaf(hid_t fid) TESTING("deleting right-most child in non-leaf B-tree node"); /* Allocate space for the group IDs */ - gids = (hid_t *) HDmalloc (ngroups * sizeof(hid_t)); - if(gids==NULL) TEST_ERROR + if(NULL == (gids = (hid_t *)HDmalloc(ngroups * sizeof(hid_t)))) TEST_ERROR - if((rootid = H5Gopen (fid, "/")) < 0) TEST_ERROR + if((rootid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create all the groups */ for (n = 0; n < ngroups; n++) { @@ -1557,10 +1556,9 @@ test_unlink_rightnode(hid_t fid) TESTING("deleting right-most child in non-leaf B-tree node"); /* Allocate space for the group IDs */ - gids = (hid_t *) HDmalloc (ngroups * sizeof(hid_t)); - if(gids==NULL) TEST_ERROR + if(NULL == (gids = (hid_t *)HDmalloc(ngroups * sizeof(hid_t)))) TEST_ERROR - if((rootid = H5Gopen (fid, "/")) < 0) TEST_ERROR + if((rootid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create all the groups */ for (n = 0; n < ngroups; n++) { @@ -1621,10 +1619,9 @@ test_unlink_middlenode(hid_t fid) TESTING("deleting right-most child in non-leaf B-tree node"); /* Allocate space for the group IDs */ - gids = (hid_t *) HDmalloc (ngroups * sizeof(hid_t)); - if(gids==NULL) TEST_ERROR + if(NULL == (gids = (hid_t *)HDmalloc(ngroups * sizeof(hid_t)))) TEST_ERROR - if((rootid = H5Gopen (fid, "/")) < 0) TEST_ERROR + if((rootid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create all the groups */ for (n = 0; n < ngroups; n++) { @@ -1987,10 +1984,10 @@ test_resurrect_group(hid_t fapl) if(H5Fclose(file) < 0) TEST_ERROR /* Re-open the file */ - if((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR /* Attempt to open the datatype under the new name */ - if((group=H5Gopen(file,GROUP2NAME)) < 0) TEST_ERROR + if((group = H5Gopen2(file, GROUP2NAME, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close things */ if(H5Gclose(group) < 0) TEST_ERROR @@ -1068,8 +1068,8 @@ test_multi(void) TEST_ERROR; /* Create and write attribute for the root group. */ - if((root = H5Gopen(file, "/"))<0) - TEST_ERROR; + if((root = H5Gopen2(file, "/", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR /* Attribute string. */ if((atype = H5Tcopy(H5T_C_S1))<0) |