summaryrefslogtreecommitdiffstats
path: root/test/mount.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-08-28 15:02:54 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-08-28 15:02:54 (GMT)
commitea343ef85416b42f68f28fb1024702c6726f7eea (patch)
treed5c401bf83f7f5578df06c54f9fd9fb198732ed2 /test/mount.c
parenteb16d8bc2b2f37c7a1d75fe7bf5258eba21515b2 (diff)
downloadhdf5-ea343ef85416b42f68f28fb1024702c6726f7eea.zip
hdf5-ea343ef85416b42f68f28fb1024702c6726f7eea.tar.gz
hdf5-ea343ef85416b42f68f28fb1024702c6726f7eea.tar.bz2
[svn-r14115] Description:
Remove all plain calls to H5Gopen() from source, replacing them with either H5Gopen2(). Add test for H5Gopen1(). Reformatted several pieces of code, to clean them up. Tested on: FreeBSD/32 6.2 (duty) FreeBSD/64 6.2 (liberty) Linux/32 2.6 (kagiso) Linux/64 2.6 (smirom) Solaris/32 5.10 (linew) Mac OS X/32 10.4.10 (amazon)
Diffstat (limited to 'test/mount.c')
-rw-r--r--test/mount.c749
1 files changed, 351 insertions, 398 deletions
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);