diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 4 | ||||
-rw-r--r-- | test/Makefile.in | 31 | ||||
-rw-r--r-- | test/dtypes.c | 1 | ||||
-rw-r--r-- | test/gen_new_group.c | 93 | ||||
-rw-r--r-- | test/gen_old_group.c | 59 | ||||
-rw-r--r-- | test/getname.c | 1448 | ||||
-rw-r--r-- | test/group_old.h5 | bin | 0 -> 1952 bytes | |||
-rw-r--r-- | test/links.c | 189 | ||||
-rw-r--r-- | test/mount.c | 33 | ||||
-rwxr-xr-x | test/objcopy.c | 73 | ||||
-rw-r--r-- | test/ohdr.c | 36 | ||||
-rw-r--r-- | test/sheap.c | 24 | ||||
-rw-r--r-- | test/stab.c | 732 | ||||
-rw-r--r-- | test/tfile.c | 8 | ||||
-rw-r--r-- | test/tgenprop.c | 2 | ||||
-rw-r--r-- | test/tid.c | 2 | ||||
-rw-r--r-- | test/titerate.c | 12 | ||||
-rw-r--r-- | test/tmisc.c | 194 | ||||
-rw-r--r-- | test/ttsafe_error.c | 14 | ||||
-rw-r--r-- | test/tunicode.c | 18 | ||||
-rw-r--r-- | test/unlink.c | 38 | ||||
-rw-r--r-- | test/vfd.c | 174 |
22 files changed, 2162 insertions, 1023 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index a1df34a..29f06a0 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -56,8 +56,8 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat testmeta # so do not appear in this list. if BUILD_ALL_CONDITIONAL BUILD_ALL_PROGS=gen_deflate gen_filters gen_new_array gen_new_fill \ - gen_new_mtime gen_new_super gen_noencoder gen_nullspace \ - space_overflow + gen_new_group gen_new_mtime gen_new_super gen_noencoder \ + gen_nullspace space_overflow else BUILD_ALL_PROGS= endif diff --git a/test/Makefile.in b/test/Makefile.in index 6aba9ea..ac41b59 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -31,7 +31,7 @@ # -SOURCES = $(libh5test_la_SOURCES) b+tree.c big.c bittests.c blocktrack.c btree2.c cache.c cmpd_dset.c dangle.c dsets.c dt_arith.c dtransform.c dtypes.c enum.c err_compat.c error_test.c extend.c external.c fillval.c flush1.c flush2.c gen_deflate.c gen_filters.c gen_new_array.c gen_new_fill.c gen_new_mtime.c gen_new_super.c gen_noencoder.c gen_nullspace.c getname.c gheap.c hyperslab.c istore.c lheap.c links.c mount.c mtime.c ntypes.c objcopy.c ohdr.c pool.c reserved.c set_extent.c sheap.c space_overflow.c stab.c stream_test.c $(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) unlink.c vfd.c +SOURCES = $(libh5test_la_SOURCES) b+tree.c big.c bittests.c blocktrack.c btree2.c cache.c cmpd_dset.c dangle.c dsets.c dt_arith.c dtransform.c dtypes.c enum.c err_compat.c error_test.c extend.c external.c fillval.c flush1.c flush2.c gen_deflate.c gen_filters.c gen_new_array.c gen_new_fill.c gen_new_group.c gen_new_mtime.c gen_new_super.c gen_noencoder.c gen_nullspace.c getname.c gheap.c hyperslab.c istore.c lheap.c links.c mount.c mtime.c ntypes.c objcopy.c ohdr.c pool.c reserved.c set_extent.c sheap.c space_overflow.c stab.c stream_test.c $(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) unlink.c vfd.c srcdir = @srcdir@ top_srcdir = @top_srcdir@ @@ -89,6 +89,7 @@ am__EXEEXT_1 = testhdf5$(EXEEXT) lheap$(EXEEXT) ohdr$(EXEEXT) \ @BUILD_ALL_CONDITIONAL_TRUE@ gen_filters$(EXEEXT) \ @BUILD_ALL_CONDITIONAL_TRUE@ gen_new_array$(EXEEXT) \ @BUILD_ALL_CONDITIONAL_TRUE@ gen_new_fill$(EXEEXT) \ +@BUILD_ALL_CONDITIONAL_TRUE@ gen_new_group$(EXEEXT) \ @BUILD_ALL_CONDITIONAL_TRUE@ gen_new_mtime$(EXEEXT) \ @BUILD_ALL_CONDITIONAL_TRUE@ gen_new_super$(EXEEXT) \ @BUILD_ALL_CONDITIONAL_TRUE@ gen_noencoder$(EXEEXT) \ @@ -192,6 +193,10 @@ gen_new_fill_SOURCES = gen_new_fill.c gen_new_fill_OBJECTS = gen_new_fill.$(OBJEXT) gen_new_fill_LDADD = $(LDADD) gen_new_fill_DEPENDENCIES = libh5test.la $(am__DEPENDENCIES_1) +gen_new_group_SOURCES = gen_new_group.c +gen_new_group_OBJECTS = gen_new_group.$(OBJEXT) +gen_new_group_LDADD = $(LDADD) +gen_new_group_DEPENDENCIES = libh5test.la $(am__DEPENDENCIES_1) gen_new_mtime_SOURCES = gen_new_mtime.c gen_new_mtime_OBJECTS = gen_new_mtime.$(OBJEXT) gen_new_mtime_LDADD = $(LDADD) @@ -325,10 +330,10 @@ SOURCES = $(libh5test_la_SOURCES) b+tree.c big.c bittests.c \ dt_arith.c dtransform.c dtypes.c enum.c err_compat.c \ error_test.c extend.c external.c fillval.c flush1.c flush2.c \ gen_deflate.c gen_filters.c gen_new_array.c gen_new_fill.c \ - gen_new_mtime.c gen_new_super.c gen_noencoder.c \ - gen_nullspace.c getname.c gheap.c hyperslab.c istore.c lheap.c \ - links.c mount.c mtime.c ntypes.c objcopy.c ohdr.c pool.c \ - reserved.c set_extent.c sheap.c space_overflow.c stab.c \ + gen_new_group.c gen_new_mtime.c gen_new_super.c \ + gen_noencoder.c gen_nullspace.c getname.c gheap.c hyperslab.c \ + istore.c lheap.c links.c mount.c mtime.c ntypes.c objcopy.c ohdr.c \ + pool.c reserved.c set_extent.c sheap.c space_overflow.c stab.c \ stream_test.c $(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) \ unlink.c vfd.c DIST_SOURCES = $(libh5test_la_SOURCES) b+tree.c big.c bittests.c \ @@ -336,10 +341,10 @@ DIST_SOURCES = $(libh5test_la_SOURCES) b+tree.c big.c bittests.c \ dt_arith.c dtransform.c dtypes.c enum.c err_compat.c \ error_test.c extend.c external.c fillval.c flush1.c flush2.c \ gen_deflate.c gen_filters.c gen_new_array.c gen_new_fill.c \ - gen_new_mtime.c gen_new_super.c gen_noencoder.c \ - gen_nullspace.c getname.c gheap.c hyperslab.c istore.c lheap.c \ - links.c mount.c mtime.c ntypes.c objcopy.c ohdr.c pool.c \ - reserved.c set_extent.c sheap.c space_overflow.c stab.c \ + gen_new_group.c gen_new_mtime.c gen_new_super.c \ + gen_noencoder.c gen_nullspace.c getname.c gheap.c hyperslab.c \ + istore.c lheap.c links.c mount.c mtime.c ntypes.c objcopy.c ohdr.c \ + pool.c reserved.c set_extent.c sheap.c space_overflow.c stab.c \ stream_test.c $(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) \ unlink.c vfd.c ETAGS = etags @@ -628,8 +633,8 @@ TEST_PROG = testhdf5 lheap ohdr stab gheap btree2 cache b+tree blocktrack sheap # The gen_old_* files can only be compiled with older versions of the library # so do not appear in this list. @BUILD_ALL_CONDITIONAL_TRUE@BUILD_ALL_PROGS = gen_deflate gen_filters gen_new_array gen_new_fill \ -@BUILD_ALL_CONDITIONAL_TRUE@ gen_new_mtime gen_new_super gen_noencoder gen_nullspace \ -@BUILD_ALL_CONDITIONAL_TRUE@ space_overflow +@BUILD_ALL_CONDITIONAL_TRUE@ gen_new_group gen_new_mtime gen_new_super gen_noencoder \ +@BUILD_ALL_CONDITIONAL_TRUE@ gen_nullspace space_overflow # The libh5test library provides common support code for the tests. @@ -796,6 +801,9 @@ gen_new_array$(EXEEXT): $(gen_new_array_OBJECTS) $(gen_new_array_DEPENDENCIES) gen_new_fill$(EXEEXT): $(gen_new_fill_OBJECTS) $(gen_new_fill_DEPENDENCIES) @rm -f gen_new_fill$(EXEEXT) $(LINK) $(gen_new_fill_LDFLAGS) $(gen_new_fill_OBJECTS) $(gen_new_fill_LDADD) $(LIBS) +gen_new_group$(EXEEXT): $(gen_new_group_OBJECTS) $(gen_new_group_DEPENDENCIES) + @rm -f gen_new_group$(EXEEXT) + $(LINK) $(gen_new_group_LDFLAGS) $(gen_new_group_OBJECTS) $(gen_new_group_LDADD) $(LIBS) gen_new_mtime$(EXEEXT): $(gen_new_mtime_OBJECTS) $(gen_new_mtime_DEPENDENCIES) @rm -f gen_new_mtime$(EXEEXT) $(LINK) $(gen_new_mtime_LDFLAGS) $(gen_new_mtime_OBJECTS) $(gen_new_mtime_LDADD) $(LIBS) @@ -908,6 +916,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_filters.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_new_array.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_new_fill.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_new_group.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_new_mtime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_new_super.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_noencoder.Po@am__quote@ diff --git a/test/dtypes.c b/test/dtypes.c index 92b7c33..78c37e0 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -4077,3 +4077,4 @@ main(void) printf("All data type tests passed.\n"); return 0; } + diff --git a/test/gen_new_group.c b/test/gen_new_group.c new file mode 100644 index 0000000..2df351f --- /dev/null +++ b/test/gen_new_group.c @@ -0,0 +1,93 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu> + * Oct 24, 2005 + * + * Purpose: This program is run to generate an HDF5 data file with both + * empty and compact groups. + * + * To test compatibility between v1.6 and v1.7, compile and run + * this program, it will generate a file called "group_new.h5". + * You need to move it to the test directory in the HDF5 v1.6 + * source tree. The test/stab.c program will read it. + * + */ + +#include "hdf5.h" + +#define FILENAME "group_new.h5" + +int main(void) +{ + hid_t fid = -1; /* File ID */ + hid_t fcpl = -1; /* File creation property list ID */ + hid_t gid = -1; /* Group creation property list ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t did = -1; /* Dataset ID */ + + /* Create file creation property list */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) goto error; + + /* Adjust group creation parameters for root group */ + /* (So that it is created in symbol-table form) */ + if(H5Pset_link_phase_change(fcpl, 0, 0) < 0) goto error; + + /* Create file for test groups */ + if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) <0) goto error; + + /* Close file creation property list */ + if(H5Pclose(fcpl) < 0) goto error; + + /* Create dataspace for datasets */ + if((sid = H5Screate(H5S_SCALAR)) < 0) goto error; + + /* Create empty group (w/default group creation properties) */ + if((gid = H5Gcreate(fid, "empty", (size_t)0)) < 0) goto error; + if(H5Gclose(gid) < 0) goto error; + + /* Create group which will contain link messages (w/default group creation properties) */ + if((gid = H5Gcreate(fid, "links", (size_t)0)) < 0) goto error; + + /* Create dataset in group */ + if((did = H5Dcreate(gid, "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) goto error; + if(H5Dclose(did)<0) goto error; + + /* Create second dataset in group */ + if((did = H5Dcreate(gid, "dset2", H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) goto error; + if(H5Dclose(did)<0) goto error; + + /* Close dataspace */ + if(H5Sclose(sid) < 0) goto error; + + /* Close group */ + if(H5Gclose(gid) < 0) goto error; + + /* Close file */ + if(H5Fclose(fid) < 0) goto error; + + return 0; + +error: + H5E_BEGIN_TRY { + H5Pclose(did); + H5Sclose(sid); + H5Dclose(gid); + H5Dclose(fcpl); + H5Fclose(fid); + } H5E_END_TRY; + return 1; +} + diff --git a/test/gen_old_group.c b/test/gen_old_group.c new file mode 100644 index 0000000..ac617ba --- /dev/null +++ b/test/gen_old_group.c @@ -0,0 +1,59 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu> + * Oct 24, 2005 + * + * Purpose: This program is run to generate an HDF5 data file with an + * empty "symbol table" group. + * + * This file is used in the v1.7 branch (after the "compact group" + * checkin) to test compatability. Compile and run this + * program (with the 1.6.x branch), it will generate a file* + * called "group_old.h5". You need to move it to the test + * directory in the HDF5 v1.7 source tree. The test/stab.c + * program will read it. + * + */ + +#include "hdf5.h" + +#define FILENAME "group_old.h5" + +int main(void) +{ + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group creation property list ID */ + + /* Create file for test groups */ + if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) <0) goto error; + + /* Create empty group that uses "symbol table" form to store links */ + if((gid = H5Gcreate(fid, "old", (size_t)0)) < 0) goto error; + if(H5Gclose(gid) < 0) goto error; + + /* Close file */ + if(H5Fclose(fid) < 0) goto error; + + return 0; + +error: + H5E_BEGIN_TRY { + H5Dclose(gid); + H5Fclose(fid); + } H5E_END_TRY; + return 1; +} + diff --git a/test/getname.c b/test/getname.c index 5ee2139..b3f1b2a 100644 --- a/test/getname.c +++ b/test/getname.c @@ -91,7 +91,7 @@ int main( void ) h5_fixname(FILENAME[3], fapl, filename3, sizeof filename3); /* Create a new file_id using default properties. */ - if ((file_id = H5Fcreate( filename0, H5F_ACC_TRUNC, H5P_DEFAULT, fapl ))<0) goto out; + if ((file_id = H5Fcreate( filename0, H5F_ACC_TRUNC, H5P_DEFAULT, fapl ))<0) TEST_ERROR; /*------------------------------------------------------------------------- @@ -102,13 +102,13 @@ int main( void ) TESTING("H5Iget_name with H5Gcreate, one group"); /* Create group "g0" in the root group using absolute name */ - if ((group_id = H5Gcreate( file_id, "/g0", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "/g0", 0 ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )<0) goto out; + if (H5Iget_name( group_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g0" )!=0) goto out; + if (check_name( name, "/g0" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -125,24 +125,24 @@ int main( void ) TESTING("H5Iget_name with H5Gcreate, more than one group"); /* Create group "g1" in the root group using absolute name */ - if ((group_id = H5Gcreate( file_id, "/g1", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "/g1", 0 ))<0) TEST_ERROR; /* Create group "g2" in group "g1" using absolute name */ - if ((group2_id = H5Gcreate( file_id, "/g1/g2", 0 ))<0) goto out; + if ((group2_id = H5Gcreate( file_id, "/g1/g2", 0 ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )<0) goto out; + if (H5Iget_name( group_id, name, size )<0) TEST_ERROR; /* Verify */ if (check_name( name, "/g1" )!=0) - goto out; + TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ if (check_name( name, "/g1/g2" )!=0) - goto out; + TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -159,24 +159,24 @@ int main( void ) TESTING("H5Iget_name with H5Gopen"); /* Reopen the group */ - if ((group_id = H5Gopen( file_id, "/g1" ))<0) goto out; + if ((group_id = H5Gopen( file_id, "/g1" ))<0) TEST_ERROR; /* Reopen the group */ - if ((group2_id = H5Gopen( file_id, "/g1/g2" ))<0) goto out; + if ((group2_id = H5Gopen( file_id, "/g1/g2" ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )<0) goto out; + if (H5Iget_name( group_id, name, size )<0) TEST_ERROR; /* Verify */ if (check_name( name, "/g1" )!=0) - goto out; + TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ if (check_name( name, "/g1/g2" )!=0) - goto out; + TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -195,35 +195,35 @@ int main( void ) TESTING("H5Iget_name with H5Dcreate"); /* Create the data space */ - if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) goto out; + 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) goto out; + H5P_DEFAULT ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( dataset_id, name, size )<0) goto out; + if (H5Iget_name( dataset_id, name, size )<0) TEST_ERROR; /* Verify */ if (check_name( name, "/d1" )!=0) - goto out; + TEST_ERROR; /* Close */ H5Dclose( dataset_id ); /* Reopen the group */ - if ((group_id = H5Gopen( file_id, "g1" ))<0) goto out; + if ((group_id = H5Gopen( file_id, "g1" ))<0) TEST_ERROR; /* Create a new dataset inside "g1" */ if ((dataset_id = H5Dcreate( group_id , "d1", H5T_NATIVE_INT, space_id, - H5P_DEFAULT ))<0) goto out; + H5P_DEFAULT ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( dataset_id, name, size )<0) goto out; + if (H5Iget_name( dataset_id, name, size )<0) TEST_ERROR; /* Verify */ if (check_name( name, "/g1/d1" )!=0) - goto out; + TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -242,31 +242,31 @@ int main( void ) TESTING("H5Iget_name with H5Dopen"); /* Reopen the dataset */ - if ((dataset_id = H5Dopen( file_id, "d1"))<0) goto out; + if ((dataset_id = H5Dopen( file_id, "d1"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( dataset_id, name, size )<0) goto out; + if (H5Iget_name( dataset_id, name, size )<0) TEST_ERROR; /* Verify */ if (check_name( name, "/d1" )!=0) - goto out; + TEST_ERROR; /* Close */ H5Dclose( dataset_id ); /* Reopen the group */ - if ((group_id = H5Gopen( file_id, "g1" ))<0) goto out; + if ((group_id = H5Gopen( file_id, "g1" ))<0) TEST_ERROR; /* Reopen the dataset */ - if ((dataset_id = H5Dopen( group_id, "d1"))<0) goto out; + if ((dataset_id = H5Dopen( group_id, "d1"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( dataset_id, name, size )<0) goto out; + if (H5Iget_name( dataset_id, name, size )<0) TEST_ERROR; /* Verify */ if (check_name( name, "/g1/d1" )!=0) - goto out; + TEST_ERROR; /* Close */ H5Dclose( dataset_id ); @@ -284,14 +284,14 @@ int main( void ) TESTING("H5Iget_name with a long path"); /* Create group "g2/bar/baz" */ - if ((group_id = H5Gcreate( file_id, "g2", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file_id, "g2/bar", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file_id, "g2/bar/baz", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "g2", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file_id, "g2/bar", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file_id, "g2/bar/baz", 0 ))<0) TEST_ERROR; /* Create a dataset */ - if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) goto out; + 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) goto out; + H5P_DEFAULT ))<0) TEST_ERROR; /* Close */ H5Dclose( dataset_id ); @@ -301,14 +301,14 @@ int main( void ) H5Gclose( group3_id ); /* Reopen the dataset */ - if ((dataset_id = H5Dopen( file_id, "/g2/bar/baz/d1"))<0) goto out; + if ((dataset_id = H5Dopen( file_id, "/g2/bar/baz/d1"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( dataset_id, name, size )< 0) goto out; + if (H5Iget_name( dataset_id, name, size )< 0) TEST_ERROR; /* Verify */ if (check_name( name, "/g2/bar/baz/d1" )!=0) - goto out; + TEST_ERROR; /* Close */ H5Dclose( dataset_id ); @@ -324,22 +324,22 @@ int main( void ) TESTING("H5Iget_name with H5Tcommit"); /* Create a datatype */ - if ((type_id = H5Tcreate (H5T_COMPOUND, sizeof(s1_t)))<0) goto out; + 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) goto out; - if (H5Tinsert (type_id, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT)<0) goto out; - if (H5Tinsert (type_id, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT)<0) goto out; + 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) goto out; + if (H5Tcommit (file_id, "t1", type_id)<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( type_id, name, size )<0) goto out; + if (H5Iget_name( type_id, name, size )<0) TEST_ERROR; /* Verify */ if (check_name( name, "/t1" )!=0) - goto out; + TEST_ERROR; /* Close datatype */ H5Tclose(type_id); @@ -354,14 +354,14 @@ int main( void ) TESTING("H5Iget_name with H5Topen"); /* Open the named datatype */ - if((type_id=H5Topen(file_id, "t1"))<0) goto out; + if((type_id=H5Topen(file_id, "t1"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( type_id, name, size )<0) goto out; + if (H5Iget_name( type_id, name, size )<0) TEST_ERROR; /* Verify */ if (check_name( name, "/t1" )!=0) - goto out; + TEST_ERROR; /* Close datatype */ @@ -379,16 +379,16 @@ int main( void ) TESTING("H5Iget_name with H5Gmove and H5Gopen"); /* Reopen the group */ - if ((group_id = H5Gopen( file_id, "/g1" ))<0) goto out; + if ((group_id = H5Gopen( file_id, "/g1" ))<0) TEST_ERROR; /* Rename group */ - if (H5Gmove( file_id, "/g1", "/g1a" )<0) goto out; + if (H5Gmove( file_id, "/g1", "/g1a" )<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )<0) goto out; + if (H5Iget_name( group_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g1a" )!=0) goto out; + if (check_name( name, "/g1a" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -406,17 +406,17 @@ int main( void ) TESTING("H5Iget_name with H5Gmove and H5Dopen"); /* Reopen the dataset */ - if ((dataset_id = H5Dopen( file_id, "/d1"))<0) goto out; + if ((dataset_id = H5Dopen( file_id, "/d1"))<0) TEST_ERROR; /* Rename dataset */ - if (H5Gmove( file_id, "/d1", "/d1a" )<0) goto out; + if (H5Gmove( file_id, "/d1", "/d1a" )<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( dataset_id, name, size )<0) goto out; + if (H5Iget_name( dataset_id, name, size )<0) TEST_ERROR; /* Verify */ if (check_name( name, "/d1a" )!=0) - goto out; + TEST_ERROR; /* Close */ H5Dclose( dataset_id ); @@ -434,17 +434,17 @@ int main( void ) TESTING("H5Iget_name with H5Gmove and H5Topen"); /* Open the named datatype */ - if((type_id=H5Topen(file_id, "/t1"))<0) goto out; + if((type_id=H5Topen(file_id, "/t1"))<0) TEST_ERROR; /* Rename datatype */ - if (H5Gmove( file_id, "/t1", "/t1a" )<0) goto out; + if (H5Gmove( file_id, "/t1", "/t1a" )<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( type_id, name, size )<0) goto out; + if (H5Iget_name( type_id, name, size )<0) TEST_ERROR; /* Verify */ if (check_name( name, "/t1a" )!=0) - goto out; + TEST_ERROR; /* Close datatype */ @@ -460,55 +460,55 @@ int main( void ) TESTING("H5Iget_name with H5Gmove and relative names"); /* Create group "/g3" */ - if ((group_id = H5Gcreate( file_id, "/g3", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "/g3", 0 ))<0) TEST_ERROR; /* Create group "/g3/foo" using absolute name */ - if ((group2_id = H5Gcreate( file_id, "/g3/foo1", 0 ))<0) goto out; + if ((group2_id = H5Gcreate( file_id, "/g3/foo1", 0 ))<0) TEST_ERROR; /* Open group "/g3/foo" again */ - if ((group3_id = H5Gopen( file_id, "/g3/foo1"))<0) goto out; + if ((group3_id = H5Gopen( file_id, "/g3/foo1"))<0) TEST_ERROR; /* Rename group */ - if (H5Gmove( group_id, "foo1", "foo2" )<0) goto out; + if (H5Gmove( group_id, "foo1", "foo2" )<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )<0) goto out; + if (H5Iget_name( group_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g3" )!=0) goto out; + if (check_name( name, "/g3" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g3/foo2" )!=0) goto out; + if (check_name( name, "/g3/foo2" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g3/foo2" )!=0) goto out; + if (check_name( name, "/g3/foo2" )!=0) TEST_ERROR; /* Rename group again */ - if (H5Gmove( file_id, "g3/foo2", "g3/foo1" )<0) goto out; + if (H5Gmove( file_id, "g3/foo2", "g3/foo1" )<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )<0) goto out; + if (H5Iget_name( group_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g3" )!=0) goto out; + if (check_name( name, "/g3" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g3/foo1" )!=0) goto out; + if (check_name( name, "/g3/foo1" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g3/foo1" )!=0) goto out; + if (check_name( name, "/g3/foo1" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -528,53 +528,53 @@ int main( void ) TESTING("H5Iget_name with H5Gmove and a long path"); /* Create group "g4/A/B" */ - if ((group_id = H5Gcreate( file_id, "g4", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file_id, "g4/A", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file_id, "g4/A/B", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "g4", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file_id, "g4/A", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file_id, "g4/A/B", 0 ))<0) TEST_ERROR; /* Create group "g5/C" */ - if ((group4_id = H5Gcreate( file_id, "g5", 0 ))<0) goto out; - if ((group5_id = H5Gcreate( file_id, "g5/C", 0 ))<0) goto out; + if ((group4_id = H5Gcreate( file_id, "g5", 0 ))<0) TEST_ERROR; + if ((group5_id = H5Gcreate( file_id, "g5/C", 0 ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ if (check_name( name, "/g4/A/B" )!=0) - goto out; + TEST_ERROR; /* Move group "B" to "D"*/ - if (H5Gmove( file_id, "/g4/A/B", "/g5/C/D" )<0) goto out; + if (H5Gmove( file_id, "/g4/A/B", "/g5/C/D" )<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g5/C/D" )!=0) goto out; + if (check_name( name, "/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) goto out; + if (H5Gmove2( group5_id, "D", group2_id, "B" )<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g4/A/B" )!=0) goto out; + if (check_name( name, "/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) goto out; + if (H5Gmove2( group_id, "A", group_id, "F")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g4/F/B" )!=0) goto out; + if (check_name( name, "/g4/F/B" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g4/F" )!=0) goto out; + if (check_name( name, "/g4/F" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -594,32 +594,32 @@ int main( void ) TESTING("H5Iget_name with H5Gmove and a long path #2"); /* Create group "g6/A/B" and "g7" */ - if ((group_id = H5Gcreate( file_id, "g6", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file_id, "g6/A", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file_id, "g6/A/B", 0 ))<0) goto out; - if ((group4_id = H5Gcreate( file_id, "g7", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "g6", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file_id, "g6/A", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file_id, "g6/A/B", 0 ))<0) TEST_ERROR; + if ((group4_id = H5Gcreate( file_id, "g7", 0 ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ if (check_name( name, "/g6/A/B" )!=0) - goto out; + TEST_ERROR; /* Move group "A" to "C"*/ - if (H5Gmove( file_id, "/g6/A", "/g7/C" )<0) goto out; + if (H5Gmove( file_id, "/g6/A", "/g7/C" )<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g7/C" )!=0) goto out; + if (check_name( name, "/g7/C" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g7/C/B" )!=0) goto out; + if (check_name( name, "/g7/C/B" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -637,16 +637,16 @@ int main( void ) TESTING("H5Iget_name with H5Gunlink"); /* Create a new group. */ - if ((group_id = H5Gcreate( file_id, "/g8", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "/g8", 0 ))<0) TEST_ERROR; /* Delete */ - if (H5Gunlink( file_id, "/g8")<0) goto out; + if (H5Gunlink( file_id, "/g8")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )<0) goto out; + if (H5Iget_name( group_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -661,47 +661,47 @@ int main( void ) TESTING("H5Iget_name with H5Gunlink and a long path"); /* Create group "g9/a/b" */ - if ((group_id = H5Gcreate( file_id, "g9", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file_id, "g9/a", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file_id, "g9/a/b", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "g9", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file_id, "g9/a", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file_id, "g9/a/b", 0 ))<0) TEST_ERROR; /* Delete */ - if (H5Gunlink( file_id, "/g9/a")<0) goto out; + if (H5Gunlink( file_id, "/g9/a")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Close */ H5Gclose( group2_id ); H5Gclose( group3_id ); /* Recreate groups */ - if ((group2_id = H5Gcreate( group_id, "a", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( group_id, "a/b", 0 ))<0) goto out; + if ((group2_id = H5Gcreate( group_id, "a", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( group_id, "a/b", 0 ))<0) TEST_ERROR; /* Delete, using relative path */ - if (H5Gunlink( group_id, "a")<0) goto out; + if (H5Gunlink( group_id, "a")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Close */ H5Gclose( group2_id ); @@ -711,33 +711,33 @@ int main( void ) H5Gclose( group_id ); /* Create group "g10/a/b" */ - if ((group_id = H5Gcreate( file_id, "g10", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file_id, "g10/a", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file_id, "g10/a/b", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "g10", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file_id, "g10/a", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file_id, "g10/a/b", 0 ))<0) TEST_ERROR; /* Delete */ - if (H5Gunlink( file_id, "/g10/a/b")<0) goto out; + if (H5Gunlink( file_id, "/g10/a/b")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Close */ H5Gclose( group3_id ); /* Recreate group */ - if ((group3_id = H5Gcreate( group_id, "a/b", 0 ))<0) goto out; + if ((group3_id = H5Gcreate( group_id, "a/b", 0 ))<0) TEST_ERROR; /* Delete, using relative path */ - if (H5Gunlink( group_id, "a/b")<0) goto out; + if (H5Gunlink( group_id, "a/b")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Close */ H5Gclose( group3_id ); @@ -757,28 +757,28 @@ int main( void ) /* Create group "g11/g" */ - if ((group_id = H5Gcreate( file_id, "g11", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file_id, "g11/g", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "g11", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file_id, "g11/g", 0 ))<0) TEST_ERROR; /* Create two datasets "g11/d" and "g11/g/d"*/ - if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) goto out; - if ((dataset_id = H5Dcreate( group_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) goto out; - if ((dataset2_id = H5Dcreate( group2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) goto out; + 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) goto out; + if (H5Gunlink( file_id, "/g11/d")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( dataset_id, name, size )<0) goto out; + if (H5Iget_name( dataset_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( dataset2_id, name, size )<0) goto out; + if (H5Iget_name( dataset2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g11/g/d" )!=0) goto out; + if (check_name( name, "/g11/g/d" )!=0) TEST_ERROR; /* Close */ H5Dclose( dataset_id ); @@ -798,7 +798,7 @@ int main( void ) TESTING("H5Iget_name with H5Fmount; with IDs on the list"); /* Create a group "g12" in the first file */ - if ((group_id = H5Gcreate( file_id, "/g12", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "/g12", 0 ))<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -807,27 +807,27 @@ int main( void ) file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); /* Create a data space */ - if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) goto out; + 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) goto out; + if ((dataset_id = H5Dcreate( file1_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) TEST_ERROR; /* Close */ H5Dclose( dataset_id ); /* Mount second file under "g12" in the first file */ - if (H5Fmount(file_id, "/g12", file1_id, H5P_DEFAULT)<0) goto out; + 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) goto out; + if ((dataset_id = H5Dopen( file_id, "/g12/d"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( dataset_id, name, size )< 0) goto out; + if (H5Iget_name( dataset_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g12/d" )!=0) goto out; + if (check_name( name, "/g12/d" )!=0) TEST_ERROR; - if (H5Funmount(file_id, "/g12")<0) goto out; + if (H5Funmount(file_id, "/g12")<0) TEST_ERROR; /* Close */ H5Dclose( dataset_id ); @@ -846,9 +846,9 @@ int main( void ) TESTING("H5Iget_name with H5Fmount; long name"); /* Create a group "g13/g1/g2" in the first file */ - if ((group_id = H5Gcreate( file_id, "/g13", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file_id, "/g13/g1", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file_id, "/g13/g1/g2", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "/g13", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file_id, "/g13/g1", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file_id, "/g13/g1/g2", 0 ))<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -858,9 +858,9 @@ int main( void ) /* Create second file and group "g" in it */ file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - if ((group_id = H5Gcreate( file1_id, "/g14", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file1_id, "/g14/g3", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file1_id, "/g14/g3/g4", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file1_id, "/g14", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file1_id, "/g14/g3", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file1_id, "/g14/g3/g4", 0 ))<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -868,78 +868,78 @@ int main( void ) H5Gclose( group3_id ); /* Mount second file under "/g13/g1" in the first file */ - if (H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT)<0) goto out; + if (H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR; /* Access group in the first file */ - if ((group_id = H5Gopen( file_id, "/g13/g1/g14/g3/g4"))<0) goto out; + if ((group_id = H5Gopen( file_id, "/g13/g1/g14/g3/g4"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g13/g1/g14/g3/g4" )!=0) goto out; + if (check_name( name, "/g13/g1/g14/g3/g4" )!=0) TEST_ERROR; - if (H5Funmount(file_id, "/g13/g1")<0) goto out; + if (H5Funmount(file_id, "/g13/g1")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); /* Mount second file under "/g13/g1" in the first file (again) */ - if (H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT)<0) goto out; + if (H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR; /* Get a group ID for the parent of the newly mounted group */ - if ((group2_id = H5Gopen( file_id, "/g13"))<0) goto out; + if ((group2_id = H5Gopen( file_id, "/g13"))<0) TEST_ERROR; /* Access group in the first file */ - if ((group_id = H5Gopen( file_id, "/g13/g1/g14/g3/g4"))<0) goto out; + if ((group_id = H5Gopen( file_id, "/g13/g1/g14/g3/g4"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g13/g1/g14/g3/g4" )!=0) goto out; + if (check_name( name, "/g13/g1/g14/g3/g4" )!=0) TEST_ERROR; - if (H5Funmount(group2_id, "g1")<0) goto out; + if (H5Funmount(group2_id, "g1")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); H5Gclose( group2_id ); /* Mount second file under "/g13/g1" in the first file (again) */ - if (H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT)<0) goto out; + if (H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR; /* Get a group ID for the newly mounted group */ - if ((group2_id = H5Gopen( file_id, "/g13/g1"))<0) goto out; + if ((group2_id = H5Gopen( file_id, "/g13/g1"))<0) TEST_ERROR; /* Access group in the first file */ - if ((group_id = H5Gopen( file_id, "/g13/g1/g14/g3/g4"))<0) goto out; + if ((group_id = H5Gopen( file_id, "/g13/g1/g14/g3/g4"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g13/g1/g14/g3/g4" )!=0) goto out; + if (check_name( name, "/g13/g1/g14/g3/g4" )!=0) TEST_ERROR; - if (H5Funmount(group2_id, ".")<0) goto out; + if (H5Funmount(group2_id, ".")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -947,56 +947,56 @@ int main( void ) /* Mount second file under "/g13/g1" in the first file, using relative path */ - if ((group3_id = H5Gopen( file_id, "/g13"))<0) goto out; + if ((group3_id = H5Gopen( file_id, "/g13"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )< 0) goto out; + if (H5Iget_name( group3_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g13" )!=0) goto out; + if (check_name( name, "/g13" )!=0) TEST_ERROR; - if (H5Fmount(group3_id, "g1", file1_id, H5P_DEFAULT)<0) goto out; + if (H5Fmount(group3_id, "g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR; /* Get a group ID for the newly mounted group */ - if ((group2_id = H5Gopen( file_id, "/g13/g1"))<0) goto out; + if ((group2_id = H5Gopen( file_id, "/g13/g1"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )< 0) goto out; + if (H5Iget_name( group2_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g13/g1" )!=0) goto out; + if (check_name( name, "/g13/g1" )!=0) TEST_ERROR; /* Access group in the first file */ - if ((group_id = H5Gopen( file_id, "/g13/g1/g14/g3/g4"))<0) goto out; + if ((group_id = H5Gopen( file_id, "/g13/g1/g14/g3/g4"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g13/g1/g14/g3/g4" )!=0) goto out; + if (check_name( name, "/g13/g1/g14/g3/g4" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); /* Access group in the first file, with relative path */ - if ((group_id = H5Gopen( group2_id, "g14/g3/g4"))<0) goto out; + if ((group_id = H5Gopen( group2_id, "g14/g3/g4"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g13/g1/g14/g3/g4" )!=0) goto out; + if (check_name( name, "/g13/g1/g14/g3/g4" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); - if (H5Funmount(group2_id, ".")<0) goto out; + if (H5Funmount(group2_id, ".")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Close */ H5Gclose( group2_id ); @@ -1004,56 +1004,56 @@ int main( void ) /* Mount second file under "/g13/g1" in the first file, using relative path */ - if ((group3_id = H5Gopen( file_id, "/g13/g1"))<0) goto out; + if ((group3_id = H5Gopen( file_id, "/g13/g1"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )< 0) goto out; + if (H5Iget_name( group3_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g13/g1" )!=0) goto out; + if (check_name( name, "/g13/g1" )!=0) TEST_ERROR; - if (H5Fmount(group3_id, ".", file1_id, H5P_DEFAULT)<0) goto out; + if (H5Fmount(group3_id, ".", file1_id, H5P_DEFAULT)<0) TEST_ERROR; /* Get a group ID for the newly mounted group */ - if ((group2_id = H5Gopen( file_id, "/g13/g1"))<0) goto out; + if ((group2_id = H5Gopen( file_id, "/g13/g1"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )< 0) goto out; + if (H5Iget_name( group2_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g13/g1" )!=0) goto out; + if (check_name( name, "/g13/g1" )!=0) TEST_ERROR; /* Access group in the first file */ - if ((group_id = H5Gopen( file_id, "/g13/g1/g14/g3/g4"))<0) goto out; + if ((group_id = H5Gopen( file_id, "/g13/g1/g14/g3/g4"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g13/g1/g14/g3/g4" )!=0) goto out; + if (check_name( name, "/g13/g1/g14/g3/g4" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); /* Access group in the first file, with relative path */ - if ((group_id = H5Gopen( group2_id, "g14/g3/g4"))<0) goto out; + if ((group_id = H5Gopen( group2_id, "g14/g3/g4"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g13/g1/g14/g3/g4" )!=0) goto out; + if (check_name( name, "/g13/g1/g14/g3/g4" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); - if (H5Funmount(group2_id, ".")<0) goto out; + if (H5Funmount(group2_id, ".")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Close */ H5Gclose( group2_id ); @@ -1073,10 +1073,10 @@ int main( void ) TESTING("H5Iget_name with H5Funmount"); /* Create a group "g15/g1/g2" in the first file */ - if ((group_id = H5Gcreate( file_id, "/g15", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file_id, "/g15/g1", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file_id, "/g15/g1/g2", 0 ))<0) goto out; - if ((group4_id = H5Gcreate( file_id, "/g15/g1/g2/g3", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "/g15", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file_id, "/g15/g1", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file_id, "/g15/g1/g2", 0 ))<0) TEST_ERROR; + if ((group4_id = H5Gcreate( file_id, "/g15/g1/g2/g3", 0 ))<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -1087,9 +1087,9 @@ int main( void ) /* Create second file and group "g" in it */ file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - if ((group_id = H5Gcreate( file1_id, "/g16", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file1_id, "/g16/g4", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file1_id, "/g16/g4/g5", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file1_id, "/g16", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file1_id, "/g16/g4", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file1_id, "/g16/g4/g5", 0 ))<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -1097,43 +1097,43 @@ int main( void ) H5Gclose( group3_id ); /* Access group in the first file */ - if ((group_id = H5Gopen( file_id, "/g15/g1/g2/g3"))<0) goto out; + if ((group_id = H5Gopen( file_id, "/g15/g1/g2/g3"))<0) TEST_ERROR; /* Mount second file under "/g13/g1" in the first file */ - if (H5Fmount(file_id, "/g15/g1", file1_id, H5P_DEFAULT)<0) goto out; + if (H5Fmount(file_id, "/g15/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR; /* Access group in the second file */ - if ((group2_id = H5Gopen( file_id, "/g15/g1/g16/g4/g5"))<0) goto out; + if ((group2_id = H5Gopen( file_id, "/g15/g1/g16/g4/g5"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ if (check_name( name, "" )!=0) - goto out; + TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )< 0) goto out; + if (H5Iget_name( group2_id, name, size )< 0) TEST_ERROR; /* Verify */ if (check_name( name, "/g15/g1/g16/g4/g5" )!=0) - goto out; + TEST_ERROR; - if (H5Funmount(file_id, "/g15/g1")<0) goto out; + if (H5Funmount(file_id, "/g15/g1")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ if (check_name( name, "/g15/g1/g2/g3" )!=0) - goto out; + TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )< 0) goto out; + if (H5Iget_name( group2_id, name, size )< 0) TEST_ERROR; /* Verify */ if (check_name( name, "" )!=0) - goto out; + TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -1152,25 +1152,25 @@ int main( void ) TESTING("H5Iget_name with a defined type dataset"); /* Create a datatype */ - if ((type_id = H5Tcreate (H5T_COMPOUND, sizeof(s1_t)))<0) goto out; + 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) goto out; - if (H5Tinsert (type_id, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT)<0) goto out; - if (H5Tinsert (type_id, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT)<0) goto out; + 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 = H5Gcreate( file_id, "g17", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "g17", 0 ))<0) TEST_ERROR; /* Save datatype for later */ - if (H5Tcommit (group_id, "t", type_id)<0) goto out; + if (H5Tcommit (group_id, "t", type_id)<0) TEST_ERROR; /* Create a data space */ - if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) goto out; + 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) goto out; + H5P_DEFAULT ))<0) TEST_ERROR; /* Close */ H5Dclose( dataset_id ); @@ -1179,30 +1179,30 @@ int main( void ) H5Gclose( group_id ); /* Open the named datatype */ - if((type_id=H5Topen(file_id, "/g17/t"))<0) goto out; + if((type_id=H5Topen(file_id, "/g17/t"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( type_id, name, size )<0) goto out; + if (H5Iget_name( type_id, name, size )<0) TEST_ERROR; /* Verify */ if (check_name( name, "/g17/t" )!=0) - goto out; + TEST_ERROR; /* Close datatype */ H5Tclose(type_id); /* Reopen the dataset */ - if ((dataset_id = H5Dopen( file_id, "/g17/d"))<0) goto out; + if ((dataset_id = H5Dopen( file_id, "/g17/d"))<0) TEST_ERROR; /* Get datatype*/ - if((type_id=H5Dget_type(dataset_id))<0) goto out; + if((type_id=H5Dget_type(dataset_id))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( type_id, name, size )< 0) goto out; + if (H5Iget_name( type_id, name, size )< 0) TEST_ERROR; /* Verify */ if (check_name( name, "" )!=0) - goto out; + TEST_ERROR; /* Close */ H5Dclose( dataset_id ); @@ -1219,21 +1219,21 @@ int main( void ) TESTING("H5Iget_name with datasets that have two names"); /* Open dataset named "d"*/ -if ((dataset_id = H5Dopen( file_id, "/g17/d"))<0) goto out; +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) goto out; -if ((dataset2_id = H5Dopen( file_id, "/g17/link"))<0) goto out; +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(H5Iget_name(dataset_id, name, size)<0) goto out; -if(check_name(name, "/g17/d")!=0) goto out; +if(H5Iget_name(dataset_id, name, size)<0) TEST_ERROR; +if(check_name(name, "/g17/d")!=0) TEST_ERROR; -if(H5Iget_name(dataset2_id, name, size)<0) goto out; -if(check_name(name, "/g17/link")!=0) goto out; +if(H5Iget_name(dataset2_id, name, size)<0) TEST_ERROR; +if(check_name(name, "/g17/link")!=0) TEST_ERROR; -if(H5Dclose(dataset_id)<0) goto out; -if(H5Dclose(dataset2_id)<0) goto out; +if(H5Dclose(dataset_id)<0) TEST_ERROR; +if(H5Dclose(dataset2_id)<0) TEST_ERROR; PASSED(); @@ -1245,34 +1245,34 @@ 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) goto out; + 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) goto out; + if ((file3_id = H5Fcreate( filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl ))<0) TEST_ERROR; /* Create the data space */ - if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) goto out; + 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) goto out; + 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) goto out; + if ((dataset2_id = H5Dcreate( file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) TEST_ERROR; /* Delete */ - if (H5Gunlink( file2_id, "/d")<0) goto out; + if (H5Gunlink( file2_id, "/d")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( dataset_id, name, size )<0) goto out; + if (H5Iget_name( dataset_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( dataset2_id, name, size )<0) goto out; + if (H5Iget_name( dataset2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/d" )!=0) goto out; + if (check_name( name, "/d" )!=0) TEST_ERROR; /* Close */ H5Dclose( dataset_id ); @@ -1292,34 +1292,34 @@ 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) goto out; + 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) goto out; + if ((file3_id = H5Fcreate( filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl ))<0) TEST_ERROR; /* Create the data space */ - if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) goto out; + 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) goto out; + 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) goto out; + if ((dataset2_id = H5Dcreate( file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) TEST_ERROR; /* Delete */ - if (H5Gunlink( file3_id, "/d")<0) goto out; + if (H5Gunlink( file3_id, "/d")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( dataset_id, name, size )<0) goto out; + if (H5Iget_name( dataset_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/d" )!=0) goto out; + if (check_name( name, "/d" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( dataset2_id, name, size )<0) goto out; + if (H5Iget_name( dataset2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Close */ H5Dclose( dataset_id ); @@ -1338,7 +1338,7 @@ PASSED(); TESTING("H5Iget_name with a small buffer for name"); /* Reopen the group */ - if ((group_id = H5Gopen( file_id, "/g17" ))<0) goto out; + if ((group_id = H5Gopen( file_id, "/g17" ))<0) TEST_ERROR; /* Get name */ name_len=H5Iget_name( group_id, name2, size2 ); @@ -1348,7 +1348,7 @@ PASSED(); name_len=H5Iget_name( group_id, name, size ); /* Verify */ - if (check_name( name, "/g17" )!=0) goto out; + if (check_name( name, "/g17" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -1364,7 +1364,7 @@ PASSED(); TESTING("H5Iget_name with a dynamic buffer for name"); /* Reopen the group */ - if ((group_id = H5Gopen( file_id, "/g17" ))<0) goto out; + if ((group_id = H5Gopen( file_id, "/g17" ))<0) TEST_ERROR; /* Get name */ name_len=H5Iget_name( group_id, NULL, size ); @@ -1373,18 +1373,18 @@ PASSED(); name3 = malloc(name_len+1); /* Get name */ - if (H5Iget_name( group_id, name3, name_len+1 )<0) goto out; + if (H5Iget_name( group_id, name3, name_len+1 )<0) TEST_ERROR; /* Verify */ if (check_name( name3, "/g17" )!=0) - goto out; + TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name3, 3 )<0) goto out; + if (H5Iget_name( group_id, name3, 3 )<0) TEST_ERROR; /* Verify */ if (check_name( name3, "/g" )!=0) - goto out; + TEST_ERROR; if ( name3 ) free(name3); @@ -1404,20 +1404,20 @@ PASSED(); TESTING("H5Iget_name with invalid IDs"); /* Create a data space */ - if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) goto out; + if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) TEST_ERROR; /* Define a datatype */ - if ((type_id = H5Tcopy(H5T_NATIVE_INT))<0) goto out; + 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) goto out; + H5P_DEFAULT ))<0) TEST_ERROR; /* Get name for non commited datatype, it should fail */ - if (H5Iget_name( type_id, name, size ) >0) goto out; + if (H5Iget_name( type_id, name, size ) >0) TEST_ERROR; /* Get name for data space, it should fail */ - if (H5Iget_name( space_id, name, size ) >0) goto out; + if (H5Iget_name( space_id, name, size ) >0) TEST_ERROR; /* Close */ H5Dclose( dataset_id ); @@ -1435,85 +1435,85 @@ PASSED(); TESTING("H5Iget_name with added names with mounting"); /* Create a group "g18/g2" in the first file */ - if ((group_id = H5Gcreate( file_id, "/g18", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file_id, "/g18/g2", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "/g18", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file_id, "/g18/g2", 0 ))<0) TEST_ERROR; /* Also create a dataset and a datatype */ - if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) goto out; - if ((type_id = H5Tcopy(H5T_NATIVE_INT))<0) goto out; + 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) goto out; + H5P_DEFAULT ))<0) TEST_ERROR; - if (H5Tcommit(file_id, "g18/t2", type_id) <0) goto out; + 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); - if ((group3_id = H5Gcreate( file1_id, "/g3", 0 ))<0) goto out; - if ((group4_id = H5Gcreate( file1_id, "/g3/g4", 0 ))<0) goto out; - if ((group5_id = H5Gcreate( file1_id, "/g3/g4/g5", 0 ))<0) goto out; + if ((group3_id = H5Gcreate( file1_id, "/g3", 0 ))<0) TEST_ERROR; + if ((group4_id = H5Gcreate( file1_id, "/g3/g4", 0 ))<0) TEST_ERROR; + if ((group5_id = H5Gcreate( file1_id, "/g3/g4/g5", 0 ))<0) TEST_ERROR; /* Mount first file at "g3/g4" in the second file */ - if (H5Fmount(file1_id, "/g3/g4", file_id, H5P_DEFAULT)<0) goto out; + 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 (H5Iget_name( group2_id, name, size )<0) goto out; - if (check_name( name, "/g18/g2" )!=0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; + if (check_name( name, "/g18/g2" )!=0) TEST_ERROR; /* Get name for the dataset ID in the first file, should be "/g18/g2/d2" still */ - if (H5Iget_name( dataset_id, name, size )<0) goto out; - if (check_name( name, "/g18/d2" )!=0) goto out; + if (H5Iget_name( dataset_id, name, size )<0) TEST_ERROR; + if (check_name( name, "/g18/d2" )!=0) TEST_ERROR; /* Get name for the datatype ID in the first file, should be "/g18/g2/t2" still */ - if (H5Iget_name( type_id, name, size )<0) goto out; - if (check_name( name, "/g18/t2" )!=0) goto out; + if (H5Iget_name( type_id, name, size )<0) TEST_ERROR; + if (check_name( name, "/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) goto out; - if ((dataset2_id = H5Dopen( file1_id, "/g3/g4/g18/d2" ))<0) goto out; - if ((type2_id = H5Topen( file1_id, "/g3/g4/g18/t2" ))<0) goto out; + 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; /* Verify names */ - if (H5Iget_name( group6_id, name, size )<0) goto out; - if (check_name( name, "/g3/g4/g18/g2" )!=0) goto out; + if (H5Iget_name( group6_id, name, size )<0) TEST_ERROR; + if (check_name( name, "/g3/g4/g18/g2" )!=0) TEST_ERROR; - if (H5Iget_name( dataset2_id, name, size )<0) goto out; - if (check_name( name, "/g3/g4/g18/d2" )!=0) goto out; + if (H5Iget_name( dataset2_id, name, size )<0) TEST_ERROR; + if (check_name( name, "/g3/g4/g18/d2" )!=0) TEST_ERROR; - if (H5Iget_name( type2_id, name, size )<0) goto out; - if (check_name( name, "/g3/g4/g18/t2" )!=0) goto out; + if (H5Iget_name( type2_id, name, size )<0) TEST_ERROR; + if (check_name( name, "/g3/g4/g18/t2" )!=0) TEST_ERROR; /* Verify that old IDs still refer to objects by their old names */ - if (H5Iget_name( group2_id, name, size )<0) goto out; - if (check_name( name, "/g18/g2" )!=0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; + if (check_name( name, "/g18/g2" )!=0) TEST_ERROR; - if (H5Iget_name( dataset_id, name, size )<0) goto out; - if (check_name( name, "/g18/d2" )!=0) goto out; + if (H5Iget_name( dataset_id, name, size )<0) TEST_ERROR; + if (check_name( name, "/g18/d2" )!=0) TEST_ERROR; - if (H5Iget_name( type_id, name, size )<0) goto out; - if (check_name( name, "/g18/t2" )!=0) goto out; + if (H5Iget_name( type_id, name, size )<0) TEST_ERROR; + if (check_name( name, "/g18/t2" )!=0) TEST_ERROR; /* Unmount */ - if (H5Funmount(file1_id, "/g3/g4")<0) goto out; + if (H5Funmount(file1_id, "/g3/g4")<0) TEST_ERROR; /* Get name for the IDs of the first file, should be unchanged */ - if (H5Iget_name( group2_id, name, size )<0) goto out; - if (check_name( name, "/g18/g2" )!=0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; + if (check_name( name, "/g18/g2" )!=0) TEST_ERROR; - if (H5Iget_name( dataset_id, name, size )<0) goto out; - if (check_name( name, "/g18/d2" )!=0) goto out; + if (H5Iget_name( dataset_id, name, size )<0) TEST_ERROR; + if (check_name( name, "/g18/d2" )!=0) TEST_ERROR; - if (H5Iget_name( type_id, name, size )<0) goto out; - if (check_name( name, "/g18/t2" )!=0) goto out; + if (H5Iget_name( type_id, name, size )<0) TEST_ERROR; + if (check_name( name, "/g18/t2" )!=0) TEST_ERROR; /* Get name for the IDs of the second file, should be "" */ - if (H5Iget_name( group6_id, name, size )<0) goto out; - if (check_name( name, "" )!=0) goto out; + if (H5Iget_name( group6_id, name, size )<0) TEST_ERROR; + if (check_name( name, "" )!=0) TEST_ERROR; - if (H5Iget_name( dataset2_id, name, size )<0) goto out; - if (check_name( name, "" )!=0) goto out; + if (H5Iget_name( dataset2_id, name, size )<0) TEST_ERROR; + if (check_name( name, "" )!=0) TEST_ERROR; - if (H5Iget_name( type2_id, name, size )<0) goto out; - if (check_name( name, "" )!=0) goto out; + if (H5Iget_name( type2_id, name, size )<0) TEST_ERROR; + if (check_name( name, "" )!=0) TEST_ERROR; H5Tclose( type_id ); H5Tclose( type2_id ); @@ -1539,25 +1539,25 @@ PASSED(); /* Create a file and group "/g1/g2" in it */ file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - if ((group_id = H5Gcreate( file1_id, "/g1", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file1_id, "/g1/g2", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file1_id, "/g1", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file1_id, "/g1/g2", 0 ))<0) TEST_ERROR; /* Get name for the ID */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ if (check_name( name, "/g1/g2" )!=0) - goto out; + TEST_ERROR; /* Close file */ H5Fclose( file1_id ); /* Get name for the ID */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ if (check_name( name, "/g1/g2" )!=0) - goto out; + TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -1575,40 +1575,40 @@ PASSED(); /* Create a file and group "/g1/g2" in it */ file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - if ((group_id = H5Gcreate( file1_id, "/g1", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file1_id, "/g1/g2", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file1_id, "/g1", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file1_id, "/g1/g2", 0 ))<0) TEST_ERROR; /* Create a new file and group "/g3/g4" in it */ - if ((file2_id = H5Fcreate( filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl ))<0) goto out; - if ((group3_id = H5Gcreate( file2_id, "/g3", 0 ))<0) goto out; - if ((group4_id = H5Gcreate( file2_id, "/g3/g4", 0 ))<0) goto out; + if ((file2_id = H5Fcreate( filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file2_id, "/g3", 0 ))<0) TEST_ERROR; + if ((group4_id = H5Gcreate( file2_id, "/g3/g4", 0 ))<0) TEST_ERROR; /* Mount first file at "/g3/g4" in the second file */ - if(H5Fmount(file2_id, "/g3/g4", file1_id, H5P_DEFAULT)<0) goto out; + 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) goto out; + if ((group5_id = H5Gopen( file2_id, "/g3/g4/g1/g2" ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group5_id, name, size )<0) goto out; + if (H5Iget_name( group5_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g3/g4/g1/g2" )!=0) goto out; + if (check_name( name, "/g3/g4/g1/g2" )!=0) TEST_ERROR; /* Delete */ - if (H5Gunlink( file1_id, "/g3/g4/g1/g2")<0) goto out; + if (H5Gunlink( file1_id, "/g3/g4/g1/g2")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group5_id, name, size )<0) goto out; + if (H5Iget_name( group5_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -1632,136 +1632,136 @@ PASSED(); /* Create a file and group "/g1/g2" in it */ file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - if ((group_id = H5Gcreate( file1_id, "/g1", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file1_id, "/g1/g2", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file1_id, "/g1", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file1_id, "/g1/g2", 0 ))<0) TEST_ERROR; /* Create a new file and group "/g3/g4" in it */ - if ((file2_id = H5Fcreate( filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl ))<0) goto out; - if ((group3_id = H5Gcreate( file2_id, "/g3", 0 ))<0) goto out; - if ((group4_id = H5Gcreate( file2_id, "/g3/g4", 0 ))<0) goto out; + if ((file2_id = H5Fcreate( filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file2_id, "/g3", 0 ))<0) TEST_ERROR; + if ((group4_id = H5Gcreate( file2_id, "/g3/g4", 0 ))<0) TEST_ERROR; /* Mount first file at "g3/g4" in the second file */ - if(H5Fmount(file2_id, "/g3/g4", file1_id, H5P_DEFAULT)<0) goto out; + if(H5Fmount(file2_id, "/g3/g4", file1_id, H5P_DEFAULT)<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group4_id, name, size )<0) goto out; + if (H5Iget_name( group4_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g3/g4" )!=0) goto out; + if (check_name( name, "/g3/g4" )!=0) TEST_ERROR; /* Open the mounted group */ - if ((group5_id = H5Gopen( file2_id, "/g3/g4/g1/g2" ))<0) goto out; + if ((group5_id = H5Gopen( file2_id, "/g3/g4/g1/g2" ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group5_id, name, size )<0) goto out; + if (H5Iget_name( group5_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g3/g4/g1/g2" )!=0) goto out; + if (check_name( name, "/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) goto out; + if ((group6_id = H5Gopen( file2_id, "/g3/g4/g1" ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group6_id, name, size )<0) goto out; + if (H5Iget_name( group6_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g3/g4/g1" )!=0) goto out; + if (check_name( name, "/g3/g4/g1" )!=0) TEST_ERROR; /* Rename group */ - if (H5Gmove( file2_id, "/g3/g4/g1/g2", "/g3/g4/g1/g5" )<0) goto out; + if (H5Gmove( file2_id, "/g3/g4/g1/g2", "/g3/g4/g1/g5" )<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group5_id, name, size )<0) goto out; + if (H5Iget_name( group5_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g3/g4/g1/g5" )!=0) goto out; + if (check_name( name, "/g3/g4/g1/g5" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g1/g5" )!=0) goto out; + if (check_name( name, "/g1/g5" )!=0) TEST_ERROR; /* Rename group */ - if (H5Gmove( file2_id, "/g3/g4/g1", "/g3/g4/g1a" )<0) goto out; + if (H5Gmove( file2_id, "/g3/g4/g1", "/g3/g4/g1a" )<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group5_id, name, size )<0) goto out; + if (H5Iget_name( group5_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g3/g4/g1a/g5" )!=0) goto out; + if (check_name( name, "/g3/g4/g1a/g5" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g1a/g5" )!=0) goto out; + if (check_name( name, "/g1a/g5" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group6_id, name, size )<0) goto out; + if (H5Iget_name( group6_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g3/g4/g1a" )!=0) goto out; + if (check_name( name, "/g3/g4/g1a" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )<0) goto out; + if (H5Iget_name( group_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g1a" )!=0) goto out; + if (check_name( name, "/g1a" )!=0) TEST_ERROR; /* Rename middle group back, using relative path */ - if (H5Gmove( group3_id, "g4/g1a", "g4/g1" )<0) goto out; + if (H5Gmove( group3_id, "g4/g1a", "g4/g1" )<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group5_id, name, size )<0) goto out; + if (H5Iget_name( group5_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g3/g4/g1/g5" )!=0) goto out; + if (check_name( name, "/g3/g4/g1/g5" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g1/g5" )!=0) goto out; + if (check_name( name, "/g1/g5" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group6_id, name, size )<0) goto out; + if (H5Iget_name( group6_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g3/g4/g1" )!=0) goto out; + if (check_name( name, "/g3/g4/g1" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )<0) goto out; + if (H5Iget_name( group_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g1" )!=0) goto out; + if (check_name( name, "/g1" )!=0) TEST_ERROR; /* Rename end group back, using relative path */ - if (H5Gmove( group3_id, "g4/g1/g5", "g4/g1/g2" )<0) goto out; + if (H5Gmove( group3_id, "g4/g1/g5", "g4/g1/g2" )<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group5_id, name, size )<0) goto out; + if (H5Iget_name( group5_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g3/g4/g1/g2" )!=0) goto out; + if (check_name( name, "/g3/g4/g1/g2" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g1/g2" )!=0) goto out; + if (check_name( name, "/g1/g2" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group6_id, name, size )<0) goto out; + if (H5Iget_name( group6_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g3/g4/g1" )!=0) goto out; + if (check_name( name, "/g3/g4/g1" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )<0) goto out; + if (H5Iget_name( group_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g1" )!=0) goto out; + if (check_name( name, "/g1" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -1783,125 +1783,125 @@ PASSED(); TESTING("H5Iget_name with H5Glink hard"); /* Create group "g19/g1" */ - if ((group_id = H5Gcreate( file_id, "/g19", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file_id, "/g19/g1", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "/g19", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file_id, "/g19/g1", 0 ))<0) TEST_ERROR; /* Create hard link to "g19/g1/ group */ - if (H5Glink(file_id, H5G_LINK_HARD, "/g19/g1", "/g19/g2")<0) goto out; + if (H5Glink(file_id, H5G_LINK_HARD, "/g19/g1", "/g19/g2")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g19/g1" )!=0) goto out; + if (check_name( name, "/g19/g1" )!=0) TEST_ERROR; /* Open the group */ - if ((group3_id = H5Gopen( file_id, "/g19/g2" ))<0) goto out; + if ((group3_id = H5Gopen( file_id, "/g19/g2" ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g19/g2" )!=0) goto out; + if (check_name( name, "/g19/g2" )!=0) TEST_ERROR; /* Rename original group */ - if (H5Gmove( file_id, "/g19/g1", "/g19/g3" )<0) goto out; + if (H5Gmove( file_id, "/g19/g1", "/g19/g3" )<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g19/g3" )!=0) goto out; + if (check_name( name, "/g19/g3" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g19/g2" )!=0) goto out; + if (check_name( name, "/g19/g2" )!=0) TEST_ERROR; /* Rename original group back, using relative path */ - if (H5Gmove( group_id, "g3", "g1" )<0) goto out; + if (H5Gmove( group_id, "g3", "g1" )<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g19/g1" )!=0) goto out; + if (check_name( name, "/g19/g1" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g19/g2" )!=0) goto out; + if (check_name( name, "/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) goto out; + 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) goto out; + if ((group4_id = H5Gopen( file_id, "/g19/g3" ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group4_id, name, size )<0) goto out; + if (H5Iget_name( group4_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g19/g3" )!=0) goto out; + if (check_name( name, "/g19/g3" )!=0) TEST_ERROR; /* Delete group */ - if (H5Gunlink( file_id, "/g19/g3")<0) goto out; + if (H5Gunlink( file_id, "/g19/g3")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group4_id, name, size )<0) goto out; + if (H5Iget_name( group4_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g19/g1" )!=0) goto out; + if (check_name( name, "/g19/g1" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g19/g2" )!=0) goto out; + if (check_name( name, "/g19/g2" )!=0) TEST_ERROR; /* Close the unlinked group */ H5Gclose( group4_id ); /* Create another hard link to "/g19/g1" group */ - if (H5Glink(file_id, H5G_LINK_HARD, "/g19/g1", "/g19/g3")<0) goto out; + 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) goto out; + if ((group4_id = H5Gopen( file_id, "/g19/g3" ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group4_id, name, size )<0) goto out; + if (H5Iget_name( group4_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g19/g3" )!=0) goto out; + if (check_name( name, "/g19/g3" )!=0) TEST_ERROR; /* Delete group, using relative path */ - if (H5Gunlink( group_id, "g3")<0) goto out; + if (H5Gunlink( group_id, "g3")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group4_id, name, size )<0) goto out; + if (H5Iget_name( group4_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g19/g1" )!=0) goto out; + if (check_name( name, "/g19/g1" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g19/g2" )!=0) goto out; + if (check_name( name, "/g19/g2" )!=0) TEST_ERROR; /* Close the unlinked group */ H5Gclose( group4_id ); @@ -1923,26 +1923,26 @@ PASSED(); TESTING("H5Iget_name with H5Glink symbolic"); /* Create group "g20/g1" */ - if ((group_id = H5Gcreate( file_id, "/g20", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file_id, "/g20/g1", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "/g20", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file_id, "/g20/g1", 0 ))<0) TEST_ERROR; /* Create symbolic link to "g20/g1/ group */ - if (H5Glink(file_id, H5G_LINK_SOFT, "/g20/g1", "/g20/g2")<0) goto out; + if (H5Glink(file_id, H5G_LINK_SOFT, "/g20/g1", "/g20/g2")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g20/g1" )!=0) goto out; + if (check_name( name, "/g20/g1" )!=0) TEST_ERROR; /* Open the group */ - if ((group3_id = H5Gopen( file_id, "/g20/g2" ))<0) goto out; + if ((group3_id = H5Gopen( file_id, "/g20/g2" ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g20/g2" )!=0) goto out; + if (check_name( name, "/g20/g2" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -1960,35 +1960,35 @@ PASSED(); TESTING("H5Iget_name with H5Glink symbolic and move target"); /* Create group "g21/g1" */ - if ((group_id = H5Gcreate( file_id, "/g21", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file_id, "/g21/g1", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "/g21", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file_id, "/g21/g1", 0 ))<0) TEST_ERROR; /* Create symbolic link to "g21/g1/ group */ - if (H5Glink(file_id, H5G_LINK_SOFT, "/g21/g1", "/g21/g2")<0) goto out; + if (H5Glink(file_id, H5G_LINK_SOFT, "/g21/g1", "/g21/g2")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g21/g1" )!=0) goto out; + if (check_name( name, "/g21/g1" )!=0) TEST_ERROR; /* Open the group */ - if ((group3_id = H5Gopen( file_id, "/g21/g2" ))<0) goto out; + if ((group3_id = H5Gopen( file_id, "/g21/g2" ))<0) TEST_ERROR; /* Rename group */ - if (H5Gmove( file_id, "/g21/g1", "/g21/g3" )<0) goto out; + if (H5Gmove( file_id, "/g21/g1", "/g21/g3" )<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g21/g3" )!=0) goto out; + if (check_name( name, "/g21/g3" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g21/g2" )!=0) goto out; + if (check_name( name, "/g21/g2" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2006,50 +2006,50 @@ PASSED(); TESTING("H5Iget_name with H5Glink symbolic and move source"); /* Create group "g22/g1" */ - if ((group_id = H5Gcreate( file_id, "/g22", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file_id, "/g22/g1", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "/g22", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file_id, "/g22/g1", 0 ))<0) TEST_ERROR; /* Create symbolic link to "g22/g1/ group */ - if (H5Glink(file_id, H5G_LINK_SOFT, "/g22/g1", "/g22/g2")<0) goto out; + if (H5Glink(file_id, H5G_LINK_SOFT, "/g22/g1", "/g22/g2")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g22/g1" )!=0) goto out; + if (check_name( name, "/g22/g1" )!=0) TEST_ERROR; /* Open the group */ - if ((group3_id = H5Gopen( file_id, "/g22/g2" ))<0) goto out; + if ((group3_id = H5Gopen( file_id, "/g22/g2" ))<0) TEST_ERROR; /* Rename soft link */ - if (H5Gmove( file_id, "/g22/g2", "/g22/g3" )<0) goto out; + if (H5Gmove( file_id, "/g22/g2", "/g22/g3" )<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g22/g1" )!=0) goto out; + if (check_name( name, "/g22/g1" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g22/g3" )!=0) goto out; + if (check_name( name, "/g22/g3" )!=0) TEST_ERROR; /* Rename soft link, using relative paths */ - if (H5Gmove( group_id, "g3", "g2" )<0) goto out; + if (H5Gmove( group_id, "g3", "g2" )<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g22/g1" )!=0) goto out; + if (check_name( name, "/g22/g1" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g22/g2" )!=0) goto out; + if (check_name( name, "/g22/g2" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2068,29 +2068,29 @@ PASSED(); TESTING("H5Iget_name with H5Glink symbolic and unlink target"); /* Create group "g23/g1" */ - if ((group_id = H5Gcreate( file_id, "/g23", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file_id, "/g23/g1", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "/g23", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file_id, "/g23/g1", 0 ))<0) TEST_ERROR; /* Create symbolic link to "g23/g1/ group */ - if (H5Glink(file_id, H5G_LINK_SOFT, "/g23/g1", "/g23/g2")<0) goto out; + if (H5Glink(file_id, H5G_LINK_SOFT, "/g23/g1", "/g23/g2")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g23/g1" )!=0) goto out; + if (check_name( name, "/g23/g1" )!=0) TEST_ERROR; /* Open the group */ - if ((group3_id = H5Gopen( file_id, "/g23/g2" ))<0) goto out; + if ((group3_id = H5Gopen( file_id, "/g23/g2" ))<0) TEST_ERROR; /* Delete group */ - if (H5Gunlink( file_id, "/g23/g1")<0) goto out; + if (H5Gunlink( file_id, "/g23/g1")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g23/g2" )!=0) goto out; + if (check_name( name, "/g23/g2" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2107,29 +2107,29 @@ PASSED(); TESTING("H5Iget_name with H5Glink symbolic and unlink source"); /* Create group "g24/g1" */ - if ((group_id = H5Gcreate( file_id, "/g24", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file_id, "/g24/g1", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "/g24", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file_id, "/g24/g1", 0 ))<0) TEST_ERROR; /* Create symbolic link to "g24/g1/ group */ - if (H5Glink(file_id, H5G_LINK_SOFT, "/g24/g1", "/g24/g2")<0) goto out; + if (H5Glink(file_id, H5G_LINK_SOFT, "/g24/g1", "/g24/g2")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g24/g1" )!=0) goto out; + if (check_name( name, "/g24/g1" )!=0) TEST_ERROR; /* Open the group */ - if ((group3_id = H5Gopen( file_id, "/g24/g2" ))<0) goto out; + if ((group3_id = H5Gopen( file_id, "/g24/g2" ))<0) TEST_ERROR; /* Delete group */ - if (H5Gunlink( file_id, "/g24/g2")<0) goto out; + if (H5Gunlink( file_id, "/g24/g2")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2146,9 +2146,9 @@ PASSED(); TESTING("H5Iget_name with several nested mounted files"); /* Create a group "g25/g1/g2" in the first file */ - if ((group_id = H5Gcreate( file_id, "/g25", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file_id, "/g25/g1", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file_id, "/g25/g1/g2", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "/g25", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file_id, "/g25/g1", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file_id, "/g25/g1/g2", 0 ))<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2158,9 +2158,9 @@ PASSED(); /* Create second file and group "/g26/g3/g4" in it */ file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - if ((group_id = H5Gcreate( file1_id, "/g26", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file1_id, "/g26/g3", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file1_id, "/g26/g3/g4", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file1_id, "/g26", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file1_id, "/g26/g3", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file1_id, "/g26/g3/g4", 0 ))<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2170,9 +2170,9 @@ PASSED(); /* Create third file and group "/g27/g5/g6" in it */ file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - if ((group_id = H5Gcreate( file2_id, "/g27", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file2_id, "/g27/g5", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file2_id, "/g27/g5/g6", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file2_id, "/g27", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file2_id, "/g27/g5", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file2_id, "/g27/g5/g6", 0 ))<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2182,9 +2182,9 @@ PASSED(); /* Create fourth file and group "/g28/g5/g6" in it */ file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - if ((group_id = H5Gcreate( file3_id, "/g28", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file3_id, "/g28/g7", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file3_id, "/g28/g7/g8", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file3_id, "/g28", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file3_id, "/g28/g7", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file3_id, "/g28/g7/g8", 0 ))<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2192,135 +2192,135 @@ PASSED(); H5Gclose( group3_id ); /* Access group which will be hidden in the first file */ - if ((group_id = H5Gopen( file_id, "/g25/g1/g2"))<0) goto out; + if ((group_id = H5Gopen( file_id, "/g25/g1/g2"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g25/g1/g2" )!=0) goto out; + if (check_name( name, "/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) goto out; + if (H5Fmount(file_id, "/g25/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=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) goto out; + if ((group2_id = H5Gopen( file_id, "/g25/g1/g26/g3/g4"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )< 0) goto out; + if (H5Iget_name( group2_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g25/g1/g26/g3/g4" )!=0) goto out; + if (check_name( name, "/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) goto out; + if (H5Fmount(file_id, "/g25/g1/g26/g3", file2_id, H5P_DEFAULT)<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )< 0) goto out; + if (H5Iget_name( group2_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Access group in the third file */ - if ((group3_id = H5Gopen( file_id, "/g25/g1/g26/g3/g27/g5/g6"))<0) goto out; + if ((group3_id = H5Gopen( file_id, "/g25/g1/g26/g3/g27/g5/g6"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )< 0) goto out; + if (H5Iget_name( group3_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g25/g1/g26/g3/g27/g5/g6" )!=0) goto out; + if (check_name( name, "/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) goto out; + if (H5Fmount(file_id, "/g25/g1/g26/g3/g27/g5", file3_id, H5P_DEFAULT)<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )< 0) goto out; + if (H5Iget_name( group3_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=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) goto out; + if ((group4_id = H5Gopen( file_id, "/g25/g1/g26/g3/g27/g5/g28/g7/g8"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group4_id, name, size )< 0) goto out; + if (H5Iget_name( group4_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g25/g1/g26/g3/g27/g5/g28/g7/g8" )!=0) goto out; + if (check_name( name, "/g25/g1/g26/g3/g27/g5/g28/g7/g8" )!=0) TEST_ERROR; - if (H5Funmount(file_id, "/g25/g1/g26/g3/g27/g5")<0) goto out; + if (H5Funmount(file_id, "/g25/g1/g26/g3/g27/g5")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group4_id, name, size )< 0) goto out; + if (H5Iget_name( group4_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )< 0) goto out; + if (H5Iget_name( group3_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g25/g1/g26/g3/g27/g5/g6" )!=0) goto out; + if (check_name( name, "/g25/g1/g26/g3/g27/g5/g6" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )< 0) goto out; + if (H5Iget_name( group2_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Close */ H5Gclose( group4_id ); H5Fclose( file3_id ); - if (H5Funmount(file_id, "/g25/g1/g26/g3")<0) goto out; + if (H5Funmount(file_id, "/g25/g1/g26/g3")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )< 0) goto out; + if (H5Iget_name( group3_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )< 0) goto out; + if (H5Iget_name( group2_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g25/g1/g26/g3/g4" )!=0) goto out; + if (check_name( name, "/g25/g1/g26/g3/g4" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Close */ H5Gclose( group3_id ); H5Fclose( file2_id ); - if (H5Funmount(file_id, "/g25/g1")<0) goto out; + if (H5Funmount(file_id, "/g25/g1")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )< 0) goto out; + if (H5Iget_name( group2_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g25/g1/g2" )!=0) goto out; + if (check_name( name, "/g25/g1/g2" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2339,50 +2339,50 @@ PASSED(); TESTING("H5Iget_name and H5Gmove with repeated path components"); /* Create a group "g29/g1/g2/g1/g2" in a file */ - if ((group_id = H5Gcreate( file_id, "/g29", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file_id, "/g29/g1", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file_id, "/g29/g1/g2", 0 ))<0) goto out; - if ((group4_id = H5Gcreate( file_id, "/g29/g1/g2/g1", 0 ))<0) goto out; - if ((group5_id = H5Gcreate( file_id, "/g29/g1/g2/g1/g2", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "/g29", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file_id, "/g29/g1", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file_id, "/g29/g1/g2", 0 ))<0) TEST_ERROR; + if ((group4_id = H5Gcreate( file_id, "/g29/g1/g2/g1", 0 ))<0) TEST_ERROR; + if ((group5_id = H5Gcreate( file_id, "/g29/g1/g2/g1/g2", 0 ))<0) TEST_ERROR; /* Rename group */ - if (H5Gmove( file_id, "/g29/g1/g2/g1/g2", "/g29/g1/g2/g1/g3" )<0) goto out; + if (H5Gmove( file_id, "/g29/g1/g2/g1/g2", "/g29/g1/g2/g1/g3" )<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group5_id, name, size )< 0) goto out; + if (H5Iget_name( group5_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g29/g1/g2/g1/g3" )!=0) goto out; + if (check_name( name, "/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) goto out; + if (H5Gmove( file_id, "/g29/g1/g2/g1", "/g29/g1/g2/g3" )<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group4_id, name, size )< 0) goto out; + if (H5Iget_name( group4_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g29/g1/g2/g3" )!=0) goto out; + if (check_name( name, "/g29/g1/g2/g3" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group5_id, name, size )< 0) goto out; + if (H5Iget_name( group5_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g29/g1/g2/g3/g3" )!=0) goto out; + if (check_name( name, "/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) goto out; + if (H5Gmove( file_id, "/g29/g1/g2/g3", "/g29/g3" )<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group4_id, name, size )< 0) goto out; + if (H5Iget_name( group4_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g29/g3" )!=0) goto out; + if (check_name( name, "/g29/g3" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group5_id, name, size )< 0) goto out; + if (H5Iget_name( group5_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g29/g3/g3" )!=0) goto out; + if (check_name( name, "/g29/g3/g3" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2402,9 +2402,9 @@ PASSED(); TESTING("H5Iget_name with higher mounted file"); /* Create a group "/g30/g1/g2" in the first file */ - if ((group_id = H5Gcreate( file_id, "/g30", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file_id, "/g30/g1", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file_id, "/g30/g1/g2", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "/g30", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file_id, "/g30/g1", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file_id, "/g30/g1/g2", 0 ))<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2414,9 +2414,9 @@ PASSED(); /* Create second file and group "/g31/g3/g4" in it */ file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - if ((group_id = H5Gcreate( file1_id, "/g31", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file1_id, "/g31/g3", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file1_id, "/g31/g3/g4", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file1_id, "/g31", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file1_id, "/g31/g3", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file1_id, "/g31/g3/g4", 0 ))<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2426,9 +2426,9 @@ PASSED(); /* Create third file and group "/g32/g5/g6" in it */ file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - if ((group_id = H5Gcreate( file2_id, "/g32", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file2_id, "/g32/g5", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file2_id, "/g32/g5/g6", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file2_id, "/g32", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file2_id, "/g32/g5", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file2_id, "/g32/g5/g6", 0 ))<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2438,9 +2438,9 @@ PASSED(); /* Create fourth file and group "/g33/g5/g6" in it */ file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - if ((group_id = H5Gcreate( file3_id, "/g33", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file3_id, "/g33/g7", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file3_id, "/g33/g7/g8", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file3_id, "/g33", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file3_id, "/g33/g7", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file3_id, "/g33/g7/g8", 0 ))<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2448,148 +2448,148 @@ PASSED(); H5Gclose( group3_id ); /* Access group which will be hidden in the first file */ - if ((group_id = H5Gopen( file_id, "/g30/g1/g2"))<0) goto out; + if ((group_id = H5Gopen( file_id, "/g30/g1/g2"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g30/g1/g2" )!=0) goto out; + if (check_name( name, "/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) goto out; + if (H5Fmount(file_id, "/g30/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=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) goto out; + if ((group2_id = H5Gopen( file_id, "/g30/g1/g31/g3/g4"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )< 0) goto out; + if (H5Iget_name( group2_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g30/g1/g31/g3/g4" )!=0) goto out; + if (check_name( name, "/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) goto out; + if (H5Fmount(file_id, "/g30/g1/g31/g3", file2_id, H5P_DEFAULT)<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )< 0) goto out; + if (H5Iget_name( group2_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=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) goto out; + if ((group3_id = H5Gopen( file_id, "/g30/g1/g31/g3/g32/g5/g6"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )< 0) goto out; + if (H5Iget_name( group3_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g30/g1/g31/g3/g32/g5/g6" )!=0) goto out; + if (check_name( name, "/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) goto out; + if (H5Fmount(file_id, "/g30", file3_id, H5P_DEFAULT)<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )< 0) goto out; + if (H5Iget_name( group3_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Access group which will be in the fourth file */ - if ((group4_id = H5Gopen( file_id, "/g30/g33/g7/g8"))<0) goto out; + if ((group4_id = H5Gopen( file_id, "/g30/g33/g7/g8"))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group4_id, name, size )< 0) goto out; + if (H5Iget_name( group4_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g30/g33/g7/g8" )!=0) goto out; + if (check_name( name, "/g30/g33/g7/g8" )!=0) TEST_ERROR; /* Unmount fourth file */ - if (H5Funmount(file_id, "/g30")<0) goto out; + if (H5Funmount(file_id, "/g30")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group4_id, name, size )< 0) goto out; + if (H5Iget_name( group4_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )< 0) goto out; + if (H5Iget_name( group3_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g30/g1/g31/g3/g32/g5/g6" )!=0) goto out; + if (check_name( name, "/g30/g1/g31/g3/g32/g5/g6" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )< 0) goto out; + if (H5Iget_name( group2_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Unmount third file */ - if (H5Funmount(file_id, "/g30/g1/g31/g3")<0) goto out; + if (H5Funmount(file_id, "/g30/g1/g31/g3")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group4_id, name, size )< 0) goto out; + if (H5Iget_name( group4_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )< 0) goto out; + if (H5Iget_name( group3_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )< 0) goto out; + if (H5Iget_name( group2_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g30/g1/g31/g3/g4" )!=0) goto out; + if (check_name( name, "/g30/g1/g31/g3/g4" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Unmount second file */ - if (H5Funmount(file_id, "/g30/g1")<0) goto out; + if (H5Funmount(file_id, "/g30/g1")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group4_id, name, size )< 0) goto out; + if (H5Iget_name( group4_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )< 0) goto out; + if (H5Iget_name( group3_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )< 0) goto out; + if (H5Iget_name( group2_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )< 0) goto out; + if (H5Iget_name( group_id, name, size )< 0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g30/g1/g2" )!=0) goto out; + if (check_name( name, "/g30/g1/g2" )!=0) TEST_ERROR; /* Close groups */ H5Gclose( group_id ); @@ -2615,9 +2615,9 @@ PASSED(); /* Create second file and group "/g35/g3/g4" in it */ file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - if ((group_id = H5Gcreate( file1_id, "/g35", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file1_id, "/g35/g3", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file1_id, "/g35/g3/g4", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file1_id, "/g35", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file1_id, "/g35/g3", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file1_id, "/g35/g3/g4", 0 ))<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2625,57 +2625,57 @@ PASSED(); H5Gclose( group3_id ); /* Create group "/g34/g1/g2" in first file */ - if ((group_id = H5Gcreate( file_id, "/g34", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file_id, "/g34/g1", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file_id, "/g34/g1/g2", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "/g34", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file_id, "/g34/g1", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file_id, "/g34/g1/g2", 0 ))<0) TEST_ERROR; /* Create hard link to "/g34/g1/g2 group */ - if (H5Glink(file_id, H5G_LINK_HARD, "/g34/g1/g2", "/g34/g2a")<0) goto out; + if (H5Glink(file_id, H5G_LINK_HARD, "/g34/g1/g2", "/g34/g2a")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g34/g1/g2" )!=0) goto out; + if (check_name( name, "/g34/g1/g2" )!=0) TEST_ERROR; /* Open the link to the group */ - if ((group4_id = H5Gopen( file_id, "/g34/g2a" ))<0) goto out; + if ((group4_id = H5Gopen( file_id, "/g34/g2a" ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group4_id, name, size )<0) goto out; + if (H5Iget_name( group4_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g34/g2a" )!=0) goto out; + if (check_name( name, "/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) goto out; + if (H5Fmount(file_id, "/g34/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group4_id, name, size )<0) goto out; + if (H5Iget_name( group4_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g34/g2a" )!=0) goto out; + if (check_name( name, "/g34/g2a" )!=0) TEST_ERROR; /* Unmount second file */ - if (H5Funmount(file_id, "/g34/g1")<0) goto out; + if (H5Funmount(file_id, "/g34/g1")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g34/g1/g2" )!=0) goto out; + if (check_name( name, "/g34/g1/g2" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group4_id, name, size )<0) goto out; + if (H5Iget_name( group4_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g34/g2a" )!=0) goto out; + if (check_name( name, "/g34/g2a" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2696,9 +2696,9 @@ PASSED(); TESTING("H5Iget_name with mounted files and unlinking"); /* Create group "/g36/g1/g2" in first file */ - if ((group_id = H5Gcreate( file_id, "/g36", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file_id, "/g36/g1", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file_id, "/g36/g1/g2", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "/g36", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file_id, "/g36/g1", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file_id, "/g36/g1/g2", 0 ))<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2708,92 +2708,92 @@ PASSED(); /* Create second file and group "/g37/g4" in it */ file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - if ((group_id = H5Gcreate( file1_id, "/g37", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file1_id, "/g37/g4", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file1_id, "/g37/g4/g5a", 0 ))<0) goto out; - if ((group4_id = H5Gcreate( file1_id, "/g37/g4/g5b", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file1_id, "/g37", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file1_id, "/g37/g4", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file1_id, "/g37/g4/g5a", 0 ))<0) TEST_ERROR; + if ((group4_id = H5Gcreate( file1_id, "/g37/g4/g5b", 0 ))<0) TEST_ERROR; /* Mount second file under "/g36/g1" in the first file */ - if (H5Fmount(file_id, "/g36/g1", file1_id, H5P_DEFAULT)<0) goto out; + 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) goto out; + if ((group5_id = H5Gopen( file_id, "/g36/g1/g37/" ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group5_id, name, size )<0) goto out; + if (H5Iget_name( group5_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g36/g1/g37" )!=0) goto out; + if (check_name( name, "/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) goto out; + if ((group6_id = H5Gopen( file_id, "/g36/g1/g37/g4/g5a" ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group6_id, name, size )<0) goto out; + if (H5Iget_name( group6_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g36/g1/g37/g4/g5a" )!=0) goto out; + if (check_name( name, "/g36/g1/g37/g4/g5a" )!=0) TEST_ERROR; /* Delete end group in mounted file, using relative paths */ - if (H5Gunlink( group5_id, "g4/g5a")<0) goto out; + if (H5Gunlink( group5_id, "g4/g5a")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group6_id, name, size )<0) goto out; + if (H5Iget_name( group6_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group3_id, name, size )<0) goto out; + if (H5Iget_name( group3_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Close deleted group */ H5Gclose( group6_id ); /* Open groups to delete in mounted file */ - if ((group6_id = H5Gopen( file_id, "/g36/g1/g37/g4" ))<0) goto out; - if ((group7_id = H5Gopen( file_id, "/g36/g1/g37/g4/g5b" ))<0) goto out; + 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; /* Get name */ - if (H5Iget_name( group6_id, name, size )<0) goto out; + if (H5Iget_name( group6_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g36/g1/g37/g4" )!=0) goto out; + if (check_name( name, "/g36/g1/g37/g4" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group7_id, name, size )<0) goto out; + if (H5Iget_name( group7_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g36/g1/g37/g4/g5b" )!=0) goto out; + if (check_name( name, "/g36/g1/g37/g4/g5b" )!=0) TEST_ERROR; /* Delete middle group in mounted file, using relative paths */ - if (H5Gunlink( group5_id, "g4")<0) goto out; + if (H5Gunlink( group5_id, "g4")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group6_id, name, size )<0) goto out; + if (H5Iget_name( group6_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group7_id, name, size )<0) goto out; + if (H5Iget_name( group7_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group4_id, name, size )<0) goto out; + if (H5Iget_name( group4_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Close deleted groups */ H5Gclose( group6_id ); @@ -2802,7 +2802,7 @@ PASSED(); /* Close group in mounted file */ H5Gclose( group5_id ); - if (H5Funmount(file_id, "/g36/g1")<0) goto out; + if (H5Funmount(file_id, "/g36/g1")<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2825,9 +2825,9 @@ PASSED(); /* Create file and group "/g38/g1/g2" in it */ file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - if ((group_id = H5Gcreate( file1_id, "/g38", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file1_id, "/g38/g1", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file1_id, "/g38/g1/g2", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file1_id, "/g38", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file1_id, "/g38/g1", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file1_id, "/g38/g1/g2", 0 ))<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2837,9 +2837,9 @@ PASSED(); /* Create second file and group "/g39/g1/g2" in it */ file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - if ((group_id = H5Gcreate( file2_id, "/g39", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file2_id, "/g39/g3", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file2_id, "/g39/g3/g4", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file2_id, "/g39", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file2_id, "/g39/g3", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file2_id, "/g39/g3/g4", 0 ))<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2849,9 +2849,9 @@ PASSED(); /* Create third file and group "/g40/g5/g6" in it */ file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - if ((group_id = H5Gcreate( file3_id, "/g40", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file3_id, "/g40/g5", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file3_id, "/g40/g5/g6", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file3_id, "/g40", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file3_id, "/g40/g5", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file3_id, "/g40/g5/g6", 0 ))<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2859,56 +2859,56 @@ PASSED(); H5Gclose( group3_id ); /* Mount second file under "/g38/g1" in the first file */ - if (H5Fmount(file1_id, "/g38/g1", file2_id, H5P_DEFAULT)<0) goto out; + 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) goto out; + if ((group_id = H5Gopen( file1_id, "/g38/g1/g39/g3/g4" ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )<0) goto out; + if (H5Iget_name( group_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g38/g1/g39/g3/g4" )!=0) goto out; + if (check_name( name, "/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) goto out; + 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) goto out; + if ((group2_id = H5Gopen( file3_id, "/g40/g5/g38/g1/g39/g3/g4" ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g40/g5/g38/g1/g39/g3/g4" )!=0) goto out; + if (check_name( name, "/g40/g5/g38/g1/g39/g3/g4" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )<0) goto out; + if (H5Iget_name( group_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g38/g1/g39/g3/g4" )!=0) goto out; + if (check_name( name, "/g38/g1/g39/g3/g4" )!=0) TEST_ERROR; /* Unmount first file */ - if (H5Funmount(file3_id, "/g40/g5")<0) goto out; + if (H5Funmount(file3_id, "/g40/g5")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )<0) goto out; + if (H5Iget_name( group_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g38/g1/g39/g3/g4" )!=0) goto out; + if (check_name( name, "/g38/g1/g39/g3/g4" )!=0) TEST_ERROR; /* Unmount second file */ - if (H5Funmount(file1_id, "/g38/g1")<0) goto out; + if (H5Funmount(file1_id, "/g38/g1")<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )<0) goto out; + if (H5Iget_name( group_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2929,9 +2929,9 @@ PASSED(); /* Create file and group "/g39/g1/g2" in it */ file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - if ((group_id = H5Gcreate( file1_id, "/g41", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file1_id, "/g41/g1", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file1_id, "/g41/g1/g2", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file1_id, "/g41", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file1_id, "/g41/g1", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file1_id, "/g41/g1/g2", 0 ))<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2941,9 +2941,9 @@ PASSED(); /* Create second file and group "/g42/g1/g2" in it */ file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - if ((group_id = H5Gcreate( file2_id, "/g42", 0 ))<0) goto out; - if ((group2_id = H5Gcreate( file2_id, "/g42/g3", 0 ))<0) goto out; - if ((group3_id = H5Gcreate( file2_id, "/g42/g3/g4", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file2_id, "/g42", 0 ))<0) TEST_ERROR; + if ((group2_id = H5Gcreate( file2_id, "/g42/g3", 0 ))<0) TEST_ERROR; + if ((group3_id = H5Gcreate( file2_id, "/g42/g3/g4", 0 ))<0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2951,26 +2951,26 @@ PASSED(); H5Gclose( group3_id ); /* Mount second file under "/g41/g1" in the first file */ - if (H5Fmount(file1_id, "/g41/g1", file2_id, H5P_DEFAULT)<0) goto out; + if (H5Fmount(file1_id, "/g41/g1", file2_id, H5P_DEFAULT)<0) TEST_ERROR; - if ((group_id = H5Gopen( file1_id, "/g41/g1/g42/g3" ))<0) goto out; + if ((group_id = H5Gopen( file1_id, "/g41/g1/g42/g3" ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group_id, name, size )<0) goto out; + if (H5Iget_name( group_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "/g41/g1/g42/g3" )!=0) goto out; + if (check_name( name, "/g41/g1/g42/g3" )!=0) TEST_ERROR; /* Unmount file */ - if (H5Funmount(file1_id, "/g41/g1")<0) goto out; + if (H5Funmount(file1_id, "/g41/g1")<0) TEST_ERROR; - if ((group2_id = H5Gopen( group_id, "g4" ))<0) goto out; + if ((group2_id = H5Gopen( group_id, "g4" ))<0) TEST_ERROR; /* Get name */ - if (H5Iget_name( group2_id, name, size )<0) goto out; + if (H5Iget_name( group2_id, name, size )<0) TEST_ERROR; /* Verify */ - if (check_name( name, "" )!=0) goto out; + if (check_name( name, "" )!=0) TEST_ERROR; /* Close */ H5Gclose( group_id ); @@ -2992,7 +2992,7 @@ PASSED(); h5_cleanup(FILENAME, fapl); return 0; -out: +error: H5Fclose( file_id ); H5_FAILED(); return 1; diff --git a/test/group_old.h5 b/test/group_old.h5 Binary files differnew file mode 100644 index 0000000..58f66f8 --- /dev/null +++ b/test/group_old.h5 diff --git a/test/links.c b/test/links.c index 8a89929..96ebbf4 100644 --- a/test/links.c +++ b/test/links.c @@ -18,8 +18,14 @@ * * Purpose: Tests hard and soft (symbolic) links. */ + +#define H5G_PACKAGE /*suppress error about including H5Gpkg */ + +/* Define this macro to indicate that the testing APIs should be available */ +#define H5G_TESTING + #include "h5test.h" -#include "H5Gprivate.h" /* Groups */ +#include "H5Gpkg.h" /* Groups */ const char *FILENAME[] = { "links1", @@ -60,39 +66,32 @@ mklinks(hid_t fapl) /* Create a file */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) { - goto error; - } - if ((scalar=H5Screate_simple (1, size, size))<0) goto error; + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + if ((scalar=H5Screate_simple (1, size, size))<0) TEST_ERROR; /* Create a group */ - if ((grp=H5Gcreate (file, "grp1", (size_t)0))<0) goto error; - if (H5Gclose (grp)<0) goto error; + if ((grp=H5Gcreate (file, "grp1", (size_t)0))<0) TEST_ERROR; + if (H5Gclose (grp)<0) TEST_ERROR; /* Create a dataset */ - if ((d1=H5Dcreate (file, "d1", H5T_NATIVE_INT, scalar, H5P_DEFAULT))<0) { - goto error; - } - if (H5Dclose (d1)<0) goto error; + if ((d1=H5Dcreate (file, "d1", H5T_NATIVE_INT, scalar, H5P_DEFAULT))<0) TEST_ERROR; + if (H5Dclose (d1)<0) TEST_ERROR; /* Create a hard link */ - if (H5Glink (file, H5G_LINK_HARD, "d1", "grp1/hard")<0) goto error; + if (H5Glink (file, H5G_LINK_HARD, "d1", "grp1/hard")<0) TEST_ERROR; /* Create a symbolic link */ - if (H5Glink (file, H5G_LINK_SOFT, "/d1", "grp1/soft")<0) goto error; + if (H5Glink (file, H5G_LINK_SOFT, "/d1", "grp1/soft")<0) TEST_ERROR; /* Create a symbolic link to something that doesn't exist */ - if (H5Glink (file, H5G_LINK_SOFT, "foobar", "grp1/dangle")<0) goto error; + if (H5Glink (file, H5G_LINK_SOFT, "foobar", "grp1/dangle")<0) TEST_ERROR; /* Create a recursive symbolic link */ - if (H5Glink (file, H5G_LINK_SOFT, "/grp1/recursive", - "/grp1/recursive")<0) { - goto error; - } + if (H5Glink (file, H5G_LINK_SOFT, "/grp1/recursive", "/grp1/recursive")<0) TEST_ERROR; /* Close */ - if (H5Sclose (scalar)<0) goto error; - if (H5Fclose (file)<0) goto error; + if (H5Sclose (scalar)<0) TEST_ERROR; + if (H5Fclose (file)<0) TEST_ERROR; PASSED(); return 0; @@ -132,81 +131,59 @@ new_links(hid_t fapl) /* Create two files */ h5_fixname(FILENAME[1], fapl, filename, sizeof filename); - if ((file_a=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) { - goto error; - } + if ((file_a=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + h5_fixname(FILENAME[2], fapl, filename, sizeof filename); - if ((file_b=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) { - goto error; - } - if ((scalar=H5Screate_simple (1, size, size))<0) goto error; + if ((file_b=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; + + if ((scalar=H5Screate_simple (1, size, size))<0) TEST_ERROR; /* Create two groups in each file */ - if ((grp1_a=H5Gcreate (file_a, "grp1", (size_t)0))<0) goto error; - if ((grp2_a=H5Gcreate (file_a, "grp2", (size_t)0))<0) goto error; - if ((grp1_b=H5Gcreate (file_b, "grp1", (size_t)0))<0) goto error; - if ((grp2_b=H5Gcreate (file_b, "grp2", (size_t)0))<0) goto error; + if ((grp1_a=H5Gcreate (file_a, "grp1", (size_t)0))<0) TEST_ERROR; + if ((grp2_a=H5Gcreate (file_a, "grp2", (size_t)0))<0) TEST_ERROR; + if ((grp1_b=H5Gcreate (file_b, "grp1", (size_t)0))<0) TEST_ERROR; + if ((grp2_b=H5Gcreate (file_b, "grp2", (size_t)0))<0) TEST_ERROR; /* Create datasets */ - if((dset1=H5Dcreate(file_a, "dataset1", H5T_NATIVE_INT, scalar, - H5P_DEFAULT))<0) { - goto error; - } - if((dset2=H5Dcreate(grp1_a, "dataset2", H5T_NATIVE_INT, scalar, - H5P_DEFAULT))<0) { - goto error; - } + if((dset1=H5Dcreate(file_a, "dataset1", H5T_NATIVE_INT, scalar, H5P_DEFAULT))<0) TEST_ERROR; + if((dset2=H5Dcreate(grp1_a, "dataset2", H5T_NATIVE_INT, scalar, H5P_DEFAULT))<0) TEST_ERROR; /* Create links within a file. Both of source and destination use * H5G_SAME_LOC. Both hard and soft links should fail. */ H5E_BEGIN_TRY { - if(H5Glink2(H5G_SAME_LOC, "dataset1", H5G_LINK_HARD , H5G_SAME_LOC, - "hard")!=FAIL) goto error; + if(H5Glink2(H5G_SAME_LOC, "dataset1", H5G_LINK_HARD , H5G_SAME_LOC, "hard")!=FAIL) TEST_ERROR; } H5E_END_TRY; H5E_BEGIN_TRY { - if(H5Glink2(H5G_SAME_LOC, "dataset1", H5G_LINK_SOFT , H5G_SAME_LOC, - "soft")!=FAIL) goto error; + if(H5Glink2(H5G_SAME_LOC, "dataset1", H5G_LINK_SOFT , H5G_SAME_LOC, "soft")!=FAIL) TEST_ERROR; } H5E_END_TRY; /* Create links across files. Both hard and soft links should fail. */ H5E_BEGIN_TRY { - if(H5Glink2(file_a, "dataset1", H5G_LINK_HARD , file_b, - "hard")!=FAIL) goto error; + if(H5Glink2(file_a, "dataset1", H5G_LINK_HARD , file_b, "hard")!=FAIL) TEST_ERROR; } H5E_END_TRY; H5E_BEGIN_TRY { - if(H5Glink2(file_a, "dataset1", H5G_LINK_SOFT, file_b, "soft")!=FAIL) - goto error; + if(H5Glink2(file_a, "dataset1", H5G_LINK_SOFT, file_b, "soft")!=FAIL) TEST_ERROR; } H5E_END_TRY; /* Create links to test H5G_SAME_LOC, H5G_LINK_HARD, H5G_LINK_SOFT. */ - if(H5Glink2(grp1_a, "dataset2", H5G_LINK_HARD , H5G_SAME_LOC, - "hard1")<0) { - goto error; - } - if(H5Glink2(H5G_SAME_LOC, "dataset2", H5G_LINK_SOFT , grp1_a, - "soft1")<0) { - goto error; - } + if(H5Glink2(grp1_a, "dataset2", H5G_LINK_HARD , H5G_SAME_LOC, "hard1")<0) TEST_ERROR; + if(H5Glink2(H5G_SAME_LOC, "dataset2", H5G_LINK_SOFT , grp1_a, "soft1")<0) TEST_ERROR; /* Create links to test H5G_LINK_HARD, H5G_LINK_SOFT across different * locations. */ - if(H5Glink2(grp1_a, "dataset2", H5G_LINK_HARD, grp2_a, "hard2")<0) { - goto error; - } - if(H5Glink2(grp1_a, "/grp1/dataset2", H5G_LINK_SOFT , grp2_a, "soft2")<0) { - goto error; - } + if(H5Glink2(grp1_a, "dataset2", H5G_LINK_HARD, grp2_a, "hard2")<0) TEST_ERROR; + if(H5Glink2(grp1_a, "/grp1/dataset2", H5G_LINK_SOFT , grp2_a, "soft2")<0) TEST_ERROR; /* Close dataspace and files */ - if (H5Sclose (scalar)<0) goto error; - if (H5Dclose(dset1)<0) goto error; - if (H5Dclose(dset2)<0) goto error; - if (H5Gclose (grp1_a)<0) goto error; - if (H5Gclose (grp2_a)<0) goto error; - if (H5Gclose (grp1_b)<0) goto error; - if (H5Gclose (grp2_b)<0) goto error; - if (H5Fclose (file_a)<0) goto error; - if (H5Fclose (file_b)<0) goto error; + if (H5Sclose (scalar)<0) TEST_ERROR; + if (H5Dclose(dset1)<0) TEST_ERROR; + if (H5Dclose(dset2)<0) TEST_ERROR; + if (H5Gclose (grp1_a)<0) TEST_ERROR; + if (H5Gclose (grp2_a)<0) TEST_ERROR; + if (H5Gclose (grp1_b)<0) TEST_ERROR; + if (H5Gclose (grp2_b)<0) TEST_ERROR; + if (H5Fclose (file_a)<0) TEST_ERROR; + if (H5Fclose (file_b)<0) TEST_ERROR; PASSED(); return 0; @@ -257,16 +234,14 @@ cklinks(hid_t fapl) /* Open the file */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - if ((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl))<0) { - goto error; - } + if ((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl))<0) TEST_ERROR; /* Hard link */ - if (H5Gget_objinfo(file, "d1", TRUE, &sb1)<0) goto error; - if (H5Gget_objinfo(file, "grp1/hard", TRUE, &sb2)<0) goto error; + if (H5Gget_objinfo(file, "d1", TRUE, &sb1)<0) TEST_ERROR; + if (H5Gget_objinfo(file, "grp1/hard", TRUE, &sb2)<0) TEST_ERROR; if (H5G_DATASET!=sb2.type) { H5_FAILED(); - puts(" Unexpected object type should have been a dataset"); + printf(" %d: Unexpected object type should have been a dataset\n", __LINE__); goto error; } if (sb1.u.obj.objno!=sb2.u.obj.objno) { @@ -277,10 +252,10 @@ cklinks(hid_t fapl) } /* Symbolic link */ - if (H5Gget_objinfo(file, "grp1/soft", TRUE, &sb2)<0) goto error; + if (H5Gget_objinfo(file, "grp1/soft", TRUE, &sb2)<0) TEST_ERROR; if (H5G_DATASET!=sb2.type) { H5_FAILED(); - puts(" Unexpected object type should have been a dataset"); + printf(" %d: Unexpected object type should have been a dataset\n", __LINE__); goto error; } if (sb1.u.obj.objno!=sb2.u.obj.objno) { @@ -289,9 +264,7 @@ cklinks(hid_t fapl) puts(" expected file location."); goto error; } - if (H5Gget_linkval(file, "grp1/soft", sizeof linkval, linkval)<0) { - goto error; - } + if (H5Gget_linkval(file, "grp1/soft", sizeof linkval, linkval)<0) TEST_ERROR; if (HDstrcmp(linkval, "/d1")) { H5_FAILED(); puts(" Soft link test failed. Wrong link value"); @@ -307,13 +280,15 @@ cklinks(hid_t fapl) puts(" H5Gget_objinfo() should have failed for a dangling link."); goto error; } - if (H5Gget_objinfo(file, "grp1/dangle", FALSE, &sb2)<0) goto error; + if (H5Gget_objinfo(file, "grp1/dangle", FALSE, &sb2)<0) TEST_ERROR; if (H5G_LINK!=sb2.type) { H5_FAILED(); - puts(" Unexpected object type should have been a symbolic link"); + printf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__); goto error; } if (H5Gget_linkval(file, "grp1/dangle", sizeof linkval, linkval)<0) { + H5_FAILED(); + printf(" %d: Can't retrieve link value\n", __LINE__); goto error; } if (HDstrcmp(linkval, "foobar")) { @@ -331,13 +306,15 @@ cklinks(hid_t fapl) puts(" H5Gget_objinfo() should have failed for a recursive link."); goto error; } - if (H5Gget_objinfo(file, "grp1/recursive", FALSE, &sb2)<0) goto error; + if (H5Gget_objinfo(file, "grp1/recursive", FALSE, &sb2)<0) TEST_ERROR; if (H5G_LINK!=sb2.type) { H5_FAILED(); - puts(" Unexpected object type should have been a symbolic link"); + printf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__); goto error; } if (H5Gget_linkval(file, "grp1/recursive", sizeof linkval, linkval)<0) { + H5_FAILED(); + printf(" %d: Can't retrieve link value\n", __LINE__); goto error; } if (HDstrcmp(linkval, "/grp1/recursive")) { @@ -347,7 +324,7 @@ cklinks(hid_t fapl) } /* Cleanup */ - if (H5Fclose(file)<0) goto error; + if (H5Fclose(file)<0) TEST_ERROR; PASSED(); return 0; @@ -369,8 +346,6 @@ cklinks(hid_t fapl) * Programmer: Raymond Lu * Thursday, April 25, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -385,22 +360,20 @@ ck_new_links(hid_t fapl) /* Open the file */ h5_fixname(FILENAME[1], fapl, filename, sizeof filename); - if ((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl))<0) { - goto error; - } + if ((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl))<0) TEST_ERROR; /* Get hard link info */ if(H5Gget_objinfo(file, "/grp1/dataset2", TRUE, &sb_dset)<0) - goto error; + TEST_ERROR; if(H5Gget_objinfo(file, "/grp1/hard1", TRUE, &sb_hard1)<0) - goto error; + TEST_ERROR; if(H5Gget_objinfo(file, "/grp2/hard2", TRUE, &sb_hard2)<0) - goto error; + TEST_ERROR; /* Check hard links */ if(H5G_DATASET!=sb_hard1.type || H5G_DATASET!=sb_hard2.type) { H5_FAILED(); - puts(" Unexpected object type, should have been a dataset"); + printf(" %d: Unexpected object type should have been a dataset\n", __LINE__); goto error; } if( sb_dset.u.obj.objno!=sb_hard1.u.obj.objno || sb_dset.u.obj.objno!=sb_hard2.u.obj.objno ) { @@ -411,34 +384,33 @@ ck_new_links(hid_t fapl) } /* Get soft link info */ - if(H5Gget_objinfo(file, "/grp1/soft1", TRUE, &sb_soft1)<0) goto error; - if(H5Gget_objinfo(file, "/grp2/soft2", TRUE, &sb_soft2)<0) goto error; + if(H5Gget_objinfo(file, "/grp1/soft1", TRUE, &sb_soft1)<0) TEST_ERROR; + if(H5Gget_objinfo(file, "/grp2/soft2", TRUE, &sb_soft2)<0) TEST_ERROR; /* Check soft links */ if(H5G_DATASET!=sb_soft1.type || H5G_DATASET!=sb_soft2.type) { H5_FAILED(); - puts(" Unexpected object type, should have been a dataset"); - goto error; + printf(" %d: Unexpected object type should have been a dataset\n", __LINE__); + TEST_ERROR; } if( sb_dset.u.obj.objno!=sb_soft1.u.obj.objno || sb_dset.u.obj.objno!=sb_soft2.u.obj.objno ) { H5_FAILED(); puts(" Soft link test failed. Link seems not to point to the "); puts(" expected file location."); - goto error; + TEST_ERROR; } - if (H5Gget_linkval(file, "grp2/soft2", sizeof linkval, linkval)<0) { - goto error; - } + if (H5Gget_linkval(file, "grp2/soft2", sizeof linkval, linkval)<0) + TEST_ERROR; if (HDstrcmp(linkval, "/grp1/dataset2")) { H5_FAILED(); puts(" Soft link test failed. Wrong link value"); - goto error; + TEST_ERROR; } /* Cleanup */ - if(H5Fclose(file)<0) goto error; + if(H5Fclose(file)<0) TEST_ERROR; PASSED(); return 0; @@ -660,9 +632,9 @@ toomany(hid_t fapl) error: H5E_BEGIN_TRY { - H5Gclose (gid2); - H5Gclose (gid); - H5Fclose (fid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid); } H5E_END_TRY; return -1; } /* end toomany() */ @@ -711,3 +683,4 @@ main(void) h5_cleanup(FILENAME, fapl); return 0; } + diff --git a/test/mount.c b/test/mount.c index 6c19143..a0c5842 100644 --- a/test/mount.c +++ b/test/mount.c @@ -336,7 +336,7 @@ test_hide(hid_t fapl) static int test_assoc(hid_t fapl) { - hid_t file1=-1, file2=-1; + hid_t file1 = -1, file2 = -1; H5G_stat_t sb1, sb2; char filename1[1024], filename2[1024]; @@ -345,35 +345,42 @@ test_assoc(hid_t fapl) h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); /* Open the files */ - 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) + TEST_ERROR /* Get information about the root of file2 */ - if (H5Gget_objinfo(file2, "/", TRUE, &sb1)<0) goto error; + if(H5Gget_objinfo(file2, "/", TRUE, &sb1) < 0) + TEST_ERROR /* Create the virtual file */ - if (H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT)<0) goto error; + if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) + TEST_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) goto error; - if (sb1.fileno!=sb2.fileno || sb1.u.obj.objno!=sb2.u.obj.objno) { + if(H5Gget_objinfo(file1, "/mnt1", TRUE, &sb2) < 0) + TEST_ERROR + if(sb1.fileno != sb2.fileno || sb1.u.obj.objno != sb2.u.obj.objno) { H5_FAILED(); puts(" Association failed."); - goto error; + AT(); + goto error; } /* Shut down */ - 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) + TEST_ERROR + if(H5Fclose(file1) < 0) + TEST_ERROR + if(H5Fclose(file2) < 0) + TEST_ERROR PASSED(); return 0; - error: +error: H5E_BEGIN_TRY { H5Fclose(file2); H5Fclose(file1); diff --git a/test/objcopy.c b/test/objcopy.c index 43d5373..9d05ead 100755 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -41,6 +41,7 @@ const char *FILENAME[] = { #define NAME_DATASET_MULTI_OHDR "dataset_multi_ohdr" #define NAME_DATASET_MULTI_OHDR2 "dataset_multi_ohdr2" #define NAME_DATASET_VL "dataset_vl" +#define NAME_GROUP_UNCOPIED "/uncopied" #define NAME_GROUP_EMPTY "/empty" #define NAME_GROUP_TOP "/g0" #define NAME_GROUP_SUB "/g0/g00" @@ -123,7 +124,7 @@ addr_lookup(H5G_stat_t *sb) { size_t n; - if (sb->u.obj.nlink<2) return NULL; /*only one link possible*/ + if (sb->u.obj.nlink<2) return FALSE; /*only one link possible*/ for(n = 0; n < idtab_g.nobjs; n++) if(idtab_g.obj[n] == sb->u.obj.objno) @@ -740,6 +741,9 @@ test_copy_named_datatype(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; + /* open the datatype for copy */ if ( (tid = H5Topen(fid_src, NAME_DATATYPE_SIMPLE)) < 0) TEST_ERROR; @@ -854,6 +858,9 @@ test_copy_dataset_simple(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; + /* open the dataset for copy */ if ( (did = H5Dopen(fid_src, NAME_DATASET_SIMPLE)) < 0) TEST_ERROR; @@ -958,6 +965,9 @@ test_copy_dataset_simple_empty(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; + /* open the dataset for copy */ if ( (did = H5Dopen(fid_src, NAME_DATASET_SIMPLE)) < 0) TEST_ERROR; @@ -1085,6 +1095,9 @@ test_copy_dataset_compound(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; + /* open the dataset for copy */ if ( (did = H5Dopen(fid_src, NAME_DATASET_COMPOUND)) < 0) TEST_ERROR; @@ -1210,6 +1223,9 @@ test_copy_dataset_chunked(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; + /* open the dataset for copy */ if ( (did = H5Dopen(fid_src, NAME_DATASET_CHUNKED)) < 0) TEST_ERROR; @@ -1324,6 +1340,9 @@ test_copy_dataset_chunked_empty(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; + /* open the dataset for copy */ if ( (did = H5Dopen(fid_src, NAME_DATASET_CHUNKED)) < 0) TEST_ERROR; @@ -1459,6 +1478,9 @@ test_copy_dataset_chunked_sparse(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; + /* open the dataset for copy */ if ( (did = H5Dopen(fid_src, NAME_DATASET_CHUNKED)) < 0) TEST_ERROR; @@ -1584,6 +1606,9 @@ test_copy_dataset_compressed(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; + /* open the dataset for copy */ if ( (did = H5Dopen(fid_src, NAME_DATASET_CHUNKED)) < 0) TEST_ERROR; @@ -1707,6 +1732,9 @@ test_copy_dataset_compact(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; + /* open the dataset for copy */ if ( (did = H5Dopen(fid_src, NAME_DATASET_COMPACT)) < 0) TEST_ERROR; @@ -1831,6 +1859,16 @@ test_copy_dataset_external(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; +/* Don't change the address in the destination file for this test, it causes the + * external file list's heap to be at a different location and generates a false + * negative for this test. The test is _slightly_ weaker because of this, but + * I can't see any easy way around it. -QAK + */ +#if 0 + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; +#endif /* 0 */ + /* open the dataset for copy */ if ( (did = H5Dopen(fid_src, NAME_DATASET_EXTERNAL)) < 0) TEST_ERROR; @@ -1949,6 +1987,9 @@ test_copy_dataset_named_dtype(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; + /* open the dataset for copy */ if ( (did = H5Dopen(fid_src, NAME_DATASET_NAMED_DTYPE)) < 0) TEST_ERROR; @@ -2083,6 +2124,9 @@ test_copy_dataset_named_dtype_hier(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; + /* open the group for copy */ if ( (gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR; @@ -2219,6 +2263,9 @@ test_copy_dataset_named_dtype_hier_outside(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; + /* open the group for copy */ if ( (gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR; @@ -2350,6 +2397,9 @@ test_copy_dataset_multi_ohdr_chunks(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; + /* open the group for copy */ if ( (gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR; @@ -2488,6 +2538,9 @@ test_copy_dataset_attr_named_dtype(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; + /* open the group for copy */ if ( (gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR; @@ -2619,6 +2672,9 @@ test_copy_dataset_vl(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; + /* open the dataset for copy */ if ( (did = H5Dopen(fid_src, NAME_DATASET_VL)) < 0) TEST_ERROR; @@ -2716,6 +2772,9 @@ test_copy_group_empty(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; + /* open the group for copy */ if ( (gid = H5Gopen(fid_src, NAME_GROUP_EMPTY)) < 0) TEST_ERROR; @@ -2844,6 +2903,9 @@ test_copy_group(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; + /* open the group for copy */ if ( (gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR; @@ -2983,6 +3045,9 @@ test_copy_group_deep(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; + /* open the group for copy */ if ( (gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR; @@ -3091,6 +3156,9 @@ test_copy_group_loop(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; + /* open the group for copy */ if ( (gid = H5Gopen(fid_src, NAME_GROUP_TOP)) < 0) TEST_ERROR; @@ -3218,6 +3286,9 @@ test_copy_link(hid_t fapl) /* create destination file */ if ( (fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if ( H5Gclose(H5Gcreate(fid_dst, NAME_GROUP_UNCOPIED, (size_t)0)) < 0) TEST_ERROR; + /* open the group for copy */ if ( (gid = H5Gopen(fid_src, NAME_GROUP_LINK)) < 0) TEST_ERROR; diff --git a/test/ohdr.c b/test/ohdr.c index 355c9ff..44b6361 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -63,7 +63,7 @@ main(void) hid_t dset=-1; H5F_t *f=NULL; char filename[1024]; - H5G_entry_t oh_ent; + H5O_loc_t oh_loc; time_t time_new, ro; int i; @@ -82,8 +82,8 @@ main(void) * Test object header creation */ TESTING("object header creation"); - HDmemset(&oh_ent,0,sizeof(H5G_entry_t)); - if (H5O_create(f, H5P_DATASET_XFER_DEFAULT, 64, &oh_ent/*out*/)<0) { + HDmemset(&oh_loc, 0, sizeof(oh_loc)); + if (H5O_create(f, H5P_DATASET_XFER_DEFAULT, 64, &oh_loc/*out*/)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; @@ -93,7 +93,7 @@ main(void) /* create a new message */ TESTING("message creation"); time_new = 11111111; - if (H5O_modify(&oh_ent, H5O_MTIME_NEW_ID, H5O_NEW_MESG, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) { + if (H5O_modify(&oh_loc, H5O_MTIME_NEW_ID, H5O_NEW_MESG, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; @@ -103,7 +103,7 @@ main(void) H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } - if (NULL==H5O_read(&oh_ent, H5O_MTIME_NEW_ID, 0, &ro, H5P_DATASET_XFER_DEFAULT)) { + if (NULL==H5O_read(&oh_loc, H5O_MTIME_NEW_ID, 0, &ro, H5P_DATASET_XFER_DEFAULT)) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; @@ -121,7 +121,7 @@ main(void) */ TESTING("message modification"); time_new = 33333333; - if (H5O_modify(&oh_ent, H5O_MTIME_NEW_ID, 0, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) { + if (H5O_modify(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; @@ -131,7 +131,7 @@ main(void) H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } - if (NULL==H5O_read(&oh_ent, H5O_MTIME_NEW_ID, 0, &ro, H5P_DATASET_XFER_DEFAULT)) { + if (NULL==H5O_read(&oh_loc, H5O_MTIME_NEW_ID, 0, &ro, H5P_DATASET_XFER_DEFAULT)) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; @@ -150,7 +150,7 @@ main(void) */ TESTING("duplicate message creation"); time_new = 55555555; - if (H5O_modify(&oh_ent, H5O_MTIME_NEW_ID, H5O_NEW_MESG, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) { + if (H5O_modify(&oh_loc, H5O_MTIME_NEW_ID, H5O_NEW_MESG, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; @@ -160,7 +160,7 @@ main(void) H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } - if (NULL==H5O_read(&oh_ent, H5O_MTIME_NEW_ID, 1, &ro, H5P_DATASET_XFER_DEFAULT)) { + if (NULL==H5O_read(&oh_loc, H5O_MTIME_NEW_ID, 1, &ro, H5P_DATASET_XFER_DEFAULT)) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; @@ -178,7 +178,7 @@ main(void) */ TESTING("duplicate message modification"); time_new = 77777777; - if (H5O_modify(&oh_ent, H5O_MTIME_NEW_ID, 1, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) { + if (H5O_modify(&oh_loc, H5O_MTIME_NEW_ID, 1, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; @@ -188,7 +188,7 @@ main(void) H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } - if (NULL==H5O_read(&oh_ent, H5O_MTIME_NEW_ID, 1, &ro, H5P_DATASET_XFER_DEFAULT)) { + if (NULL==H5O_read(&oh_loc, H5O_MTIME_NEW_ID, 1, &ro, H5P_DATASET_XFER_DEFAULT)) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; @@ -212,7 +212,7 @@ main(void) TESTING("object header overflow in memory"); for (i=0; i<40; i++) { time_new = (i+1)*1000+1; - if (H5O_modify(&oh_ent, H5O_MTIME_ID, H5O_NEW_MESG, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) { + if (H5O_modify(&oh_loc, H5O_MTIME_ID, H5O_NEW_MESG, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; @@ -232,7 +232,7 @@ main(void) TESTING("object header overflow on disk"); for (i=0; i<10; i++) { time_new = (i + 1) * 1000 + 10; - if (H5O_modify(&oh_ent, H5O_MTIME_NEW_ID, H5O_NEW_MESG, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) { + if (H5O_modify(&oh_loc, H5O_MTIME_NEW_ID, H5O_NEW_MESG, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; @@ -249,23 +249,23 @@ main(void) * Delete all time messages. */ TESTING("message deletion"); - if (H5O_remove(&oh_ent, H5O_MTIME_NEW_ID, H5O_ALL, TRUE, H5P_DATASET_XFER_DEFAULT)<0) { + if (H5O_remove(&oh_loc, H5O_MTIME_NEW_ID, H5O_ALL, TRUE, H5P_DATASET_XFER_DEFAULT)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } - if (H5O_remove(&oh_ent, H5O_MTIME_ID, H5O_ALL, TRUE, H5P_DATASET_XFER_DEFAULT)<0) { + if (H5O_remove(&oh_loc, H5O_MTIME_ID, H5O_ALL, TRUE, H5P_DATASET_XFER_DEFAULT)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } - if (H5O_read(&oh_ent, H5O_MTIME_NEW_ID, 0, &ro, H5P_DATASET_XFER_DEFAULT)) { + if (H5O_read(&oh_loc, H5O_MTIME_NEW_ID, 0, &ro, H5P_DATASET_XFER_DEFAULT)) { H5_FAILED(); puts(" H5O_read() should have failed but didn't"); H5Eclear_stack(H5E_DEFAULT); goto error; } - if (H5O_read(&oh_ent, H5O_MTIME_ID, 0, &ro, H5P_DATASET_XFER_DEFAULT)) { + if (H5O_read(&oh_loc, H5O_MTIME_ID, 0, &ro, H5P_DATASET_XFER_DEFAULT)) { H5_FAILED(); puts(" H5O_read() should have failed but didn't"); H5Eclear_stack(H5E_DEFAULT); @@ -276,7 +276,7 @@ main(void) /* release resources */ TESTING("object header closing"); - if (H5O_close(&oh_ent)<0) { + if (H5O_close(&oh_loc)<0) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); goto error; diff --git a/test/sheap.c b/test/sheap.c index a7eda39..9b3362c 100644 --- a/test/sheap.c +++ b/test/sheap.c @@ -153,7 +153,11 @@ test_allocate_simple(hid_t fapl) H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ - if(obj_addr != 1178) TEST_ERROR; +#ifdef H5_HAVE_LARGE_HSIZET + if(obj_addr != 530) TEST_ERROR; +#else /* H5_HAVE_LARGE_HSIZET */ + if(obj_addr != 478) TEST_ERROR; +#endif /* H5_HAVE_LARGE_HSIZET */ PASSED(); @@ -166,7 +170,11 @@ test_allocate_simple(hid_t fapl) H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ - if(obj_addr != 1188) TEST_ERROR; +#ifdef H5_HAVE_LARGE_HSIZET + if(obj_addr != 540) TEST_ERROR; +#else /* H5_HAVE_LARGE_HSIZET */ + if(obj_addr != 488) TEST_ERROR; +#endif /* H5_HAVE_LARGE_HSIZET */ PASSED(); @@ -179,7 +187,11 @@ test_allocate_simple(hid_t fapl) H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ - if(obj_addr != 6298) TEST_ERROR; +#ifdef H5_HAVE_LARGE_HSIZET + if(obj_addr != 5650) TEST_ERROR; +#else /* H5_HAVE_LARGE_HSIZET */ + if(obj_addr != 5598) TEST_ERROR; +#endif /* H5_HAVE_LARGE_HSIZET */ PASSED(); @@ -192,7 +204,11 @@ test_allocate_simple(hid_t fapl) H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } /* end if */ - if(obj_addr != 6810) TEST_ERROR; +#ifdef H5_HAVE_LARGE_HSIZET + if(obj_addr != 6162) TEST_ERROR; +#else /* H5_HAVE_LARGE_HSIZET */ + if(obj_addr != 6110) TEST_ERROR; +#endif /* H5_HAVE_LARGE_HSIZET */ PASSED(); diff --git a/test/stab.c b/test/stab.c index 947825c..33c0fce 100644 --- a/test/stab.c +++ b/test/stab.c @@ -16,13 +16,14 @@ * Programmer: Robb Matzke <matzke@llnl.gov> * Tuesday, November 24, 1998 */ -#include "h5test.h" -/* - * This file needs to access private datatypes from the H5G package. - */ -#define H5G_PACKAGE -#include "H5Gpkg.h" +#define H5G_PACKAGE /*suppress error about including H5Gpkg */ + +/* Define this macro to indicate that the testing APIs should be available */ +#define H5G_TESTING + +#include "h5test.h" +#include "H5Gpkg.h" /* Groups */ const char *FILENAME[] = { "stab1", @@ -30,6 +31,40 @@ const char *FILENAME[] = { NULL }; +#define NAME_BUF_SIZE 1024 + +/* Definitions for 'lifecycle' test */ +#define LIFECYCLE_TOP_GROUP "top" +#define LIFECYCLE_BOTTOM_GROUP "bottom %u" +#define LIFECYCLE_MAX_COMPACT 4 +#define LIFECYCLE_MIN_DENSE 3 +#define LIFECYCLE_EST_NUM_ENTRIES 3 +#define LIFECYCLE_EST_NAME_LEN 10 + +/* Definitions for 'long_compact' test */ +#define LONG_COMPACT_LENGTH ((64 * 1024) + 1024) + +/* Definitions for 'read_old' test */ +#define READ_OLD_NGROUPS 100 +#define READ_OLD_BUFSIZE 1024 + +/* The group_old.h5 is generated from gen_old_fill.c in HDF5 'test' directory + * for version 1.6. To get this data file, simply compile gen_old_group.c with + * the HDF5 library in that branch and run it. */ +#define FILE_OLD_GROUPS "group_old.h5" + +/* Definitions for 'no_compact' test */ +#define NO_COMPACT_TOP_GROUP "top" +#define NO_COMPACT_BOTTOM_GROUP "bottom %u" +#define NO_COMPACT_MAX_COMPACT 0 +#define NO_COMPACT_MIN_DENSE 0 + +/* Definitions for 'no_compact' test */ +#define GCPL_ON_ROOT_MIDDLE_GROUP "/middle" +#define GCPL_ON_ROOT_BOTTOM_GROUP "/middle/bottom" +#define GCPL_ON_ROOT_MAX_COMPACT 4 +#define GCPL_ON_ROOT_MIN_DENSE 2 + /*------------------------------------------------------------------------- * Function: test_misc @@ -127,11 +162,11 @@ test_long(hid_t file) TESTING("long names"); /* Group names */ - name1 = malloc(namesize); + name1 = HDmalloc(namesize); for (i=0; i<namesize; i++) name1[i] = (char)('A' + i%26); name1[namesize-1] = '\0'; - name2 = malloc(2*namesize + 2); + name2 = HDmalloc(2*namesize + 2); sprintf(name2, "%s/%s", name1, name1); /* Create groups */ @@ -146,6 +181,10 @@ test_long(hid_t file) H5Gclose(g1); H5Gclose(g2); + /* Release name buffers */ + HDfree(name2); + HDfree(name1); + PASSED(); return 0; @@ -153,6 +192,10 @@ test_long(hid_t file) H5E_BEGIN_TRY { H5Gclose(g1); H5Gclose(g2); + if(name2) + free(name2); + if(name1) + free(name1); } H5E_END_TRY; return 1; } @@ -214,6 +257,674 @@ test_large(hid_t file) /*------------------------------------------------------------------------- + * Function: lifecycle + * + * Purpose: Test that adding links to a group follow proper "lifecycle" + * of empty->compact->symbol table->compact->empty. (As group + * is created, links are added, then links removed) + * + * Return: Success: 0 + * + * Failure: -1 + * + * Programmer: Quincey Koziol + * Monday, October 17, 2005 + * + *------------------------------------------------------------------------- + */ +static int +lifecycle(hid_t fapl) +{ + hid_t fid = (-1); /* File ID */ + hid_t gid = (-1); /* Group ID */ + hid_t gid2 = (-1); /* Datatype ID */ + hid_t gcpl = (-1); /* Group creation property list ID */ + size_t lheap_size_hint; /* Local heap size hint */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + unsigned est_num_entries; /* Estimated # of entries in group */ + unsigned est_name_len; /* Estimated length of entry name */ + unsigned nmsgs; /* Number of messages in group's header */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename[NAME_BUF_SIZE]; + off_t empty_size; /* Size of an empty file */ + unsigned u; /* Local index variable */ + off_t file_size; /* Size of each file created */ + + TESTING("group lifecycle"); + + /* Create file */ + h5_fixname(FILENAME[1], fapl, filename, sizeof(filename)); + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + + /* Close file */ + if(H5Fclose(fid) < 0) TEST_ERROR; + + /* Get size of file as empty */ + if((empty_size = h5_get_file_size(filename)) == 0) TEST_ERROR; + + /* Re-open file */ + if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR; + + /* Set up group creation property list */ + if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) TEST_ERROR; + + /* Query default group creation property settings */ + if(H5Pget_local_heap_size_hint(gcpl, &lheap_size_hint) < 0) TEST_ERROR; + if(lheap_size_hint != H5G_CRT_GINFO_LHEAP_SIZE_HINT) TEST_ERROR; + if(H5Pget_link_phase_change(gcpl, &max_compact, &min_dense) < 0) TEST_ERROR; + if(max_compact != H5G_CRT_GINFO_MAX_COMPACT) TEST_ERROR; + if(min_dense != H5G_CRT_GINFO_MIN_DENSE) TEST_ERROR; + if(H5Pget_est_link_info(gcpl, &est_num_entries, &est_name_len) < 0) TEST_ERROR; + if(est_num_entries != H5G_CRT_GINFO_EST_NUM_ENTRIES) TEST_ERROR; + if(est_name_len != H5G_CRT_GINFO_EST_NAME_LEN) TEST_ERROR; + + /* Set GCPL parameters */ + if(H5Pset_link_phase_change(gcpl, LIFECYCLE_MAX_COMPACT, LIFECYCLE_MIN_DENSE) < 0) TEST_ERROR; + if(H5Pset_est_link_info(gcpl, LIFECYCLE_EST_NUM_ENTRIES, LIFECYCLE_EST_NAME_LEN) < 0) TEST_ERROR; + + /* Create group for testing lifecycle */ + if((gid = H5Gcreate_expand(fid, LIFECYCLE_TOP_GROUP, gcpl, H5P_DEFAULT)) < 0) TEST_ERROR + + /* Query default group creation property settings */ + if(H5Pget_link_phase_change(gcpl, &max_compact, &min_dense) < 0) TEST_ERROR; + if(max_compact != LIFECYCLE_MAX_COMPACT) TEST_ERROR; + if(min_dense != LIFECYCLE_MIN_DENSE) TEST_ERROR; + if(H5Pget_est_link_info(gcpl, &est_num_entries, &est_name_len) < 0) TEST_ERROR; + if(est_num_entries != LIFECYCLE_EST_NUM_ENTRIES) TEST_ERROR; + if(est_name_len != LIFECYCLE_EST_NAME_LEN) TEST_ERROR; + + /* Use internal testing routine to check that the group has no links or symbol table */ + if(H5G_is_empty_test(gid) != TRUE) TEST_ERROR; + + /* Create first "bottom" group */ + sprintf(objname, LIFECYCLE_BOTTOM_GROUP, (unsigned)0); + if((gid2 = H5Gcreate(gid, objname, (size_t)0)) < 0) TEST_ERROR + + /* Check on bottom group's status */ + if(H5G_is_empty_test(gid2) != TRUE) TEST_ERROR; + + /* Close bottom group */ + if(H5Gclose(gid2) < 0) TEST_ERROR + + /* Check on top group's status */ + if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR; + if(H5G_has_links_test(gid, &nmsgs) != TRUE) TEST_ERROR; + if(nmsgs != 1) TEST_ERROR; + + /* Create several more bottom groups, to push the top group almost to a symbol table */ + /* (Start counting at '1', since we've already created one bottom group */ + for(u = 1; u < LIFECYCLE_MAX_COMPACT; u++) { + sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); + if((gid2 = H5Gcreate(gid, objname, (size_t)0)) < 0) TEST_ERROR + + /* Check on bottom group's status */ + if(H5G_is_empty_test(gid2) != TRUE) TEST_ERROR; + + /* Close bottom group */ + if(H5Gclose(gid2) < 0) TEST_ERROR + } /* end for */ + + /* Check on top group's status */ + if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR; + if(H5G_has_links_test(gid, &nmsgs) != TRUE) TEST_ERROR; + if(nmsgs != LIFECYCLE_MAX_COMPACT) TEST_ERROR; + + /* Create one more "bottom" group, which should push top group into using a symbol table */ + sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); + if((gid2 = H5Gcreate(gid, objname, (size_t)0)) < 0) TEST_ERROR + + /* Check on bottom group's status */ + if(H5G_is_empty_test(gid2) != TRUE) TEST_ERROR; + + /* Close bottom group */ + if(H5Gclose(gid2) < 0) TEST_ERROR + + /* Check on top group's status */ + if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR; + if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR; + if(H5G_has_stab_test(gid) != TRUE) TEST_ERROR; + + /* Unlink objects from top group */ + while(u >= LIFECYCLE_MIN_DENSE) { + sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); + + if(H5Gunlink(gid, objname) < 0) TEST_ERROR + + u--; + } /* end while */ + + /* Check on top group's status */ + if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR; + if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR; + if(H5G_has_stab_test(gid) != TRUE) TEST_ERROR; + + /* Unlink one more object from the group, which should transform back to using links */ + sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); + if(H5Gunlink(gid, objname) < 0) TEST_ERROR + u--; + + /* Check on top group's status */ + if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR; + if(H5G_has_links_test(gid, &nmsgs) != TRUE) TEST_ERROR; + if(nmsgs != (LIFECYCLE_MIN_DENSE - 1)) TEST_ERROR; + + /* Unlink last two objects from top group */ + sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); + if(H5Gunlink(gid, objname) < 0) TEST_ERROR + u--; + sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); + if(H5Gunlink(gid, objname) < 0) TEST_ERROR + + /* Check on top group's status */ + if(H5G_is_empty_test(gid) != TRUE) TEST_ERROR; + + /* Close top group */ + if(H5Gclose(gid) < 0) TEST_ERROR; + + /* Unlink top group */ + if(H5Gunlink(fid, LIFECYCLE_TOP_GROUP) < 0) TEST_ERROR + + /* Close GCPL */ + if(H5Pclose(gcpl) < 0) TEST_ERROR; + + /* Close file */ + if(H5Fclose(fid) < 0) TEST_ERROR; + + /* Get size of file as empty */ + if((file_size = h5_get_file_size(filename)) == 0) TEST_ERROR; + + /* Verify that file is correct size */ + if(file_size != empty_size) TEST_ERROR; + + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Gclose(gcpl); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid); + } H5E_END_TRY; + return 1; +} /* end lifecycle() */ + + +/*------------------------------------------------------------------------- + * Function: long_compact + * + * Purpose: Test that long links are correctly _not_ put into compact + * form. + * + * Return: Success: 0 + * + * Failure: -1 + * + * Programmer: Quincey Koziol + * Tuesday, October 18, 2005 + * + *------------------------------------------------------------------------- + */ +static int +long_compact(hid_t fapl) +{ + hid_t fid = (-1); /* File ID */ + hid_t gid = (-1); /* Group ID */ + hid_t gid2 = (-1); /* Group ID */ + char *objname; /* Object name */ + char filename[NAME_BUF_SIZE]; + off_t empty_size; /* Size of an empty file */ + off_t file_size; /* Size of each file created */ + + TESTING("long link names in compact groups"); + + /* Create file */ + h5_fixname(FILENAME[1], fapl, filename, sizeof(filename)); + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + + /* Close file */ + if(H5Fclose(fid) < 0) TEST_ERROR + + /* Get size of file as empty */ + if((empty_size = h5_get_file_size(filename)) == 0) TEST_ERROR + + /* Construct very long object name template */ + if((objname = HDmalloc(LONG_COMPACT_LENGTH+1)) == NULL) TEST_ERROR + HDmemset(objname, 'a', LONG_COMPACT_LENGTH); + objname[LONG_COMPACT_LENGTH] = '\0'; + + /* Re-open file */ + if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR + + /* Create top group */ + if((gid = H5Gcreate(fid, "top", (size_t)0)) < 0) TEST_ERROR + + /* Use internal testing routine to check that the group has no links or symbol table */ + if(H5G_is_empty_test(gid) != TRUE) TEST_ERROR + + /* Create first group with "long" name */ + if((gid2 = H5Gcreate(gid, objname, (size_t)0)) < 0) TEST_ERROR + + /* Check on bottom group's status */ + if(H5G_is_empty_test(gid2) != TRUE) TEST_ERROR + + /* Close bottom group */ + if(H5Gclose(gid2) < 0) TEST_ERROR + + /* Check on top group's status */ + /* (Should have symbol table to hold links, since name is too long for object header message) */ + if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR + if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR + if(H5G_has_stab_test(gid) != TRUE) TEST_ERROR + + /* Create second group with "long" name */ + objname[0] = 'b'; + if((gid2 = H5Gcreate(gid, objname, (size_t)0)) < 0) TEST_ERROR + + /* Check on bottom group's status */ + if(H5G_is_empty_test(gid2) != TRUE) TEST_ERROR; + + /* Close bottom group */ + if(H5Gclose(gid2) < 0) TEST_ERROR + + /* Check on top group's status */ + /* (Should have symbol table to hold links, since name is too long for object header message) */ + if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR + if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR + if(H5G_has_stab_test(gid) != TRUE) TEST_ERROR + + /* Unlink second object from top group */ + if(H5Gunlink(gid, objname) < 0) TEST_ERROR + + /* Check on top group's status */ + /* (Should still be symbol table to hold links, since name is too long for object header message) */ + if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR + if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR + if(H5G_has_stab_test(gid) != TRUE) TEST_ERROR + + /* Unlink first object from top group */ + objname[0] = 'a'; + if(H5Gunlink(gid, objname) < 0) TEST_ERROR + + /* Check on top group's status */ + /* (Should have deleted the symbol table now) */ + if(H5G_is_empty_test(gid) != TRUE) TEST_ERROR; + + /* Free object name */ + HDfree(objname); + + /* Close top group */ + if(H5Gclose(gid) < 0) TEST_ERROR + + /* Unlink top group */ + if(H5Gunlink(fid, "top") < 0) TEST_ERROR + + /* Close file */ + if(H5Fclose(fid) < 0) TEST_ERROR + + /* Get size of file as empty */ + if((file_size = h5_get_file_size(filename)) == 0) TEST_ERROR; + + /* Verify that file is correct size */ + if(file_size != empty_size) TEST_ERROR; + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid); + } H5E_END_TRY; + return 1; +} /* end long_compact() */ + + +/*------------------------------------------------------------------------- + * Function: read_old + * + * Purpose: Test reading a file with "old style" (symbol table) groups + * + * Return: Success: 0 + * + * Failure: -1 + * + * Programmer: Quincey Koziol + * Monday, October 24, 2005 + * + *------------------------------------------------------------------------- + */ +static int +read_old(hid_t fapl) +{ + int fd_old = (-1), fd_new = (-1); /* File descriptors for copying data */ + hid_t fid = (-1); /* File ID */ + hid_t gid = (-1); /* Group ID */ + hid_t gid2 = (-1); /* Group ID */ + char buf[READ_OLD_BUFSIZE]; /* Buffer for copying data */ + ssize_t nread; /* Number of bytes read in */ + char objname[NAME_BUF_SIZE]; /* Object name */ + unsigned u; /* Local index variable */ + char *srcdir = HDgetenv("srcdir"); /* where the src code is located */ + char filename[512]=""; /* old test file name */ + char filename2[NAME_BUF_SIZE]; /* copy of old test file */ + + TESTING("reading old groups"); + + /* Generate correct name for test file by prepending the source path */ + if(srcdir && ((HDstrlen(srcdir) + HDstrlen(FILE_OLD_GROUPS) + 1) < sizeof(filename))) { + HDstrcpy(filename, srcdir); + HDstrcat(filename, "/"); + } + HDstrcat(filename, FILE_OLD_GROUPS); + + /* Create filename */ + h5_fixname(FILENAME[1], fapl, filename2, sizeof(filename2)); + + /* Copy old file into temporary file */ + if((fd_old = HDopen(filename, O_RDONLY, 0666)) < 0) TEST_ERROR + if((fd_new = HDopen(filename2, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0) TEST_ERROR + + /* Copy data */ + while((nread = HDread(fd_old, buf, (size_t)READ_OLD_BUFSIZE)) > 0) + HDwrite(fd_new, buf, (size_t)nread); + + /* Close files */ + if(HDclose(fd_old) < 0) TEST_ERROR + if(HDclose(fd_new) < 0) TEST_ERROR + + + /* Open copied file */ + if((fid = H5Fopen(filename2, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR + + /* Attempt to open "old" group */ + if((gid = H5Gopen(fid, "old")) < 0) TEST_ERROR + + /* Check on old group's status */ + if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR + if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR + if(H5G_has_stab_test(gid) != TRUE) TEST_ERROR + + /* Create a bunch of objects in the group */ + for(u = 0; u < READ_OLD_NGROUPS; u++) { + sprintf(objname, "Group %u", u); + if((gid2 = H5Gcreate(gid, objname, (size_t)0)) < 0) TEST_ERROR + + /* Check on bottom group's status */ + if(H5G_is_empty_test(gid2) != TRUE) TEST_ERROR + + /* Close bottom group */ + if(H5Gclose(gid2) < 0) TEST_ERROR + } /* end for */ + + /* Check on old group's status */ + /* (Should stay in old "symbol table" form) */ + if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR + if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR + if(H5G_has_stab_test(gid) != TRUE) TEST_ERROR + + /* Delete new objects from old group */ + for(u = 0; u < READ_OLD_NGROUPS; u++) { + sprintf(objname, "Group %u", u); + if(H5Gunlink(gid, objname) < 0) TEST_ERROR + } /* end for */ + + /* Check on old group's status */ + /* (Should stay in old "symbol table" form) */ + if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR + if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR + if(H5G_has_stab_test(gid) != TRUE) TEST_ERROR + + /* Close old group */ + if(H5Gclose(gid) < 0) TEST_ERROR; + + /* Close first file */ + if(H5Fclose(fid)<0) TEST_ERROR; + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Gclose(gid); + H5Fclose(fid); + } H5E_END_TRY; + return 1; +} /* end read_old() */ + + +/*------------------------------------------------------------------------- + * Function: no_compact + * + * Purpose: Test that its possible to create groups that don't use the + * compact form directly (and don't use link messages). + * + * Return: Success: 0 + * + * Failure: -1 + * + * Programmer: Quincey Koziol + * Tuesday, October 25, 2005 + * + *------------------------------------------------------------------------- + */ +static int +no_compact(hid_t fapl) +{ + hid_t fid = (-1); /* File ID */ + hid_t gid = (-1); /* Group ID */ + hid_t gid2 = (-1); /* Datatype ID */ + hid_t gcpl = (-1); /* Group creation property list ID */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename[NAME_BUF_SIZE]; + off_t empty_size; /* Size of an empty file */ + off_t file_size; /* Size of each file created */ + + TESTING("group without compact form"); + + /* Create file */ + h5_fixname(FILENAME[1], fapl, filename, sizeof(filename)); + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + + /* Close file */ + if(H5Fclose(fid) < 0) TEST_ERROR; + + /* Get size of file as empty */ + if((empty_size = h5_get_file_size(filename)) == 0) TEST_ERROR; + + /* Re-open file */ + if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR; + + /* Set up group creation property list */ + if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) TEST_ERROR; + + /* Set GCPL parameters */ + if(H5Pset_link_phase_change(gcpl, NO_COMPACT_MAX_COMPACT, NO_COMPACT_MIN_DENSE) < 0) TEST_ERROR; + + /* Create group for testing lifecycle */ + if((gid = H5Gcreate_expand(fid, NO_COMPACT_TOP_GROUP, gcpl, H5P_DEFAULT)) < 0) TEST_ERROR + + /* Close GCPL */ + if(H5Pclose(gcpl) < 0) TEST_ERROR; + + /* Use internal testing routine to check that the group has no links or symbol table */ + if(H5G_is_empty_test(gid) != TRUE) TEST_ERROR; + + /* Create first "bottom" group */ + sprintf(objname, NO_COMPACT_BOTTOM_GROUP, (unsigned)0); + if((gid2 = H5Gcreate(gid, objname, (size_t)0)) < 0) TEST_ERROR + + /* Check on bottom group's status */ + if(H5G_is_empty_test(gid2) != TRUE) TEST_ERROR; + + /* Close bottom group */ + if(H5Gclose(gid2) < 0) TEST_ERROR + + /* Check on top group's status */ + if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR; + if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR; + if(H5G_has_stab_test(gid) != TRUE) TEST_ERROR; + + /* Unlink object from top group */ + sprintf(objname, NO_COMPACT_BOTTOM_GROUP, (unsigned)0); + if(H5Gunlink(gid, objname) < 0) TEST_ERROR + + /* Check on top group's status */ + if(H5G_is_empty_test(gid) != TRUE) TEST_ERROR; + + /* Close top group */ + if(H5Gclose(gid) < 0) TEST_ERROR; + + /* Unlink top group */ + if(H5Gunlink(fid, NO_COMPACT_TOP_GROUP) < 0) TEST_ERROR + + /* Close file */ + if(H5Fclose(fid) < 0) TEST_ERROR; + + /* Get size of file as empty */ + if((file_size = h5_get_file_size(filename)) == 0) TEST_ERROR; + + /* Verify that file is correct size */ + if(file_size != empty_size) TEST_ERROR; + + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Gclose(gcpl); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid); + } H5E_END_TRY; + return 1; +} /* end no_compact() */ + + +/*------------------------------------------------------------------------- + * Function: gcpl_on_root + * + * Purpose: Test setting group creation properties for root group. + * + * Return: Success: 0 + * + * Failure: -1 + * + * Programmer: Quincey Koziol + * Tuesday, October 25, 2005 + * + *------------------------------------------------------------------------- + */ +static int +gcpl_on_root(hid_t fapl) +{ + hid_t fid = (-1); /* File ID */ + hid_t gid = (-1); /* Group ID */ + hid_t gid2 = (-1); /* Datatype ID */ + hid_t fcpl = (-1); /* File creation property list ID */ + hid_t gcpl = (-1); /* Group creation property list ID */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + char filename[NAME_BUF_SIZE]; + + TESTING("setting root group creation properties"); + + /* Create file */ + h5_fixname(FILENAME[1], fapl, filename, sizeof(filename)); + + /* Set up file creation property list */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR; + + /* Set GCPL parameters */ + if(H5Pset_link_phase_change(fcpl, GCPL_ON_ROOT_MAX_COMPACT, GCPL_ON_ROOT_MIN_DENSE) < 0) TEST_ERROR; + + /* Query the group creation properties from the FCPL */ + if(H5Pget_link_phase_change(fcpl, &max_compact, &min_dense) < 0) TEST_ERROR; + if(max_compact != GCPL_ON_ROOT_MAX_COMPACT) TEST_ERROR; + if(min_dense != GCPL_ON_ROOT_MIN_DENSE) TEST_ERROR; + + /* Create file with modified root group creation properties */ + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) TEST_ERROR; + + /* Close FCPL */ + if(H5Pclose(fcpl) < 0) TEST_ERROR; + + /* Open the root group */ + if((gid = H5Gopen(fid, "/")) < 0) TEST_ERROR; + + /* Query the group creation properties */ + if((gcpl = H5Gget_create_plist(gid)) < 0) TEST_ERROR; + if(H5Pget_link_phase_change(gcpl, &max_compact, &min_dense) < 0) TEST_ERROR; + if(max_compact != GCPL_ON_ROOT_MAX_COMPACT) TEST_ERROR; + if(min_dense != GCPL_ON_ROOT_MIN_DENSE) TEST_ERROR; + + /* Close GCPL */ + if(H5Pclose(gcpl) < 0) TEST_ERROR; + + /* Create a group creation property list, with intermediate group creation set */ + if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) TEST_ERROR; + if(H5Pset_create_intermediate_group(gcpl, TRUE) < 0) TEST_ERROR + + /* Create a group and intermediate groups, to check if root group settings are inherited */ + if((gid2 = H5Gcreate_expand(gid, GCPL_ON_ROOT_BOTTOM_GROUP, gcpl, H5P_DEFAULT)) < 0) TEST_ERROR + + /* Close GCPL */ + if(H5Pclose(gcpl) < 0) TEST_ERROR; + + /* Query the group creation properties */ + if((gcpl = H5Gget_create_plist(gid2)) < 0) TEST_ERROR; + if(H5Pget_link_phase_change(gcpl, &max_compact, &min_dense) < 0) TEST_ERROR; + if(max_compact != H5G_CRT_GINFO_MAX_COMPACT) TEST_ERROR; + if(min_dense != H5G_CRT_GINFO_MIN_DENSE) TEST_ERROR; + + /* Close GCPL */ + if(H5Pclose(gcpl) < 0) TEST_ERROR; + + /* Close bottom group */ + if(H5Gclose(gid2) < 0) TEST_ERROR; + + /* Open the middle group */ + if((gid2 = H5Gopen(fid, GCPL_ON_ROOT_MIDDLE_GROUP)) < 0) TEST_ERROR; + + /* Query the group creation properties */ + if((gcpl = H5Gget_create_plist(gid2)) < 0) TEST_ERROR; + if(H5Pget_link_phase_change(gcpl, &max_compact, &min_dense) < 0) TEST_ERROR; + if(max_compact != GCPL_ON_ROOT_MAX_COMPACT) TEST_ERROR; + if(min_dense != GCPL_ON_ROOT_MIN_DENSE) TEST_ERROR; + + /* Close GCPL */ + if(H5Pclose(gcpl) < 0) TEST_ERROR; + + /* Close bottom group */ + if(H5Gclose(gid2) < 0) TEST_ERROR; + + /* Close root group */ + if(H5Gclose(gid) < 0) TEST_ERROR; + + /* Close file */ + if(H5Fclose(fid) < 0) TEST_ERROR; + + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Gclose(gcpl); + H5Gclose(gid2); + H5Gclose(gid); + H5Gclose(fcpl); + H5Fclose(fid); + } H5E_END_TRY; + return 1; +} /* end gcpl_on_root() */ + + +/*------------------------------------------------------------------------- * Function: main * * Purpose: Test groups @@ -258,6 +969,11 @@ main(void) nerrors += test_misc(file); nerrors += test_long(file); nerrors += test_large(file); + nerrors += lifecycle(fapl); + nerrors += long_compact(fapl); + nerrors += read_old(fapl); + nerrors += no_compact(fapl); + nerrors += gcpl_on_root(fapl); if (nerrors) goto error; /* Cleanup */ diff --git a/test/tfile.c b/test/tfile.c index 586dd59..84c96ca 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1207,9 +1207,9 @@ test_file_freespace(void) free_space = H5Fget_freespace(file); CHECK(free_space, FAIL, "H5Fget_freespace"); #ifdef H5_HAVE_LARGE_HSIZET - VERIFY(free_space, 168, "H5Fget_freespace"); + VERIFY(free_space, 420, "H5Fget_freespace"); #else /* H5_HAVE_LARGE_HSIZET */ - VERIFY(free_space, 76, "H5Fget_freespace"); + VERIFY(free_space, 588, "H5Fget_freespace"); #endif /* H5_HAVE_LARGE_HSIZET */ /* Delete datasets in file */ @@ -1223,9 +1223,9 @@ test_file_freespace(void) free_space = H5Fget_freespace(file); CHECK(free_space, FAIL, "H5Fget_freespace"); #ifdef H5_HAVE_LARGE_HSIZET - VERIFY(free_space, 3584, "H5Fget_freespace"); + VERIFY(free_space, 4628, "H5Fget_freespace"); #else /* H5_HAVE_LARGE_HSIZET */ - VERIFY(free_space, 3428, "H5Fget_freespace"); + VERIFY(free_space, 4592, "H5Fget_freespace"); #endif /* H5_HAVE_LARGE_HSIZET */ /* Close file */ diff --git a/test/tgenprop.c b/test/tgenprop.c index da72641..189eeb7 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -133,7 +133,7 @@ test_genprop_basic_class(void) CHECK_I(cid3, "H5Pget_class_parent"); /* Verify class parent's parent correct */ - ret = H5Pequal(cid3,H5P_NO_CLASS); + ret = H5Pequal(cid3,H5P_GROUP_CREATE); VERIFY(ret, 1, "H5Pequal"); /* Close parent class's parent */ @@ -26,7 +26,7 @@ static int basic_id_test(void) { H5I_type_t myType = H5I_BADID; hid_t arrayID = H5I_INVALID_HID; - void* testObj; + void* testObj = NULL; void* testPtr = NULL; char nameString[10]; hid_t testID; diff --git a/test/titerate.c b/test/titerate.c index 2a3a599..0c41ce6 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -385,7 +385,6 @@ static void test_iter_attr(void) { hid_t file; /* File ID */ hid_t dataset; /* Common Dataset ID */ - hid_t datatype; /* Common datatype ID */ hid_t filespace; /* Common dataspace ID */ hid_t attribute; /* Attribute ID */ int i; /* counting variable */ @@ -402,18 +401,15 @@ static void test_iter_attr(void) file = H5Fcreate(DATAFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(file, FAIL, "H5Fcreate"); - datatype = H5Tcopy(H5T_NATIVE_INT); - CHECK(datatype, FAIL, "H5Tcopy"); - filespace=H5Screate(H5S_SCALAR); CHECK(filespace, FAIL, "H5Screate"); - dataset = H5Dcreate(file, "Dataset", datatype, filespace, H5P_DEFAULT); + dataset = H5Dcreate(file, "Dataset", H5T_NATIVE_INT, filespace, H5P_DEFAULT); CHECK(dataset, FAIL, "H5Dcreate"); for(i=0; i< NATTR; i++) { sprintf(name,"Attribute %d",i); - attribute = H5Acreate(dataset, name, datatype, filespace, H5P_DEFAULT); + attribute = H5Acreate(dataset, name, H5T_NATIVE_INT, filespace, H5P_DEFAULT); CHECK(attribute, FAIL, "H5Acreate"); /* Keep a copy of the attribute names around for later */ @@ -428,15 +424,13 @@ static void test_iter_attr(void) ret=H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); - ret=H5Tclose(datatype); - CHECK(ret, FAIL, "H5Tclose"); - ret=H5Sclose(filespace); CHECK(ret, FAIL, "H5Sclose"); ret=H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); + /* Iterate through the attributes on the dataset in various ways */ file=H5Fopen(DATAFILE, H5F_ACC_RDONLY, H5P_DEFAULT); CHECK(file, FAIL, "H5Fopen"); diff --git a/test/tmisc.c b/test/tmisc.c index c24195e..44df4ce 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -231,8 +231,13 @@ unsigned m13_rdata[MISC13_DIM1][MISC13_DIM2]; /* Data read from dataset #define MISC20_SPACE_RANK 2 /* Make sure the product of the following 2 does not get too close to */ /* 64 bits, risking an overflow. */ +#ifdef H5_HAVE_LARGE_HSIZET #define MISC20_SPACE_DIM0 (8*1024*1024*(uint64_t)1024) #define MISC20_SPACE_DIM1 ((256*1024*(uint64_t)1024)+1) +#else /* H5_HAVE_LARGE_HSIZET */ +#define MISC20_SPACE_DIM0 (128*(uint64_t)1024) +#define MISC20_SPACE_DIM1 ((4*(uint64_t)1024)+1) +#endif /* H5_HAVE_LARGE_HSIZET */ #define MISC20_SPACE2_DIM0 8 #define MISC20_SPACE2_DIM1 4 @@ -258,6 +263,15 @@ unsigned m13_rdata[MISC13_DIM1][MISC13_DIM2]; /* Data read from dataset #define MISC23_FILE "tmisc23.h5" #define MISC23_NAME_BUF_SIZE 40 +/* Definitions for misc. test #24 */ +#define MISC24_FILE "tmisc24.h5" +#define MISC24_GROUP_NAME "group" +#define MISC24_GROUP_LINK "group_link" +#define MISC24_DATASET_NAME "dataset" +#define MISC24_DATASET_LINK "dataset_link" +#define MISC24_DATATYPE_NAME "datatype" +#define MISC24_DATATYPE_LINK "datatype_link" + /**************************************************************** ** ** test_misc1(): test unlinking a dataset from a group and immediately @@ -2816,7 +2830,11 @@ test_misc18(void) VERIFY(statbuf.u.obj.ohdr.nmesgs, 6, "H5Gget_objinfo"); VERIFY(statbuf.u.obj.ohdr.nchunks, 1, "H5Gget_objinfo"); VERIFY(statbuf.u.obj.ohdr.size, 272, "H5Gget_objinfo"); +#ifdef H5_HAVE_LARGE_HSIZET VERIFY(statbuf.u.obj.ohdr.free, 152, "H5Gget_objinfo"); +#else /* H5_HAVE_LARGE_HSIZET */ + VERIFY(statbuf.u.obj.ohdr.free, 160, "H5Gget_objinfo"); +#endif /* H5_HAVE_LARGE_HSIZET */ /* Create second dataset */ did2 = H5Dcreate(fid, MISC18_DSET2_NAME, H5T_STD_U32LE, sid, H5P_DEFAULT); @@ -2828,7 +2846,11 @@ test_misc18(void) VERIFY(statbuf.u.obj.ohdr.nmesgs, 6, "H5Gget_objinfo"); VERIFY(statbuf.u.obj.ohdr.nchunks, 1, "H5Gget_objinfo"); VERIFY(statbuf.u.obj.ohdr.size, 272, "H5Gget_objinfo"); +#ifdef H5_HAVE_LARGE_HSIZET VERIFY(statbuf.u.obj.ohdr.free, 152, "H5Gget_objinfo"); +#else /* H5_HAVE_LARGE_HSIZET */ + VERIFY(statbuf.u.obj.ohdr.free, 160, "H5Gget_objinfo"); +#endif /* H5_HAVE_LARGE_HSIZET */ /* Loop creating attributes on each dataset, flushing them to the file each time */ for(u=0; u<10; u++) { @@ -2857,18 +2879,32 @@ test_misc18(void) /* Get object information for dataset #1 now */ ret = H5Gget_objinfo(fid,MISC18_DSET1_NAME,0,&statbuf); CHECK(ret, FAIL, "H5Gget_objinfo"); - VERIFY(statbuf.u.obj.ohdr.nmesgs, 24, "H5Gget_objinfo"); +#ifdef H5_HAVE_LARGE_HSIZET + VERIFY(statbuf.u.obj.ohdr.nmesgs, 28, "H5Gget_objinfo"); + VERIFY(statbuf.u.obj.ohdr.nchunks, 9, "H5Gget_objinfo"); + VERIFY(statbuf.u.obj.ohdr.size, 944, "H5Gget_objinfo"); + VERIFY(statbuf.u.obj.ohdr.free, 72, "H5Gget_objinfo"); +#else /* H5_HAVE_LARGE_HSIZET */ + VERIFY(statbuf.u.obj.ohdr.nmesgs, 26, "H5Gget_objinfo"); VERIFY(statbuf.u.obj.ohdr.nchunks, 9, "H5Gget_objinfo"); VERIFY(statbuf.u.obj.ohdr.size, 888, "H5Gget_objinfo"); - VERIFY(statbuf.u.obj.ohdr.free, 16, "H5Gget_objinfo"); + VERIFY(statbuf.u.obj.ohdr.free, 24, "H5Gget_objinfo"); +#endif /* H5_HAVE_LARGE_HSIZET */ /* Get object information for dataset #2 now */ ret = H5Gget_objinfo(fid,MISC18_DSET2_NAME,0,&statbuf); CHECK(ret, FAIL, "H5Gget_objinfo"); - VERIFY(statbuf.u.obj.ohdr.nmesgs, 24, "H5Gget_objinfo"); +#ifdef H5_HAVE_LARGE_HSIZET + VERIFY(statbuf.u.obj.ohdr.nmesgs, 28, "H5Gget_objinfo"); + VERIFY(statbuf.u.obj.ohdr.nchunks, 9, "H5Gget_objinfo"); + VERIFY(statbuf.u.obj.ohdr.size, 944, "H5Gget_objinfo"); + VERIFY(statbuf.u.obj.ohdr.free, 72, "H5Gget_objinfo"); +#else /* H5_HAVE_LARGE_HSIZET */ + VERIFY(statbuf.u.obj.ohdr.nmesgs, 26, "H5Gget_objinfo"); VERIFY(statbuf.u.obj.ohdr.nchunks, 9, "H5Gget_objinfo"); VERIFY(statbuf.u.obj.ohdr.size, 888, "H5Gget_objinfo"); - VERIFY(statbuf.u.obj.ohdr.free, 16, "H5Gget_objinfo"); + VERIFY(statbuf.u.obj.ohdr.free, 24, "H5Gget_objinfo"); +#endif /* H5_HAVE_LARGE_HSIZET */ /* Close second dataset */ ret = H5Dclose(did2); @@ -3349,9 +3385,11 @@ test_misc20(void) dcpl = H5Pcreate(H5P_DATASET_CREATE); CHECK(dcpl, FAIL, "H5Pcreate"); - /* Use chunked storage for this dataset */ + /* Try to use chunked storage for this dataset */ +#ifdef H5_HAVE_LARGE_HSIZET ret = H5Pset_chunk(dcpl,rank,big_dims); VERIFY(ret, FAIL, "H5Pset_chunk"); +#endif /* H5_HAVE_LARGE_HSIZET */ /* Verify that the storage for the dataset is the correct size and hasn't * been truncated. @@ -3466,6 +3504,7 @@ test_misc20(void) /* Open dataset with small dimensions */ did = H5Dopen(fid, MISC20_DSET_NAME); +#ifdef H5_HAVE_LARGE_HSIZET CHECK(did, FAIL, "H5Dopen"); /* Get the layout version */ @@ -3481,6 +3520,9 @@ test_misc20(void) /* Close datasset */ ret=H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); +#else /* H5_HAVE_LARGE_HSIZET */ + VERIFY(did, FAIL, "H5Dopen"); +#endif /* H5_HAVE_LARGE_HSIZET */ /* Close file */ ret = H5Fclose(fid); @@ -3886,6 +3928,13 @@ test_misc23(void) CHECK(status, FAIL, "H5Dclose"); + status = H5Tclose(type_id); + CHECK(status, FAIL, "H5Tclose"); + + status = H5Sclose(space_id); + CHECK(status, FAIL, "H5Sclose"); + + status = H5Pclose(create_id); CHECK(status, FAIL, "H5Pclose"); @@ -3956,10 +4005,141 @@ test_misc23(void) status = H5Pclose(create_id); CHECK(status, FAIL, "H5Pclose"); + status = H5Gclose(group_id); + CHECK(status, FAIL, "H5Gclose"); + + status = H5Fclose(file_id); + CHECK(status, FAIL, "H5Fclose"); + } /* end test_misc23() */ /**************************************************************** ** +** test_misc24(): Test opening objects with inappropriate APIs +** +****************************************************************/ +static void +test_misc24(void) +{ + hid_t file_id = 0, group_id = 0, type_id = 0, space_id = 0, + dset_id = 0, tmp_id = 0; + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing opening objects with inappropriate APIs\n")); + + /* Create a new file using default properties. */ + file_id = H5Fcreate(MISC24_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + CHECK(file_id, FAIL, "H5Fcreate"); + + /* Create dataspace for dataset */ + space_id = H5Screate(H5S_SCALAR); + CHECK(space_id, FAIL, "H5Screate"); + + /* Create group, dataset & named datatype objects */ + group_id = H5Gcreate(file_id, MISC24_GROUP_NAME, (size_t)0); + CHECK(group_id, FAIL, "H5Gcreate"); + + dset_id = H5Dcreate(file_id, MISC24_DATASET_NAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT); + CHECK(dset_id, FAIL, "H5Dcreate"); + + type_id = H5Tcopy(H5T_NATIVE_INT); + CHECK(type_id, FAIL, "H5Tcopy"); + + ret = H5Tcommit(file_id, MISC24_DATATYPE_NAME, type_id); + CHECK(ret, FAIL, "H5Tcommit"); + + /* Create soft links to the objects created */ + ret = H5Glink2(file_id, MISC24_GROUP_NAME, H5G_LINK_SOFT, file_id, MISC24_GROUP_LINK); + CHECK(ret, FAIL, "H5Glink2"); + + ret = H5Glink2(file_id, MISC24_DATASET_NAME, H5G_LINK_SOFT, file_id, MISC24_DATASET_LINK); + CHECK(ret, FAIL, "H5Glink2"); + + ret = H5Glink2(file_id, MISC24_DATATYPE_NAME, H5G_LINK_SOFT, file_id, MISC24_DATATYPE_LINK); + CHECK(ret, FAIL, "H5Glink2"); + + /* Close IDs for objects */ + ret = H5Dclose(dset_id); + CHECK(ret, FAIL, "H5Dclose"); + + ret = H5Sclose(space_id); + CHECK(ret, FAIL, "H5Sclose"); + + ret = H5Gclose(group_id); + CHECK(ret, FAIL, "H5Gclose"); + + ret = H5Tclose(type_id); + CHECK(ret, FAIL, "H5Tclose"); + + /* Attempt to open each kind of object with wrong API, including using soft links */ + H5E_BEGIN_TRY { + tmp_id = H5Dopen(file_id, MISC24_GROUP_NAME); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Dopen"); + + H5E_BEGIN_TRY { + tmp_id = H5Dopen(file_id, MISC24_GROUP_LINK); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Dopen"); + + H5E_BEGIN_TRY { + tmp_id = H5Topen(file_id, MISC24_GROUP_NAME); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Topen"); + + H5E_BEGIN_TRY { + tmp_id = H5Topen(file_id, MISC24_GROUP_LINK); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Topen"); + + H5E_BEGIN_TRY { + tmp_id = H5Gopen(file_id, MISC24_DATASET_NAME); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Gopen"); + + H5E_BEGIN_TRY { + tmp_id = H5Gopen(file_id, MISC24_DATASET_LINK); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Gopen"); + + H5E_BEGIN_TRY { + tmp_id = H5Topen(file_id, MISC24_DATASET_NAME); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Topen"); + + H5E_BEGIN_TRY { + tmp_id = H5Topen(file_id, MISC24_DATASET_LINK); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Topen"); + + H5E_BEGIN_TRY { + tmp_id = H5Gopen(file_id, MISC24_DATATYPE_NAME); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Gopen"); + + H5E_BEGIN_TRY { + tmp_id = H5Gopen(file_id, MISC24_DATATYPE_LINK); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Gopen"); + + H5E_BEGIN_TRY { + tmp_id = H5Dopen(file_id, MISC24_DATATYPE_NAME); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Dopen"); + + H5E_BEGIN_TRY { + tmp_id = H5Dopen(file_id, MISC24_DATATYPE_LINK); + } H5E_END_TRY; + VERIFY(tmp_id, FAIL, "H5Dopen"); + + /* Close file */ + ret = H5Fclose(file_id); + CHECK(ret, FAIL, "H5Fclose"); +} /* end test_misc24() */ + +/**************************************************************** +** ** test_misc(): Main misc. test routine. ** ****************************************************************/ @@ -3991,9 +4171,10 @@ test_misc(void) test_misc20(); /* Test problems with truncated dimensions in version 2 of storage layout message */ #if defined H5_HAVE_FILTER_SZIP test_misc21(); /* Test that "late" allocation time is treated the same as "incremental", for chunked datasets w/a filters */ - test_misc22(); /* check szip bits per pixel */ + test_misc22(); /* check szip bits per pixel */ #endif /* H5_HAVE_FILTER_SZIP */ test_misc23(); /* Test intermediate group creation */ + test_misc24(); /* Test inappropriate API opens of objects */ } /* test_misc() */ @@ -4043,5 +4224,6 @@ cleanup_misc(void) HDremove(MISC22_FILE); #endif /* H5_HAVE_FILTER_SZIP */ HDremove(MISC23_FILE); + HDremove(MISC24_FILE); } diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c index a612751..1f07429 100644 --- a/test/ttsafe_error.c +++ b/test/ttsafe_error.c @@ -91,19 +91,13 @@ void tts_error(void) expected[2].min_num = H5E_EXISTS; expected[3].maj_num = H5E_SYM; - expected[3].min_num = H5E_CANTINSERT; + expected[3].min_num = H5E_NOTFOUND; expected[4].maj_num = H5E_SYM; - expected[4].min_num = H5E_CANTINSERT; + expected[4].min_num = H5E_CALLBACK; - expected[5].maj_num = H5E_BTREE; - expected[5].min_num = H5E_CANTINIT; - - expected[6].maj_num = H5E_BTREE; - expected[6].min_num = H5E_CANTINSERT; - - expected[7].maj_num = H5E_SYM; - expected[7].min_num = H5E_CANTINSERT; + expected[5].maj_num = H5E_SYM; + expected[5].min_num = H5E_EXISTS; /* set up mutex for global count of errors */ ret=pthread_mutex_init(&error_mutex, NULL); diff --git a/test/tunicode.c b/test/tunicode.c index 22146bf..f4c4cda 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -468,6 +468,7 @@ void test_objnames(hid_t fid, const char* string) CHECK(ret, FAIL, "H5Dclose"); ret = H5Sclose(space_id); CHECK(ret, FAIL, "H5Sclose"); + ret = H5Gclose(grp2_id); CHECK(ret, FAIL, "H5Gclose"); @@ -481,9 +482,9 @@ void test_objnames(hid_t fid, const char* string) ret = H5Glink2(fid, GROUP2_NAME, H5G_LINK_HARD, grp3_id, GROUP2_NAME); CHECK(ret, FAIL, "H5Glink2"); - strcpy(path_buf, GROUP2_NAME); - strcat(path_buf, "/"); - strcat(path_buf, string); + HDstrcpy(path_buf, GROUP2_NAME); + HDstrcat(path_buf, "/"); + HDstrcat(path_buf, string); ret = H5Glink(grp3_id, H5G_LINK_SOFT, path_buf, string); CHECK(ret, FAIL, "H5Glink"); @@ -580,6 +581,7 @@ void test_compound(hid_t fid, const char * string) herr_t ret; /* Initialize compound data */ + HDmemset(&s1, 0, sizeof(s1_t)); /* To make purify happy */ s1.a = COMP_INT_VAL; s1.c = COMP_DOUBLE_VAL; s1.b = COMP_FLOAT_VAL; @@ -793,6 +795,7 @@ void test_unicode(void) unsigned int unicode_point; /* Unicode code point for a single character */ hid_t fid; /* ID of file */ int x; /* Temporary variable */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing UTF-8 Encoding\n")); @@ -800,13 +803,14 @@ void test_unicode(void) /* Create a random string with length NUM_CHARS */ HDsrandom((unsigned long)HDtime(NULL)); + HDmemset(test_string, 0, sizeof(test_string)); for(x=0; x<NUM_CHARS; x++) { /* We need to avoid unprintable characters (codes 0-31) and the * . and / characters, since they aren't allowed in path names. */ - unicode_point = HDrandom() % (MAX_CODE_POINT-32) + 32; - if(unicode_point != 56 && unicode_point != 57) + unicode_point = (HDrandom() % (MAX_CODE_POINT-32)) + 32; + if(unicode_point != 46 && unicode_point != 47) cur_pos = write_char(unicode_point, test_string, cur_pos); } @@ -832,6 +836,10 @@ void test_unicode(void) test_enum(fid, test_string); test_opaque(fid, test_string); + /* Close file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + /* This function could be useful in debugging if certain strings * create errors. */ diff --git a/test/unlink.c b/test/unlink.c index 76c9bcc..37bd55b 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -248,8 +248,6 @@ test_many(hid_t file) * Programmer: Robb Matzke * Friday, September 25, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -260,12 +258,12 @@ test_symlink(hid_t file) TESTING("symlink removal"); /* Create a test group and symlink */ - if ((work=H5Gcreate(file, "/test_symlink", 0))<0) goto error; - if (H5Glink(work, H5G_LINK_SOFT, "link_value", "link")<0) goto error; - if (H5Gunlink(work, "link")<0) goto error; + if ((work=H5Gcreate(file, "/test_symlink", 0))<0) TEST_ERROR; + if (H5Glink(work, H5G_LINK_SOFT, "link_value", "link")<0) TEST_ERROR; + if (H5Gunlink(work, "link")<0) TEST_ERROR; /* Cleanup */ - if (H5Gclose(work)<0) goto error; + if (H5Gclose(work)<0) TEST_ERROR; PASSED(); return 0; @@ -528,7 +526,7 @@ test_filespace(void) hsize_t dims[FILESPACE_NDIMS]= {FILESPACE_DIM0, FILESPACE_DIM1, FILESPACE_DIM2}; /* Dataset dimensions */ hsize_t chunk_dims[FILESPACE_NDIMS]= {FILESPACE_CHUNK0, FILESPACE_CHUNK1, FILESPACE_CHUNK2}; /* Chunk dimensions */ hsize_t attr_dims[FILESPACE_ATTR_NDIMS]= {FILESPACE_ATTR_DIM0, FILESPACE_ATTR_DIM1}; /* Attribute dimensions */ - int *data; /* Pointer to dataset buffer */ + int *data = NULL; /* Pointer to dataset buffer */ int *tmp_data; /* Temporary pointer to dataset buffer */ off_t empty_size; /* Size of an empty file */ off_t file_size; /* Size of each file created */ @@ -927,8 +925,9 @@ test_filespace(void) } /* end for */ /* Remove the all the groups */ - for(u=0; u<UNLINK_NGROUPS; u++) { - sprintf(objname,"%s %u",GROUPNAME,u); + /* (Remove them in reverse order just to make file size calculation easier -QAK) */ + for(u=UNLINK_NGROUPS; u>0; u--) { + sprintf(objname,"%s %u",GROUPNAME,(u-1)); if(H5Gunlink (file, objname)<0) TEST_ERROR; } /* end for */ @@ -1007,9 +1006,10 @@ test_filespace(void) } /* end for */ /* Remove complex group hierarchy */ - for(u=0; u<FILESPACE_TOP_GROUPS; u++) { + /* (Remove them in reverse order just to make file size calculation easier -QAK) */ + for(u=FILESPACE_TOP_GROUPS; u>0; u--) { /* Open group */ - sprintf(objname,"%s %u",GROUPNAME,u); + sprintf(objname,"%s %u",GROUPNAME,(u-1)); if((group = H5Gopen (file, objname))<0) TEST_ERROR; /* Open nested groups inside top groups */ @@ -1037,7 +1037,7 @@ test_filespace(void) if(H5Gclose (group)<0) TEST_ERROR; /* Remove top group */ - sprintf(objname,"%s %u",GROUPNAME,u); + sprintf(objname,"%s %u",GROUPNAME,(u-1)); if(H5Gunlink (file, objname)<0) TEST_ERROR; } /* end for */ @@ -1226,6 +1226,10 @@ test_filespace(void) return 0; error: + /* Release dataset buffer */ + if(data) + HDfree(data); + return 1; } /* end test_filespace() */ @@ -1525,6 +1529,9 @@ test_unlink_rightleaf(hid_t fid) for (n = 0; n < ngroups; n++) if(H5Gclose(gids[n])<0) TEST_ERROR; + /* Close root group ID */ + if(H5Gclose(rootid)<0) TEST_ERROR; + /* Free memory */ HDfree(gids); @@ -1586,6 +1593,9 @@ test_unlink_rightnode(hid_t fid) if(H5Gunlink(fid,"/ZoneB8")<0) TEST_ERROR; if(H5Gunlink(fid,"/ZoneB80")<0) TEST_ERROR; + /* Close root group ID */ + if(H5Gclose(rootid)<0) TEST_ERROR; + /* Free memory */ HDfree(gids); @@ -1790,6 +1800,9 @@ test_unlink_middlenode(hid_t fid) if(H5Gunlink(fid,"/ZoneC8")<0) TEST_ERROR; if(H5Gunlink(fid,"/ZoneC80")<0) TEST_ERROR; + /* Close root group ID */ + if(H5Gclose(rootid)<0) TEST_ERROR; + /* Free memory */ HDfree(gids); @@ -2187,6 +2200,7 @@ main(void) nerrors += test_unlink_chunked_dataset(); /* Close */ + if (H5Pclose(fapl2)<0) TEST_ERROR; if (H5Fclose(file)<0) TEST_ERROR; if (nerrors) { printf("***** %d FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); @@ -72,38 +72,38 @@ test_sec2(void) /* Set property list and file name for SEC2 driver. */ fapl = h5_fileaccess(); if(H5Pset_fapl_sec2(fapl)<0) - goto error; + TEST_ERROR; h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) - goto error; + TEST_ERROR; /* Retrieve the access property list... */ if ((access_fapl = H5Fget_access_plist(file)) < 0) - goto error; + TEST_ERROR; /* ...and close the property list */ if (H5Pclose(access_fapl) < 0) - goto error; + TEST_ERROR; /* Check file handle API */ if(H5Fget_vfd_handle(file, H5P_DEFAULT, (void **)&fhandle)<0) - goto error; + TEST_ERROR; if(*fhandle<0) - goto error; + TEST_ERROR; /* Check file size API */ if(H5Fget_filesize(file, &file_size) < 0) - goto error; + TEST_ERROR; /* There is no garantee the size of metadata in file is constant. * Just try to check if it's reasonable. It's 2KB right now. */ if(file_size<1*KB || file_size>4*KB) - goto error; + TEST_ERROR; if(H5Fclose(file)<0) - goto error; + TEST_ERROR; h5_cleanup(FILENAME, fapl); PASSED(); return 0; @@ -150,40 +150,40 @@ test_core(void) /* Set property list and file name for CORE driver */ fapl = h5_fileaccess(); if(H5Pset_fapl_core(fapl, CORE_INCREMENT, TRUE)<0) - goto error; + TEST_ERROR; h5_fixname(FILENAME[1], fapl, filename, sizeof filename); if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) - goto error; + TEST_ERROR; /* Retrieve the access property list... */ if ((access_fapl = H5Fget_access_plist(file)) < 0) - goto error; + TEST_ERROR; /* ...and close the property list */ if (H5Pclose(access_fapl) < 0) - goto error; + TEST_ERROR; if(H5Fget_vfd_handle(file, H5P_DEFAULT, &fhandle)<0) - goto error; + TEST_ERROR; if(fhandle==NULL) { printf("fhandle==NULL\n"); - goto error; + TEST_ERROR; } /* Check file size API */ if(H5Fget_filesize(file, &file_size) < 0) - goto error; + TEST_ERROR; /* There is no garantee the size of metadata in file is constant. * Just try to check if it's reasonable. Why is this 4KB? */ if(file_size<2*KB || file_size>6*KB) - goto error; + TEST_ERROR; if(H5Fclose(file)<0) - goto error; + TEST_ERROR; h5_cleanup(FILENAME, fapl); PASSED(); return 0; @@ -235,7 +235,7 @@ test_family_opens(char *fname, hid_t fa_pl) /* Case 3: reopen file with wrong member size */ if(H5Pset_fapl_family(fa_pl, (hsize_t)128, H5P_DEFAULT)<0) - goto error; + TEST_ERROR; H5E_BEGIN_TRY { file=H5Fopen(fname, H5F_ACC_RDWR, fa_pl); @@ -251,7 +251,7 @@ test_family_opens(char *fname, hid_t fa_pl) } if(H5Pset_fapl_family(fa_pl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT)<0) - goto error; + TEST_ERROR; H5E_BEGIN_TRY { file=H5Fopen(wrong_name, H5F_ACC_RDWR, fa_pl); @@ -307,111 +307,111 @@ test_family(void) fapl = h5_fileaccess(); if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT)<0) - goto error; + TEST_ERROR; h5_fixname(FILENAME[2], fapl, filename, sizeof filename); if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) - goto error; + TEST_ERROR; if(H5Fclose(file)<0) - goto error; + TEST_ERROR; /* Test different wrong ways to reopen family files where there's only * one member file existing. */ if(test_family_opens(filename, fapl)<0) - goto error; + TEST_ERROR; /* Reopen the file with default member file size */ if(H5Pset_fapl_family(fapl, (hsize_t)H5F_FAMILY_DEFAULT, H5P_DEFAULT)<0) - goto error; + TEST_ERROR; if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl))<0) - goto error; + TEST_ERROR; /* Check file size API */ if(H5Fget_filesize(file, &file_size) < 0) - goto error; + TEST_ERROR; - /* The file size is supposed to be about 1024 bytes right now. */ - if(file_size<KB/2 || file_size>4*KB) - goto error; + /* The file size is supposed to be about 300 bytes right now. */ + if(file_size<KB/4 || file_size>4*KB) + TEST_ERROR; /* Create and write dataset */ if((space=H5Screate_simple(2, dims, NULL))<0) - goto error; + TEST_ERROR; /* Retrieve the access property list... */ if ((access_fapl = H5Fget_access_plist(file)) < 0) - goto error; + TEST_ERROR; /* ...and close the property list */ if (H5Pclose(access_fapl) < 0) - goto error; + TEST_ERROR; if((dset=H5Dcreate(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT))<0) - goto error; + TEST_ERROR; for(i=0; i<FAMILY_NUMBER; i++) for(j=0; j<FAMILY_SIZE; j++) buf[i][j] = i*10000+j; if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0) - goto error; + TEST_ERROR; /* check file handle API */ if((fapl2=H5Pcreate(H5P_FILE_ACCESS))<0) - goto error; + TEST_ERROR; if(H5Pset_family_offset(fapl2, (hsize_t)0)<0) - goto error; + TEST_ERROR; if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle)<0) - goto error; + TEST_ERROR; if(*fhandle<0) - goto error; + TEST_ERROR; if(H5Pset_family_offset(fapl2, (hsize_t)(FAMILY_SIZE*2))<0) - goto error; + TEST_ERROR; if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle2)<0) - goto error; + TEST_ERROR; if(*fhandle2<0) - goto error; + TEST_ERROR; /* Check file size API */ if(H5Fget_filesize(file, &file_size) < 0) - goto error; + TEST_ERROR; /* Some data has been written. The file size should be bigger(18KB+976 * bytes if int size is 4 bytes) now. */ if(sizeof(int)<=4) { if(file_size<18*KB || file_size>20*KB) - goto error; + TEST_ERROR; } else if(sizeof(int)>=8) { if(file_size<32*KB || file_size>40*KB) - goto error; + TEST_ERROR; } if(H5Sclose(space)<0) - goto error; + TEST_ERROR; if(H5Dclose(dset)<0) - goto error; + TEST_ERROR; if(H5Pclose(fapl2)<0) - goto error; + TEST_ERROR; if(H5Fclose(file)<0) - goto error; + TEST_ERROR; /* Test different wrong ways to reopen family files when there're multiple * member files existing. */ if(test_family_opens(filename, fapl)<0) - goto error; + TEST_ERROR; /* Reopen the file with correct member file size. */ if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT)<0) - goto error; + TEST_ERROR; if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl))<0) - goto error; + TEST_ERROR; if(H5Fclose(file)<0) - goto error; + TEST_ERROR; h5_cleanup(FILENAME, fapl); PASSED(); @@ -469,7 +469,7 @@ test_family_compat(void) fapl = h5_fileaccess(); if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE2, H5P_DEFAULT)<0) - goto error; + TEST_ERROR; h5_fixname(COMPAT_BASENAME, fapl, filename, sizeof filename); @@ -482,13 +482,13 @@ test_family_compat(void) strcat(pathname, filename); if((file=H5Fopen(pathname, H5F_ACC_RDONLY, fapl))<0) - goto error; + TEST_ERROR; if(H5Fclose(file)<0) - goto error; + TEST_ERROR; if(H5Pclose(fapl)<0) - goto error; + TEST_ERROR; PASSED(); return 0; @@ -519,7 +519,7 @@ error: *------------------------------------------------------------------------- */ static herr_t -test_multi_opens(char *fname, hid_t fa_pl) +test_multi_opens(char *fname) { hid_t file; char super_name[1024]; /*name string "%%s-s.h5"*/ @@ -600,90 +600,92 @@ test_multi(void) memb_addr[H5FD_MEM_DRAW] = HADDR_MAX/2; if(H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, TRUE)<0) - goto error; + TEST_ERROR; h5_fixname(FILENAME[3], fapl, filename, sizeof filename); if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) - goto error; + TEST_ERROR; if(H5Fclose(file)<0) - goto error; + TEST_ERROR; /* Test wrong ways to reopen multi files */ - if(test_multi_opens(filename, fapl)<0) - goto error; + if(test_multi_opens(filename)<0) + TEST_ERROR; /* Reopen the file */ if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl))<0) - goto error; + TEST_ERROR; /* Create and write data set */ if((space=H5Screate_simple(2, dims, NULL))<0) - goto error; + TEST_ERROR; /* Retrieve the access property list... */ if ((access_fapl = H5Fget_access_plist(file)) < 0) - goto error; + TEST_ERROR; /* ...and close the property list */ if (H5Pclose(access_fapl) < 0) - goto error; + TEST_ERROR; /* Check file size API */ if(H5Fget_filesize(file, &file_size) < 0) - goto error; + TEST_ERROR; /* Before any data is written, the raw data file is empty. So * the file size is only the size of metadata file. It's supposed - * to be 2KB. + * to be 400 bytes. */ - if(file_size<1*KB || file_size>4*KB) - goto error; + if(file_size<(KB/4) || file_size>4*KB) + TEST_ERROR; if((dset=H5Dcreate(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT))<0) - goto error; + TEST_ERROR; for(i=0; i<MULTI_SIZE; i++) for(j=0; j<MULTI_SIZE; j++) buf[i][j] = i*10000+j; if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0) - goto error; + TEST_ERROR; if((fapl2=H5Pcreate(H5P_FILE_ACCESS))<0) - goto error; + TEST_ERROR; if(H5Pset_multi_type(fapl2, H5FD_MEM_SUPER)<0) - goto error; + TEST_ERROR; if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle)<0) - goto error; + TEST_ERROR; if(*fhandle<0) - goto error; + TEST_ERROR; if(H5Pset_multi_type(fapl2, H5FD_MEM_DRAW)<0) - goto error; + TEST_ERROR; if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle2)<0) - goto error; + TEST_ERROR; if(*fhandle2<0) - goto error; + TEST_ERROR; /* Check file size API */ if(H5Fget_filesize(file, &file_size) < 0) - goto error; + TEST_ERROR; /* After the data is written, the file size is huge because the * beginning of raw data file is set at HADDR_MAX/2. It's supposed * to be (HADDR_MAX/2 + 128*128*4) */ +#ifdef H5_HAVE_LARGE_HSIZET if(file_size < HADDR_MAX/2 || file_size > HADDR_MAX) - goto error; + TEST_ERROR; +#endif /* H5_HAVE_LARGE_HSIZET */ if(H5Sclose(space)<0) - goto error; + TEST_ERROR; if(H5Dclose(dset)<0) - goto error; + TEST_ERROR; if(H5Pclose(fapl2)<0) - goto error; + TEST_ERROR; if(H5Fclose(file)<0) - goto error; + TEST_ERROR; h5_cleanup(FILENAME, fapl); PASSED(); |