From df803f78d045963ca024111fc27ba5dc225d2b08 Mon Sep 17 00:00:00 2001 From: Pedro Vicente Nunes Date: Fri, 20 Oct 2006 13:45:17 -0500 Subject: [svn-r12793] 1. fix a compiling error in atlantia 2. added the test library delete framework to delete output .h5 files 3. cleaned warnings --- tools/h5repack/Makefile.am | 4 ++-- tools/h5repack/Makefile.in | 15 +++++++++------ tools/h5repack/h5repack_copy.c | 34 +++++++++++++++++----------------- tools/h5repack/h5repack_refs.c | 18 +++++++++--------- tools/h5repack/testh5repack_main.c | 27 ++++++++++++++++++++++++++- tools/h5repack/testh5repack_make.c | 5 ++--- 6 files changed, 65 insertions(+), 38 deletions(-) diff --git a/tools/h5repack/Makefile.am b/tools/h5repack/Makefile.am index 794dd43..29fd26b 100644 --- a/tools/h5repack/Makefile.am +++ b/tools/h5repack/Makefile.am @@ -35,8 +35,8 @@ SCRIPT_DEPEND=h5repack$(EXEEXT) # Our main target, h5repack tool bin_PROGRAMS=h5repack -# All programs depend on the hdf5 library and the tools library -LDADD=$(LIBH5TOOLS) $(LIBHDF5) +# Depend on the hdf5 library, the tools library, the test library +LDADD=$(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) # Source files COMMON_SOURCES=h5repack.c h5repack_copy.c h5repack_filters.c \ diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 9ce905b..eb556e1 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -80,21 +80,24 @@ am_h5repack_OBJECTS = $(am__objects_1) h5repack_main.$(OBJEXT) h5repack_OBJECTS = $(am_h5repack_OBJECTS) h5repack_LDADD = $(LDADD) am__DEPENDENCIES_1 = $(top_builddir)/tools/lib/libh5tools.la -am__DEPENDENCIES_2 = $(top_builddir)/src/libhdf5.la -h5repack_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) +am__DEPENDENCIES_2 = $(top_builddir)/test/libh5test.la +am__DEPENDENCIES_3 = $(top_builddir)/src/libhdf5.la +h5repack_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) am_h5repacktst_OBJECTS = $(am__objects_1) testh5repack_attr.$(OBJEXT) \ testh5repack_dset.$(OBJEXT) testh5repack_main.$(OBJEXT) \ testh5repack_make.$(OBJEXT) testh5repack_util.$(OBJEXT) h5repacktst_OBJECTS = $(am_h5repacktst_OBJECTS) h5repacktst_LDADD = $(LDADD) -h5repacktst_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) +h5repacktst_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) am_testh5repack_detect_szip_OBJECTS = \ testh5repack_detect_szip.$(OBJEXT) testh5repack_detect_szip_OBJECTS = \ $(am_testh5repack_detect_szip_OBJECTS) testh5repack_detect_szip_LDADD = $(LDADD) testh5repack_detect_szip_DEPENDENCIES = $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_2) + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles @@ -357,8 +360,8 @@ TEST_PROG = h5repacktst check_SCRIPTS = $(TEST_SCRIPT) SCRIPT_DEPEND = h5repack$(EXEEXT) -# All programs depend on the hdf5 library and the tools library -LDADD = $(LIBH5TOOLS) $(LIBHDF5) +# Depend on the hdf5 library, the tools library, the test library +LDADD = $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) # Source files COMMON_SOURCES = h5repack.c h5repack_copy.c h5repack_filters.c \ diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 7c530ab..03edd01 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -173,7 +173,7 @@ int copy_objects(const char* fnamein, pack_opt_t *options) { hid_t fidin; - hid_t fidout; + hid_t fidout=-1; trav_table_t *travt=NULL; /*------------------------------------------------------------------------- @@ -275,17 +275,17 @@ int do_copy_objects(hid_t fidin, trav_table_t *travt, pack_opt_t *options) /* repack options */ { - hid_t grp_in; /* group ID */ - hid_t grp_out; /* group ID */ - hid_t dset_in; /* read dataset ID */ - hid_t dset_out; /* write dataset ID */ - hid_t type_in; /* named type ID */ - hid_t type_out; /* named type ID */ - hid_t dcpl_id; /* dataset creation property list ID */ - hid_t dcpl_out; /* dataset creation property list ID */ - hid_t f_space_id; /* file space ID */ - hid_t ftype_id; /* file type ID */ - hid_t wtype_id; /* read/write type ID */ + hid_t grp_in=-1; /* group ID */ + hid_t grp_out=-1; /* group ID */ + hid_t dset_in=-1; /* read dataset ID */ + hid_t dset_out=-1; /* write dataset ID */ + hid_t type_in=-1; /* named type ID */ + hid_t type_out=-1; /* named type ID */ + hid_t dcpl_id=-1; /* dataset creation property list ID */ + hid_t dcpl_out=-1; /* dataset creation property list ID */ + hid_t f_space_id=-1; /* file space ID */ + hid_t ftype_id=-1; /* file type ID */ + hid_t wtype_id=-1; /* read/write type ID */ size_t msize; /* size of type */ hsize_t nelmts; /* number of elements in dataset */ int rank; /* rank of dataset */ @@ -758,11 +758,11 @@ int copy_attr(hid_t loc_in, pack_opt_t *options ) { - hid_t attr_id; /* attr ID */ - hid_t attr_out; /* attr ID */ - hid_t space_id; /* space ID */ - hid_t ftype_id; /* file type ID */ - hid_t wtype_id; /* read/write type ID */ + hid_t attr_id=-1; /* attr ID */ + hid_t attr_out=-1; /* attr ID */ + hid_t space_id=-1; /* space ID */ + hid_t ftype_id=-1; /* file type ID */ + hid_t wtype_id=-1; /* read/write type ID */ size_t msize; /* size of type */ void *buf=NULL; /* data buffer */ hsize_t nelmts; /* number of elements in dataset */ diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c index 2a01f9e..7fce723 100644 --- a/tools/h5repack/h5repack_refs.c +++ b/tools/h5repack/h5repack_refs.c @@ -54,15 +54,15 @@ int do_copy_refobjs(hid_t fidin, trav_table_t *travt, pack_opt_t *options) /* repack options */ { - hid_t grp_in; /* read group ID */ - hid_t grp_out; /* write group ID */ - hid_t dset_in; /* read dataset ID */ - hid_t dset_out; /* write dataset ID */ - hid_t type_in; /* named type ID */ - hid_t dcpl_id; /* dataset creation property list ID */ - hid_t space_id; /* space ID */ - hid_t ftype_id; /* file type ID */ - hid_t wtype_id; /* read/write type ID */ + hid_t grp_in=-1; /* read group ID */ + hid_t grp_out=-1; /* write group ID */ + hid_t dset_in=-1; /* read dataset ID */ + hid_t dset_out=-1; /* write dataset ID */ + hid_t type_in=-1; /* named type ID */ + hid_t dcpl_id=-1; /* dataset creation property list ID */ + hid_t space_id=-1; /* space ID */ + hid_t ftype_id=-1; /* file type ID */ + hid_t wtype_id=-1; /* read/write type ID */ size_t msize; /* size of type */ hsize_t nelmts; /* number of elements in dataset */ int rank; /* rank of dataset */ diff --git a/tools/h5repack/testh5repack_main.c b/tools/h5repack/testh5repack_main.c index 3692b3e..7a5b46d 100644 --- a/tools/h5repack/testh5repack_main.c +++ b/tools/h5repack/testh5repack_main.c @@ -18,6 +18,23 @@ #include "testh5repack.h" #include "h5diff.h" +const char *FILENAME[] = { + FNAME1OUT, + FNAME2OUT, + FNAME3OUT, + FNAME4OUT, + FNAME5OUT, + FNAME7OUT, + FNAME8OUT, + FNAME9OUT, + FNAME10OUT, + FNAME11OUT, + FNAME12OUT, + FNAME13OUT, + FNAME14OUT, + NULL +}; + /*------------------------------------------------------------------------- * Function: main @@ -43,12 +60,19 @@ int main (int argc, const char *argv[]) #if defined (H5_HAVE_FILTER_SZIP) int szip_can_encode = 0; #endif + hid_t fapl; + + /* initialize */ memset(&diff_options, 0, sizeof (diff_opt_t)); memset(&pack_options, 0, sizeof (pack_opt_t)); /* run tests */ puts("Testing h5repack:"); + /* setup */ + fapl = h5_fileaccess(); + + /* make the test files */ if (make_testfiles()<0) goto error; @@ -1174,7 +1198,6 @@ if (szip_can_encode) { * test a big file *------------------------------------------------------------------------- */ - TESTING(" big file"); if (h5repack_init (&pack_options, 0)<0) TEST_ERROR; @@ -1196,6 +1219,8 @@ if (szip_can_encode) { puts("All h5repack tests passed."); + h5_cleanup(FILENAME, fapl); + return 0; error: diff --git a/tools/h5repack/testh5repack_make.c b/tools/h5repack/testh5repack_make.c index 319af3d..32016f6 100644 --- a/tools/h5repack/testh5repack_make.c +++ b/tools/h5repack/testh5repack_make.c @@ -25,7 +25,6 @@ #define GBLL ((unsigned long_long) 1024*1024*1024) - int make_all_objects(hid_t loc_id); int make_attributes(hid_t loc_id); int make_hlinks(hid_t loc_id); @@ -1311,10 +1310,10 @@ int make_big(hid_t loc_id) hid_t dcpl; hsize_t dims[1]={GBLL}; /* dataset dimensions */ hsize_t hs_size[1]={GBLL/1024}; /* hyperslab dimensions */ - hsize_t chunk_dims[1]={hs_size[0]}; /* chunk dimensions */ + hsize_t chunk_dims[1]={GBLL/1024}; /* chunk dimensions */ hsize_t hs_start[1]; size_t size; - size_t nelmts=(size_t)hs_size[0]; + size_t nelmts=(size_t)GBLL/1024; char fillvalue=-1; char *buf=NULL; int i, j, s; -- cgit v0.12