From 6fca8e80d00b23332af6dc0d694d30820e4d50cb Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 29 Jan 2013 14:31:27 -0500 Subject: [svn-r23201] Correct option text --- release_docs/CMake.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release_docs/CMake.txt b/release_docs/CMake.txt index 8fb5f5e..029d16d 100644 --- a/release_docs/CMake.txt +++ b/release_docs/CMake.txt @@ -295,7 +295,7 @@ HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF HDF5_TEST_VFD "Execute tests with different VFDs" OFF HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF -HDF5_USE_FOLDERS "Do not include CPack Packaging" OFF +HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." OFF HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON IF (APPLE) @@ -303,7 +303,7 @@ IF (APPLE) IF (CMAKE_BUILD_TYPE MATCHES Debug) HDF5_ENABLE_TRACE "Enable API tracing capability" ON IF (HDF5_TEST_VFD) - HDF5_TEST_FHEAP_VFD "Execute tests with different VFDs" ON + HDF5_TEST_FHEAP_VFD "Execute fheap test with different VFDs" ON IF (WIN32 AND NOT CYGWIN) HDF_LEGACY_NAMING "Use Legacy Names for Libraries and Programs" OFF HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF -- cgit v0.12 From 3b787c97d3d3161f20f187ff44c2e28cf9eaf39a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 29 Jan 2013 14:33:55 -0500 Subject: [svn-r23202] Add another warning to ignore list --- config/cmake/CTestCustom.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 6b6acc2..c33201f 100755 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -13,6 +13,7 @@ SET (CTEST_CUSTOM_WARNING_EXCEPTION "disabling jobserver mode" "config.cmake.xlatefile.c" "warning.*implicit declaration of function" + "note: expanded from macro" # "fpp:[ \t]*warning:[ \t]*cannot remove H5_DEBUG_API - not a predefined macro" ) -- cgit v0.12 From ab2f0d00f33a6b08ec152ec47fc14e2bfab098b8 Mon Sep 17 00:00:00 2001 From: Peter Cao Date: Wed, 30 Jan 2013 14:37:33 -0500 Subject: [svn-r23203] Add test program to generate test file for checking performance. --- tools/misc/h5perf_gentest.c | 528 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 528 insertions(+) create mode 100755 tools/misc/h5perf_gentest.c diff --git a/tools/misc/h5perf_gentest.c b/tools/misc/h5perf_gentest.c new file mode 100755 index 0000000..332e6e8 --- /dev/null +++ b/tools/misc/h5perf_gentest.c @@ -0,0 +1,528 @@ +/***************************************************************************** + This test generates attributes, groups, and datasets of many types. It + creates a large number of attributes, groups, and datasets by specifying + -a, -g, -d options respectively. Using "-h" option to see details. + + Programmer: Peter Cao , Jan. 2013 + ****************************************************************************/ + +#include "hdf5.h" +#include +#include + +#define FNAME "test_perf.h5" +#define NGROUPS 20 +#define NDSETS 20 +#define NATTRS 20 +#define NROWS 40 +#define NTYPES 9 +#define MAXVLEN 10 +#define FIXED_LEN 8 + +typedef enum { SOLID=0, LIQUID, GAS, PLASMA } phase_t; + +typedef struct { + int i; + unsigned long long l; + float f; + double d; + char s[FIXED_LEN]; + phase_t e; + float f_array[FIXED_LEN]; + hvl_t i_vlen; + char *s_vlen; +} test_comp_t; + +typedef struct { + int zipcode; + char *city; +} zipcode_t; + +void add_attrs(hid_t oid, int idx); +void add_attr(hid_t oid, const char *name, hid_t tid, hid_t sid, void *buf) ; + +int main (int argc, char *argv[]) +{ + char fname[32]; + int i, ngrps=NGROUPS, ndsets=NDSETS, nattrs=NATTRS, nrows=NROWS, + chunk=NROWS/10+1, vlen=MAXVLEN, l=0, z=0; + + memset(fname, 0, 32); + for (i=1; inrows) chunk=nrows/4; + if (chunk<1) chunk = 1; + if (vlen<1) vlen = MAXVLEN; + + if (strlen(fname)<=0) + sprintf(fname, FNAME); + + create_perf_test_file(fname, ngrps, ndsets, nattrs, nrows, (hsize_t)chunk, vlen, z, l); + + return 0; +} + +/***************************************************************************** + This function generates attributes, groups, and datasets of many types. + + Parameters: + fname: file_name. + ngrps: number of top level groups. + ndsets: number of datasets. + attrs: number of attributes. + nrow: number of rows in a dataset. + chunk: chunk size (single number). + vlen: max vlen size. + comp: use latest format. + latest: use gzip comnpression. + + Return: Non-negative on success/Negative on failure + + Programmer: Peter Cao , Jan. 2013 + ****************************************************************************/ +herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattrs, + int nrows, hsize_t chunk, int vlen, int compressed, int latest) +{ + int i, j, k; + hid_t fid, sid_null, sid_1d, sid_2d, did, aid, sid_2, fapl=H5P_DEFAULT, dcpl=H5P_DEFAULT, + gid1, gid2, cmp_tid, tid_str, tid_enum, tid_array_f, tid_vlen_i, + tid_vlen_s; + char name[32]; + hsize_t dims[1]={nrows}, dims2d[2]={nrows, (nrows/4+1)}, dims_array[1]={FIXED_LEN}, + dim1[1]={2}; + char *enum_names[4] = {"SOLID", "LIQUID", "GAS", "PLASMA"}; + test_comp_t *buf_comp=NULL; + int *buf_int=NULL; + float (*buf_float_a)[FIXED_LEN]=NULL; + double **buf_double2d=NULL; + hvl_t *buf_vlen_i=NULL; + char (*buf_str)[FIXED_LEN]; + char **buf_vlen_s=NULL; + hobj_ref_t buf_ref[2]; + hdset_reg_ref_t buf_reg_ref[2]; + size_t offset; + herr_t status; + char *names[NTYPES] = { "int", "ulong", "float", "double", "fixed string", + "enum", "fixed float array", "vlen int array", "vlen strings"}; + hid_t types[NTYPES] = { H5T_NATIVE_INT, H5T_NATIVE_UINT64, H5T_NATIVE_FLOAT, + H5T_NATIVE_DOUBLE, tid_str, tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s}; + hsize_t coords[4][2] = { {0, 1}, {3, 5}, {1, 0}, {2, 4}}, start=0, stride=1, count=1; + + /* create fixed string datatype */ + types[4] = tid_str = H5Tcopy (H5T_C_S1); + H5Tset_size (tid_str, FIXED_LEN); + + /* create enum datatype */ + types[5] = tid_enum = H5Tenum_create(H5T_NATIVE_INT); + for (i = (int) SOLID; i <= (int) PLASMA; i++) { + phase_t val = (phase_t) i; + status = H5Tenum_insert (tid_enum, enum_names[i], &val); + } + + /* create float array datatype */ + types[6] = tid_array_f = H5Tarray_create (H5T_NATIVE_FLOAT, 1, dims_array); + + /* create variable length integer datatypes */ + types[7] = tid_vlen_i = H5Tvlen_create (H5T_NATIVE_INT); + + /* create variable length string datatype */ + types[8] = tid_vlen_s = H5Tcopy (H5T_C_S1); + H5Tset_size (tid_vlen_s, H5T_VARIABLE); + + /* create compound datatypes */ + cmp_tid = H5Tcreate (H5T_COMPOUND, sizeof (test_comp_t)); + offset = 0; + for (i=0; i0) { + H5Pset_chunk (dcpl, 1, &chunk); + } + + /* set dataset compression */ + if (compressed) { + if (chunk<=0) { + chunk = nrows/10+1;; + H5Pset_chunk (dcpl, 1, &chunk); + } + H5Pset_shuffle (dcpl); + H5Pset_deflate (dcpl, 6); + } + + /* allocate buffers */ + buf_comp = (test_comp_t *)calloc(nrows, sizeof(test_comp_t)); + buf_int = (int *)calloc(nrows, sizeof(int)); + buf_float_a = malloc(nrows*sizeof(*buf_float_a)); + buf_vlen_i = (hvl_t *)calloc(nrows, sizeof (hvl_t)); + buf_vlen_s = (char **)calloc(nrows, sizeof(char *)); + buf_str = malloc(nrows*sizeof (*buf_str)); + + /* allocate array of doulbe pointers */ + buf_double2d = (double **)calloc(dims2d[0],sizeof(double *)); + /* allocate a contigous chunk of memory for the data */ + buf_double2d[0] = (double *)calloc( dims2d[0]*dims2d[1],sizeof(double) ); + /* assign memory city to pointer array */ + for (i=1; i Date: Wed, 30 Jan 2013 15:00:19 -0500 Subject: [svn-r23204] Update help information. --- tools/misc/h5perf_gentest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/misc/h5perf_gentest.c b/tools/misc/h5perf_gentest.c index 332e6e8..ef719ef 100755 --- a/tools/misc/h5perf_gentest.c +++ b/tools/misc/h5perf_gentest.c @@ -69,7 +69,7 @@ int main (int argc, char *argv[]) z = 1; else if (strcmp(argv[i], "-h")==0) { printf("\nOPTONS:\n"); - printf("\t-f F:\tfile_name (default: %s).\n", FNAME); + printf("\t-f F:\tname of the test file (default: %s).\n", FNAME); printf("\t-g N:\tnumber of top level groups (default: %d).\n", NGROUPS); printf("\t-d N:\tnumber of datasets (default: %d).\n", NDSETS); printf("\t-a N:\tnumber of attributes (default: %d).\n", NATTRS); @@ -78,6 +78,7 @@ int main (int argc, char *argv[]) printf("\t-v N:\tmax vlen size (default: %d).\n", MAXVLEN); printf("\t-l:\tuse latest format (default: no).\n"); printf("\t-z:\tuse gzip comnpression (default: no).\n"); + printf("\t-h:\tthis help information.\n"); printf("Example:\n"); printf("\t./a.out -f test.h5 -g 10000 -d 5000 -a 500 -r 400 -c 20 -v 40 -l -z\n\n"); exit(0); -- cgit v0.12 From 7461ce3958c10dc7c6401302d7adda6cefbbba71 Mon Sep 17 00:00:00 2001 From: Peter Cao Date: Wed, 30 Jan 2013 15:06:46 -0500 Subject: [svn-r23205] correct a typo in the instruction. --- tools/misc/h5perf_gentest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/misc/h5perf_gentest.c b/tools/misc/h5perf_gentest.c index ef719ef..ea8a2c8 100755 --- a/tools/misc/h5perf_gentest.c +++ b/tools/misc/h5perf_gentest.c @@ -77,7 +77,7 @@ int main (int argc, char *argv[]) printf("\t-c N:\tchunk size (default: %d).\n", (NROWS/10+1)); printf("\t-v N:\tmax vlen size (default: %d).\n", MAXVLEN); printf("\t-l:\tuse latest format (default: no).\n"); - printf("\t-z:\tuse gzip comnpression (default: no).\n"); + printf("\t-z:\tuse gzip compression (default: no).\n"); printf("\t-h:\tthis help information.\n"); printf("Example:\n"); printf("\t./a.out -f test.h5 -g 10000 -d 5000 -a 500 -r 400 -c 20 -v 40 -l -z\n\n"); -- cgit v0.12 From d42db65e892602db57a314cad83414c89bd74aa1 Mon Sep 17 00:00:00 2001 From: Peter Cao Date: Wed, 30 Jan 2013 15:53:15 -0500 Subject: [svn-r23206] minor fixes for number of attributes to be created. --- tools/misc/h5perf_gentest.c | 65 ++++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/tools/misc/h5perf_gentest.c b/tools/misc/h5perf_gentest.c index ea8a2c8..b5b8059 100755 --- a/tools/misc/h5perf_gentest.c +++ b/tools/misc/h5perf_gentest.c @@ -38,8 +38,8 @@ typedef struct { char *city; } zipcode_t; -void add_attrs(hid_t oid, int idx); -void add_attr(hid_t oid, const char *name, hid_t tid, hid_t sid, void *buf) ; +int add_attrs(hid_t oid, int idx); +int add_attr(hid_t oid, const char *name, hid_t tid, hid_t sid, void *buf) ; int main (int argc, char *argv[]) { @@ -263,10 +263,10 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattr /* add attributes*/ gid1 = H5Gcreate (fid, "attributes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - nattrs = nattrs/6; if (nattrs<1) nattrs = 1; - for (i=0; i Date: Wed, 30 Jan 2013 16:09:56 -0500 Subject: [svn-r23207] add the new test file to the list. --- MANIFEST | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MANIFEST b/MANIFEST index 8384c2f..e0ffe8f 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1300,6 +1300,8 @@ ./tools/misc/talign.c ./tools/misc/testfiles/h5mkgrp_help.txt ./tools/misc/testfiles/h5mkgrp_version.txt.in +./tools/misc/h5perf_gentest.c + # h5stat sources ./tools/h5stat/Makefile.am -- cgit v0.12 From 9d23b171a5e54c8e1c2d254e2e4b24003d3caf61 Mon Sep 17 00:00:00 2001 From: Peter Cao Date: Wed, 30 Jan 2013 17:06:40 -0500 Subject: [svn-r23208] adding a large compound dataset to the test file --- tools/misc/h5perf_gentest.c | 97 ++++++++++++++++++++++++++++++++------------- 1 file changed, 70 insertions(+), 27 deletions(-) diff --git a/tools/misc/h5perf_gentest.c b/tools/misc/h5perf_gentest.c index b5b8059..6442a10 100755 --- a/tools/misc/h5perf_gentest.c +++ b/tools/misc/h5perf_gentest.c @@ -14,7 +14,8 @@ #define NGROUPS 20 #define NDSETS 20 #define NATTRS 20 -#define NROWS 40 +#define DIM0 40 +#define NROWS 100 #define NTYPES 9 #define MAXVLEN 10 #define FIXED_LEN 8 @@ -40,12 +41,15 @@ typedef struct { int add_attrs(hid_t oid, int idx); int add_attr(hid_t oid, const char *name, hid_t tid, hid_t sid, void *buf) ; +herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, + int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen, + int compressed, int latest); int main (int argc, char *argv[]) { char fname[32]; - int i, ngrps=NGROUPS, ndsets=NDSETS, nattrs=NATTRS, nrows=NROWS, - chunk=NROWS/10+1, vlen=MAXVLEN, l=0, z=0; + int i, ngrps=NGROUPS, ndsets=NDSETS, nattrs=NATTRS, dim0=DIM0, + chunk=DIM0/10+1, nrows=NROWS, vlen=MAXVLEN, l=0, z=0; memset(fname, 0, 32); for (i=1; inrows) chunk=nrows/4; + if (dim0dim0) chunk=dim0/4; if (chunk<1) chunk = 1; if (vlen<1) vlen = MAXVLEN; if (strlen(fname)<=0) sprintf(fname, FNAME); - create_perf_test_file(fname, ngrps, ndsets, nattrs, nrows, (hsize_t)chunk, vlen, z, l); + create_perf_test_file(fname, ngrps, ndsets, nattrs, (hsize_t)nrows, + (hsize_t)dim0, (hsize_t)chunk, vlen, z, l); return 0; } @@ -119,18 +127,19 @@ int main (int argc, char *argv[]) Programmer: Peter Cao , Jan. 2013 ****************************************************************************/ -herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattrs, - int nrows, hsize_t chunk, int vlen, int compressed, int latest) +herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, + int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen, + int compressed, int latest) { int i, j, k; - hid_t fid, sid_null, sid_1d, sid_2d, did, aid, sid_2, fapl=H5P_DEFAULT, dcpl=H5P_DEFAULT, - gid1, gid2, cmp_tid, tid_str, tid_enum, tid_array_f, tid_vlen_i, - tid_vlen_s; + hid_t fid, sid_null, sid_1d, sid_2d, did, aid, sid_2, sid_large, + fapl=H5P_DEFAULT, dcpl=H5P_DEFAULT, gid1, gid2, cmp_tid, tid_str, + tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s; char name[32]; - hsize_t dims[1]={nrows}, dims2d[2]={nrows, (nrows/4+1)}, dims_array[1]={FIXED_LEN}, + hsize_t dims[1]={dim0}, dims2d[2]={dim0, (dim0/4+1)}, dims_array[1]={FIXED_LEN}, dim1[1]={2}; char *enum_names[4] = {"SOLID", "LIQUID", "GAS", "PLASMA"}; - test_comp_t *buf_comp=NULL; + test_comp_t *buf_comp=NULL, *buf_comp_large=NULL; int *buf_int=NULL; float (*buf_float_a)[FIXED_LEN]=NULL; double **buf_double2d=NULL; @@ -146,6 +155,9 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattr hid_t types[NTYPES] = { H5T_NATIVE_INT, H5T_NATIVE_UINT64, H5T_NATIVE_FLOAT, H5T_NATIVE_DOUBLE, tid_str, tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s}; hsize_t coords[4][2] = { {0, 1}, {3, 5}, {1, 0}, {2, 4}}, start=0, stride=1, count=1; + + /* the large compound dataset will be at least as large as regular datasets. */ + if (nrows < dim0) nrows = dim0; /* create fixed string datatype */ types[4] = tid_str = H5Tcopy (H5T_C_S1); @@ -184,6 +196,7 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattr sid_1d = H5Screate_simple (1, dims, NULL); sid_2d = H5Screate_simple (2, dims2d, NULL); sid_2 = H5Screate_simple (1, dim1, NULL); + sid_large = H5Screate_simple (1, &nrows, NULL); sid_null = H5Screate (H5S_NULL); /* create fid access property */ @@ -201,7 +214,7 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattr /* set dataset compression */ if (compressed) { if (chunk<=0) { - chunk = nrows/10+1;; + chunk = dim0/10+1;; H5Pset_chunk (dcpl, 1, &chunk); } H5Pset_shuffle (dcpl); @@ -209,12 +222,13 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattr } /* allocate buffers */ - buf_comp = (test_comp_t *)calloc(nrows, sizeof(test_comp_t)); - buf_int = (int *)calloc(nrows, sizeof(int)); - buf_float_a = malloc(nrows*sizeof(*buf_float_a)); - buf_vlen_i = (hvl_t *)calloc(nrows, sizeof (hvl_t)); - buf_vlen_s = (char **)calloc(nrows, sizeof(char *)); - buf_str = malloc(nrows*sizeof (*buf_str)); + buf_comp = (test_comp_t *)calloc(dim0, sizeof(test_comp_t)); + buf_comp_large = (test_comp_t *)calloc(nrows, sizeof(test_comp_t)); + buf_int = (int *)calloc(dim0, sizeof(int)); + buf_float_a = malloc(dim0*sizeof(*buf_float_a)); + buf_vlen_i = (hvl_t *)calloc(dim0, sizeof (hvl_t)); + buf_vlen_s = (char **)calloc(dim0, sizeof(char *)); + buf_str = malloc(dim0*sizeof (*buf_str)); /* allocate array of doulbe pointers */ buf_double2d = (double **)calloc(dims2d[0],sizeof(double *)); @@ -253,7 +267,23 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattr buf_double2d[i][j] = i+j/10000.0; } - + for (i=0; i Date: Thu, 31 Jan 2013 09:28:04 -0500 Subject: [svn-r23209] Change "diff -b" to just "cmp" for tests. diff is for text files and the ddl redirect does not have an ending newline. --- tools/h5dump/testh5dump.sh.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index c766b51..57c7d96 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -31,7 +31,7 @@ H5IMPORT=../h5import/h5import # The h5import tool name H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary -CMP='diff -b' # Compares without end of file newlines +CMP='cmp' DIFF='diff -c' CP='cp' DIRNAME='dirname' @@ -433,13 +433,13 @@ TOOLTEST() { else echo "*FAILED*" echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext + rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext fi } -- cgit v0.12 From 415aa7e257df7fc9ba85117ee8f66e5ef6dcf0df Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 31 Jan 2013 15:51:23 -0500 Subject: [svn-r23216] Add newline for special case of only raw data to stdout --- tools/lib/h5tools.c | 9 +++++++-- tools/testfiles/tnoattrddl.ddl | 2 +- tools/testfiles/tnoddl.ddl | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 254c8b4..66c0e64 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -157,6 +157,9 @@ h5tools_close(void) H5E_auto2_t tools_func; void *tools_edata; if (h5tools_init_g) { + if((rawoutstream == NULL) && rawdatastream && (rawdatastream == stdout)) + HDfprintf(rawdatastream, "\n"); + H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); if(tools_func!=NULL) H5Eprint2(H5tools_ERR_STACK_g, rawerrorstream); @@ -1237,7 +1240,8 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t break; case H5T_REFERENCE: { - if (H5Tequal(tid, H5T_STD_REF_DSETREG)) { + if (size == H5R_DSET_REG_REF_BUF_SIZE) { + /* if (H5Tequal(tid, H5T_STD_REF_DSETREG)) */ if (region_output) { /* region data */ hid_t region_id, region_space; @@ -1261,7 +1265,8 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t } } /* end if (region_output... */ } - else if (H5Tequal(tid, H5T_STD_REF_OBJ)) { + else if (size == H5R_OBJ_REF_BUF_SIZE) { + /* if (H5Tequal(tid, H5T_STD_REF_OBJ)) */ ; } } diff --git a/tools/testfiles/tnoattrddl.ddl b/tools/testfiles/tnoattrddl.ddl index c68877d..f7326d0 100644 --- a/tools/testfiles/tnoattrddl.ddl +++ b/tools/testfiles/tnoattrddl.ddl @@ -4,4 +4,4 @@ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9 100 - "string attribute" \ No newline at end of file + "string attribute" diff --git a/tools/testfiles/tnoddl.ddl b/tools/testfiles/tnoddl.ddl index dc19888..5238777 100644 --- a/tools/testfiles/tnoddl.ddl +++ b/tools/testfiles/tnoddl.ddl @@ -399,4 +399,4 @@ 4, 4.0001, 4.0002, 4.0003, 4.0004, 4.0005, 4.0006, 4.0007, 5, 5.0001, 5.0002, 5.0003, 5.0004, 5.0005, 5.0006, 5.0007, 6, 6.0001, 6.0002, 6.0003, 6.0004, 6.0005, 6.0006, 6.0007, - 7, 7.0001, 7.0002, 7.0003, 7.0004, 7.0005, 7.0006, 7.0007 \ No newline at end of file + 7, 7.0001, 7.0002, 7.0003, 7.0004, 7.0005, 7.0006, 7.0007 -- cgit v0.12 From 5140343f45312d4d2e486e6cc7645c7bc42b1267 Mon Sep 17 00:00:00 2001 From: Peter Cao Date: Thu, 31 Jan 2013 17:15:15 -0500 Subject: [svn-r23217] add scalr vlen string datasets --- tools/misc/h5perf_gentest.c | 111 +++++++++++++++++++++++++------------------- 1 file changed, 63 insertions(+), 48 deletions(-) diff --git a/tools/misc/h5perf_gentest.c b/tools/misc/h5perf_gentest.c index 6442a10..6a080d0 100755 --- a/tools/misc/h5perf_gentest.c +++ b/tools/misc/h5perf_gentest.c @@ -92,14 +92,6 @@ int main (int argc, char *argv[]) } } - if (ngrpsdim0) chunk=dim0/4; - if (chunk<1) chunk = 1; - if (vlen<1) vlen = MAXVLEN; - if (strlen(fname)<=0) sprintf(fname, FNAME); @@ -132,10 +124,10 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, int compressed, int latest) { int i, j, k; - hid_t fid, sid_null, sid_1d, sid_2d, did, aid, sid_2, sid_large, + hid_t fid, sid_null, sid_scalar, sid_1d, sid_2d, did, aid, sid_2, sid_large, fapl=H5P_DEFAULT, dcpl=H5P_DEFAULT, gid1, gid2, cmp_tid, tid_str, tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s; - char name[32]; + char name[32], tmp_name1[32], tmp_name2[32], tmp_name3[32]; hsize_t dims[1]={dim0}, dims2d[2]={dim0, (dim0/4+1)}, dims_array[1]={FIXED_LEN}, dim1[1]={2}; char *enum_names[4] = {"SOLID", "LIQUID", "GAS", "PLASMA"}; @@ -148,7 +140,7 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, char **buf_vlen_s=NULL; hobj_ref_t buf_ref[2]; hdset_reg_ref_t buf_reg_ref[2]; - size_t offset; + size_t offset, len; herr_t status; char *names[NTYPES] = { "int", "ulong", "float", "double", "fixed string", "enum", "fixed float array", "vlen int array", "vlen strings"}; @@ -156,8 +148,14 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, H5T_NATIVE_DOUBLE, tid_str, tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s}; hsize_t coords[4][2] = { {0, 1}, {3, 5}, {1, 0}, {2, 4}}, start=0, stride=1, count=1; - /* the large compound dataset will be at least as large as regular datasets. */ - if (nrows < dim0) nrows = dim0; + if (nrows < NROWS) nrows = NROWS; + if (ngrpsdim0) chunk=dim0/4; + if (chunk<1) chunk = 1; + if (vlen<1) vlen = MAXVLEN; /* create fixed string datatype */ types[4] = tid_str = H5Tcopy (H5T_C_S1); @@ -198,6 +196,7 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, sid_2 = H5Screate_simple (1, dim1, NULL); sid_large = H5Screate_simple (1, &nrows, NULL); sid_null = H5Screate (H5S_NULL); + sid_scalar = H5Screate (H5S_SCALAR); /* create fid access property */ fapl = H5Pcreate (H5P_FILE_ACCESS); @@ -238,6 +237,7 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, for (i=1; i Date: Fri, 1 Feb 2013 20:53:32 -0500 Subject: [svn-r23219] Description: Bring reviewed changes from Coverity branch back to trunk (QK & JK): r20457: Coverity issue 691: return of H5duo could be negative. Fixed by using STDOUT_FILENO and redesign parse_command_line and main to cleanup file allocations. The output_file var is null when using stdout. In cleanup do not close output_file if NULL. r20510: Initialize ufid = -1 and predicate HDclose call on ufid != -1 r20511: Purpose: Fix coverity issue 1715 Description: Free "file" and nested data on failure in H5FD_core_open. r20512: Initialize ifid = -1 and predicate HDclose call on ifid != -1 r20514: Initialize h5fid = -1 and predicate HDclose call on h5fid != -1 r20516: Added else branch to the if (ret_value < 0) check. r20522: Addressed coverity issues 930-933, 850, 836, 835, 1307. All minor potential buffer overwrite bugs, or coverity errors. Fixed by replacing strcpy and sprintf with strncpy and snprintf. r20523: fixed coverity issues 68, 1120, 1116i r20524: Check H5Z_SZIP->encoder_present < 1 assuming 0 represents absence. r20601: Purpose: Fix coverity issues 1703-1705 Description: Modified the cleanup code in test_free in accum.c to reset allocated buffers to NULL after they are freed, and modified the error cleanup code to check if these buffers are NULL before freeing them. Also fixed some unrelated warnings in accum.c. r20602: Use HDsnprintf and HDstrncat r20603: Purpose: Fix coverity issues 808-809 Description: Modified test_core in vfd.c to check the returns from malloc, and keep track of whether points and check are allocated by setting them to NULL when they are not. Added code to free points and check on error if they are not NULL. Also fixed unrelated warnings in vfd.c. r20604: Use HDstrncpy. r20605: Use HDstrncpy and HDstrncat. r20606: Purpose: Fix coverity issue 807 Description: Modified long_compact in stab.c to keep track of whether objname is allocated by setting it to NULL when it is not. Added code to free objname on error if it is not NULL. r20607: Changed string function calls to use versions that specify the string length to fix coverity issues 832 and 839. Tested on: Mac OSX/64 10.8.2 (amazon) (Too minor to require h5committest) --- c++/src/H5CommonFG.cpp | 49 +---- src/H5.c | 10 +- src/H5FDcore.c | 8 + src/H5FDmulti.c | 110 ++++++----- src/H5Gint.c | 4 +- src/H5Gname.c | 53 +++-- src/H5system.c | 526 +++++++++++++++++++++++++------------------------ test/accum.c | 22 ++- test/stab.c | 9 +- test/vfd.c | 219 ++++++++++---------- tools/h5jam/h5unjam.c | 165 ++++++++-------- tools/lib/h5tools.c | 52 ++--- 12 files changed, 623 insertions(+), 604 deletions(-) diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index dcc331f..b3889a0 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -130,9 +130,7 @@ Group CommonFG::openGroup( const char* name ) const // If the opening of the group failed, throw an exception if( group_id < 0 ) - { throwException("openGroup", "H5Gopen2 failed"); - } // No failure, create and return the Group object Group group( group_id ); @@ -174,9 +172,7 @@ DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, co // If the creation of the dataset failed, throw an exception if( dataset_id < 0 ) - { throwException("createDataSet", "H5Dcreate2 failed"); - } // No failure, create and return the DataSet object DataSet dataset( dataset_id ); @@ -270,9 +266,8 @@ void CommonFG::link( H5L_type_t link_type, const char* curr_name, const char* ne break; } /* end switch */ - if( ret_value < 0 ) { + if( ret_value < 0 ) throwException("link", "creating link failed"); - } } //-------------------------------------------------------------------------- @@ -300,9 +295,7 @@ void CommonFG::unlink( const char* name ) const { herr_t ret_value = H5Ldelete( getLocId(), name, H5P_DEFAULT ); if( ret_value < 0 ) - { throwException("unlink", "H5Ldelete failed"); - } } //-------------------------------------------------------------------------- @@ -336,9 +329,7 @@ void CommonFG::move( const char* src, const char* dst ) const { herr_t ret_value = H5Lmove( getLocId(), src, H5L_SAME_LOC, dst, H5P_DEFAULT, H5P_DEFAULT ); if( ret_value < 0 ) - { throwException("move", "H5Lmove failed"); - } } //-------------------------------------------------------------------------- @@ -371,9 +362,7 @@ void CommonFG::getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& st { herr_t ret_value = H5Gget_objinfo( getLocId(), name, follow_link, &statbuf ); if( ret_value < 0 ) - { throwException("getObjinfo", "H5Gget_objinfo failed"); - } } //-------------------------------------------------------------------------- @@ -400,9 +389,7 @@ void CommonFG::getObjinfo( const char* name, H5G_stat_t& statbuf ) const { herr_t ret_value = H5Gget_objinfo( getLocId(), name, 0, &statbuf ); if( ret_value < 0 ) - { throwException("getObjinfo", "H5Gget_objinfo failed"); - } } //-------------------------------------------------------------------------- @@ -440,9 +427,8 @@ H5std_string CommonFG::getLinkval( const char* name, size_t size ) const { ret_value = H5Lget_info(getLocId(), name, &linkinfo, H5P_DEFAULT); if( ret_value < 0 ) - { throwException("getLinkval", "H5Lget_info to find buffer size failed"); - } + val_size = linkinfo.u.val_size; } @@ -453,9 +439,8 @@ H5std_string CommonFG::getLinkval( const char* name, size_t size ) const ret_value = H5Lget_val(getLocId(), name, value_C, val_size, H5P_DEFAULT); if( ret_value < 0 ) - { throwException("getLinkval", "H5Lget_val failed"); - } + value = H5std_string(value_C); delete []value_C; } @@ -498,9 +483,7 @@ void CommonFG::setComment( const char* name, const char* comment ) const { herr_t ret_value = H5Oset_comment_by_name( getLocId(), name, comment, H5P_DEFAULT ); if( ret_value < 0 ) - { throwException("setComment", "H5Oset_comment_by_name failed"); - } } //-------------------------------------------------------------------------- @@ -530,9 +513,7 @@ void CommonFG::removeComment(const char* name) const { herr_t ret_value = H5Oset_comment_by_name(getLocId(), name, NULL, H5P_DEFAULT); if( ret_value < 0 ) - { throwException("removeComment", "H5Oset_comment_by_name failed"); - } } //-------------------------------------------------------------------------- @@ -588,9 +569,8 @@ H5std_string CommonFG::getComment( const char* name, size_t bufsize ) const // if H5Oget_comment_by_name returns SUCCEED, return the string comment, // otherwise, throw an exception if( ret_value < 0 ) - { throwException("getComment", "H5Oget_comment_by_name failed"); - } + H5std_string comment = H5std_string(comment_C); delete []comment_C; return (comment); @@ -628,9 +608,7 @@ void CommonFG::mount( const char* name, H5File& child, PropList& plist ) const // Raise exception if H5Fmount returns negative value if( ret_value < 0 ) - { throwException("mount", "H5Fmount failed"); - } } //-------------------------------------------------------------------------- @@ -659,9 +637,7 @@ void CommonFG::unmount( const char* name ) const // Raise exception if H5Funmount returns negative value if( ret_value < 0 ) - { throwException("unmount", "H5Funmount failed"); - } } //-------------------------------------------------------------------------- @@ -1006,9 +982,7 @@ hsize_t CommonFG::getNumObjs() const herr_t ret_value = H5Gget_info(getLocId(), &ginfo); if(ret_value < 0) - { throwException("getNumObjs", "H5Gget_info failed"); - } return (ginfo.nlinks); } @@ -1032,9 +1006,7 @@ H5std_string CommonFG::getObjnameByIdx(hsize_t idx) const // call H5Lget_name_by_idx with name as NULL to get its length ssize_t name_len = H5Lget_name_by_idx(getLocId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, NULL, 0, H5P_DEFAULT); if(name_len < 0) - { throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); - } // now, allocate C buffer to get the name char* name_C = new char[name_len+1]; @@ -1067,9 +1039,8 @@ ssize_t CommonFG::getObjnameByIdx(hsize_t idx, char* name, size_t size) const { ssize_t name_len = H5Lget_name_by_idx(getLocId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, name, size, H5P_DEFAULT); if(name_len < 0) - { throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); - } + return (name_len); } @@ -1085,9 +1056,8 @@ ssize_t CommonFG::getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) char* name_C = new char[size]; ssize_t name_len = getObjnameByIdx(idx, name_C, size); if(name_len < 0) - { throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); - } + name = H5std_string(name_C); delete []name_C; return (name_len); @@ -1107,9 +1077,8 @@ H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx) const { H5G_obj_t obj_type = H5Gget_objtype_by_idx(getLocId(), idx); if (obj_type == H5G_UNKNOWN) - { throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed"); - } + return (obj_type); } @@ -1135,9 +1104,7 @@ H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, char* type_name) const case H5G_TYPE: HDstrcpy(type_name, "datatype"); break; case H5G_UNKNOWN: default: - { throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed"); - } } return (obj_type); } @@ -1163,9 +1130,7 @@ H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const case H5G_TYPE: type_name = H5std_string("datatype"); break; case H5G_UNKNOWN: default: - { throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed"); - } } return (obj_type); } diff --git a/src/H5.c b/src/H5.c index 4176d96..14ec7ca 100644 --- a/src/H5.c +++ b/src/H5.c @@ -714,14 +714,14 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) if (!disable_version_check){ /* - *verify if H5_VERS_INFO is consistent with the other version information. - *Check only the first sizeof(lib_str) char. Assume the information - *will fit within this size or enough significance. + * Verify if H5_VERS_INFO is consistent with the other version information. + * Check only the first sizeof(lib_str) char. Assume the information + * will fit within this size or enough significance. */ - sprintf(lib_str, "HDF5 library version: %d.%d.%d", + HDsnprintf(lib_str, sizeof(lib_str), "HDF5 library version: %d.%d.%d", H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE); if(*substr) { - HDstrcat(lib_str, "-"); + HDstrncat(lib_str, "-", 1); HDstrncat(lib_str, substr, (sizeof(lib_str) - HDstrlen(lib_str)) - 1); } /* end if */ if (HDstrcmp(lib_str, H5_lib_vers_info_g)){ diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 03cc15e..43c8945 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -570,6 +570,14 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) ret_value = (H5FD_t *)file; done: + if(!ret_value && file) { + if(file->fd >= 0) + HDclose(file->fd); + H5MM_xfree(file->name); + H5MM_xfree(file->mem); + H5MM_xfree(file); + } /* end if */ + FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_core_open() */ diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 16934e3..c2701c4 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -77,6 +77,7 @@ #define H5FD_MULTI_DXPL_PROP_NAME "H5FD_MULTI_DXPL" #define H5FD_MULTI_DXPL_PROP_SIZE sizeof(H5FD_multi_dxpl_t) +#define H5FD_MULT_MAX_FILE_NAME_LEN 1024 /* The driver identification number, initialized at runtime */ static hid_t H5FD_MULTI_g = 0; @@ -207,12 +208,14 @@ static char * my_strdup(const char *s) { char *x; + size_t str_len; if(!s) return NULL; - if(NULL == (x = (char *)malloc(strlen(s) + 1))) + str_len = strlen(s) + 1; + if(NULL == (x = (char *)malloc(str_len))) return NULL; - strcpy(x, s); + memcpy(x, s, str_len); return x; } @@ -301,7 +304,7 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; hid_t memb_fapl[H5FD_MEM_NTYPES]; const char *memb_name[H5FD_MEM_NTYPES]; - char meta_name[1024], raw_name[1024]; + char meta_name[H5FD_MULT_MAX_FILE_NAME_LEN], raw_name[H5FD_MULT_MAX_FILE_NAME_LEN]; haddr_t memb_addr[H5FD_MEM_NTYPES]; /*NO TRACE*/ @@ -324,25 +327,39 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, /* The names */ /* process meta filename */ - if (meta_ext){ - if (strstr(meta_ext, "%s")) - strcpy(meta_name, meta_ext); + if(meta_ext) { + if(strstr(meta_ext, "%s")) { + /* Note: this doesn't accommodate for when the '%s' in the user's + * string is at a position >sizeof(meta_name) - QK & JK - 2013/01/17 + */ + strncpy(meta_name, meta_ext, sizeof(meta_name)); + meta_name[sizeof(meta_name) - 1] = '\0'; + } else - sprintf(meta_name, "%%s%s", meta_ext); + snprintf(meta_name, sizeof(meta_name), "%%s%s", meta_ext); + } + else { + strncpy(meta_name, "%s.meta", sizeof(meta_name)); + meta_name[sizeof(meta_name) - 1] = '\0'; } - else - strcpy(meta_name, "%s.meta"); memb_name[H5FD_MEM_SUPER] = meta_name; /* process raw filename */ - if (raw_ext){ - if (strstr(raw_ext, "%s")) - strcpy(raw_name, raw_ext); + if(raw_ext) { + if(strstr(raw_ext, "%s")) { + /* Note: this doesn't accommodate for when the '%s' in the user's + * string is at a position >sizeof(raw_name) - QK & JK - 2013/01/17 + */ + strncpy(raw_name, raw_ext, sizeof(raw_name)); + raw_name[sizeof(raw_name) - 1] = '\0'; + } else - sprintf(raw_name, "%%s%s", raw_ext); + snprintf(raw_name, sizeof(raw_name), "%%s%s", raw_ext); + } + else { + strncpy(raw_name, "%s.raw", sizeof(raw_name)); + raw_name[sizeof(raw_name) - 1] = '\0'; } - else - strcpy(raw_name, "%s.raw"); memb_name[H5FD_MEM_DRAW] = raw_name; /* The sizes */ @@ -471,7 +488,7 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, if (!memb_name) { assert(strlen(letters)==H5FD_MEM_NTYPES); for (mt=H5FD_MEM_DEFAULT; mtmemb_fapl[mt]; /*default or bad ID*/ } } - if (memb_name) { - for (mt=H5FD_MEM_DEFAULT; mtmemb_name[mt]) { - memb_name[mt] = (char *)malloc(strlen(fa->memb_name[mt])+1); - strcpy(memb_name[mt], fa->memb_name[mt]); - } else + if(memb_name) { + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { + if(fa->memb_name[mt]) + memb_name[mt] = my_strdup(fa->memb_name[mt]); + else memb_name[mt] = NULL; } } @@ -969,17 +985,17 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/, p += sizeof(haddr_t); nseen++; } END_MEMBERS; - if (H5Tconvert(H5T_NATIVE_HADDR, H5T_STD_U64LE, nseen*2, buf+8, NULL, - H5P_DEFAULT)<0) + if (H5Tconvert(H5T_NATIVE_HADDR, H5T_STD_U64LE, nseen*2, buf+8, NULL, H5P_DEFAULT)<0) H5Epush_ret(func, H5E_ERR_CLS, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1) /* Encode all name templates */ p = buf + 8 + nseen*2*8; UNIQUE_MEMBERS(file->fa.memb_map, mt) { size_t n = strlen(file->fa.memb_name[mt]) + 1; - strcpy((char *)p, file->fa.memb_name[mt]); + strncpy((char *)p, file->fa.memb_name[mt], n); p += n; - for (i=n; i%8; i++) *p++ = '\0'; + for (i=n; i%8; i++) + *p++ = '\0'; } END_MEMBERS; return 0; @@ -1209,19 +1225,21 @@ H5FD_multi_fapl_copy(const void *_old_fa) ALL_MEMBERS(mt) { if (old_fa->memb_fapl[mt]>=0) { new_fa->memb_fapl[mt] = H5Pcopy(old_fa->memb_fapl[mt]); - if (new_fa->memb_fapl[mt]<0) nerrors++; + if(new_fa->memb_fapl[mt]<0) + nerrors++; } if (old_fa->memb_name[mt]) { - new_fa->memb_name[mt] = (char *)malloc(strlen(old_fa->memb_name[mt])+1); + new_fa->memb_name[mt] = my_strdup(old_fa->memb_name[mt]); assert(new_fa->memb_name[mt]); - strcpy(new_fa->memb_name[mt], old_fa->memb_name[mt]); } } END_MEMBERS; if (nerrors) { ALL_MEMBERS(mt) { - if (new_fa->memb_fapl[mt]>=0) (void)H5Pclose(new_fa->memb_fapl[mt]); - if (new_fa->memb_name[mt]) free(new_fa->memb_name[mt]); + if (new_fa->memb_fapl[mt]>=0) + (void)H5Pclose(new_fa->memb_fapl[mt]); + if (new_fa->memb_name[mt]) + free(new_fa->memb_name[mt]); } END_MEMBERS; free(new_fa); H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "invalid freespace objects", NULL) @@ -2191,7 +2209,7 @@ compute_next(H5FD_multi_t *file) static int open_members(H5FD_multi_t *file) { - char tmp[1024]; + char tmp[H5FD_MULT_MAX_FILE_NAME_LEN]; int nerrors=0; static const char *func="(H5FD_multi)open_members"; /* Function Name for error reporting */ @@ -2199,30 +2217,28 @@ open_members(H5FD_multi_t *file) H5Eclear2(H5E_DEFAULT); UNIQUE_MEMBERS(file->fa.memb_map, mt) { - if (file->memb[mt]) continue; /*already open*/ + if(file->memb[mt]) + continue; /*already open*/ assert(file->fa.memb_name[mt]); - sprintf(tmp, file->fa.memb_name[mt], file->name); + /* Note: This truncates the user's filename down to only sizeof(tmp) + * characters. -QK & JK, 2013/01/17 + */ + snprintf(tmp, sizeof(tmp), file->fa.memb_name[mt], file->name); #ifdef H5FD_MULTI_DEBUG - if (file->flags & H5F_ACC_DEBUG) { - fprintf(stderr, "H5FD_MULTI: open member %d \"%s\"\n", - (int)mt, tmp); - } + if(file->flags & H5F_ACC_DEBUG) + fprintf(stderr, "H5FD_MULTI: open member %d \"%s\"\n", (int)mt, tmp); #endif H5E_BEGIN_TRY { - file->memb[mt] = H5FDopen(tmp, file->flags, file->fa.memb_fapl[mt], - HADDR_UNDEF); + file->memb[mt] = H5FDopen(tmp, file->flags, file->fa.memb_fapl[mt], HADDR_UNDEF); } H5E_END_TRY; - if (!file->memb[mt]) { + if(!file->memb[mt]) { #ifdef H5FD_MULTI_DEBUG - if (file->flags & H5F_ACC_DEBUG) { - fprintf(stderr, "H5FD_MULTI: open failed for member %d\n", - (int)mt); - } + if(file->flags & H5F_ACC_DEBUG) + fprintf(stderr, "H5FD_MULTI: open failed for member %d\n", (int)mt); #endif - if (!file->fa.relax || (file->flags & H5F_ACC_RDWR)) { + if(!file->fa.relax || (file->flags & H5F_ACC_RDWR)) nerrors++; - } } } END_MEMBERS; if (nerrors) diff --git a/src/H5Gint.c b/src/H5Gint.c index ad2e57e..fe8b995 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -928,7 +928,7 @@ H5G_visit_cb(const H5O_link_t *lnk, void *_udata) /* Build the link's relative path name */ HDassert(udata->path[old_path_len] == '\0'); - HDstrcpy(&(udata->path[old_path_len]), lnk->name); + HDstrncpy(&(udata->path[old_path_len]), lnk->name, link_name_len + 1); udata->curr_path_len += link_name_len; /* Construct the link info from the link message */ @@ -992,7 +992,7 @@ H5G_visit_cb(const H5O_link_t *lnk, void *_udata) /* Add the path separator to the current path */ HDassert(udata->path[udata->curr_path_len] == '\0'); - HDstrcpy(&(udata->path[udata->curr_path_len]), "/"); + HDstrncpy(&(udata->path[udata->curr_path_len]), "/", 2); udata->curr_path_len++; /* Attempt to get the link info for this group */ diff --git a/src/H5Gname.c b/src/H5Gname.c index 576d866..6619c86 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -293,7 +293,9 @@ static H5RS_str_t * H5G_build_fullpath(const char *prefix, const char *name) { char *full_path; /* Full user path built */ + size_t orig_path_len; /* Original length of the path */ size_t path_len; /* Length of the path */ + size_t name_len; /* Length of the name */ unsigned need_sep; /* Flag to indicate if separator is needed */ H5RS_str_t *ret_value; /* Return value */ @@ -304,7 +306,7 @@ H5G_build_fullpath(const char *prefix, const char *name) HDassert(name); /* Get the length of the prefix */ - path_len = HDstrlen(prefix); + orig_path_len = path_len = HDstrlen(prefix); /* Determine if there is a trailing separator in the name */ if(prefix[path_len - 1] == '/') @@ -313,20 +315,21 @@ H5G_build_fullpath(const char *prefix, const char *name) need_sep = 1; /* Add in the length needed for the '/' separator and the relative path */ - path_len += HDstrlen(name) + need_sep; + name_len = HDstrlen(name); + path_len += name_len + need_sep; /* Allocate space for the path */ if(NULL == (full_path = (char *)H5FL_BLK_MALLOC(str_buf, path_len + 1))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Build full path */ - HDstrcpy(full_path, prefix); + HDstrncpy(full_path, prefix, orig_path_len + 1); if(need_sep) - HDstrcat(full_path, "/"); - HDstrcat(full_path, name); + HDstrncat(full_path, "/", 1); + HDstrncat(full_path, name, name_len); /* Create reference counted string for path */ - if((ret_value = H5RS_own(full_path)) == NULL) + if(NULL == (ret_value = H5RS_own(full_path))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") done: @@ -423,7 +426,7 @@ H5G_build_fullpath_refstr_refstr(const H5RS_str_t *prefix_r, const H5RS_str_t *n herr_t H5G__name_init(H5G_name_t *name, const char *path) { - FUNC_ENTER_PACKAGE + FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ HDassert(name); @@ -717,6 +720,7 @@ H5G_name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char path_len = HDstrlen(path); if(full_suffix_len < path_len) { const char *dst_suffix; /* Destination suffix that changes */ + size_t dst_suffix_len; /* Length of destination suffix */ const char *src_suffix; /* Source suffix that changes */ size_t path_prefix_len; /* Length of path prefix */ const char *path_prefix2; /* 2nd prefix for path */ @@ -747,25 +751,26 @@ H5G_name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char /* Determine destination suffix */ dst_suffix = dst_path + (common_prefix_len - 1); + dst_suffix_len = HDstrlen(dst_suffix); /* Compute path prefix before src suffix*/ path_prefix2 = path; path_prefix2_len = path_prefix_len - HDstrlen(src_suffix); /* Allocate space for the new path */ - new_path_len = path_prefix2_len + HDstrlen(dst_suffix) + full_suffix_len; + new_path_len = path_prefix2_len + dst_suffix_len + full_suffix_len; if(NULL == (new_path = (char *)H5FL_BLK_MALLOC(str_buf, new_path_len + 1))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Create the new path */ if(path_prefix2_len > 0) { HDstrncpy(new_path, path_prefix2, path_prefix2_len); - HDstrcpy(new_path + path_prefix2_len, dst_suffix); + HDstrncpy(new_path + path_prefix2_len, dst_suffix, dst_suffix_len + 1); } /* end if */ else - HDstrcpy(new_path, dst_suffix); + HDstrncpy(new_path, dst_suffix, dst_suffix_len + 1); if(full_suffix_len > 0) - HDstrcat(new_path, full_suffix); + HDstrncat(new_path, full_suffix, full_suffix_len); /* Release previous path */ H5RS_decr(*path_r_ptr); @@ -887,23 +892,25 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) if(obj_in_child) { const char *full_path; /* Full path of current object */ const char *src_path; /* Full path of source object */ + size_t src_path_len; /* Length of source full path */ char *new_full_path; /* New full path of object */ size_t new_full_len; /* Length of new full path */ /* Get pointers to paths of interest */ full_path = H5RS_get_str(obj_path->full_path_r); src_path = H5RS_get_str(names->src_full_path_r); + src_path_len = HDstrlen(src_path); /* Build new full path */ /* Allocate space for the new full path */ - new_full_len = HDstrlen(src_path) + HDstrlen(full_path); + new_full_len = src_path_len + HDstrlen(full_path); if(NULL == (new_full_path = (char *)H5FL_BLK_MALLOC(str_buf, new_full_len + 1))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Create the new full path */ - HDstrcpy(new_full_path, src_path); - HDstrcat(new_full_path, full_path); + HDstrncpy(new_full_path, src_path, src_path_len + 1); + HDstrncat(new_full_path, full_path, new_full_len); /* Release previous full path */ H5RS_decr(obj_path->full_path_r); @@ -931,6 +938,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) if(obj_in_child) { const char *full_path; /* Full path of current object */ const char *full_suffix; /* Full path after source path */ + size_t full_suffix_len; /* Length of full path after source path */ const char *src_path; /* Full path of source object */ char *new_full_path; /* New full path of object */ @@ -940,13 +948,14 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) /* Construct full path suffix */ full_suffix = full_path + HDstrlen(src_path); + full_suffix_len = HDstrlen(full_suffix); /* Build new full path */ /* Create the new full path */ - if(NULL == (new_full_path = (char *)H5FL_BLK_MALLOC(str_buf, HDstrlen(full_suffix) + 1))) + if(NULL == (new_full_path = (char *)H5FL_BLK_MALLOC(str_buf, full_suffix_len + 1))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - HDstrcpy(new_full_path, full_suffix); + HDstrncpy(new_full_path, full_suffix, full_suffix_len + 1); /* Release previous full path */ H5RS_decr(obj_path->full_path_r); @@ -992,10 +1001,12 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) if(H5G_common_path(obj_path->full_path_r, names->src_full_path_r)) { const char *full_path; /* Full path of current object */ const char *full_suffix; /* Suffix of full path, after src_path */ + size_t full_suffix_len; /* Length of suffix of full path after src_path*/ char *new_full_path; /* New full path of object */ size_t new_full_len; /* Length of new full path */ const char *src_path; /* Full path of source object */ const char *dst_path; /* Full path of destination object */ + size_t dst_path_len; /* Length of destination's full path */ /* Sanity check */ HDassert(names->dst_full_path_r); @@ -1004,6 +1015,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) full_path = H5RS_get_str(obj_path->full_path_r); src_path = H5RS_get_str(names->src_full_path_r); dst_path = H5RS_get_str(names->dst_full_path_r); + dst_path_len = HDstrlen(dst_path); /* Make certain that the source and destination names are full (not relative) paths */ HDassert(*src_path == '/'); @@ -1011,6 +1023,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) /* Get pointer to "full suffix" */ full_suffix = full_path + HDstrlen(src_path); + full_suffix_len = HDstrlen(full_suffix); /* Update the user path, if one exists */ if(obj_path->user_path_r) @@ -1020,13 +1033,13 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) /* Build new full path */ /* Allocate space for the new full path */ - new_full_len = HDstrlen(dst_path) + HDstrlen(full_suffix); + new_full_len = dst_path_len + full_suffix_len; if(NULL == (new_full_path = (char *)H5FL_BLK_MALLOC(str_buf, new_full_len + 1))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Create the new full path */ - HDstrcpy(new_full_path, dst_path); - HDstrcat(new_full_path, full_suffix); + HDstrncpy(new_full_path, dst_path, dst_path_len + 1); + HDstrncat(new_full_path, full_suffix, full_suffix_len); /* Release previous full path */ H5RS_decr(obj_path->full_path_r); @@ -1318,7 +1331,7 @@ H5G_get_name_by_addr(hid_t file, hid_t lapl_id, hid_t dxpl_id, const H5O_loc_t * /* If there's a buffer provided, copy into it, up to the limit of its size */ if(name) { /* Copy the initial path separator */ - HDstrcpy(name, "/"); + HDstrncpy(name, "/", 2); /* Append the rest of the path */ /* (less one character, for the initial path separator) */ diff --git a/src/H5system.c b/src/H5system.c index c0baee1..83cecba 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -122,24 +122,24 @@ HDfprintf(FILE *stream, const char *fmt, ...) va_start (ap, fmt); while (*fmt) { - fwidth = prec = 0; - zerofill = 0; - leftjust = 0; - plussign = 0; - prefix = 0; - ldspace = 0; - modifier[0] = '\0'; - - if ('%'==fmt[0] && '%'==fmt[1]) { - HDputc ('%', stream); - fmt += 2; - nout++; - } else if ('%'==fmt[0]) { - s = fmt + 1; - - /* Flags */ - while(HDstrchr ("-+ #", *s)) { - switch(*s) { + fwidth = prec = 0; + zerofill = 0; + leftjust = 0; + plussign = 0; + prefix = 0; + ldspace = 0; + modifier[0] = '\0'; + + if ('%'==fmt[0] && '%'==fmt[1]) { + HDputc ('%', stream); + fmt += 2; + nout++; + } else if ('%'==fmt[0]) { + s = fmt + 1; + + /* Flags */ + while(HDstrchr ("-+ #", *s)) { + switch(*s) { case '-': leftjust = 1; break; @@ -155,244 +155,251 @@ HDfprintf(FILE *stream, const char *fmt, ...) case '#': prefix = 1; break; - } /* end switch */ /*lint !e744 Switch statement doesn't _need_ default */ - s++; - } /* end while */ - - /* Field width */ - if (HDisdigit (*s)) { - zerofill = ('0'==*s); - fwidth = (int)HDstrtol (s, &rest, 10); - s = rest; - } else if ('*'==*s) { - fwidth = va_arg (ap, int); - if (fwidth<0) { - leftjust = 1; - fwidth = -fwidth; - } - s++; - } + } /* end switch */ /*lint !e744 Switch statement doesn't _need_ default */ + s++; + } /* end while */ + + /* Field width */ + if(HDisdigit(*s)) { + zerofill = ('0' == *s); + fwidth = (int)HDstrtol (s, &rest, 10); + s = rest; + } /* end if */ + else if ('*'==*s) { + fwidth = va_arg (ap, int); + if(fwidth < 0) { + leftjust = 1; + fwidth = -fwidth; + } + s++; + } + + /* Precision */ + if('.'==*s) { + s++; + if(HDisdigit(*s)) { + prec = (int)HDstrtol(s, &rest, 10); + s = rest; + } else if('*'==*s) { + prec = va_arg(ap, int); + s++; + } + if(prec < 1) + prec = 1; + } + + /* Extra type modifiers */ + if(HDstrchr("ZHhlqLI", *s)) { + switch(*s) { + /*lint --e{506} Don't issue warnings about constant value booleans */ + /*lint --e{774} Don't issue warnings boolean within 'if' always evaluates false/true */ + case 'H': + if(sizeof(hsize_t) < sizeof(long)) + modifier[0] = '\0'; + else if(sizeof(hsize_t) == sizeof(long)) + HDstrncpy(modifier, "l", 2); + else + HDstrncpy(modifier, H5_PRINTF_LL_WIDTH, HDstrlen(H5_PRINTF_LL_WIDTH) + 1); + break; - /* Precision */ - if ('.'==*s) { - s++; - if (HDisdigit (*s)) { - prec = (int)HDstrtol (s, &rest, 10); - s = rest; - } else if ('*'==*s) { - prec = va_arg (ap, int); - s++; - } - if (prec<1) prec = 1; - } + case 'Z': + if(sizeof(size_t) < sizeof(long)) + modifier[0] = '\0'; + else if(sizeof(size_t) == sizeof(long)) + HDstrncpy(modifier, "l", 2); + else + HDstrncpy(modifier, H5_PRINTF_LL_WIDTH, HDstrlen(H5_PRINTF_LL_WIDTH) + 1); + break; - /* Extra type modifiers */ - if (HDstrchr ("ZHhlqLI", *s)) { - switch (*s) { - /*lint --e{506} Don't issue warnings about constant value booleans */ - /*lint --e{774} Don't issue warnings boolean within 'if' always evaluates false/true */ - case 'H': - if (sizeof(hsize_t)0) - sprintf (format_templ+HDstrlen(format_templ), "%d", fwidth); - if (prec>0) - sprintf (format_templ+HDstrlen(format_templ), ".%d", prec); - if (*modifier) - sprintf (format_templ+HDstrlen(format_templ), "%s", modifier); - sprintf (format_templ+HDstrlen(format_templ), "%c", conv); - - - /* Conversion */ - switch (conv) { - case 'd': - case 'i': - if (!HDstrcmp(modifier, "h")) { - short x = (short)va_arg (ap, int); - n = fprintf (stream, format_templ, x); - } else if (!*modifier) { - int x = va_arg (ap, int); - n = fprintf (stream, format_templ, x); - } else if (!HDstrcmp (modifier, "l")) { - long x = va_arg (ap, long); - n = fprintf (stream, format_templ, x); - } else { - int64_t x = va_arg(ap, int64_t); - n = fprintf (stream, format_templ, x); - } - break; - - case 'o': - case 'u': - case 'x': - case 'X': - if (!HDstrcmp (modifier, "h")) { - unsigned short x = (unsigned short)va_arg (ap, unsigned int); - n = fprintf (stream, format_templ, x); - } else if (!*modifier) { - unsigned int x = va_arg (ap, unsigned int); /*lint !e732 Loss of sign not really occuring */ - n = fprintf (stream, format_templ, x); - } else if (!HDstrcmp (modifier, "l")) { - unsigned long x = va_arg (ap, unsigned long); /*lint !e732 Loss of sign not really occuring */ - n = fprintf (stream, format_templ, x); - } else { - uint64_t x = va_arg(ap, uint64_t); /*lint !e732 Loss of sign not really occuring */ - n = fprintf (stream, format_templ, x); - } - break; - - case 'f': - case 'e': - case 'E': - case 'g': - case 'G': - if (!HDstrcmp (modifier, "h")) { - float x = (float) va_arg (ap, double); - n = fprintf (stream, format_templ, x); - } else if (!*modifier || !HDstrcmp (modifier, "l")) { - double x = va_arg (ap, double); - n = fprintf (stream, format_templ, x); - } else { - /* - * Some compilers complain when `long double' and - * `double' are the same thing. - */ + break; + } + s++; + } + + /* Conversion */ + conv = *s++; + + /* Create the format template */ + sprintf(format_templ, "%%%s%s%s%s%s", (leftjust ? "-" : ""), + (plussign ? "+" : ""), (ldspace ? " " : ""), + (prefix ? "#" : ""), (zerofill ? "0" : "")); + if(fwidth > 0) + sprintf(format_templ+HDstrlen(format_templ), "%d", fwidth); + if(prec > 0) + sprintf(format_templ+HDstrlen(format_templ), ".%d", prec); + if(*modifier) + sprintf(format_templ+HDstrlen(format_templ), "%s", modifier); + sprintf (format_templ+HDstrlen(format_templ), "%c", conv); + + + /* Conversion */ + switch (conv) { + case 'd': + case 'i': + if(!HDstrcmp(modifier, "h")) { + short x = (short)va_arg (ap, int); + n = fprintf (stream, format_templ, x); + } else if(!*modifier) { + int x = va_arg (ap, int); + n = fprintf (stream, format_templ, x); + } else if(!HDstrcmp (modifier, "l")) { + long x = va_arg (ap, long); + n = fprintf (stream, format_templ, x); + } else { + int64_t x = va_arg(ap, int64_t); + n = fprintf (stream, format_templ, x); + } + break; + + case 'o': + case 'u': + case 'x': + case 'X': + if(!HDstrcmp(modifier, "h")) { + unsigned short x = (unsigned short)va_arg (ap, unsigned int); + n = fprintf(stream, format_templ, x); + } else if(!*modifier) { + unsigned int x = va_arg (ap, unsigned int); /*lint !e732 Loss of sign not really occuring */ + n = fprintf(stream, format_templ, x); + } else if(!HDstrcmp(modifier, "l")) { + unsigned long x = va_arg (ap, unsigned long); /*lint !e732 Loss of sign not really occuring */ + n = fprintf(stream, format_templ, x); + } else { + uint64_t x = va_arg(ap, uint64_t); /*lint !e732 Loss of sign not really occuring */ + n = fprintf(stream, format_templ, x); + } + break; + + case 'f': + case 'e': + case 'E': + case 'g': + case 'G': + if(!HDstrcmp(modifier, "h")) { + float x = (float)va_arg(ap, double); + n = fprintf(stream, format_templ, x); + } else if(!*modifier || !HDstrcmp(modifier, "l")) { + double x = va_arg(ap, double); + n = fprintf(stream, format_templ, x); + } else { + /* + * Some compilers complain when `long double' and + * `double' are the same thing. + */ #if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE - long double x = va_arg (ap, long double); - n = fprintf (stream, format_templ, x); + long double x = va_arg(ap, long double); + n = fprintf(stream, format_templ, x); #else - double x = va_arg (ap, double); - n = fprintf (stream, format_templ, x); + double x = va_arg(ap, double); + n = fprintf(stream, format_templ, x); #endif - } - break; - - case 'a': - { - haddr_t x = va_arg (ap, haddr_t); /*lint !e732 Loss of sign not really occuring */ - if (H5F_addr_defined(x)) { - sprintf(format_templ, "%%%s%s%s%s%s", - leftjust?"-":"", plussign?"+":"", - ldspace?" ":"", prefix?"#":"", - zerofill?"0":""); - if (fwidth>0) - sprintf(format_templ+HDstrlen(format_templ), "%d", fwidth); - - /*lint --e{506} Don't issue warnings about constant value booleans */ - /*lint --e{774} Don't issue warnings boolean within 'if' always evaluates false/true */ - if (sizeof(x)==H5_SIZEOF_INT) { - HDstrcat(format_templ, "u"); - } else if (sizeof(x)==H5_SIZEOF_LONG) { - HDstrcat(format_templ, "lu"); - } else if (sizeof(x)==H5_SIZEOF_LONG_LONG) { - HDstrcat(format_templ, H5_PRINTF_LL_WIDTH); - HDstrcat(format_templ, "u"); - } - n = fprintf(stream, format_templ, x); + } + break; + + case 'a': + { + haddr_t x = va_arg (ap, haddr_t); /*lint !e732 Loss of sign not really occuring */ + + if(H5F_addr_defined(x)) { + sprintf(format_templ, "%%%s%s%s%s%s", + (leftjust ? "-" : ""), (plussign ? "+" : ""), + (ldspace ? " " : ""), (prefix ? "#" : ""), + (zerofill ? "0" : "")); + if(fwidth > 0) + sprintf(format_templ + HDstrlen(format_templ), "%d", fwidth); + + /*lint --e{506} Don't issue warnings about constant value booleans */ + /*lint --e{774} Don't issue warnings boolean within 'if' always evaluates false/true */ + if(sizeof(x) == H5_SIZEOF_INT) + HDstrcat(format_templ, "u"); + else if(sizeof(x) == H5_SIZEOF_LONG) + HDstrcat(format_templ, "lu"); + else if(sizeof(x) == H5_SIZEOF_LONG_LONG) { + HDstrcat(format_templ, H5_PRINTF_LL_WIDTH); + HDstrcat(format_templ, "u"); + } + n = fprintf(stream, format_templ, x); + } else { + HDstrcpy(format_templ, "%"); + if(leftjust) + HDstrcat(format_templ, "-"); + if(fwidth) + sprintf(format_templ+HDstrlen(format_templ), "%d", fwidth); + HDstrcat(format_templ, "s"); + fprintf(stream, format_templ, "UNDEF"); + } + } + break; + + case 'c': + { + char x = (char)va_arg(ap, int); + n = fprintf(stream, format_templ, x); + } + break; + + case 's': + case 'p': + { + char *x = va_arg(ap, char*); /*lint !e64 Type mismatch not really occuring */ + n = fprintf(stream, format_templ, x); + } + break; + + case 'n': + format_templ[HDstrlen(format_templ) - 1] = 'u'; + n = fprintf(stream, format_templ, nout); + break; + + case 't': + { + htri_t tri_var = va_arg(ap, htri_t); + + if(tri_var > 0) + fprintf (stream, "TRUE"); + else if(!tri_var) + fprintf(stream, "FALSE"); + else + fprintf(stream, "FAIL(%d)", (int)tri_var); + } + break; + + default: + HDfputs(format_templ, stream); + n = (int)HDstrlen(format_templ); + break; + } + nout += n; + fmt = s; } else { - HDstrcpy(format_templ, "%"); - if (leftjust) - HDstrcat(format_templ, "-"); - if (fwidth) - sprintf(format_templ+HDstrlen(format_templ), "%d", fwidth); - HDstrcat(format_templ, "s"); - fprintf(stream, format_templ, "UNDEF"); + HDputc(*fmt, stream); + fmt++; + nout++; } } - break; - - case 'c': - { - char x = (char)va_arg (ap, int); - n = fprintf (stream, format_templ, x); - } - break; - - case 's': - case 'p': - { - char *x = va_arg (ap, char*); /*lint !e64 Type mismatch not really occuring */ - n = fprintf (stream, format_templ, x); - } - break; - - case 'n': - format_templ[HDstrlen(format_templ)-1] = 'u'; - n = fprintf (stream, format_templ, nout); - break; - - case 't': - { - htri_t tri_var = va_arg (ap, htri_t); - if (tri_var > 0) fprintf (stream, "TRUE"); - else if (!tri_var) fprintf (stream, "FALSE"); - else fprintf (stream, "FAIL(%d)", (int)tri_var); - } - break; - - default: - HDfputs (format_templ, stream); - n = (int)HDstrlen (format_templ); - break; - } - nout += n; - fmt = s; - } else { - HDputc (*fmt, stream); - fmt++; - nout++; - } - } - va_end (ap); + va_end(ap); return nout; } /* end HDfprintf() */ @@ -713,23 +720,23 @@ H5_build_extpath(const char *name, char **extpath/*out*/) if(NULL == (new_name = (char *)H5MM_strdup(name))) HGOTO_ERROR(H5E_INTERNAL, H5E_NOSPACE, FAIL, "memory allocation failed") - /* - * Windows: name[0-1] is ":" - * Get current working directory on the drive specified in NAME - * Unix: does not apply + /* + * Windows: name[0-1] is ":" + * Get current working directory on the drive specified in NAME + * Unix: does not apply * OpenVMS: does not apply - */ + */ if(CHECK_ABS_DRIVE(name)) { drive = name[0] - 'A' + 1; retcwd = HDgetdcwd(drive, cwdpath, MAX_PATH_LEN); HDstrcpy(new_name, &name[2]); } /* end if */ - /* - * Windows: name[0] is a '/' or '\' - * Get current drive - * Unix: does not apply - * OpenVMS: does not apply - */ + /* + * Windows: name[0] is a '/' or '\' + * Get current drive + * Unix: does not apply + * OpenVMS: does not apply + */ else if(CHECK_ABS_PATH(name) && (0 != (drive = HDgetdrive()))) { sprintf(cwdpath, "%c:%c", (drive+'A'-1), name[0]); retcwd = cwdpath; @@ -749,7 +756,7 @@ H5_build_extpath(const char *name, char **extpath/*out*/) if(NULL == (full_path = (char *)H5MM_malloc(path_len))) HGOTO_ERROR(H5E_INTERNAL, H5E_NOSPACE, FAIL, "memory allocation failed") - HDstrcpy(full_path, cwdpath); + HDstrncpy(full_path, cwdpath, cwdlen + 1); #ifdef H5_VMS /* If the file name contains relative path, cut off the beginning bracket. Also cut off the * ending bracket of CWDPATH to combine the full path name. i.g. @@ -759,15 +766,16 @@ H5_build_extpath(const char *name, char **extpath/*out*/) */ if(new_name[0] == '[') { char *tmp = new_name; + full_path[cwdlen - 1] = '\0'; HDstrcat(full_path, ++tmp); } /* end if */ else - HDstrcat(full_path, new_name); + HDstrncat(full_path, new_name, HDstrlen(new_name)); #else if(!CHECK_DELIMITER(cwdpath[cwdlen - 1])) - HDstrcat(full_path, DIR_SEPS); - HDstrcat(full_path, new_name); + HDstrncat(full_path, DIR_SEPS, HDstrlen(DIR_SEPS)); + HDstrncat(full_path, new_name, HDstrlen(new_name)); #endif } /* end if */ } /* end else */ diff --git a/test/accum.c b/test/accum.c index e4c1bd8..488b866 100644 --- a/test/accum.c +++ b/test/accum.c @@ -470,8 +470,11 @@ test_free(void) if(HDmemcmp(expect + 76, rbuf, 116 * sizeof(int32_t)) != 0) TEST_ERROR; HDfree(wbuf); + wbuf = NULL; HDfree(rbuf); + rbuf = NULL; HDfree(expect); + expect = NULL; if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -480,9 +483,12 @@ test_free(void) return 0; error: - HDfree(wbuf); - HDfree(rbuf); - HDfree(expect); + if(wbuf) + HDfree(wbuf); + if(rbuf) + HDfree(rbuf); + if(expect) + HDfree(expect); return 1; } /* test_free */ @@ -1646,7 +1652,7 @@ unsigned test_random_write(void) { uint8_t *wbuf, *rbuf; /* Buffers for reading & writing */ - unsigned long seed = 0; /* Random # seed */ + unsigned seed = 0; /* Random # seed */ size_t *off; /* Offset of buffer segments to write */ size_t *len; /* Size of buffer segments to write */ size_t cur_off; /* Current offset */ @@ -1667,10 +1673,10 @@ test_random_write(void) TESTING("random writes to accumulator"); /* Choose random # seed */ - seed = (unsigned long)HDtime(NULL); + seed = (unsigned)HDtime(NULL); #ifdef QAK -/* seed = (unsigned long)1155438845; */ -HDfprintf(stderr, "Random # seed was: %lu\n", seed); +/* seed = (unsigned)1155438845; */ +HDfprintf(stderr, "Random # seed was: %u\n", seed); #endif /* QAK */ HDsrandom(seed); @@ -1762,7 +1768,7 @@ error: HDfree(off); HDfree(len); - HDfprintf(stderr, "Random # seed was: %lu\n", seed); + HDfprintf(stderr, "Random # seed was: %u\n", seed); return 1; } /* end test_random_write() */ diff --git a/test/stab.c b/test/stab.c index a42ee5e..48b58b1 100644 --- a/test/stab.c +++ b/test/stab.c @@ -539,7 +539,7 @@ long_compact(hid_t fapl2) hid_t fid = (-1); /* File ID */ hid_t gid = (-1); /* Group ID */ hid_t gid2 = (-1); /* Group ID */ - char *objname; /* Object name */ + char *objname = NULL; /* Object name */ char filename[NAME_BUF_SIZE]; h5_stat_size_t empty_size; /* Size of an empty file */ h5_stat_size_t file_size; /* Size of each file created */ @@ -557,7 +557,7 @@ long_compact(hid_t fapl2) if((empty_size = h5_get_file_size(filename, fapl2)) < 0) TEST_ERROR /* Construct very long object name template */ - if((objname = (char *)HDmalloc((size_t)(LONG_COMPACT_LENGTH + 1))) == NULL) TEST_ERROR + if(NULL == (objname = (char *)HDmalloc((size_t)(LONG_COMPACT_LENGTH + 1)))) TEST_ERROR HDmemset(objname, 'a', (size_t)LONG_COMPACT_LENGTH); objname[LONG_COMPACT_LENGTH] = '\0'; @@ -620,6 +620,7 @@ long_compact(hid_t fapl2) /* Free object name */ HDfree(objname); + objname = NULL; /* Close top group */ if(H5Gclose(gid) < 0) TEST_ERROR @@ -645,6 +646,10 @@ error: H5Gclose(gid); H5Fclose(fid); } H5E_END_TRY; + + if(objname) + HDfree(objname); + return 1; } /* end long_compact() */ diff --git a/test/vfd.c b/test/vfd.c index ca354d9..b85c054 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -28,17 +28,20 @@ #define FAMILY_SIZE2 (5*KB) #define MULTI_SIZE 128 #define CORE_INCREMENT (4*KB) +#define DSET1_NAME "dset1" +#define DSET1_DIM1 1024 +#define DSET1_DIM2 32 +#define DSET3_NAME "dset3" -/*Macros for Direct VFD*/ +/* Macros for Direct VFD */ +#ifdef H5_HAVE_DIRECT #define MBOUNDARY 512 #define FBSIZE (4*KB) #define CBSIZE (8*KB) #define THRESHOLD 1 -#define DSET1_NAME "dset1" -#define DSET1_DIM1 1024 -#define DSET1_DIM2 32 #define DSET2_NAME "dset2" #define DSET2_DIM 4 +#endif /* H5_HAVE_DIRECT */ const char *FILENAME[] = { "sec2_file", /*0*/ @@ -165,7 +168,7 @@ test_direct(void) size_t mbound; size_t fbsize; size_t cbsize; - int *points, *check, *p1, *p2; + int *points = NULL, *check = NULL, *p1, *p2; int wdata2[DSET2_DIM] = {11,12,13,14}; int rdata2[DSET2_DIM]; int i, j, n; @@ -189,10 +192,10 @@ test_direct(void) if(H5Pget_fapl_direct(fapl, &mbound, &fbsize, &cbsize) < 0) TEST_ERROR; if(mbound != MBOUNDARY || fbsize != FBSIZE || cbsize != CBSIZE) - TEST_ERROR; + TEST_ERROR; if(H5Pset_alignment(fapl, (hsize_t)THRESHOLD, (hsize_t)FBSIZE) < 0) - TEST_ERROR; + TEST_ERROR; H5E_BEGIN_TRY { file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); @@ -235,17 +238,16 @@ test_direct(void) /* Allocate aligned memory for data set 1. For data set 1, everything is aligned including * memory address, size of data, and file address. */ - if(posix_memalign(&points, (size_t)FBSIZE, (size_t)(DSET1_DIM1*DSET1_DIM2*sizeof(int)))!=0) + if(0 != HDposix_memalign(&points, (size_t)FBSIZE, (size_t)(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) TEST_ERROR; - - if(posix_memalign(&check, (size_t)FBSIZE, (size_t)(DSET1_DIM1*DSET1_DIM2*sizeof(int)))!=0) + if(0 != HDposix_memalign(&check, (size_t)FBSIZE, (size_t)(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) TEST_ERROR; /* Initialize the dset1 */ p1 = points; for(i = n = 0; i < DSET1_DIM1; i++) - for(j = 0; j < DSET1_DIM2; j++) - *p1++ = n++; + for(j = 0; j < DSET1_DIM2; j++) + *p1++ = n++; /* Create the data space1 */ dims1[0] = DSET1_DIM1; @@ -275,13 +277,13 @@ test_direct(void) p1 = points; p2 = check; for(i = 0; i < DSET1_DIM1; i++) - for(j = 0; j < DSET1_DIM2; j++) - if(*p1++ != *p2++) { - H5_FAILED(); - printf(" Read different values than written in data set 1.\n"); - printf(" At index %d,%d\n", i, j); - TEST_ERROR; - } /* end if */ + for(j = 0; j < DSET1_DIM2; j++) + if(*p1++ != *p2++) { + H5_FAILED(); + printf(" Read different values than written in data set 1.\n"); + printf(" At index %d,%d\n", i, j); + TEST_ERROR; + } /* end if */ /* Create the data space2. For data set 2, memory address and data size are not aligned. */ dims2[0] = DSET2_DIM; @@ -308,12 +310,12 @@ test_direct(void) /* Check that the values read are the same as the values written */ for(i = 0; i < DSET2_DIM; i++) - if(wdata2[i] != rdata2[i]) { - H5_FAILED(); - printf(" Read different values than written in data set 2.\n"); - printf(" At index %d\n", i); + if(wdata2[i] != rdata2[i]) { + H5_FAILED(); + printf(" Read different values than written in data set 2.\n"); + printf(" At index %d\n", i); TEST_ERROR; - } /* end if */ + } /* end if */ if(H5Sclose(space1) < 0) TEST_ERROR; @@ -325,10 +327,10 @@ test_direct(void) TEST_ERROR; if(H5Fclose(file) < 0) TEST_ERROR; - if(points) - free(points); - if(check) - free(check); + HDassert(points); + HDfree(points); + HDassert(check); + HDfree(check); h5_cleanup(FILENAME, fapl); PASSED(); @@ -336,13 +338,19 @@ test_direct(void) error: H5E_BEGIN_TRY { - H5Pclose (fapl); + H5Pclose(fapl); H5Sclose(space1); H5Dclose(dset1); H5Sclose(space2); H5Dclose(dset2); H5Fclose(file); } H5E_END_TRY; + + if(points) + HDfree(points); + if(check) + HDfree(check); + return -1; #endif /*H5_HAVE_DIRECT*/ } @@ -368,7 +376,7 @@ test_core(void) char filename[1024]; void *fhandle=NULL; hsize_t file_size; - int *points, *check, *p1, *p2; + int *points = NULL, *check = NULL, *p1, *p2; hid_t dset1=-1, space1=-1; hsize_t dims1[2]; int i, j, n; @@ -427,14 +435,16 @@ test_core(void) TEST_ERROR; /* Allocate memory for data set. */ - points=(int*)malloc(DSET1_DIM1*DSET1_DIM2*sizeof(int)); - check=(int*)malloc(DSET1_DIM1*DSET1_DIM2*sizeof(int)); + if(NULL == (points = (int *)HDmalloc(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) + TEST_ERROR; + if(NULL == (check = (int *)HDmalloc(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) + TEST_ERROR; /* Initialize the dset1 */ p1 = points; for(i = n = 0; i < DSET1_DIM1; i++) - for(j = 0; j < DSET1_DIM2; j++) - *p1++ = n++; + for(j = 0; j < DSET1_DIM2; j++) + *p1++ = n++; /* Create the data space1 */ dims1[0] = DSET1_DIM1; @@ -464,13 +474,13 @@ test_core(void) p1 = points; p2 = check; for(i = 0; i < DSET1_DIM1; i++) - for(j = 0; j < DSET1_DIM2; j++) - if(*p1++ != *p2++) { - H5_FAILED(); - printf(" Read different values than written in data set 1.\n"); - printf(" At index %d,%d\n", i, j); - TEST_ERROR; - } /* end if */ + for(j = 0; j < DSET1_DIM2; j++) + if(*p1++ != *p2++) { + H5_FAILED(); + printf(" Read different values than written in data set 1.\n"); + printf(" At index %d,%d\n", i, j); + TEST_ERROR; + } /* end if */ if(H5Dclose(dset1) < 0) TEST_ERROR; @@ -501,10 +511,10 @@ test_core(void) TEST_ERROR; /* Reallocate memory for reading buffer. */ - if(check) - free(check); - - check = (int*)malloc(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)); + HDassert(check); + HDfree(check); + if(NULL == (check = (int *)HDmalloc(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) + TEST_ERROR; /* Read the data back from dset1 */ if(H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) @@ -514,13 +524,13 @@ test_core(void) p1 = points; p2 = check; for(i = 0; i < DSET1_DIM1; i++) - for(j = 0; j < DSET1_DIM2; j++) - if(*p1++ != *p2++) { - H5_FAILED(); - printf(" Read different values than written in data set 1.\n"); - printf(" At index %d,%d\n", i, j); - TEST_ERROR; - } /* end if */ + for(j = 0; j < DSET1_DIM2; j++) + if(*p1++ != *p2++) { + H5_FAILED(); + printf(" Read different values than written in data set 1.\n"); + printf(" At index %d,%d\n", i, j); + TEST_ERROR; + } /* end if */ /* Check file size API */ if(H5Fget_filesize(file, &file_size) < 0) @@ -537,10 +547,10 @@ test_core(void) TEST_ERROR; if(H5Fclose(file) < 0) TEST_ERROR; - if(points) - free(points); - if(check) - free(check); + HDassert(points); + HDfree(points); + HDassert(check); + HDfree(check); h5_cleanup(FILENAME, fapl); @@ -549,9 +559,15 @@ test_core(void) error: H5E_BEGIN_TRY { - H5Pclose (fapl); + H5Pclose(fapl); H5Fclose(file); } H5E_END_TRY; + + if(points) + HDfree(points); + if(check) + HDfree(check); + return -1; } @@ -579,27 +595,30 @@ test_family_opens(char *fname, hid_t fa_pl) int i; /* Case 1: reopen file with 1st member file name and default property list */ - sprintf(first_name, fname, 0); + HDsnprintf(first_name, sizeof(first_name), fname, 0); H5E_BEGIN_TRY { - file=H5Fopen(first_name, H5F_ACC_RDWR, H5P_DEFAULT); + file = H5Fopen(first_name, H5F_ACC_RDWR, H5P_DEFAULT); } H5E_END_TRY; - if(file >= 0) TEST_ERROR + if(file >= 0) + TEST_ERROR /* Case 2: reopen file with correct name template but default property list */ H5E_BEGIN_TRY { - file=H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT); + file = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT); } H5E_END_TRY; - if(file >= 0) TEST_ERROR + if(file >= 0) + TEST_ERROR /* Case 3: reopen file with wrong member size */ if(H5Pset_fapl_family(fa_pl, (hsize_t)128, H5P_DEFAULT) < 0) TEST_ERROR; H5E_BEGIN_TRY { - file=H5Fopen(fname, H5F_ACC_RDWR, fa_pl); + file = H5Fopen(fname, H5F_ACC_RDWR, fa_pl); } H5E_END_TRY; - if(file >= 0) TEST_ERROR + if(file >= 0) + TEST_ERROR /* Case 4: reopen file with wrong name template */ HDstrcpy(wrong_name, fname); @@ -613,9 +632,10 @@ test_family_opens(char *fname, hid_t fa_pl) TEST_ERROR; H5E_BEGIN_TRY { - file=H5Fopen(wrong_name, H5F_ACC_RDWR, fa_pl); + file = H5Fopen(wrong_name, H5F_ACC_RDWR, fa_pl); } H5E_END_TRY; - if(file >= 0) TEST_ERROR + if(file >= 0) + TEST_ERROR return 0; @@ -704,44 +724,44 @@ test_family(void) if((dset=H5Dcreate2(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; - for(i=0; i20*KB) - TEST_ERROR; - } else if(sizeof(int)>=8) { - if(file_size<32*KB || file_size>40*KB) - TEST_ERROR; - } +#if H5_SIZEOF_INT <= 4 + if(file_size < (18 * KB) || file_size > (20 * KB)) + TEST_ERROR; +#elif H5_SIZEOF_INT >= 8 + if(file_size < (32 * KB) || file_size > (40 * KB)) + TEST_ERROR; +#endif if(H5Sclose(space) < 0) TEST_ERROR; @@ -761,7 +781,7 @@ test_family(void) if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0) TEST_ERROR; - if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) + if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR; if(H5Fclose(file) < 0) @@ -829,13 +849,13 @@ test_family_compat(void) * Since we're going to open the files with write mode, this protects the original * files. */ - sprintf(newname_individual, newname, counter); - sprintf(pathname_individual, pathname, counter); + HDsnprintf(newname_individual, sizeof(newname_individual), newname, counter); + HDsnprintf(pathname_individual, sizeof(pathname_individual), pathname, counter); - while (h5_make_local_copy(pathname_individual, newname_individual) >= 0) { + while(h5_make_local_copy(pathname_individual, newname_individual) >= 0) { counter++; - sprintf(newname_individual, newname, counter); - sprintf(pathname_individual, pathname, counter); + HDsnprintf(newname_individual, sizeof(newname_individual), newname, counter); + HDsnprintf(pathname_individual, sizeof(pathname_individual), pathname, counter); } /* Make sure we can open the file. Use the read and write mode to flush the @@ -888,7 +908,7 @@ error: * reopening multi file. * * Return: Success: 0 - * Failure: 1 + * Failure: -1 * * Programmer: Raymond Lu * Thursday, May 19, 2005 @@ -903,14 +923,14 @@ test_multi_opens(char *fname) char sf_name[1024]; /*name string "multi_file-s.h5"*/ /* Case: reopen with the name of super file and default property list */ - sprintf(super_name, "%%s-%c.h5", 's'); - sprintf(sf_name, super_name, fname); + HDsnprintf(super_name, sizeof(super_name), "%%s-%c.h5", 's'); + HDsnprintf(sf_name, sizeof(sf_name), super_name, fname); H5E_BEGIN_TRY { - file=H5Fopen(sf_name, H5F_ACC_RDWR, H5P_DEFAULT); + file = H5Fopen(sf_name, H5F_ACC_RDWR, H5P_DEFAULT); } H5E_END_TRY; - return 0; + return(file >= 0 ? -1 : 0); } @@ -999,11 +1019,11 @@ test_multi(void) TEST_ERROR; /* Reopen the file */ - if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) + if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR; /* Create and write data set */ - if((space=H5Screate_simple(2, dims, NULL)) < 0) + if((space = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR; /* Retrieve the access property list... */ @@ -1146,19 +1166,16 @@ error: static herr_t test_multi_compat(void) { - hid_t file=(-1), fapl, fapl2=(-1), dset=(-1), space=(-1); - hid_t access_fapl = -1; + hid_t file=(-1), fapl, dset=(-1), space=(-1); char newname[1024]; char filename_s[1024], newname_s[1024]; char filename_r[1024], newname_r[1024]; - int *fhandle2=NULL, *fhandle=NULL; H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES]; hid_t memb_fapl[H5FD_MEM_NTYPES]; haddr_t memb_addr[H5FD_MEM_NTYPES]; const char *memb_name[H5FD_MEM_NTYPES]; char sv[H5FD_MEM_NTYPES][32]; hsize_t dims[2]={MULTI_SIZE, MULTI_SIZE}; - char dname[]="dataset2"; int i, j; int buf[MULTI_SIZE][MULTI_SIZE]; @@ -1238,7 +1255,7 @@ test_multi_compat(void) if((space=H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR; - if((dset=H5Dcreate2(file, DSET2_NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((dset=H5Dcreate2(file, DSET3_NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; for(i=0; i= 0); + status = H5Fclose(ifile); + HDassert(status >= 0); if (usize == 0) { /* no user block to remove: message? */ @@ -320,7 +307,7 @@ main(int argc, const char *argv[]) if (ub_file == NULL) { /* write to sdtout */ - ufid = HDdup(1); + ufid = STDOUT_FILENO; } else { ufid = HDopen(ub_file,O_WRONLY|O_CREAT|O_TRUNC, 0644 ); @@ -371,17 +358,25 @@ main(int argc, const char *argv[]) } done: - if (ub_file) { - HDfree (ub_file); - if (ufid >= 0) HDclose(ufid); + if(input_file) + HDfree(input_file); + if(output_file) + HDfree(output_file); + if(ub_file) { + HDfree(ub_file); + if(ufid >= 0) + status = HDclose(ufid); + HDassert(status >= 0); } - if (input_file) - HDfree (input_file); - if (output_file) - HDfree (output_file); - if (h5fid >= 0) HDclose(h5fid); - if (ifid >= 0) HDclose(ifid); + if(h5fid >= 0) { + status = HDclose(h5fid); + HDassert(status >= 0); + } + if(ifid >= 0) { + status = HDclose(ifid); + HDassert(status >= 0); + } return h5tools_getstatus(); } diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 66c0e64..0d9bc15 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -30,10 +30,6 @@ #include "h5tools_utils.h" #include "H5private.h" -#define SANITY_CHECK - -#define ALIGN(A,Z) ((((A) + (Z) - 1) / (Z)) * (Z)) - /* global variables */ hid_t H5tools_ERR_STACK_g = 0; hid_t H5tools_ERR_CLS_g = -1; @@ -1122,7 +1118,6 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t while(block_index > 0) { size_t bytes_in = 0; /* # of bytes to write */ size_t bytes_wrote = 0; /* # of bytes written */ - size_t item_size = size; /* size of items in bytes */ if(block_index > sizeof(size_t)) bytes_in = sizeof(size_t); @@ -1168,16 +1163,21 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t break; case H5T_COMPOUND: { - unsigned j; - hid_t memb; + int snmembs; unsigned nmembs; - size_t offset; - nmembs = H5Tget_nmembers(tid); + if((snmembs = H5Tget_nmembers(tid)) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers of compound failed"); + nmembs = (unsigned)snmembs; for (block_index = 0; block_index < block_nelmts; block_index++) { + unsigned j; + mem = ((unsigned char*)_mem) + block_index * size; for (j = 0; j < nmembs; j++) { + hid_t memb; + size_t offset; + offset = H5Tget_member_offset(tid, j); memb = H5Tget_member_type(tid, j); @@ -1192,7 +1192,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t case H5T_ARRAY: { int k, ndims; - hsize_t i, dims[H5S_MAX_RANK], temp_nelmts, nelmts; + hsize_t dims[H5S_MAX_RANK], temp_nelmts, nelmts; hid_t memb; /* get the array's base datatype for each element */ @@ -1219,7 +1219,6 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t break; case H5T_VLEN: { - unsigned int i; hsize_t nelmts; hid_t memb; @@ -1305,10 +1304,9 @@ render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, hsize_t *start = NULL; hsize_t *count = NULL; hsize_t numelem; - hsize_t numindex; hsize_t total_size[H5S_MAX_RANK]; int jndx; - int type_size; + size_t type_size; hid_t mem_space = -1; void *region_buf = NULL; int blkndx; @@ -1399,15 +1397,17 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, FILE *stream, hid_t container) { HERR_INIT(hbool_t, TRUE) - hssize_t nblocks; + hssize_t snblocks; + hsize_t nblocks; hsize_t alloc_size; - hsize_t *ptdata = NULL; + hsize_t *ptdata; int ndims; hid_t dtype; hid_t type_id; - if((nblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0) + if((snblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0) H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_select_hyper_nblocks failed"); + nblocks = (hsize_t)snblocks; /* Print block information */ if((ndims = H5Sget_simple_extent_ndims(region_space)) < 0) @@ -1463,13 +1463,12 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, * hssize_t npoints is the number of points in the region *------------------------------------------------------------------------- */ -int +static int render_bin_output_region_data_points(hid_t region_space, hid_t region_id, FILE *stream, hid_t container, - int ndims, hid_t type_id, hssize_t npoints, hsize_t *ptdata) + int ndims, hid_t type_id, hssize_t npoints) { hsize_t *dims1 = NULL; - int jndx; int type_size; hid_t mem_space = -1; void *region_buf = NULL; @@ -1525,8 +1524,6 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id, { HERR_INIT(hbool_t, TRUE) hssize_t npoints; - hsize_t alloc_size; - hsize_t *ptdata; int ndims; hid_t dtype; hid_t type_id; @@ -1538,15 +1535,6 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id, if((ndims = H5Sget_simple_extent_ndims(region_space)) < 0) H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); - alloc_size = npoints * ndims * sizeof(ptdata[0]); - HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ - if(NULL == (ptdata = (hsize_t *)HDmalloc((size_t) alloc_size))) - HGOTO_ERROR(FALSE, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); - - H5_CHECK_OVERFLOW(npoints, hssize_t, hsize_t); - if(H5Sget_select_elem_pointlist(region_space, (hsize_t) 0, (hsize_t) npoints, ptdata) < 0) - HGOTO_ERROR(FALSE, H5E_tools_min_id_g, "H5Sget_select_elem_pointlist failed"); - if((dtype = H5Dget_type(region_id)) < 0) HGOTO_ERROR(FALSE, H5E_tools_min_id_g, "H5Dget_type failed"); @@ -1554,11 +1542,9 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id, HGOTO_ERROR(FALSE, H5E_tools_min_id_g, "H5Tget_native_type failed"); render_bin_output_region_data_points(region_space, region_id, - stream, container, ndims, type_id, npoints, ptdata); + stream, container, ndims, type_id, npoints); done: - HDfree(ptdata); - if(H5Tclose(type_id) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); -- cgit v0.12 From b65a911b8aff6e38133772d2e4a4f1714fad600e Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 3 Feb 2013 11:20:03 -0500 Subject: [svn-r23221] Snapshot version 1.9 release 142 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.txt b/README.txt index 3178848..5842824 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.142 currently under development +HDF5 version 1.9.143 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 6b7d958..285b1ae 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -467,7 +467,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 132 +LT_VERS_REVISION = 133 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 5757e36..829bc3a 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 132 +LT_VERS_REVISION = 133 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 2632655..ef3fc41 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.142. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.143. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.142' -PACKAGE_STRING='HDF5 1.9.142' +PACKAGE_VERSION='1.9.143' +PACKAGE_STRING='HDF5 1.9.143' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1484,7 +1484,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.142 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.143 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1554,7 +1554,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.142:";; + short | recursive ) echo "Configuration of HDF5 1.9.143:";; esac cat <<\_ACEOF @@ -1750,7 +1750,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.142 +HDF5 configure 1.9.143 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2844,7 +2844,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.142, which was +It was created by HDF5 $as_me 1.9.143, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3676,7 +3676,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.142' + VERSION='1.9.143' cat >>confdefs.h <<_ACEOF @@ -31723,7 +31723,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.142, which was +This file was extended by HDF5 $as_me 1.9.143, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31789,7 +31789,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.142 +HDF5 config.status 1.9.143 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -34562,7 +34562,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.142 +HDF5 config.lt 1.9.143 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. diff --git a/configure.ac b/configure.ac index 1c32c43..894a10d 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.142], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.143], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index fd4a0b0..3261a78 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -517,7 +517,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 132 +LT_VERS_REVISION = 133 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index bad9f0e..d89c02c 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -458,7 +458,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 132 +LT_VERS_REVISION = 133 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 20934ed..1f39ba7 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -474,7 +474,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 132 +LT_VERS_REVISION = 133 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 5c9b565..2ded187 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -457,7 +457,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 132 +LT_VERS_REVISION = 133 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 883a300..6d329bb 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.142 currently under development +HDF5 version 1.9.143 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index bd9d859..de4af2a 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 142 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 143 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.142" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.143" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 24a49c7..ceb4e33 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -522,7 +522,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 132 +LT_VERS_REVISION = 133 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 9c61823..c5db8dc 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.142" +#define H5_PACKAGE_STRING "HDF5 1.9.143" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.142" +#define H5_PACKAGE_VERSION "1.9.143" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.142" +#define H5_VERSION "1.9.143" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From c0b2724d4db12e75ef5e297900b088f1839886cd Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 4 Feb 2013 09:42:21 -0500 Subject: [svn-r23223] Description: Revert use of snprintf() for sprintf(), as it is not supported on Windows. (And file a bug, http://jira.hdfgroup.uiuc.edu/browse/HDFFV-8302, for the general problem) Tested: Mac OSX/64 10.8.2 (amazon) --- src/H5FDmulti.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index c2701c4..5bdfbbe 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -336,7 +336,7 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, meta_name[sizeof(meta_name) - 1] = '\0'; } else - snprintf(meta_name, sizeof(meta_name), "%%s%s", meta_ext); + sprintf(meta_name, "%%s%s", meta_ext); } else { strncpy(meta_name, "%s.meta", sizeof(meta_name)); @@ -354,7 +354,7 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, raw_name[sizeof(raw_name) - 1] = '\0'; } else - snprintf(raw_name, sizeof(raw_name), "%%s%s", raw_ext); + sprintf(raw_name, "%%s%s", raw_ext); } else { strncpy(raw_name, "%s.raw", sizeof(raw_name)); @@ -488,7 +488,7 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, if (!memb_name) { assert(strlen(letters)==H5FD_MEM_NTYPES); for (mt=H5FD_MEM_DEFAULT; mtfa.memb_name[mt], file->name); + sprintf(tmp, file->fa.memb_name[mt], file->name); #ifdef H5FD_MULTI_DEBUG if(file->flags & H5F_ACC_DEBUG) -- cgit v0.12 From c3e149d06fe79fab3b5e48d4d9198cacea42ed53 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 4 Feb 2013 15:15:59 -0500 Subject: [svn-r23226] HDFFV-8285: suppress-ddl option: Changed file options to allow for filename F to be optional. Tested: local linux --- tools/h5dump/CMakeLists.txt | 12 +++--- tools/h5dump/h5dump.c | 48 ++++++++++++------------ tools/h5dump/testh5dump.sh.in | 10 ++--- tools/lib/h5tools.c | 1 + tools/lib/h5tools_utils.c | 2 + tools/testfiles/h5dump-help.txt | 2 +- tools/testfiles/tnofilename-with-packed-bits.ddl | 2 +- tools/testfiles/tpbitsIncomplete.ddl | 2 +- tools/testfiles/tpbitsLengthExceeded.ddl | 2 +- tools/testfiles/tpbitsLengthPositive.ddl | 2 +- tools/testfiles/tpbitsMaxExceeded.ddl | 2 +- tools/testfiles/tpbitsOffsetExceeded.ddl | 2 +- tools/testfiles/tpbitsOffsetNegative.ddl | 2 +- 13 files changed, 48 insertions(+), 41 deletions(-) diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 1d0012e..286d09f 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -1262,12 +1262,14 @@ IF (BUILD_TESTING) ADD_HELP_TEST(help 0 -h) # test data output redirection - ADD_H5_TEST (tnoddl 0 --enable-error-stack --ddl=NULL -y packedbits.h5) - ADD_H5_TEST (tnodata 0 --enable-error-stack --output=NULL packedbits.h5) - ADD_H5_TEST (tnoattrddl 0 --enable-error-stack --ddl=NULL -y tattr.h5) - ADD_H5_TEST (tnoattrdata 0 --enable-error-stack -A --output=NULL tattr.h5) + #ADD_H5_TEST (tnoddl 0 --enable-error-stack -O -y packedbits.h5) + ADD_H5_TEST (tnoddl 0 --enable-error-stack --ddl -y packedbits.h5) + #ADD_H5_TEST (tnodata 0 --enable-error-stack -o packedbits.h5) + ADD_H5_TEST (tnodata 0 --enable-error-stack --output packedbits.h5) + ADD_H5_TEST (tnoattrddl 0 --enable-error-stack -O -y tattr.h5) + ADD_H5_TEST (tnoattrdata 0 --enable-error-stack -A -o tattr.h5) ADD_H5_TEST_EXPORT (trawdatafile packedbits.h5 0 --enable-error-stack -y -o) - ADD_H5_TEST_EXPORT (tnoddlfile packedbits.h5 0 --enable-error-stack --ddl=NULL -y -o) + ADD_H5_TEST_EXPORT (tnoddlfile packedbits.h5 0 --enable-error-stack -O -y -o) ADD_TEST ( NAME H5DUMP-clear-twithddlfile-export COMMAND ${CMAKE_COMMAND} diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 0d667df..d89202c 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -71,7 +71,7 @@ struct handler_t { */ /* The following initialization makes use of C language cancatenating */ /* "xxx" "yyy" into "xxxyyy". */ -static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o:b*F:s:S:Aq:z:m:RECM:O:"; +static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:Aq:z:m:RECM:O*"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "hel", no_arg, 'h' }, @@ -139,11 +139,11 @@ static struct long_options l_opts[] = { { "grou", require_arg, 'g' }, { "gro", require_arg, 'g' }, { "gr", require_arg, 'g' }, - { "output", require_arg, 'o' }, - { "outpu", require_arg, 'o' }, - { "outp", require_arg, 'o' }, - { "out", require_arg, 'o' }, - { "ou", require_arg, 'o' }, + { "output", optional_arg, 'o' }, + { "outpu", optional_arg, 'o' }, + { "outp", optional_arg, 'o' }, + { "out", optional_arg, 'o' }, + { "ou", optional_arg, 'o' }, { "soft-link", require_arg, 'l' }, { "soft-lin", require_arg, 'l' }, { "soft-li", require_arg, 'l' }, @@ -187,7 +187,7 @@ static struct long_options l_opts[] = { { "enable-error-stack", no_arg, 'E' }, { "packed-bits", require_arg, 'M' }, { "no-compact-subset", no_arg, 'C' }, - { "ddl", require_arg, 'O' }, + { "ddl", optional_arg, 'O' }, { NULL, 0, '\0' } }; @@ -283,7 +283,7 @@ usage(const char *prog) PRINTVALSTREAM(rawoutstream, " --no-compact-subset Disable compact form of subsetting and allow the use\n"); PRINTVALSTREAM(rawoutstream, " of \"[\" in dataset names.\n"); PRINTVALSTREAM(rawoutstream, " -O F, --ddl=F Output ddl text into file F\n"); - PRINTVALSTREAM(rawoutstream, " Use NULL as filename to suppress ddl display\n"); + PRINTVALSTREAM(rawoutstream, " Do not use filename F to suppress ddl display\n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " Subsetting is available by using the following options with a dataset\n"); PRINTVALSTREAM(rawoutstream, " attribute. Subsetting is done by selecting a hyperslab from the data.\n"); @@ -515,11 +515,7 @@ set_data_output_file(const char *fname, int is_bin) } /* First check if filename is string "NULL" */ - if (HDstrcmp(fname, "NULL") == 0) { - rawdatastream = NULL; - retvalue = SUCCEED; - } - else { + if (fname != NULL) { /* binary output */ if (is_bin) { if ((f = HDfopen(fname, "wb")) != NULL) { @@ -534,6 +530,10 @@ set_data_output_file(const char *fname, int is_bin) } } } + else { + rawdatastream = NULL; + retvalue = SUCCEED; + } return retvalue; } @@ -564,16 +564,16 @@ set_attr_output_file(const char *fname, int is_bin) } /* First check if filename is string "NULL" */ - if (HDstrcmp(fname, "NULL") == 0) { - rawattrstream = NULL; - retvalue = SUCCEED; - } - else { + if (fname != NULL) { if ((f = HDfopen(fname, "w")) != NULL) { rawattrstream = f; retvalue = SUCCEED; } } + else { + rawattrstream = NULL; + retvalue = SUCCEED; + } return retvalue; } @@ -603,12 +603,14 @@ set_output_file(const char *fname) rawoutstream = NULL; } /* First check if filename is string "NULL" */ - if (HDstrcmp(fname, "NULL") == 0) { - rawoutstream = NULL; - retvalue = SUCCEED; + if (fname != NULL) { + if ((f = HDfopen(fname, "w")) != NULL) { + rawoutstream = f; + retvalue = SUCCEED; + } } - else if ((f = HDfopen(fname, "w")) != NULL) { - rawoutstream = f; + else { + rawoutstream = NULL; retvalue = SUCCEED; } diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 57c7d96..238eee9 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -799,12 +799,12 @@ COPY_TESTFILES_TO_TESTDIR #TOOLTEST h5dump-help.txt -h # test data output redirection -TOOLTEST tnoddl.ddl --enable-error-stack --ddl=NULL -y packedbits.h5 -TOOLTEST tnodata.ddl --enable-error-stack --output=NULL packedbits.h5 -TOOLTEST tnoattrddl.ddl --enable-error-stack --ddl=NULL -y tattr.h5 -TOOLTEST tnoattrdata.ddl --enable-error-stack -A --output=NULL tattr.h5 +TOOLTEST tnoddl.ddl --enable-error-stack --ddl -y packedbits.h5 +TOOLTEST tnodata.ddl --enable-error-stack --output packedbits.h5 +TOOLTEST tnoattrddl.ddl --enable-error-stack -O -y tattr.h5 +TOOLTEST tnoattrdata.ddl --enable-error-stack -A -o tattr.h5 TOOLTEST2 trawdatafile.exp --enable-error-stack -y -o trawdatafile.txt packedbits.h5 -TOOLTEST2 tnoddlfile.exp --enable-error-stack --ddl=NULL -y -o tnoddlfile.txt packedbits.h5 +TOOLTEST2 tnoddlfile.exp --enable-error-stack -O -y -o tnoddlfile.txt packedbits.h5 TOOLTEST2A twithddlfile.exp twithddl.exp --enable-error-stack --ddl=twithddl.txt -y -o twithddlfile.txt packedbits.h5 # test for maximum display datasets diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 0d9bc15..5f4227c 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -153,6 +153,7 @@ h5tools_close(void) H5E_auto2_t tools_func; void *tools_edata; if (h5tools_init_g) { + /* special case where only data is output to stdout */ if((rawoutstream == NULL) && rawdatastream && (rawdatastream == stdout)) HDfprintf(rawdatastream, "\n"); diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index d45eab2..d7c5adb 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -277,6 +277,8 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti opt_opt = '?'; } + else + opt_arg = NULL; } else { if (arg[len] == '=') { diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt index 12629c9..40510a4 100644 --- a/tools/testfiles/h5dump-help.txt +++ b/tools/testfiles/h5dump-help.txt @@ -47,7 +47,7 @@ usage: h5dump [OPTIONS] files --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -O F, --ddl=F Output ddl text into file F - Use NULL as filename to suppress ddl display + Do not use filename F to suppress ddl display Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. diff --git a/tools/testfiles/tnofilename-with-packed-bits.ddl b/tools/testfiles/tnofilename-with-packed-bits.ddl index e8b733c..440e3d9 100644 --- a/tools/testfiles/tnofilename-with-packed-bits.ddl +++ b/tools/testfiles/tnofilename-with-packed-bits.ddl @@ -47,7 +47,7 @@ usage: h5dump [OPTIONS] files --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -O F, --ddl=F Output ddl text into file F - Use NULL as filename to suppress ddl display + Do not use filename F to suppress ddl display Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. diff --git a/tools/testfiles/tpbitsIncomplete.ddl b/tools/testfiles/tpbitsIncomplete.ddl index 0af7386..758b6b4 100644 --- a/tools/testfiles/tpbitsIncomplete.ddl +++ b/tools/testfiles/tpbitsIncomplete.ddl @@ -47,7 +47,7 @@ usage: h5dump [OPTIONS] files --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -O F, --ddl=F Output ddl text into file F - Use NULL as filename to suppress ddl display + Do not use filename F to suppress ddl display Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. diff --git a/tools/testfiles/tpbitsLengthExceeded.ddl b/tools/testfiles/tpbitsLengthExceeded.ddl index bf1ced8..a85ba49 100644 --- a/tools/testfiles/tpbitsLengthExceeded.ddl +++ b/tools/testfiles/tpbitsLengthExceeded.ddl @@ -47,7 +47,7 @@ usage: h5dump [OPTIONS] files --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -O F, --ddl=F Output ddl text into file F - Use NULL as filename to suppress ddl display + Do not use filename F to suppress ddl display Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. diff --git a/tools/testfiles/tpbitsLengthPositive.ddl b/tools/testfiles/tpbitsLengthPositive.ddl index 4aa79bd..d5a1c88 100644 --- a/tools/testfiles/tpbitsLengthPositive.ddl +++ b/tools/testfiles/tpbitsLengthPositive.ddl @@ -47,7 +47,7 @@ usage: h5dump [OPTIONS] files --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -O F, --ddl=F Output ddl text into file F - Use NULL as filename to suppress ddl display + Do not use filename F to suppress ddl display Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. diff --git a/tools/testfiles/tpbitsMaxExceeded.ddl b/tools/testfiles/tpbitsMaxExceeded.ddl index 89a767c..e24245c 100644 --- a/tools/testfiles/tpbitsMaxExceeded.ddl +++ b/tools/testfiles/tpbitsMaxExceeded.ddl @@ -47,7 +47,7 @@ usage: h5dump [OPTIONS] files --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -O F, --ddl=F Output ddl text into file F - Use NULL as filename to suppress ddl display + Do not use filename F to suppress ddl display Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. diff --git a/tools/testfiles/tpbitsOffsetExceeded.ddl b/tools/testfiles/tpbitsOffsetExceeded.ddl index 2f89be6..8f58c47 100644 --- a/tools/testfiles/tpbitsOffsetExceeded.ddl +++ b/tools/testfiles/tpbitsOffsetExceeded.ddl @@ -47,7 +47,7 @@ usage: h5dump [OPTIONS] files --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -O F, --ddl=F Output ddl text into file F - Use NULL as filename to suppress ddl display + Do not use filename F to suppress ddl display Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. diff --git a/tools/testfiles/tpbitsOffsetNegative.ddl b/tools/testfiles/tpbitsOffsetNegative.ddl index e3bca0c..6df8cce 100644 --- a/tools/testfiles/tpbitsOffsetNegative.ddl +++ b/tools/testfiles/tpbitsOffsetNegative.ddl @@ -47,7 +47,7 @@ usage: h5dump [OPTIONS] files --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -O F, --ddl=F Output ddl text into file F - Use NULL as filename to suppress ddl display + Do not use filename F to suppress ddl display Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. -- cgit v0.12 From b1e0f6c5a558892523c21baac0c812103bcf42a0 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 5 Feb 2013 10:11:47 -0500 Subject: [svn-r23227] HDFFV-8215 - update help text to be cosistent with the RM entry. Tested: local linux --- tools/h5ls/h5ls.c | 4 ++-- tools/testfiles/help-1.ls | 4 ++-- tools/testfiles/help-2.ls | 4 ++-- tools/testfiles/help-3.ls | 4 ++-- tools/testfiles/textlinksrc-nodangle-1.ls | 4 ++-- tools/testfiles/tgroup-1.ls | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 2266480..7135e4e 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -177,7 +177,7 @@ static void usage (void) { HDfprintf(rawerrorstream, "\ -usage: %s [OPTIONS] [OBJECTS...]\n\ +usage: %s [OPTIONS] file[/OBJECT] [file[/[OBJECT]...]\n\ OPTIONS\n\ -h, -?, --help Print a usage message and exit\n\ -a, --address Print raw data address. If dataset is contiguous, address\n\ @@ -217,7 +217,7 @@ usage: %s [OPTIONS] [OBJECTS...]\n\ --vfd=DRIVER Use the specified virtual file driver\n\ -x, --hexdump Show raw data in hexadecimal format\n\ \n\ - OBJECTS\n\ + file/OBJECT\n\ Each object consists of an HDF5 file name optionally followed by a\n\ slash and an object name within the file (if no object is specified\n\ within the file then the contents of the root group are displayed).\n\ diff --git a/tools/testfiles/help-1.ls b/tools/testfiles/help-1.ls index aaba608..491f696 100644 --- a/tools/testfiles/help-1.ls +++ b/tools/testfiles/help-1.ls @@ -1,4 +1,4 @@ -usage: h5ls [OPTIONS] [OBJECTS...] +usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...] OPTIONS -h, -?, --help Print a usage message and exit -a, --address Print raw data address. If dataset is contiguous, address @@ -38,7 +38,7 @@ usage: h5ls [OPTIONS] [OBJECTS...] --vfd=DRIVER Use the specified virtual file driver -x, --hexdump Show raw data in hexadecimal format - OBJECTS + file/OBJECT Each object consists of an HDF5 file name optionally followed by a slash and an object name within the file (if no object is specified within the file then the contents of the root group are displayed). diff --git a/tools/testfiles/help-2.ls b/tools/testfiles/help-2.ls index aaba608..491f696 100644 --- a/tools/testfiles/help-2.ls +++ b/tools/testfiles/help-2.ls @@ -1,4 +1,4 @@ -usage: h5ls [OPTIONS] [OBJECTS...] +usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...] OPTIONS -h, -?, --help Print a usage message and exit -a, --address Print raw data address. If dataset is contiguous, address @@ -38,7 +38,7 @@ usage: h5ls [OPTIONS] [OBJECTS...] --vfd=DRIVER Use the specified virtual file driver -x, --hexdump Show raw data in hexadecimal format - OBJECTS + file/OBJECT Each object consists of an HDF5 file name optionally followed by a slash and an object name within the file (if no object is specified within the file then the contents of the root group are displayed). diff --git a/tools/testfiles/help-3.ls b/tools/testfiles/help-3.ls index aaba608..491f696 100644 --- a/tools/testfiles/help-3.ls +++ b/tools/testfiles/help-3.ls @@ -1,4 +1,4 @@ -usage: h5ls [OPTIONS] [OBJECTS...] +usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...] OPTIONS -h, -?, --help Print a usage message and exit -a, --address Print raw data address. If dataset is contiguous, address @@ -38,7 +38,7 @@ usage: h5ls [OPTIONS] [OBJECTS...] --vfd=DRIVER Use the specified virtual file driver -x, --hexdump Show raw data in hexadecimal format - OBJECTS + file/OBJECT Each object consists of an HDF5 file name optionally followed by a slash and an object name within the file (if no object is specified within the file then the contents of the root group are displayed). diff --git a/tools/testfiles/textlinksrc-nodangle-1.ls b/tools/testfiles/textlinksrc-nodangle-1.ls index 7427e1c..9c19957 100644 --- a/tools/testfiles/textlinksrc-nodangle-1.ls +++ b/tools/testfiles/textlinksrc-nodangle-1.ls @@ -1,6 +1,6 @@ Error: --no-dangling-links must be used along with --follow-symlinks option! -usage: h5ls [OPTIONS] [OBJECTS...] +usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...] OPTIONS -h, -?, --help Print a usage message and exit -a, --address Print raw data address. If dataset is contiguous, address @@ -40,7 +40,7 @@ usage: h5ls [OPTIONS] [OBJECTS...] --vfd=DRIVER Use the specified virtual file driver -x, --hexdump Show raw data in hexadecimal format - OBJECTS + file/OBJECT Each object consists of an HDF5 file name optionally followed by a slash and an object name within the file (if no object is specified within the file then the contents of the root group are displayed). diff --git a/tools/testfiles/tgroup-1.ls b/tools/testfiles/tgroup-1.ls index effaf5a..893c9ce 100644 --- a/tools/testfiles/tgroup-1.ls +++ b/tools/testfiles/tgroup-1.ls @@ -1,6 +1,6 @@ Error: 'recursive' option not compatible with 'group info' option! -usage: h5ls [OPTIONS] [OBJECTS...] +usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...] OPTIONS -h, -?, --help Print a usage message and exit -a, --address Print raw data address. If dataset is contiguous, address @@ -40,7 +40,7 @@ usage: h5ls [OPTIONS] [OBJECTS...] --vfd=DRIVER Use the specified virtual file driver -x, --hexdump Show raw data in hexadecimal format - OBJECTS + file/OBJECT Each object consists of an HDF5 file name optionally followed by a slash and an object name within the file (if no object is specified within the file then the contents of the root group are displayed). -- cgit v0.12 From d7a07d62a486f28ca869416762a4b45c7befb45b Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Tue, 5 Feb 2013 11:09:45 -0500 Subject: [svn-r23228] Purpose: Revert back one of the coverity updates from previous checkin. "r20457: Coverity issue 691" in previous svn log. Only revert the change about using "STDOUT_FILENO". Description: Using "STDOUT_FILENO" caused error on Windows. On unix it's defined in , but not in Windows. After a little discussion with Allen, he remembered how the similar case were handled for h5dump redirecting those streams. (in h5dump.c) However it would requires more attention to apply, so this issue is entered as a separate task in jira HDDFV-8306. Tested: jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), fred (mac64-LE) --- tools/h5jam/h5unjam.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c index 18b5f11..691e2f2 100644 --- a/tools/h5jam/h5unjam.c +++ b/tools/h5jam/h5unjam.c @@ -307,7 +307,7 @@ main(int argc, const char *argv[]) if (ub_file == NULL) { /* write to sdtout */ - ufid = STDOUT_FILENO; + ufid = HDdup(1); } else { ufid = HDopen(ub_file,O_WRONLY|O_CREAT|O_TRUNC, 0644 ); -- cgit v0.12 From 0e3517d34fb6b4c2c1016ea6be80f3046f6d8549 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Tue, 5 Feb 2013 12:07:02 -0500 Subject: [svn-r23230] Purpose: Implement H5Dscatter and H5Dgather Description: Adds 2 new API functions, H5Dscatter and H5Dgather. H5Dscatter retrieves data from a specified callback function and scatters it into a selection, defined by a supplied dataspace, within a supplied memory buffer. H5Dgather gathers data from a selection within a supplied memory buffer and passes it in a contiguous form to a supplied callback function. Added tests for these functions Tested: jam, ostrich, koala (h5committest); ummon --- bin/trace | 2 + release_docs/RELEASE.txt | 3 + src/H5Dpublic.h | 13 + src/H5Dscatgath.c | 200 ++++++++- test/dsets.c | 1012 ++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 1229 insertions(+), 1 deletion(-) diff --git a/bin/trace b/bin/trace index 67aeb17..657ac92 100755 --- a/bin/trace +++ b/bin/trace @@ -99,7 +99,9 @@ $Source = ""; "H5A_operator2_t" => "x", "H5A_info_t" => "x", "H5AC_cache_config_t" => "x", + "H5D_gather_func_t" => "x", "H5D_operator_t" => "x", + "H5D_scatter_func_t" => "x", "H5E_auto_t" => "x", "H5E_auto1_t" => "x", "H5E_auto2_t" => "x", diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 6d329bb..a67c613 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -106,6 +106,9 @@ New Features Library: -------- + - Added new API functions H5Dscatter and H5Dgather to scatter data to and + and gather data from a selection within a memory buffer. + (NAF - 2013/02/05) - The library now supports the data conversion from enumeration to numeric (integer and floating-point number) datatypes. See Issue 8221. (SLU - 2012/10/23) diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index 523f2b2..484b176 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -107,6 +107,15 @@ extern "C" { typedef herr_t (*H5D_operator_t)(void *elem, hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data); +/* Define the operator function pointer for H5Dscatter() */ +typedef herr_t (*H5D_scatter_func_t)(void **src_buf/*out*/, + size_t *src_buf_bytes_used/*out*/, + void *op_data); + +/* Define the operator function pointer for H5Dgather() */ +typedef herr_t (*H5D_gather_func_t)(const void *dst_buf, + size_t dst_buf_bytes_used, void *op_data); + H5_DLL hid_t H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id); H5_DLL hid_t H5Dcreate_anon(hid_t file_id, hid_t type_id, hid_t space_id, @@ -131,6 +140,10 @@ H5_DLL herr_t H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_ H5_DLL herr_t H5Dfill(const void *fill, hid_t fill_type, void *buf, hid_t buf_type, hid_t space); H5_DLL herr_t H5Dset_extent(hid_t dset_id, const hsize_t size[]); +H5_DLL herr_t H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, + hid_t dst_space_id, void *dst_buf); +H5_DLL herr_t H5Dgather(hid_t src_space_id, void *src_buf, hid_t type_id, + size_t dst_buf_size, void *dst_buf, H5D_gather_func_t op, void *op_data); H5_DLL herr_t H5Ddebug(hid_t dset_id); /* Symbols defined for compatibility with previous versions of the HDF5 API. diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index 49b6132..74d6749 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -27,6 +27,7 @@ #include "H5Dpkg.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ +#include "H5Iprivate.h" /* IDs */ /****************/ @@ -361,7 +362,7 @@ done: * copies them into the gather buffer TGATH_BUF. * Each element is ELMT_SIZE bytes and arranged in application * memory according to SPACE. - * The caller is requesting that at most NELMTS be gathered. + * The caller is requesting that exactly NELMTS be gathered. * * Return: Success: Number of elements copied. * Failure: 0 @@ -899,3 +900,200 @@ H5D__compound_opt_write(size_t nelmts, const H5D_type_info_t *type_info) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D__compound_opt_write() */ + +/*------------------------------------------------------------------------- + * Function: H5Dscatter + * + * Purpose: Scatters data provided by the callback op to the + * destination buffer dst_buf, where the dimensions of + * dst_buf and the selection to be scattered to are specified + * by the dataspace dst_space_id. The type of the data to be + * scattered is specified by type_id. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Neil Fortner + * 14 Jan 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, + hid_t dst_space_id, void *dst_buf) +{ + H5T_t *type; /* Datatype */ + H5S_t *dst_space; /* Dataspace */ + H5S_sel_iter_t iter; /* Selection iteration info*/ + hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */ + void *src_buf = NULL; /* Source (contiguous) data buffer */ + size_t src_buf_nbytes = 0; /* Size of src_buf */ + size_t type_size; /* Datatype element size */ + hssize_t nelmts; /* Number of remaining elements in selection */ + size_t nelmts_scatter = 0; /* Number of elements to scatter to dst_buf */ + H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ + H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE5("e", "x*xii*x", op, op_data, type_id, dst_space_id, dst_buf); + + /* Check args */ + if(op == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid callback function pointer") + if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + if(NULL == (dst_space= (H5S_t *)H5I_object_verify(dst_space_id, H5I_DATASPACE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") + if(dst_buf == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination buffer provided") + + /* Fill the DXPL cache values for later use */ + if(H5D__get_dxpl_cache(H5P_DATASET_XFER_DEFAULT, &dxpl_cache) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") + + /* Get datatype element size */ + if(0 == (type_size = H5T_GET_SIZE(type))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get datatype size") + + /* Get number of elements in dataspace */ + if((nelmts = (hssize_t)H5S_GET_SELECT_NPOINTS(dst_space)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "unable to get number of elements in selection") + + /* Initialize selection iterator */ + if(H5S_select_iter_init(&iter, dst_space, type_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize selection iterator information") + iter_init = TRUE; + + /* Loop until all data has been scattered */ + while(nelmts > 0) { + /* Make callback to retrieve data */ + if(op(&src_buf, &src_buf_nbytes, op_data) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CALLBACK, FAIL, "callback operator returned failure") + + /* Calculate number of elements */ + nelmts_scatter = src_buf_nbytes / type_size; + + /* Check callback results */ + if(!src_buf) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "callback did not return a buffer") + if(src_buf_nbytes == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "callback returned a buffer size of 0") + if(src_buf_nbytes % type_size) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "buffer size is not a multiple of datatype size") + if(nelmts_scatter > (size_t)nelmts) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "callback returned more elements than in selection") + + /* Scatter data */ + if(H5D__scatter_mem(src_buf, dst_space, &iter, nelmts_scatter, dxpl_cache, dst_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "scatter failed") + + nelmts -= (hssize_t)nelmts_scatter; + } /* end while */ + +done: + /* Release selection iterator */ + if(iter_init) { + if(H5S_SELECT_ITER_RELEASE(&iter) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") + } /* end if */ + + FUNC_LEAVE_API(ret_value) +} /* H5Dscatter() */ + + +/*------------------------------------------------------------------------- + * Function: H5Dgather + * + * Purpose: Gathers data provided from the source buffer src_buf to + * contiguous buffer dst_buf, then calls the callback op. + * The dimensions of src_buf and the selection to be gathered + * are specified by the dataspace src_space_id. The type of + * the data to be gathered is specified by type_id. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Neil Fortner + * 16 Jan 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Dgather(hid_t src_space_id, void *src_buf, hid_t type_id, size_t dst_buf_size, + void *dst_buf, H5D_gather_func_t op, void *op_data) +{ + H5T_t *type; /* Datatype */ + H5S_t *src_space; /* Dataspace */ + H5S_sel_iter_t iter; /* Selection iteration info*/ + hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */ + size_t type_size; /* Datatype element size */ + hssize_t nelmts; /* Number of remaining elements in selection */ + size_t dst_buf_nelmts; /* Number of elements that can fit in dst_buf */ + size_t nelmts_gathered; /* Number of elements gathered from src_buf */ + H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ + H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE7("e", "i*xiz*xx*x", src_space_id, src_buf, type_id, dst_buf_size, + dst_buf, op, op_data); + + /* Check args */ + if(NULL == (src_space= (H5S_t *)H5I_object_verify(src_space_id, H5I_DATASPACE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") + if(src_buf == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no source buffer provided") + if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + if(dst_buf_size == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination buffer size is 0") + if(dst_buf == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination buffer provided") + if(op == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid callback function pointer") + + /* Fill the DXPL cache values for later use */ + if(H5D__get_dxpl_cache(H5P_DATASET_XFER_DEFAULT, &dxpl_cache) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") + + /* Get datatype element size */ + if(0 == (type_size = H5T_GET_SIZE(type))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get datatype size") + + /* Get number of elements in dst_buf_size */ + dst_buf_nelmts = dst_buf_size / type_size; + if(dst_buf_nelmts == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination buffer is not large enough to hold one element") + + /* Get number of elements in dataspace */ + if((nelmts = (hssize_t)H5S_GET_SELECT_NPOINTS(src_space)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "unable to get number of elements in selection") + + /* Initialize selection iterator */ + if(H5S_select_iter_init(&iter, src_space, type_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize selection iterator information") + iter_init = TRUE; + + /* Loop until all data has been scattered */ + while(nelmts > 0) { + /* Gather data */ + if(0 == (nelmts_gathered = H5D__gather_mem(src_buf, src_space, &iter, MIN(dst_buf_nelmts, (size_t)nelmts), dxpl_cache, dst_buf))) + HGOTO_ERROR(H5E_IO, H5E_CANTCOPY, FAIL, "gather failed") + HDassert(nelmts_gathered == MIN(dst_buf_nelmts, (size_t)nelmts)); + + /* Make callback to process dst_buf */ + if(op(dst_buf, nelmts_gathered * type_size, op_data) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CALLBACK, FAIL, "callback operator returned failure") + + nelmts -= (hssize_t)nelmts_gathered; + } /* end while */ + +done: + /* Release selection iterator */ + if(iter_init) { + if(H5S_SELECT_ITER_RELEASE(&iter) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") + } /* end if */ + + FUNC_LEAVE_API(ret_value) +} /* H5Dgather() */ + diff --git a/test/dsets.c b/test/dsets.c index 838ef48..96611d9 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -8181,6 +8181,1012 @@ error: /*------------------------------------------------------------------------- + * Function: test_scatter + * + * Purpose: Tests H5Dscatter with a variety of different selections + * and source buffer sizes. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Neil Fortner + * Wednesday, January 16, 2013 + * + *------------------------------------------------------------------------- + */ +typedef struct scatter_info_t { + int *src_buf; /* Source data buffer */ + size_t block; /* Maximum number of elements to return to H5Dscatter() */ + size_t size; /* Remaining number of elements to return */ +} scatter_info_t; + +#define TEST_SCATTER_CHECK_ARR(ARR, EXP) \ + for(i=0; i<(int)(sizeof(ARR)/sizeof(ARR[0])); i++) \ + for(j=0; j<(int)(sizeof(ARR[0])/sizeof(ARR[0][0])); j++) \ + for(k=0; k<(int)(sizeof(ARR[0][0])/sizeof(ARR[0][0][0])); k++) \ + if(ARR[i][j][k] != EXP[i][j][k]) { \ + H5_FAILED(); AT(); \ + printf(" " #ARR "[%d][%d][%d] == %d, " #EXP "[%d][%d][%d] == %d\n", i, j, k, ARR[i][j][k], i, j, k, EXP[i][j][k]); \ + goto error; \ + } + +static herr_t +scatter_cb(void **src_buf/*out*/, size_t *src_buf_bytes_used/*out*/, + void *_scatter_info) +{ + scatter_info_t *scatter_info = (scatter_info_t *)_scatter_info; + size_t nelmts; /* Number of elements to return in src_buf */ + + /* Calculate number of elements */ + nelmts = MIN(scatter_info->block, scatter_info->size); + HDassert(nelmts > 0); + + /* Set output variables */ + *src_buf = (void *)scatter_info->src_buf; + *src_buf_bytes_used = nelmts * sizeof(scatter_info->src_buf[0]); + + /* Update scatter_info */ + scatter_info->src_buf += nelmts; + scatter_info->size -= nelmts; + + return SUCCEED; +} + +static herr_t +test_scatter(void) +{ + hid_t sid = -1; /* Dataspace ID */ + hsize_t dim[3] = {8, 4, 8}; /* Dataspace dimensions */ + hsize_t start[3] = {0, 0, 0}; + hsize_t stride[3] = {0, 0, 0}; + hsize_t count[3] = {0, 0, 0}; + hsize_t block[3] = {0, 0, 0}; + hsize_t start2[3] = {0, 0, 0}; + hsize_t count2[3] = {0, 0, 0}; + hsize_t point[4][3] = {{2, 3, 2}, {3, 0, 2}, {7, 2, 0}, {0, 1, 5}}; + size_t src_buf_size; + int src_buf[36]; /* Source data buffer */ + int dst_buf[8][4][8]; /* Destination data buffer */ + int expect_dst_buf[8][4][8]; /* Expected destination data buffer */ + scatter_info_t scatter_info; /* Operator data for callback */ + int i, j, k, src_i; /* Local index variables */ + + TESTING("H5Dscatter()"); + + /* Create dataspace */ + if((sid = H5Screate_simple(3, dim, NULL)) < 0) TEST_ERROR + + /* Initialize src_buf */ + for(i=0; i<(int)(sizeof(src_buf)/sizeof(src_buf[0])); i++) + src_buf[i] = i + 1; + + + /* + * Test 1: Simple case + */ + /* Select hyperslab */ + count[0] = 1; + count[1] = 1; + count[2] = 8; + if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL ,count, NULL) < 0) + TEST_ERROR + + /* Initialize dst_buf and expect_dst_buf */ + (void)HDmemset(expect_dst_buf, 0, sizeof(expect_dst_buf)); + for(i=0; i<8; i++) + expect_dst_buf[0][0][i] = src_buf[i]; + + /* Loop over buffer sizes */ + for(src_buf_size=1; src_buf_size<=9; src_buf_size++) { + /* Reset dst_buf */ + (void)HDmemset(dst_buf, 0, sizeof(dst_buf)); + + /* Set up scatter info */ + scatter_info.src_buf = src_buf; + scatter_info.block = src_buf_size; + scatter_info.size = 8; + + /* Scatter data */ + if(H5Dscatter(scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf) < 0) + TEST_ERROR + + /* Verify data */ + TEST_SCATTER_CHECK_ARR(dst_buf, expect_dst_buf) + } /* end for */ + + + /* + * Test 2: Single block in dataset + */ + /* Select hyperslab */ + start[0] = 3; + start[1] = 2; + start[2] = 4; + count[0] = 2; + count[1] = 3; + count[2] = 2; + if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL ,count, NULL) < 0) + TEST_ERROR + + /* Initialize expect_dst_buf */ + (void)HDmemset(expect_dst_buf, 0, sizeof(expect_dst_buf)); + src_i = 0; + for(i=3; i<5; i++) + for(j=2; j<5; j++) + for(k=4; k<6; k++) + expect_dst_buf[i][j][k] = src_buf[src_i++]; + + /* Loop over buffer sizes */ + for(src_buf_size=1; src_buf_size<=13; src_buf_size++) { + /* Reset dst_buf */ + (void)HDmemset(dst_buf, 0, sizeof(dst_buf)); + + /* Set up scatter info */ + scatter_info.src_buf = src_buf; + scatter_info.block = src_buf_size; + scatter_info.size = 12; + + /* Scatter data */ + if(H5Dscatter(scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf) < 0) + TEST_ERROR + + /* Verify data */ + TEST_SCATTER_CHECK_ARR(dst_buf, expect_dst_buf) + } /* end for */ + + + /* + * Test 3: Multiple blocks + */ + /* Select hyperslab */ + start[0] = 1; + start[1] = 1; + start[2] = 1; + stride[0] = 3; + stride[1] = 4; + stride[2] = 5; + count[0] = 3; + count[1] = 1; + count[2] = 2; + block[0] = 1; + block[1] = 3; + block[2] = 2; + if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride ,count, block) < 0) + TEST_ERROR + + /* Initialize expect_dst_buf */ + /* Iterate over block containing selection, checking if each element is in + * selection. Note that the algorithm used here (if statement) would not + * work for overlapping hyperslabs. */ + (void)HDmemset(expect_dst_buf, 0, sizeof(expect_dst_buf)); + src_i = 0; + for(i=1; i<8; i++) + for(j=1; j<4; j++) + for(k=1; k<8; k++) + if((hsize_t)i >= start[0] + && ((hsize_t)i - start[0]) % stride[0] < block[0] + && ((hsize_t)i - start[0]) / stride[0] < count[0] + && (hsize_t)j >= start[1] + && ((hsize_t)j - start[1]) % stride[1] < block[1] + && ((hsize_t)j - start[1]) / stride[1] < count[1] + && (hsize_t)k >= start[2] + && ((hsize_t)k - start[2]) % stride[2] < block[2] + && ((hsize_t)k - start[2]) / stride[2] < count[2]) + expect_dst_buf[i][j][k] = src_buf[src_i++]; + + /* Loop over buffer sizes */ + for(src_buf_size=1; src_buf_size<=37; src_buf_size++) { + /* Reset dst_buf */ + (void)HDmemset(dst_buf, 0, sizeof(dst_buf)); + + /* Set up scatter info */ + scatter_info.src_buf = src_buf; + scatter_info.block = src_buf_size; + scatter_info.size = 36; + + /* Scatter data */ + if(H5Dscatter(scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf) < 0) + TEST_ERROR + + /* Verify data */ + TEST_SCATTER_CHECK_ARR(dst_buf, expect_dst_buf) + } /* end for */ + + + /* + * Test 4: Compound selection + */ + /* Select hyperslabs */ + start[0] = 2; + start[1] = 1; + start[2] = 1; + count[0] = 2; + count[1] = 3; + count[2] = 2; + if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL ,count, NULL) < 0) + TEST_ERROR + start2[0] = 1; + start2[1] = 2; + start2[2] = 2; + count2[0] = 3; + count2[1] = 2; + count2[2] = 2; + if(H5Sselect_hyperslab(sid, H5S_SELECT_XOR, start2, NULL ,count2, NULL) < 0) + TEST_ERROR + + /* Initialize expect_dst_buf */ + /* Iterate over block containing selection, checking if each element is in + * selection. */ + (void)HDmemset(expect_dst_buf, 0, sizeof(expect_dst_buf)); + src_i = 0; + for(i=1; i<4; i++) + for(j=1; j<4; j++) + for(k=1; k<4; k++) + if(!(((hsize_t)i >= start[0] && (hsize_t)i < start[0] + count[0]) + && ((hsize_t)j >= start[1] && (hsize_t)j < start[1] + count[1]) + && ((hsize_t)k >= start[2] && (hsize_t)k < start[2] + count[2])) + != !(((hsize_t)i >= start2[0] && (hsize_t)i < start2[0] + count2[0]) + && ((hsize_t)j >= start2[1] && (hsize_t)j < start2[1] + count2[1]) + && ((hsize_t)k >= start2[2] && (hsize_t)k < start2[2] + count2[2]))) + expect_dst_buf[i][j][k] = src_buf[src_i++]; + + /* Loop over buffer sizes */ + for(src_buf_size=1; src_buf_size<=17; src_buf_size++) { + /* Reset dst_buf */ + (void)HDmemset(dst_buf, 0, sizeof(dst_buf)); + + /* Set up scatter info */ + scatter_info.src_buf = src_buf; + scatter_info.block = src_buf_size; + scatter_info.size = 16; + + /* Scatter data */ + if(H5Dscatter(scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf) < 0) + TEST_ERROR + + /* Verify data */ + TEST_SCATTER_CHECK_ARR(dst_buf, expect_dst_buf) + } /* end for */ + + + /* + * Test 5: Point selection + */ + /* Select hyperslabs */ + if(H5Sselect_elements(sid, H5S_SELECT_SET, sizeof(point) / sizeof(point[0]), (hsize_t *)point) < 0) + TEST_ERROR + + /* Initialize expect_dst_buf */ + /* Iterate over block containing selection, checking if each element is in + * selection. */ + (void)HDmemset(expect_dst_buf, 0, sizeof(expect_dst_buf)); + for(i=0; i<(int)(sizeof(point) / sizeof(point[0])); i++) + expect_dst_buf[point[i][0]][point[i][1]][point[i][2]] + = src_buf[i]; + + /* Loop over buffer sizes */ + for(src_buf_size=1; src_buf_size<=5; src_buf_size++) { + /* Reset dst_buf */ + (void)HDmemset(dst_buf, 0, sizeof(dst_buf)); + + /* Set up scatter info */ + scatter_info.src_buf = src_buf; + scatter_info.block = src_buf_size; + scatter_info.size = 4; + + /* Scatter data */ + if(H5Dscatter(scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf) < 0) + TEST_ERROR + + /* Verify data */ + TEST_SCATTER_CHECK_ARR(dst_buf, expect_dst_buf) + } /* end for */ + + + /* Close everything */ + if(H5Sclose(sid) < 0) TEST_ERROR + + PASSED(); + + return 0; + +error: + H5E_BEGIN_TRY { + H5Sclose(sid); + } H5E_END_TRY; + return -1; +} /* end test_scatter() */ + + +/*------------------------------------------------------------------------- + * Function: test_gather + * + * Purpose: Tests H5Dgather with a variety of different selections and + * destination buffer sizes. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Neil Fortner + * Wednesday, January 16, 2013 + * + *------------------------------------------------------------------------- + */ +typedef struct gather_info_t { + int *expect_dst_buf; /* Expected destination data buffer */ + size_t max_nelmts; /* Maximum number of elements passed to callback */ + hbool_t last_call; /* Whether this should be the last time the callback is called */ +} gather_info_t; + +static herr_t +gather_cb(const void *dst_buf, size_t dst_buf_bytes_used, + void *_gather_info) +{ + gather_info_t *gather_info = (gather_info_t *)_gather_info; + size_t nelmts; /* Number of elements in src_buf */ + int i; /* Local index variable */ + + HDassert(dst_buf_bytes_used > 0); + + /* Calculate number of elements */ + nelmts = dst_buf_bytes_used / sizeof(gather_info->expect_dst_buf[0]); + + /* Make sure the number of bytes is a multiple of the number of elements */ + if(nelmts * sizeof(gather_info->expect_dst_buf[0]) != dst_buf_bytes_used) + TEST_ERROR + + /* Make sure we weren't passed more data than we requested to be passed at + * once */ + if(nelmts > gather_info->max_nelmts) + TEST_ERROR + + /* If we were passed less data than requested, make sure this is the last + * time the callback was called */ + if(gather_info->last_call) + TEST_ERROR + if(nelmts < gather_info->max_nelmts) + gather_info->last_call = TRUE; + + /* Compare data and expected data */ + for(i=0; i<(int)nelmts; i++) + if(((const int *)dst_buf)[i] != *((gather_info->expect_dst_buf)++)) + TEST_ERROR + + return SUCCEED; + +error: + return FAIL; +} + +static herr_t +test_gather(void) +{ + hid_t sid = -1; /* Dataspace ID */ + hsize_t dim[3] = {8, 4, 8}; /* Dataspace dimensions */ + hsize_t start[3] = {0, 0, 0}; + hsize_t stride[3] = {0, 0, 0}; + hsize_t count[3] = {0, 0, 0}; + hsize_t block[3] = {0, 0, 0}; + hsize_t start2[3] = {0, 0, 0}; + hsize_t count2[3] = {0, 0, 0}; + hsize_t point[4][3] = {{2, 3, 2}, {3, 0, 2}, {7, 2, 0}, {0, 1, 5}}; + size_t dst_buf_size; + int src_buf[8][4][8]; /* Source data buffer */ + int dst_buf[36]; /* Destination data buffer */ + int expect_dst_buf[36]; /* Expected destination data buffer */ + gather_info_t gather_info; /* Operator data for callback */ + int i, j, k, dst_i; /* Local index variables */ + + TESTING("H5Dgather()"); + + /* Create dataspace */ + if((sid = H5Screate_simple(3, dim, NULL)) < 0) TEST_ERROR + + /* Initialize src_buf */ + for(i=0; i<(int)(sizeof(src_buf)/sizeof(src_buf[0])); i++) + for(j=0; j<(int)(sizeof(src_buf[0])/sizeof(src_buf[0][0])); j++) + for(k=0; k<(int)(sizeof(src_buf[0][0])/sizeof(src_buf[0][0][0])); k++) + src_buf[i][j][k] = 1 + k + + (int)(sizeof(src_buf[0][0]) / sizeof(src_buf[0][0][0])) * j + + (int)(sizeof(src_buf[0]) / sizeof(src_buf[0][0][0])) * i; + + + /* + * Test 1: Simple case + */ + /* Select hyperslab */ + count[0] = 1; + count[1] = 1; + count[2] = 10; + if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL ,count, NULL) < 0) + TEST_ERROR + + /* Initialize expect_dst_buf */ + (void)HDmemset(expect_dst_buf, 0, sizeof(expect_dst_buf)); + for(i=0; i<10; i++) + expect_dst_buf[i] = src_buf[0][0][i]; + + /* Loop over buffer sizes */ + for(dst_buf_size=1; dst_buf_size<=11; dst_buf_size++) { + /* Reset dst_buf */ + (void)HDmemset(dst_buf, 0, sizeof(dst_buf)); + + /* Initialize gather_info */ + gather_info.expect_dst_buf = expect_dst_buf; + gather_info.max_nelmts = dst_buf_size; + gather_info.last_call = FALSE; + + /* Gather data */ + if(H5Dgather(sid, src_buf, H5T_NATIVE_INT, dst_buf_size * sizeof(dst_buf[0]), dst_buf, gather_cb, &gather_info) < 0) + TEST_ERROR + + /* Verify that all data has been gathered (and verified) */ + if(gather_info.expect_dst_buf - expect_dst_buf != 10) TEST_ERROR + } /* end for */ + + /* Test with a dst_buf_size that is not a multiple of the datatype size */ + /* Reset dst_buf */ + dst_buf_size = 7; + (void)HDmemset(dst_buf, 0, sizeof(dst_buf)); + + /* Initialize gather_info */ + gather_info.expect_dst_buf = expect_dst_buf; + gather_info.max_nelmts = dst_buf_size - 1; + gather_info.last_call = FALSE; + + /* Gather data */ + if(H5Dgather(sid, src_buf, H5T_NATIVE_INT, dst_buf_size * sizeof(dst_buf[0]) - 1, dst_buf, gather_cb, &gather_info) < 0) + TEST_ERROR + + /* Verify that all data has been gathered (and verified) */ + if(gather_info.expect_dst_buf - expect_dst_buf != 10) TEST_ERROR + + + /* + * Test 2: Single block in dataset + */ + /* Select hyperslab */ + start[0] = 3; + start[1] = 2; + start[2] = 4; + count[0] = 2; + count[1] = 3; + count[2] = 2; + if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL ,count, NULL) < 0) + TEST_ERROR + + /* Initialize expect_dst_buf */ + (void)HDmemset(expect_dst_buf, 0, sizeof(expect_dst_buf)); + dst_i = 0; + for(i=3; i<5; i++) + for(j=2; j<5; j++) + for(k=4; k<6; k++) + expect_dst_buf[dst_i++] = src_buf[i][j][k]; + + /* Loop over buffer sizes */ + for(dst_buf_size=1; dst_buf_size<=13; dst_buf_size++) { + /* Reset dst_buf */ + (void)HDmemset(dst_buf, 0, sizeof(dst_buf)); + + /* Initialize gather_info */ + gather_info.expect_dst_buf = expect_dst_buf; + gather_info.max_nelmts = dst_buf_size; + gather_info.last_call = FALSE; + + /* Gather data */ + if(H5Dgather(sid, src_buf, H5T_NATIVE_INT, dst_buf_size * sizeof(dst_buf[0]), dst_buf, gather_cb, &gather_info) < 0) + TEST_ERROR + + /* Verify that all data has been gathered (and verified) */ + if(gather_info.expect_dst_buf - expect_dst_buf != 12) TEST_ERROR + } /* end for */ + + + /* + * Test 3: Multiple blocks + */ + /* Select hyperslab */ + start[0] = 1; + start[1] = 1; + start[2] = 1; + stride[0] = 3; + stride[1] = 4; + stride[2] = 5; + count[0] = 3; + count[1] = 1; + count[2] = 2; + block[0] = 1; + block[1] = 3; + block[2] = 2; + if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride ,count, block) < 0) + TEST_ERROR + + /* Initialize expect_dst_buf */ + /* Iterate over block containing selection, checking if each element is in + * selection. Note that the algorithm used here (if statement) would not + * work for overlapping hyperslabs. */ + (void)HDmemset(expect_dst_buf, 0, sizeof(expect_dst_buf)); + dst_i = 0; + for(i=1; i<8; i++) + for(j=1; j<4; j++) + for(k=1; k<8; k++) + if((hsize_t)i >= start[0] + && ((hsize_t)i - start[0]) % stride[0] < block[0] + && ((hsize_t)i - start[0]) / stride[0] < count[0] + && (hsize_t)j >= start[1] + && ((hsize_t)j - start[1]) % stride[1] < block[1] + && ((hsize_t)j - start[1]) / stride[1] < count[1] + && (hsize_t)k >= start[2] + && ((hsize_t)k - start[2]) % stride[2] < block[2] + && ((hsize_t)k - start[2]) / stride[2] < count[2]) + expect_dst_buf[dst_i++] = src_buf[i][j][k]; + + /* Loop over buffer sizes */ + for(dst_buf_size=1; dst_buf_size<=37; dst_buf_size++) { + /* Reset dst_buf */ + (void)HDmemset(dst_buf, 0, sizeof(dst_buf)); + + /* Initialize gather_info */ + gather_info.expect_dst_buf = expect_dst_buf; + gather_info.max_nelmts = dst_buf_size; + gather_info.last_call = FALSE; + + /* Gather data */ + if(H5Dgather(sid, src_buf, H5T_NATIVE_INT, dst_buf_size * sizeof(dst_buf[0]), dst_buf, gather_cb, &gather_info) < 0) + TEST_ERROR + + /* Verify that all data has been gathered (and verified) */ + if(gather_info.expect_dst_buf - expect_dst_buf != 36) TEST_ERROR + } /* end for */ + + + /* + * Test 4: Compound selection + */ + /* Select hyperslabs */ + start[0] = 2; + start[1] = 1; + start[2] = 1; + count[0] = 2; + count[1] = 3; + count[2] = 2; + if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL ,count, NULL) < 0) + TEST_ERROR + start2[0] = 1; + start2[1] = 2; + start2[2] = 2; + count2[0] = 3; + count2[1] = 2; + count2[2] = 2; + if(H5Sselect_hyperslab(sid, H5S_SELECT_XOR, start2, NULL ,count2, NULL) < 0) + TEST_ERROR + + /* Initialize expect_dst_buf */ + /* Iterate over block containing selection, checking if each element is in + * selection. */ + (void)HDmemset(expect_dst_buf, 0, sizeof(expect_dst_buf)); + dst_i = 0; + for(i=1; i<4; i++) + for(j=1; j<4; j++) + for(k=1; k<4; k++) + if(!(((hsize_t)i >= start[0] && (hsize_t)i < start[0] + count[0]) + && ((hsize_t)j >= start[1] && (hsize_t)j < start[1] + count[1]) + && ((hsize_t)k >= start[2] && (hsize_t)k < start[2] + count[2])) + != !(((hsize_t)i >= start2[0] && (hsize_t)i < start2[0] + count2[0]) + && ((hsize_t)j >= start2[1] && (hsize_t)j < start2[1] + count2[1]) + && ((hsize_t)k >= start2[2] && (hsize_t)k < start2[2] + count2[2]))) + expect_dst_buf[dst_i++] = src_buf[i][j][k]; + + /* Loop over buffer sizes */ + for(dst_buf_size=1; dst_buf_size<=17; dst_buf_size++) { + /* Reset dst_buf */ + (void)HDmemset(dst_buf, 0, sizeof(dst_buf)); + + /* Initialize gather_info */ + gather_info.expect_dst_buf = expect_dst_buf; + gather_info.max_nelmts = dst_buf_size; + gather_info.last_call = FALSE; + + /* Gather data */ + if(H5Dgather(sid, src_buf, H5T_NATIVE_INT, dst_buf_size * sizeof(dst_buf[0]), dst_buf, gather_cb, &gather_info) < 0) + TEST_ERROR + + /* Verify that all data has been gathered (and verified) */ + if(gather_info.expect_dst_buf - expect_dst_buf != 16) TEST_ERROR + } /* end for */ + + + /* + * Test 5: Point selection + */ + /* Select hyperslabs */ + if(H5Sselect_elements(sid, H5S_SELECT_SET, sizeof(point) / sizeof(point[0]), (hsize_t *)point) < 0) + TEST_ERROR + + /* Initialize expect_dst_buf */ + /* Iterate over block containing selection, checking if each element is in + * selection. */ + (void)HDmemset(expect_dst_buf, 0, sizeof(expect_dst_buf)); + for(i=0; i<(int)(sizeof(point) / sizeof(point[0])); i++) + expect_dst_buf[i] = src_buf[point[i][0]][point[i][1]][point[i][2]]; + + /* Loop over buffer sizes */ + for(dst_buf_size=1; dst_buf_size<=5; dst_buf_size++) { + /* Reset dst_buf */ + (void)HDmemset(dst_buf, 0, sizeof(dst_buf)); + + /* Initialize gather_info */ + gather_info.expect_dst_buf = expect_dst_buf; + gather_info.max_nelmts = dst_buf_size; + gather_info.last_call = FALSE; + + /* Gather data */ + if(H5Dgather(sid, src_buf, H5T_NATIVE_INT, dst_buf_size * sizeof(dst_buf[0]), dst_buf, gather_cb, &gather_info) < 0) + TEST_ERROR + + /* Verify that all data has been gathered (and verified) */ + if(gather_info.expect_dst_buf - expect_dst_buf != 4) TEST_ERROR + } /* end for */ + + + /* Close everything */ + if(H5Sclose(sid) < 0) TEST_ERROR + + PASSED(); + + return 0; + +error: + H5E_BEGIN_TRY { + H5Sclose(sid); + } H5E_END_TRY; + return -1; +} /* end test_gather() */ + + +/*------------------------------------------------------------------------- + * Function: test_scatter_error + * + * Purpose: Tests H5Dscatter with a variety of different conditions + * that should cause errors. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Neil Fortner + * Monday, February 4, 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +scatter_error_cb_fail(void **src_buf/*out*/, size_t *src_buf_bytes_used/*out*/, + void *_scatter_info) +{ + scatter_info_t *scatter_info = (scatter_info_t *)_scatter_info; + size_t nelmts; /* Number of elements to return in src_buf */ + + /* Calculate number of elements */ + nelmts = MIN(scatter_info->block, scatter_info->size); + HDassert(nelmts > 0); + + /* Set output variables */ + *src_buf = (void *)scatter_info->src_buf; + *src_buf_bytes_used = nelmts * sizeof(scatter_info->src_buf[0]); + + return FAIL; +} + +static herr_t +scatter_error_cb_null(void **src_buf/*out*/, size_t *src_buf_bytes_used/*out*/, + void *_scatter_info) +{ + scatter_info_t *scatter_info = (scatter_info_t *)_scatter_info; + size_t nelmts; /* Number of elements to return in src_buf */ + + /* Calculate number of elements */ + nelmts = MIN(scatter_info->block, scatter_info->size); + HDassert(nelmts > 0); + + /* Set output variables */ + *src_buf = NULL; + *src_buf_bytes_used = nelmts * sizeof(scatter_info->src_buf[0]); + + return SUCCEED; +} + +static herr_t +scatter_error_cb_unalign(void **src_buf/*out*/, size_t *src_buf_bytes_used/*out*/, + void *_src_buf_bytes_used) +{ + /* Set output variables */ + *src_buf = _src_buf_bytes_used; + *src_buf_bytes_used = *(size_t *)_src_buf_bytes_used; + + return SUCCEED; +} + +static herr_t +test_scatter_error(void) +{ + hid_t sid = -1; /* Dataspace ID */ + hsize_t dim[1] = {10}; /* Dataspace dimensions */ + hsize_t start[3] = {2}; + hsize_t count[3] = {6}; + int src_buf[7]; /* Source data buffer */ + int dst_buf[10]; /* Destination data buffer */ + scatter_info_t scatter_info; /* Operator data for callback */ + size_t cb_unalign_nbytes; /* Number of bytes to return for unaligned test */ + herr_t ret; /* Return value */ + int i; /* Local index variable */ + + TESTING("H5Dscatter() error conditions"); + + /* Create dataspace */ + if((sid = H5Screate_simple(1, dim, NULL)) < 0) TEST_ERROR + + /* Initialize src_buf */ + for(i=0; i<(int)(sizeof(src_buf)/sizeof(src_buf[0])); i++) + src_buf[i] = i + 1; + + /* Select hyperslab */ + if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL ,count, NULL) < 0) + TEST_ERROR + + /* Verify that base configuration passes */ + scatter_info.src_buf = src_buf; + scatter_info.block = sizeof(src_buf)/sizeof(src_buf[0]); + scatter_info.size = 6; + if(H5Dscatter(scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf) < 0) + TEST_ERROR + + + /* + * Test invalid parameters + */ + scatter_info.src_buf = src_buf; + scatter_info.size = 6; + H5E_BEGIN_TRY { + ret = H5Dscatter(NULL, NULL, H5T_NATIVE_INT, sid, dst_buf); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + + scatter_info.src_buf = src_buf; + scatter_info.size = 6; + H5E_BEGIN_TRY { + ret = H5Dscatter(scatter_cb, &scatter_info, sid, sid, dst_buf); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + + scatter_info.src_buf = src_buf; + scatter_info.size = 6; + H5E_BEGIN_TRY { + ret = H5Dscatter(scatter_cb, &scatter_info, H5T_NATIVE_INT, H5T_NATIVE_INT, dst_buf); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + + scatter_info.src_buf = src_buf; + scatter_info.size = 6; + H5E_BEGIN_TRY { + ret = H5Dscatter(scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, NULL); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + + + /* + * Test returning too many elements in callback + */ + scatter_info.src_buf = src_buf; + scatter_info.size = 7; + H5E_BEGIN_TRY { + ret = H5Dscatter(scatter_cb, &scatter_info, H5T_NATIVE_INT, sid, dst_buf); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + + + /* + * Test callback returns failure + */ + scatter_info.src_buf = src_buf; + scatter_info.size = 6; + H5E_BEGIN_TRY { + ret = H5Dscatter(scatter_error_cb_fail, &scatter_info, H5T_NATIVE_INT, sid, dst_buf); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + + + /* + * Test callback returns NULL buffer + */ + scatter_info.src_buf = src_buf; + scatter_info.size = 6; + H5E_BEGIN_TRY { + ret = H5Dscatter(scatter_error_cb_null, &scatter_info, H5T_NATIVE_INT, sid, dst_buf); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + + + /* + * Test callback returns 0 for src_buf_bytes_used + */ + cb_unalign_nbytes = 0; + H5E_BEGIN_TRY { + ret = H5Dscatter(scatter_error_cb_unalign, &cb_unalign_nbytes, H5T_NATIVE_INT, sid, dst_buf); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + + + /* + * Test callback returns src_buf_bytes_used that is not a multiple of + * datatype size + */ + cb_unalign_nbytes = sizeof(src_buf[0]) - 1; + H5E_BEGIN_TRY { + ret = H5Dscatter(scatter_error_cb_unalign, &cb_unalign_nbytes, H5T_NATIVE_INT, sid, dst_buf); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + + cb_unalign_nbytes = sizeof(src_buf[0]) + 1; + H5E_BEGIN_TRY { + ret = H5Dscatter(scatter_error_cb_unalign, &cb_unalign_nbytes, H5T_NATIVE_INT, sid, dst_buf); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + + + /* Close everything */ + if(H5Sclose(sid) < 0) TEST_ERROR + + PASSED(); + + return 0; + +error: + H5E_BEGIN_TRY { + H5Sclose(sid); + } H5E_END_TRY; + return -1; +} /* end test_scatter_error() */ + + +/*------------------------------------------------------------------------- + * Function: test_gather_error + * + * Purpose: Tests H5Dgather with a variety of different conditions + * that should cause errors. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Neil Fortner + * Monday, February 4, 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +gather_error_cb_fail(const void UNUSED *dst_buf, + size_t UNUSED dst_buf_bytes_used, void UNUSED *op_data) +{ + return FAIL; +} + +static herr_t +test_gather_error(void) +{ + hid_t sid = -1; /* Dataspace ID */ + hsize_t dim[1] = {10}; /* Dataspace dimensions */ + hsize_t start[1] = {2}; + hsize_t count[1] = {6}; + int src_buf[10]; /* Source data buffer */ + int dst_buf[6]; /* Destination data buffer */ + int expect_dst_buf[6]; /* Expected destination data buffer */ + gather_info_t gather_info; /* Operator data for callback */ + herr_t ret; /* Return value */ + int i; /* Local index variable */ + + TESTING("H5Dgather() error conditions"); + + /* Create dataspace */ + if((sid = H5Screate_simple(1, dim, NULL)) < 0) TEST_ERROR + + /* Initialize src_buf */ + for(i=0; i<(int)(sizeof(src_buf)/sizeof(src_buf[0])); i++) + src_buf[i] = 1 + i; + + /* Select hyperslab */ + if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL ,count, NULL) < 0) + TEST_ERROR + + /* Initialize expect_dst_buf */ + (void)HDmemset(expect_dst_buf, 0, sizeof(expect_dst_buf)); + for(i=0; i<6; i++) + expect_dst_buf[i] = src_buf[i + 2]; + + /* Verify that base configuration passes */ + gather_info.expect_dst_buf = expect_dst_buf; + gather_info.max_nelmts = 6; + gather_info.last_call = FALSE; + if(H5Dgather(sid, src_buf, H5T_NATIVE_INT, 6 * sizeof(dst_buf[0]), dst_buf, gather_cb, &gather_info) < 0) + TEST_ERROR + + /* + * Test invalid parameters + */ + gather_info.expect_dst_buf = expect_dst_buf; + gather_info.last_call = FALSE; + H5E_BEGIN_TRY { + ret = H5Dgather(H5T_NATIVE_INT, src_buf, H5T_NATIVE_INT, 6 * sizeof(dst_buf[0]), dst_buf, gather_cb, &gather_info); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + + gather_info.expect_dst_buf = expect_dst_buf; + gather_info.last_call = FALSE; + H5E_BEGIN_TRY { + ret = H5Dgather(sid, NULL, H5T_NATIVE_INT, 6 * sizeof(dst_buf[0]), dst_buf, gather_cb, &gather_info); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + + gather_info.expect_dst_buf = expect_dst_buf; + gather_info.last_call = FALSE; + H5E_BEGIN_TRY { + ret = H5Dgather(sid, src_buf, sid, 6 * sizeof(dst_buf[0]), dst_buf, gather_cb, &gather_info); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + + gather_info.expect_dst_buf = expect_dst_buf; + gather_info.last_call = FALSE; + H5E_BEGIN_TRY { + ret = H5Dgather(sid, src_buf, H5T_NATIVE_INT, 0, dst_buf, gather_cb, &gather_info); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + + gather_info.expect_dst_buf = expect_dst_buf; + gather_info.last_call = FALSE; + H5E_BEGIN_TRY { + ret = H5Dgather(sid, src_buf, H5T_NATIVE_INT, 1, dst_buf, gather_cb, &gather_info); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + + gather_info.expect_dst_buf = expect_dst_buf; + gather_info.last_call = FALSE; + H5E_BEGIN_TRY { + ret = H5Dgather(sid, src_buf, H5T_NATIVE_INT, 6 * sizeof(dst_buf[0]), NULL, gather_cb, &gather_info); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + + gather_info.expect_dst_buf = expect_dst_buf; + gather_info.last_call = FALSE; + H5E_BEGIN_TRY { + ret = H5Dgather(sid, src_buf, H5T_NATIVE_INT, 6 * sizeof(dst_buf[0]), dst_buf, NULL, &gather_info); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + + + /* + * Test callback returns failure + */ + gather_info.expect_dst_buf = expect_dst_buf; + gather_info.last_call = FALSE; + H5E_BEGIN_TRY { + ret = H5Dgather(sid, src_buf, H5T_NATIVE_INT, 6 * sizeof(dst_buf[0]), dst_buf, gather_error_cb_fail, NULL); + } H5E_END_TRY + if(ret >= 0) TEST_ERROR + + + /* Close everything */ + if(H5Sclose(sid) < 0) TEST_ERROR + + PASSED(); + + return 0; + +error: + H5E_BEGIN_TRY { + H5Sclose(sid); + } H5E_END_TRY; + return -1; +} /* end test_gather_error() */ + + +/*------------------------------------------------------------------------- * Function: main * * Purpose: Tests the dataset interface (H5D) @@ -8315,6 +9321,12 @@ main(void) /* Close 2nd FAPL */ if(H5Pclose(fapl2) < 0) TEST_ERROR + /* Tests that do not use files */ + nerrors += (test_scatter() < 0 ? 1 : 0); + nerrors += (test_gather() < 0 ? 1 : 0); + nerrors += (test_scatter_error() < 0 ? 1 : 0); + nerrors += (test_gather_error() < 0 ? 1 : 0); + /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); -- cgit v0.12 From 400bf73d17c5a7c9a4917b97669cbdea916dce76 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Thu, 7 Feb 2013 16:57:57 -0500 Subject: [svn-r23234] Fix out-of-bounds errors on pgcc for H5Dscatter and H5Dgather tests. Tested: jam (pgcc), ummon (gcc) --- test/dsets.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/dsets.c b/test/dsets.c index 96611d9..7689a81 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -8236,7 +8236,7 @@ static herr_t test_scatter(void) { hid_t sid = -1; /* Dataspace ID */ - hsize_t dim[3] = {8, 4, 8}; /* Dataspace dimensions */ + hsize_t dim[3] = {8, 5, 8}; /* Dataspace dimensions */ hsize_t start[3] = {0, 0, 0}; hsize_t stride[3] = {0, 0, 0}; hsize_t count[3] = {0, 0, 0}; @@ -8246,8 +8246,8 @@ test_scatter(void) hsize_t point[4][3] = {{2, 3, 2}, {3, 0, 2}, {7, 2, 0}, {0, 1, 5}}; size_t src_buf_size; int src_buf[36]; /* Source data buffer */ - int dst_buf[8][4][8]; /* Destination data buffer */ - int expect_dst_buf[8][4][8]; /* Expected destination data buffer */ + int dst_buf[8][5][8]; /* Destination data buffer */ + int expect_dst_buf[8][5][8]; /* Expected destination data buffer */ scatter_info_t scatter_info; /* Operator data for callback */ int i, j, k, src_i; /* Local index variables */ @@ -8562,7 +8562,7 @@ static herr_t test_gather(void) { hid_t sid = -1; /* Dataspace ID */ - hsize_t dim[3] = {8, 4, 8}; /* Dataspace dimensions */ + hsize_t dim[3] = {8, 5, 8}; /* Dataspace dimensions */ hsize_t start[3] = {0, 0, 0}; hsize_t stride[3] = {0, 0, 0}; hsize_t count[3] = {0, 0, 0}; @@ -8571,7 +8571,7 @@ test_gather(void) hsize_t count2[3] = {0, 0, 0}; hsize_t point[4][3] = {{2, 3, 2}, {3, 0, 2}, {7, 2, 0}, {0, 1, 5}}; size_t dst_buf_size; - int src_buf[8][4][8]; /* Source data buffer */ + int src_buf[8][5][8]; /* Source data buffer */ int dst_buf[36]; /* Destination data buffer */ int expect_dst_buf[36]; /* Expected destination data buffer */ gather_info_t gather_info; /* Operator data for callback */ @@ -8597,17 +8597,17 @@ test_gather(void) /* Select hyperslab */ count[0] = 1; count[1] = 1; - count[2] = 10; + count[2] = 8; if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL ,count, NULL) < 0) TEST_ERROR /* Initialize expect_dst_buf */ (void)HDmemset(expect_dst_buf, 0, sizeof(expect_dst_buf)); - for(i=0; i<10; i++) + for(i=0; i<8; i++) expect_dst_buf[i] = src_buf[0][0][i]; /* Loop over buffer sizes */ - for(dst_buf_size=1; dst_buf_size<=11; dst_buf_size++) { + for(dst_buf_size=1; dst_buf_size<=9; dst_buf_size++) { /* Reset dst_buf */ (void)HDmemset(dst_buf, 0, sizeof(dst_buf)); @@ -8621,7 +8621,7 @@ test_gather(void) TEST_ERROR /* Verify that all data has been gathered (and verified) */ - if(gather_info.expect_dst_buf - expect_dst_buf != 10) TEST_ERROR + if(gather_info.expect_dst_buf - expect_dst_buf != 8) TEST_ERROR } /* end for */ /* Test with a dst_buf_size that is not a multiple of the datatype size */ @@ -8639,7 +8639,7 @@ test_gather(void) TEST_ERROR /* Verify that all data has been gathered (and verified) */ - if(gather_info.expect_dst_buf - expect_dst_buf != 10) TEST_ERROR + if(gather_info.expect_dst_buf - expect_dst_buf != 8) TEST_ERROR /* -- cgit v0.12 From 69a777556e61928537648bcd46ae16069c042547 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Thu, 7 Feb 2013 19:09:24 -0500 Subject: [svn-r23235] Fix for: HDFFV-7909 When building with g95 on Mac OS X 64-bit, the wrong options (gfortran) are used Tested: duck (gfortran, g95 (which is not supported)) --- config/apple | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/config/apple b/config/apple index 34085e0..c5c0a19 100644 --- a/config/apple +++ b/config/apple @@ -58,10 +58,6 @@ if test "X-" = "X-$FC"; then ;; esac fi -# Figure out compiler flags -. $srcdir/config/gnu-fflags - -. $srcdir/config/intel-fflags # compiler version strings case $CC in @@ -79,20 +75,22 @@ case $CC in echo "No match to get cc_version_info for $CC" ;; esac - +# Figure out Fortran compiler flags and version strings case $FC in *gfortran*) + . $srcdir/config/gnu-fflags fc_version_info=`$FC $FCFLAGS $H5_FCFLAGS --version 2>&1 |\ grep 'GCC' | sed 's/\(.*(GCC) [-a-z0-9\. ]*\).*/\1/'` ;; *ifc*|*ifort*) + . $srcdir/config/intel-fflags fc_version_info=`$FC $FCFLAGS $H5_FCFLAGS -V 2>&1 | grep 'Version' |\ sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'` ;; *) - echo "No match to get fc_version_info for $FC" + echo "No match to get fc_version_info and flags for $FC" ;; esac -- cgit v0.12 From 386f73823af1fbe6bd39e9bce3c247c183ae56c1 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Thu, 7 Feb 2013 19:28:55 -0500 Subject: [svn-r23236] Fix for: HDFFV-8223 Write a Fortran test for conversion fron enum to numeric type Tested (jam, gnu, intel) --- fortran/test/fortranlib_test_F03.f90 | 4 + fortran/test/tH5T_F03.f90 | 351 ++++++++++++++++++++++++++++++++++- 2 files changed, 353 insertions(+), 2 deletions(-) diff --git a/fortran/test/fortranlib_test_F03.f90 b/fortran/test/fortranlib_test_F03.f90 index a03241c..606b050 100644 --- a/fortran/test/fortranlib_test_F03.f90 +++ b/fortran/test/fortranlib_test_F03.f90 @@ -82,6 +82,10 @@ PROGRAM fortranlibtest_F03 CALL write_test_status(ret_total_error, ' Testing writing/reading enum dataset, using C_LOC', total_error) ret_total_error = 0 + CALL t_enum_conv(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing enumeration conversions', total_error) + + ret_total_error = 0 CALL t_bit(ret_total_error) CALL write_test_status(ret_total_error, ' Testing writing/reading bitfield dataset, using C_LOC', total_error) diff --git a/fortran/test/tH5T_F03.f90 b/fortran/test/tH5T_F03.f90 index 1c4da8b..7336cf7 100644 --- a/fortran/test/tH5T_F03.f90 +++ b/fortran/test/tH5T_F03.f90 @@ -1028,8 +1028,8 @@ END SUBROUTINE test_array_compound_atomic INTEGER, PARAMETER :: int_kind_8 = SELECTED_INT_KIND(Fortran_INTEGER_4) !should map to INTEGER*4 on most modern processors INTEGER, PARAMETER :: int_kind_16 = SELECTED_INT_KIND(Fortran_INTEGER_8) !should map to INTEGER*8 on most modern processors - INTEGER, PARAMETER :: real_kind_7 = SELECTED_REAL_KIND(Fortran_REAL_4) !should map to REAL*4 on most modern processors - INTEGER, PARAMETER :: real_kind_15 = SELECTED_REAL_KIND(Fortran_REAL_8) !should map to REAL*8 on most modern processors + INTEGER, PARAMETER :: real_kind_7 = SELECTED_REAL_KIND(Fortran_REAL_4) !should map to REAL*4 on most modern processors + INTEGER, PARAMETER :: real_kind_15 = SELECTED_REAL_KIND(Fortran_REAL_8) !should map to REAL*8 on most modern processors CHARACTER(LEN=12), PARAMETER :: filename = "dsetf_F03.h5" ! File name CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name @@ -3092,3 +3092,350 @@ SUBROUTINE test_nbit(cleanup, total_error ) END SUBROUTINE test_nbit +SUBROUTINE t_enum_conv(total_error) + +!------------------------------------------------------------------------- +! Subroutine: t_enum_conv +! +! Purpose: Tests converting data from enumeration datatype +! to numeric (integer or floating-point number) +! datatype. Tests various KINDs of INTEGERs +! and REALs. Checks reading enum data into +! INTEGER and REAL KINDs. +! +! Return: Success: 0 +! Failure: number of errors +! +! Programmer: M. Scot Breitenfeld +! October 27, 2012 +! +! Note: Adapted from C test (enum.c -- test_conv) +! No reliance on C tests. +!------------------------------------------------------------------------- +! + USE HDF5 + USE ISO_C_BINDING + + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + + INTEGER, PARAMETER :: int_kind_8 = SELECTED_INT_KIND(Fortran_INTEGER_4) !should map to INTEGER*4 on most modern processors + INTEGER, PARAMETER :: int_kind_16 = SELECTED_INT_KIND(Fortran_INTEGER_8)!should map to INTEGER*8 on most modern processors + + INTEGER, PARAMETER :: real_kind_7 = SELECTED_REAL_KIND(Fortran_REAL_4) !should map to REAL*4 on most modern processors + + INTEGER(hid_t) :: cwg=-1, dtype=-1, space=-1, dset=-1, memtype ! Handles + INTEGER(hid_t) :: file ! Handles + + ! Enumerated type + ENUM, BIND(C) + ENUMERATOR :: E1_RED, E1_GREEN, E1_BLUE, E1_WHITE, E1_BLACK + END ENUM + + INTEGER :: val + + ! Enumerated data array + ! Some values are out of range for testing. The library should accept them + INTEGER(KIND(E1_RED)), DIMENSION(1:20), TARGET :: data1 = (/E1_RED, E1_GREEN, E1_BLUE, E1_GREEN, E1_WHITE,& + E1_WHITE, E1_BLACK, E1_GREEN, E1_BLUE, E1_RED,& + E1_RED, E1_BLUE, E1_GREEN, E1_BLACK, E1_WHITE,& + E1_RED, E1_WHITE, INT(0,KIND(E1_RED)), INT(-1,KIND(E1_RED)), INT(-2,KIND(E1_RED))/) + + ! Reading array for enum data + INTEGER(KIND(E1_RED)), DIMENSION(1:20), TARGET :: data2 + + ! Reading array's for converted enum data + INTEGER(C_SHORT), DIMENSION(1:20), TARGET :: data_short + INTEGER(C_INT), DIMENSION(1:20), TARGET :: data_int + REAL(C_DOUBLE), DIMENSION(1:20), TARGET :: data_double + + INTEGER(int_kind_8), DIMENSION(1:20), TARGET :: data_i8 + INTEGER(int_kind_16), DIMENSION(1:20), TARGET :: data_i16 + REAL(real_kind_7), DIMENSION(1:20), TARGET :: data_r7 + + INTEGER(hsize_t), DIMENSION(1:1) :: ds_size = (/20/) + INTEGER(size_t) :: i + INTEGER :: error + TYPE(C_PTR) :: f_ptr + INTEGER(HID_T) :: m_baset ! Memory base type + ! + ! Create a new file using the default properties. + ! + CALL h5fcreate_f("enum1.h5", H5F_ACC_TRUNC_F, file, error) + CALL check("h5fcreate_f", error, total_error) + ! + ! Create a new group using the default properties. + ! + CALL h5gcreate_f(file, "test_conv", cwg, error) + CALL check("h5gcreate_f",error, total_error) + ! + ! Create a enum type + ! + CALL H5Tcreate_f(H5T_ENUM_F, H5OFFSETOF(C_LOC(data1(1)), C_LOC(data1(2))), dtype, error) + CALL check("h5tcreate_f",error, total_error) + ! + ! Initialize enum data. + ! + val = E1_RED + CALL H5Tenum_insert_f(dtype, "RED", val, error) + CALL check("h5tenum_insert_f",error, total_error) + val = E1_GREEN + CALL H5Tenum_insert_f(dtype, "GREEN", val, error) + CALL check("h5tenum_insert_f",error, total_error) + val = E1_BLUE + CALL H5Tenum_insert_f(dtype, "BLUE", val, error) + CALL check("h5tenum_insert_f",error, total_error) + val = E1_WHITE + CALL H5Tenum_insert_f(dtype, "WHITE", val, error) + CALL check("h5tenum_insert_f",error, total_error) + val = E1_BLACK + CALL H5Tenum_insert_f(dtype, "BLACK", val, error) + CALL check("h5tenum_insert_f",error, total_error) + ! + ! Create dataspace. Setting maximum size to be the current size. + ! + CALL h5screate_simple_f(1, ds_size, space, error) + CALL check("h5screate_simple_f", error, total_error) + + ! *************************************** + ! * Dataset of enumeration type + ! *************************************** + ! + ! Create a dataset of enum type and write enum data to it + + CALL h5dcreate_f(cwg, "color_table1", dtype, space, dset, error) + CALL check("h5dcreate_f", error, total_error) + + f_ptr = C_LOC(data1(1)) + CALL h5dwrite_f(dset, dtype, f_ptr, error, space, space) + CALL check(" h5dwrite_f", error, total_error) + + ! Test reading back the data with no conversion + + f_ptr = C_LOC(data2(1)) + CALL h5dread_f(dset, dtype, f_ptr, error, space, space) + CALL check(" h5dread_f", error, total_error) + + ! Check values + DO i = 1, ds_size(1) + IF(data1(i) .NE. data2(i))THEN + total_error = total_error + 1 + WRITE(*,'(" 1. data1(",I0,")=",I0," .NE. data2(",I0,")=",I0)') i, data1(i),i,data2(i) + EXIT + ENDIF + ENDDO + + ! Test converting the data to integer (KIND=C_SHORT). Read enum data back as integer + m_baset = h5kind_to_type(KIND(data_short(1)), H5_INTEGER_KIND) ! Memory base type + f_ptr = C_LOC(data_short(1)) + CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) + CALL check("h5dread_f", error, total_error) + ! Check values + DO i = 1, ds_size(1) + IF(data1(i) .NE. data_short(i))THEN + total_error = total_error + 1 + WRITE(*,'(" 2. data1(",I0,")=",I0," .NE. data_short(",I0,")=",I0)') i, data1(i),i,data_short(i) + EXIT + ENDIF + ENDDO + + ! Test converting the data to (KIND=C_double) number. + ! Read enum data back as (KIND=C_double) number + + m_baset = h5kind_to_type(KIND(data_double(1)), H5_REAL_KIND) ! Memory base type + f_ptr = C_LOC(data_double(1)) + CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) + CALL check("h5dread_f", error, total_error) + ! Check values + DO i = 1, ds_size(1) + IF(data1(i) .NE. INT(data_double(i)))THEN + total_error = total_error + 1 + WRITE(*,'(" 3. data_double(",I0,")=",I0," .NE. data_double(",I0,")=",I0)') & + i, INT(data1(i)), i, INT(data_double(i)) + EXIT + ENDIF + ENDDO + + ! Test converting the data to (SELECTED_INT_KIND(Fortran_INTEGER_4)) number. + ! Read enum data back as (SELECTED_INT_KIND(Fortran_INTEGER_4)) number + + m_baset = h5kind_to_type(int_kind_8, H5_INTEGER_KIND) ! Memory base type + f_ptr = C_LOC(data_i8(1)) + CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) + CALL check("h5dread_f", error, total_error) + ! Check values + DO i = 1, ds_size(1) + IF(data1(i) .NE. INT(data_i8(i)))THEN + total_error = total_error + 1 + WRITE(*,'(" 4. data_i8(",I0,")=",I0," .NE. data_i8(",I0,")=",I0)') & + i, INT(data1(i)), i, INT(data_i8(i)) + EXIT + ENDIF + ENDDO + + ! Test converting the data to (SELECTED_INT_KIND(Fortran_INTEGER_8)) number. + ! Read enum data back as (SELECTED_INT_KIND(Fortran_INTEGER_8)) number + + m_baset = h5kind_to_type(int_kind_16, H5_INTEGER_KIND) ! Memory base type + f_ptr = C_LOC(data_i16(1)) + CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) + CALL check("h5dread_f", error, total_error) + ! Check values + DO i = 1, ds_size(1) + IF(data1(i) .NE. INT(data_i16(i)))THEN + total_error = total_error + 1 + WRITE(*,'(" 5. data_i16(",I0,")=",I0," .NE. data_i16(",I0,")=",I0)') & + i, INT(data1(i)), i, INT(data_i16(i)) + EXIT + ENDIF + ENDDO + + ! Test converting the data to SELECTED_REAL_KIND(Fortran_REAL_4) number. + ! Read enum data back as SELECTED_REAL_KIND(Fortran_REAL_4) number + + m_baset = h5kind_to_type(KIND(data_r7(1)), H5_REAL_KIND) ! Memory base type + f_ptr = C_LOC(data_r7(1)) + CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) + CALL check("h5dread_f", error, total_error) + ! Check values + DO i = 1, ds_size(1) + IF(data1(i) .NE. INT(data_r7(i)))THEN + total_error = total_error + 1 + WRITE(*,'(" 6. data_r7(",I0,")=",I0," .NE. data_r7(",I0,")=",I0)') & + i, INT(data1(i)), i, INT(data_r7(i)) + EXIT + ENDIF + ENDDO + + CALL h5dclose_f(dset, error) + CALL check("h5dclose_f", error, total_error) + + ! *************************************** + ! * Dataset of C_int type + ! *************************************** + + ! Create a integer dataset of KIND=C_INT and write enum data to it + m_baset = h5kind_to_type(KIND(data_int(1)), H5_INTEGER_KIND) ! Memory base type + CALL h5dcreate_f(cwg, "color_table2", m_baset, space, dset, error) + CALL check("h5dcreate_f", error, total_error) + + ! Write the enum data + f_ptr = C_LOC(data1(1)) + CALL h5dwrite_f(dset, dtype, f_ptr, error, space, space) + CALL check("h5dwrite_f", error, total_error) + + ! Test reading back the data with no conversion + f_ptr = C_LOC(data_int(1)) + CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) + CALL check("h5dread_f", error, total_error) + + DO i = 1, ds_size(1) + IF(data1(i) .NE. data_int(i))THEN + total_error = total_error + 1 + WRITE(*,'(" 7. data1(",I0,")=",I0," .NE. data_int(",I0,")=",I0)') i, data1(i),i,data_int(i) + EXIT + ENDIF + ENDDO + CALL h5dclose_f(dset, error) + CALL check("h5dclose_f", error, total_error) + + !************************************** + !* Dataset of C_double type + !************************************** + + ! Create a dataset of KIND=C_DOUBLE and write enum data to it + m_baset = h5kind_to_type(KIND(data_double(1)), H5_REAL_KIND) ! Memory base type + CALL h5dcreate_f(cwg, "color_table3", m_baset, space, dset, error) + CALL check("h5dcreate_f", error, total_error) + + f_ptr = C_LOC(data1(1)) + CALL h5dwrite_f(dset, dtype, f_ptr, error, space, space) + CALL check("h5dwrite_f", error, total_error) + + ! Test reading back the data with no conversion + f_ptr = C_LOC(data_double(1)) + CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) + CALL check("h5dread_f", error, total_error) + + DO i = 1, ds_size(1) + IF(data1(i) .NE. INT(data_double(i)))THEN + total_error = total_error + 1 + WRITE(*,'(" 8. data1(",I0,")=",I0," .NE. data_double(",I0,")=",I0)') i, data1(i),i,INT(data_double(i)) + EXIT + ENDIF + ENDDO + CALL h5dclose_f(dset, error) + CALL check("h5dclose_f", error, total_error) + + !********************************************************* + !* Dataset of real SELECTED_REAL_KIND(Fortran_REAL_4) type + !********************************************************* + + ! Create a dataset of SELECTED_REAL_KIND(Fortran_REAL_4) and write enum data to it + m_baset = h5kind_to_type(KIND(data_r7(1)), H5_REAL_KIND) ! Memory base type + CALL h5dcreate_f(cwg, "color_table4", m_baset, space, dset, error) + CALL check("h5dcreate_f", error, total_error) + + f_ptr = C_LOC(data1(1)) + CALL h5dwrite_f(dset, dtype, f_ptr, error, space, space) + CALL check("h5dwrite_f", error, total_error) + + ! Test reading back the data with no conversion + f_ptr = C_LOC(data_r7(1)) + CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) + CALL check("h5dread_f", error, total_error) + + DO i = 1, ds_size(1) + IF(data1(i) .NE. INT(data_r7(i)))THEN + total_error = total_error + 1 + WRITE(*,'(" 9. data1(",I0,")=",I0," .NE. data_r7(",I0,")=",I0)') i, data1(i),i,INT(data_r7(i)) + EXIT + ENDIF + ENDDO + CALL h5dclose_f(dset, error) + CALL check("h5dclose_f", error, total_error) + + ! ***************************************************************** + ! * Dataset of integer SELECTED_INT_KIND(Fortran_INTEGER_8) type + ! ***************************************************************** + + ! Create a integer dataset of (SELECTED_INT_KIND(Fortran_INTEGER_8)) and write enum data to it + m_baset = h5kind_to_type(KIND(data_i16(1)), H5_INTEGER_KIND) ! Memory base type + CALL h5dcreate_f(cwg, "color_table5", m_baset, space, dset, error) + CALL check("h5dcreate_f", error, total_error) + + ! Write the enum data + f_ptr = C_LOC(data1(1)) + CALL h5dwrite_f(dset, dtype, f_ptr, error, space, space) + CALL check("h5dwrite_f", error, total_error) + + ! Test reading back the data with no conversion + f_ptr = C_LOC(data_i16(1)) + CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) + CALL check("h5dread_f", error, total_error) + + DO i = 1, ds_size(1) + IF(data1(i) .NE. data_i16(i))THEN + total_error = total_error + 1 + WRITE(*,'(" 10. data1(",I0,")=",I0," .NE. data_i16(",I0,")=",I0)') i, data1(i),i,data_i16(i) + EXIT + ENDIF + ENDDO + CALL h5dclose_f(dset, error) + CALL check("h5dclose_f", error, total_error) + + ! + ! Close and release resources. + ! + CALL h5sclose_f(space, error) + CALL check("H5Sclose_f", error, total_error) + CALL h5tclose_f(dtype, error) + CALL check("H5Tclose_f", error, total_error) + CALL h5gclose_f(cwg, error) + CALL check("h5gclose_f",error, total_error) + CALL h5fclose_f(file, error) + CALL check("H5Fclose_f", error, total_error) + +END SUBROUTINE t_enum_conv + -- cgit v0.12 From 692fa69934553e34a7166fd919b90309bc4ecb23 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Fri, 8 Feb 2013 11:49:21 -0500 Subject: [svn-r23237] Purpose: Implement H5Dscatter and H5Dgather Description: Adds 2 new API functions, H5Dscatter and H5Dgather. H5Dscatter retrieves data from a specified callback function and scatters it into a selection, defined by a supplied dataspace, within a supplied memory buffer. H5Dgather gathers data from a selection within a supplied memory buffer and passes it in a contiguous form to a supplied callback function. Added tests for these functions Tested: jam, ostrich, koala (h5committest); ummon --- src/H5Dscatgath.c | 10 +++++++--- test/dsets.c | 18 +++++++++++++++++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index 74d6749..60a8800 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -1048,8 +1048,6 @@ H5Dgather(hid_t src_space_id, void *src_buf, hid_t type_id, size_t dst_buf_size, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination buffer size is 0") if(dst_buf == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination buffer provided") - if(op == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid callback function pointer") /* Fill the DXPL cache values for later use */ if(H5D__get_dxpl_cache(H5P_DATASET_XFER_DEFAULT, &dxpl_cache) < 0) @@ -1068,6 +1066,11 @@ H5Dgather(hid_t src_space_id, void *src_buf, hid_t type_id, size_t dst_buf_size, if((nelmts = (hssize_t)H5S_GET_SELECT_NPOINTS(src_space)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "unable to get number of elements in selection") + /* If dst_buf is not large enough to hold all the elements, make sure there + * is a callback */ + if(((size_t)nelmts > dst_buf_nelmts) && (op == NULL)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback supplied and destination buffer too small") + /* Initialize selection iterator */ if(H5S_select_iter_init(&iter, src_space, type_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize selection iterator information") @@ -1081,10 +1084,11 @@ H5Dgather(hid_t src_space_id, void *src_buf, hid_t type_id, size_t dst_buf_size, HDassert(nelmts_gathered == MIN(dst_buf_nelmts, (size_t)nelmts)); /* Make callback to process dst_buf */ - if(op(dst_buf, nelmts_gathered * type_size, op_data) < 0) + if(op && op(dst_buf, nelmts_gathered * type_size, op_data) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CALLBACK, FAIL, "callback operator returned failure") nelmts -= (hssize_t)nelmts_gathered; + HDassert(op || (nelmts == 0)); } /* end while */ done: diff --git a/test/dsets.c b/test/dsets.c index 7689a81..7abe818 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -8624,6 +8624,22 @@ test_gather(void) if(gather_info.expect_dst_buf - expect_dst_buf != 8) TEST_ERROR } /* end for */ + /* Test without a callback */ + /* Loop over buffer sizes */ + for(dst_buf_size=8; dst_buf_size<=9; dst_buf_size++) { + /* Reset dst_buf */ + (void)HDmemset(dst_buf, 0, sizeof(dst_buf)); + + /* Gather data */ + if(H5Dgather(sid, src_buf, H5T_NATIVE_INT, dst_buf_size * sizeof(dst_buf[0]), dst_buf, NULL, NULL) < 0) + TEST_ERROR + + /* Verify data */ + for(i=0; i<(int)(sizeof(dst_buf)/sizeof(dst_buf[0])); i++) + if(dst_buf[i] != expect_dst_buf[i]) + TEST_ERROR + } /* end for */ + /* Test with a dst_buf_size that is not a multiple of the datatype size */ /* Reset dst_buf */ dst_buf_size = 7; @@ -9155,7 +9171,7 @@ test_gather_error(void) gather_info.expect_dst_buf = expect_dst_buf; gather_info.last_call = FALSE; H5E_BEGIN_TRY { - ret = H5Dgather(sid, src_buf, H5T_NATIVE_INT, 6 * sizeof(dst_buf[0]), dst_buf, NULL, &gather_info); + ret = H5Dgather(sid, src_buf, H5T_NATIVE_INT, 5 * sizeof(dst_buf[0]), dst_buf, NULL, &gather_info); } H5E_END_TRY if(ret >= 0) TEST_ERROR -- cgit v0.12 From d91625d1392bfccdc500b151444030a05a639675 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 8 Feb 2013 15:36:31 -0500 Subject: [svn-r23238] Description: Bring changes from Coverity branch to trunk: r20528: Purpose: Fix coverity issue 1372 Description: Rewrite file open secition of H5FD_stdio_open to avoid TOCTUO condition. No longer calls access, and uses a tentative open in "rb" or "rb+" mode to check for existence of the file. r20609: Use HDstrncpy and HDstrncat. --gh r20611: Use HDstrncpy. --gh Tested on: Mac OSX/64 10.8.2 (amazon) w/debug, C++ & FORTRAN (h5committest not required, already tested on branch) --- src/H5FDstdio.c | 35 ++++++++++++++++++++++------------- src/H5Gname.c | 2 +- src/H5Gtest.c | 2 +- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 43bf6b9..4e484c2 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -365,26 +365,35 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, if (ADDR_OVERFLOW(maxaddr)) H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_OVERFLOW, "maxaddr too large", NULL) - /* Attempt to open/create the file */ - if (access(name, F_OK) < 0) { - if ((flags & H5F_ACC_CREAT) && (flags & H5F_ACC_RDWR)) { + /* Tentatively open file in read-only mode, to check for existence */ + if(flags & H5F_ACC_RDWR) + f = fopen(name, "rb+"); + else + f = fopen(name, "rb"); + + if(!f) { + /* File doesn't exist */ + if(flags & H5F_ACC_CREAT) { + assert(flags & H5F_ACC_RDWR); f = fopen(name, "wb+"); write_access = 1; /* Note the write access */ } else H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_CANTOPENFILE, "file doesn't exist and CREAT wasn't specified", NULL) - } else if ((flags & H5F_ACC_CREAT) && (flags & H5F_ACC_EXCL)) { + } else if(flags & H5F_ACC_EXCL) { + /* File exists, but EXCL is passed. Fail. */ + assert(flags & H5F_ACC_CREAT); + fclose(f); H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_FILEEXISTS, "file exists but CREAT and EXCL were specified", NULL) - } else if (flags & H5F_ACC_RDWR) { - if (flags & H5F_ACC_TRUNC) - f = fopen(name, "wb+"); - else - f = fopen(name, "rb+"); + } else if(flags & H5F_ACC_RDWR) { + if(flags & H5F_ACC_TRUNC) + f = freopen(name, "wb+", f); write_access = 1; /* Note the write access */ - } else { - f = fopen(name, "rb"); - } - if (!f) + } /* end if */ + /* Note there is no need to reopen if neither TRUNC nor EXCL are specified, + * as the tentative open will work */ + + if(!f) H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_CANTOPENFILE, "fopen failed", NULL) /* Build the return value */ diff --git a/src/H5Gname.c b/src/H5Gname.c index 6619c86..72da498 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -764,7 +764,7 @@ H5G_name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char /* Create the new path */ if(path_prefix2_len > 0) { - HDstrncpy(new_path, path_prefix2, path_prefix2_len); + HDstrncpy(new_path, path_prefix2, path_prefix2_len + 1); HDstrncpy(new_path + path_prefix2_len, dst_suffix, dst_suffix_len + 1); } /* end if */ else diff --git a/src/H5Gtest.c b/src/H5Gtest.c index b39b4ff..2b5d32a 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -568,7 +568,7 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign /* Set the user path, if given */ if(user_path) - HDstrcpy(user_path, H5RS_get_str(obj_path->user_path_r)); + HDstrncpy(user_path, H5RS_get_str(obj_path->user_path_r), (size_t)(len + 1)); /* Set the length of the path */ *user_path_len = (size_t)len; -- cgit v0.12 From 944f0399ac73a622dcfb03c42dbfad4ecc2948ed Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 10 Feb 2013 11:25:10 -0500 Subject: [svn-r23240] Snapshot version 1.9 release 143 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.txt b/README.txt index 5842824..224be1b 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.143 currently under development +HDF5 version 1.9.144 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 285b1ae..76b7717 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -467,7 +467,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 133 +LT_VERS_REVISION = 134 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 829bc3a..d94d73c 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 133 +LT_VERS_REVISION = 134 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index ef3fc41..0fce423 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.143. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.144. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.143' -PACKAGE_STRING='HDF5 1.9.143' +PACKAGE_VERSION='1.9.144' +PACKAGE_STRING='HDF5 1.9.144' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1484,7 +1484,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.143 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.144 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1554,7 +1554,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.143:";; + short | recursive ) echo "Configuration of HDF5 1.9.144:";; esac cat <<\_ACEOF @@ -1750,7 +1750,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.143 +HDF5 configure 1.9.144 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2844,7 +2844,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.143, which was +It was created by HDF5 $as_me 1.9.144, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3676,7 +3676,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.143' + VERSION='1.9.144' cat >>confdefs.h <<_ACEOF @@ -31723,7 +31723,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.143, which was +This file was extended by HDF5 $as_me 1.9.144, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31789,7 +31789,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.143 +HDF5 config.status 1.9.144 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -34562,7 +34562,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.143 +HDF5 config.lt 1.9.144 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. diff --git a/configure.ac b/configure.ac index 894a10d..c6959f9 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.143], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.144], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 3261a78..6a816b0 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -517,7 +517,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 133 +LT_VERS_REVISION = 134 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index d89c02c..149fd6d 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -458,7 +458,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 133 +LT_VERS_REVISION = 134 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 1f39ba7..d1b1977 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -474,7 +474,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 133 +LT_VERS_REVISION = 134 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 2ded187..afef6f7 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -457,7 +457,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 133 +LT_VERS_REVISION = 134 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index a67c613..a5ff940 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.143 currently under development +HDF5 version 1.9.144 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index de4af2a..63439c4 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 143 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 144 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.143" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.144" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index ceb4e33..d9dca2d 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -522,7 +522,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 133 +LT_VERS_REVISION = 134 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index c5db8dc..7787026 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.143" +#define H5_PACKAGE_STRING "HDF5 1.9.144" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.143" +#define H5_PACKAGE_VERSION "1.9.144" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.143" +#define H5_VERSION "1.9.144" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From 871b69723e764114578c2c88f125d8ce6ce57597 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Sun, 10 Feb 2013 21:06:01 -0500 Subject: [svn-r23241] Fix for: HDFFV-7596 H5DSget_scale returns size that includes NULL termination and H5DSget_label returns size Updated tests. Tested: jam( gnu, intel) --- hl/fortran/src/H5DSfc.c | 8 ++------ hl/src/H5DS.c | 4 +++- hl/test/test_ds.c | 8 ++++---- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/hl/fortran/src/H5DSfc.c b/hl/fortran/src/H5DSfc.c index 3135cfa..2e38939 100644 --- a/hl/fortran/src/H5DSfc.c +++ b/hl/fortran/src/H5DSfc.c @@ -331,12 +331,8 @@ nh5dsget_scale_name_c(hid_t_f *did, _fcd name, size_t_f *size) /* * Convert C name to FORTRAN and place it in the given buffer */ - if(size_c != 0) { - HD5packFstring(c_scale_name, _fcdtocp(name), (size_t)*size); - *size = (size_t_f)size_c-1; /* (-1) because we don't include the NULL ending in the length*/ - } else { - *size = (size_t_f)size_c; /* if NULL then no name was found */ - } + HD5packFstring(c_scale_name, _fcdtocp(name), (size_t)*size); + *size = (size_t_f)size_c; done: if(c_scale_name) HDfree(c_scale_name); diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index e9ea9cf..cb3a1ce 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -1779,6 +1779,8 @@ out: * Comments: * * Modifications: +* The size of the name returned should not include the NULL termination +* in its value so as to be consistent with other HDF5 APIs. * *------------------------------------------------------------------------- */ @@ -1875,7 +1877,7 @@ ssize_t H5DSget_scale_name(hid_t did, buf=NULL; } - return (ssize_t) nbytes; + return (ssize_t) MAX(0,nbytes-1); /* error zone */ out: diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index e290bbb..b81f8d4 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -1127,9 +1127,9 @@ herr_t test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *sc if((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) { if(H5DSis_attached(did, dsid, idx) == 1) { if((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0)) > 0) { - name_out = (char*)HDmalloc(name_len * sizeof (char)); + name_out = (char*)HDmalloc((name_len+1) * sizeof (char)); if(name_out != NULL) { - if(H5DSget_scale_name(dsid, name_out, (size_t)name_len) >= 0) { + if(H5DSget_scale_name(dsid, name_out, (size_t)name_len+1) >= 0) { if(HDstrcmp(scalename,name_out)==0) { ret_value = SUCCEED; } @@ -3232,12 +3232,12 @@ static int test_simple(void) goto out; /* allocate a buffer */ - name_out = (char*)HDmalloc(name_len * sizeof (char)); + name_out = (char*)HDmalloc((name_len+1) * sizeof (char)); if(name_out == NULL) goto out; /* get the scale name using this buffer */ - if(H5DSget_scale_name(dsid, name_out, (size_t)name_len) < 0) + if(H5DSget_scale_name(dsid, name_out, (size_t)name_len+1) < 0) goto out; if(HDstrcmp("Latitude set 0",name_out)!=0) -- cgit v0.12 From b37820aecbe7e94fcf4bb1b1757322393e5b01c4 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Sun, 10 Feb 2013 21:18:24 -0500 Subject: [svn-r23242] Added info. about changed behavior of H5DSgetscale_name (HDFFV-7596) --- release_docs/RELEASE.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index a5ff940..0ac9c3f 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -975,7 +975,10 @@ Bug Fixes since HDF5-1.8.0 release High-Level APIs: ------ - + - Fixed problem with H5DSget_scale_name including the NULL terminator in + the size calculation returned by the function. The API does not + include the NULL terminator in the size returned (MSB- 2013/2/10) + - Fixed problem with H5TBdelete_record destroying all data following the deletion of a row. (MSB- 2012/7/26) -- cgit v0.12 From 23d2b5d55726751b70f47f8214cc94c8ead15f1f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 11 Feb 2013 15:15:17 -0500 Subject: [svn-r23244] Correct test dependency handling. Tested: local linux --- tools/h5dump/CMakeLists.txt | 164 +++++++++++++++++++++----------------------- 1 file changed, 78 insertions(+), 86 deletions(-) diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 286d09f..56f49ac 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -784,10 +784,7 @@ IF (BUILD_TESTING) -E compare_files ${resultfile}.txt ${resultfile}.exp ) SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-output-cmp-${resultfile}") + SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-${resultfile}) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST_EXPORT file) @@ -1270,27 +1267,23 @@ IF (BUILD_TESTING) ADD_H5_TEST (tnoattrdata 0 --enable-error-stack -A -o tattr.h5) ADD_H5_TEST_EXPORT (trawdatafile packedbits.h5 0 --enable-error-stack -y -o) ADD_H5_TEST_EXPORT (tnoddlfile packedbits.h5 0 --enable-error-stack -O -y -o) - ADD_TEST ( - NAME H5DUMP-clear-twithddlfile-export - COMMAND ${CMAKE_COMMAND} - -E remove twithddl.txt - ) - SET_TESTS_PROPERTIES (H5DUMP-clear-twithddlfile-export PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-clear-twithddlfile-export PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-clear-twithddlfile-export") - ADD_H5_TEST_EXPORT (twithddlfile packedbits.h5 0 --enable-error-stack --ddl=twithddl.txt -y -o) - ADD_TEST ( - NAME H5DUMP-output-cmp-meta-twithddlfile - COMMAND ${CMAKE_COMMAND} - -E compare_files twithddl.txt twithddl.exp - ) - SET_TESTS_PROPERTIES (H5DUMP-output-cmp-meta-twithddlfile PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-output-cmp-meta-twithddlfile PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-output-cmp-meta-twithddlfile") + + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5DUMP-clear-twithddlfile-export + COMMAND ${CMAKE_COMMAND} + -E remove twithddl.txt + ) + SET_TESTS_PROPERTIES (H5DUMP-clear-twithddlfile-export PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + ADD_H5_TEST_EXPORT (twithddlfile packedbits.h5 0 --enable-error-stack --ddl=twithddl.txt -y -o) + ADD_TEST ( + NAME H5DUMP-output-cmp-meta-twithddlfile + COMMAND ${CMAKE_COMMAND} + -E compare_files twithddl.txt twithddl.exp + ) + SET_TESTS_PROPERTIES (H5DUMP-output-cmp-meta-twithddlfile PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-output-cmp-meta-twithddlfile PROPERTIES DEPENDS "H5DUMP-clear-twithddlfile-export") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) # test for maximum display datasets ADD_H5_TEST (twidedisplay 0 --enable-error-stack -w0 packedbits.h5) @@ -1548,11 +1541,18 @@ IF (BUILD_TESTING) ADD_H5_EXPORT_TEST (tstr2bin6 tstr2.h5 0 --enable-error-stack -d /g6/dset6 -b -o) # NATIVE default. the NATIVE test can be validated with h5import/h5diff + ADD_TEST (NAME H5DUMP-clear-objects-tbin1 COMMAND ${CMAKE_COMMAND} -E remove out1.bin) + SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin1 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + IF (HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin1 PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ADD_H5_TEST (tbin1 0 --enable-error-stack -d integer -o out1.bin -b tbinary.h5) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-tbin1 PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-tbin1") + IF (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5DUMP-tbin1 PROPERTIES DEPENDS H5DUMP-clear-objects-tbin1) + SET (last_test "H5DUMP-tbin1") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DUMP-clear-out1D COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/std/out1D.h5) @@ -1563,35 +1563,45 @@ IF (BUILD_TESTING) ADD_TEST (NAME H5DUMP-h5diff-out1D COMMAND h5diff tbinary.h5 out1D.h5 /integer /integer) SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1D PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1D PROPERTIES DEPENDS H5DUMP-h5import-out1D) - SET (last_test "H5DUMP-h5diff-out1D") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-clear-out1 COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/std/out1.h5) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-clear-out1 PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST (NAME H5DUMP-h5import-out1 COMMAND h5import out1.bin -c out3.h5import -o out1.h5) - SET_TESTS_PROPERTIES (H5DUMP-h5import-out1 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-h5import-out1 PROPERTIES DEPENDS H5DUMP-clear-out1) - ADD_TEST (NAME H5DUMP-h5diff-out1 COMMAND h5diff tbinary.h5 out1.h5 /integer /integer) - SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1 PROPERTIES DEPENDS H5DUMP-h5import-out1) - SET (last_test "H5DUMP-h5diff-out1") - - ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o out2.bin tbinary.h5) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5DUMP-clear-out1 COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/std/out1.h5) + SET_TESTS_PROPERTIES (H5DUMP-clear-out1 PROPERTIES DEPENDS H5DUMP-tbin1) + ADD_TEST (NAME H5DUMP-h5import-out1 COMMAND h5import out1.bin -c out3.h5import -o out1.h5) + SET_TESTS_PROPERTIES (H5DUMP-h5import-out1 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-h5import-out1 PROPERTIES DEPENDS H5DUMP-clear-out1) + ADD_TEST (NAME H5DUMP-h5diff-out1 COMMAND h5diff tbinary.h5 out1.h5 /integer /integer) + SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1 PROPERTIES DEPENDS H5DUMP-h5import-out1) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + + ADD_TEST (NAME H5DUMP-clear-objects-tbin2 COMMAND ${CMAKE_COMMAND} -E remove out2.bin) + SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin2 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + IF (HDF5_ENABLE_USING_MEMCHECKER) IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-tbin2 PROPERTIES DEPENDS ${last_test}) + SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin2 PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o out2.bin tbinary.h5) + IF (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5DUMP-tbin2 PROPERTIES DEPENDS H5DUMP-clear-objects-tbin2) SET (last_test "H5DUMP-tbin2") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) # the NATIVE test can be validated with h5import/h5diff + ADD_TEST (NAME H5DUMP-clear-objects-tbin3 COMMAND ${CMAKE_COMMAND} -E remove out3.bin) + SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin3 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + IF (HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin3 PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ADD_H5_TEST (tbin3 0 --enable-error-stack -d integer -o out3.bin -b NATIVE tbinary.h5) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-tbin3 PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-tbin3") + IF (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5DUMP-tbin3 PROPERTIES DEPENDS H5DUMP-clear-objects-tbin3) + SET (last_test "H5DUMP-tbin3") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DUMP-clear-out3D COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/std/out3D.h5) @@ -1602,49 +1612,31 @@ IF (BUILD_TESTING) ADD_TEST (NAME H5DUMP-h5diff-out3D COMMAND h5diff tbinary.h5 out3D.h5 /integer /integer -q) SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3D PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3D PROPERTIES DEPENDS H5DUMP-h5import-out3D) - SET (last_test "H5DUMP-h5diff-out3D") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-clear-out3 COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/std/out3.h5) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-clear-out3 PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST (NAME H5DUMP-h5import-out3 COMMAND h5import out3.bin -c out3.h5import -o out3.h5) - SET_TESTS_PROPERTIES (H5DUMP-h5import-out3 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-h5import-out3 PROPERTIES DEPENDS H5DUMP-clear-out3) - ADD_TEST (NAME H5DUMP-h5diff-out3 COMMAND h5diff tbinary.h5 out3.h5 /integer /integer -q) - SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3 PROPERTIES DEPENDS H5DUMP-h5import-out3) - SET (last_test "H5DUMP-h5diff-out3") - - ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o out4.bin tbinary.h5) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-tbin4 PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-tbin4") + ADD_TEST (NAME H5DUMP-clear-out3 COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/std/out3.h5) + SET_TESTS_PROPERTIES (H5DUMP-h5import-out3 PROPERTIES DEPENDS H5DUMP-tbin3) + ADD_TEST (NAME H5DUMP-h5import-out3 COMMAND h5import out3.bin -c out3.h5import -o out3.h5) + SET_TESTS_PROPERTIES (H5DUMP-h5import-out3 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-h5import-out3 PROPERTIES DEPENDS H5DUMP-clear-out3) + ADD_TEST (NAME H5DUMP-h5diff-out3 COMMAND h5diff tbinary.h5 out3.h5 /integer /integer -q) + SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3 PROPERTIES DEPENDS H5DUMP-h5import-out3) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - - # Clean up binary output files - IF (NOT HDF5_NOCLEANUP) - ADD_TEST ( - NAME H5DUMP-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - out1.bin - out1LE.bin - out2.bin - out3.bin - out4.bin - out1.h5 - out3.h5 - ) - SET_TESTS_PROPERTIES (H5DUMP-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + + ADD_TEST (NAME H5DUMP-clear-objects-tbin4 COMMAND ${CMAKE_COMMAND} -E remove out4.bin) + SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin4 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + IF (HDF5_ENABLE_USING_MEMCHECKER) IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-clear-objects PROPERTIES DEPENDS ${last_test}) + SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin4 PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-clear-objects") - ENDIF (NOT HDF5_NOCLEANUP) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o out4.bin tbinary.h5) + IF (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5DUMP-tbin4 PROPERTIES DEPENDS H5DUMP-clear-objects-tbin4) + SET (last_test "H5DUMP-tbin4") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) # test for dataset region references ADD_H5_TEST (tdatareg 0 --enable-error-stack tdatareg.h5) -- cgit v0.12 From d9baac8b0b857d82dd0e520a624d6396814417a9 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Mon, 11 Feb 2013 16:20:37 -0500 Subject: [svn-r23245] I added the information about the new function H5DOwrite_chunk. No test is needed. --- release_docs/RELEASE.txt | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 0ac9c3f..fa0e6ec 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -371,9 +371,9 @@ New Features High-Level APIs: ------ - Table: In version 3.0 of Table, "NROWS" (used to store number of records) was - deprecated (PVN - 2008/11/24) + deprecated (PVN - 2008/11/24) - - Added Fortran wrappers for Dimension Scale APIs. HDFFV-3797 + - Added Fortran wrappers for Dimension Scale APIs. HDFFV-3797 h5dsset_scale_f h5dsattach_scale_f h5dsdetach_scale_f @@ -386,9 +386,15 @@ New Features (EIP for SB - 2011/10/13) - New API: h5ltpath_valid (Fortran: h5ltpath_valid_f) which checks - if a path is correct and determines if a link resolves to a valid - object and checks that the link does not dangle. (MSB- 2012/3/15) - + if a path is correct and determines if a link resolves to a valid + object and checks that the link does not dangle. (MSB- 2012/3/15) + + - A new API function H5DOwrite_chunk. It writes a data chunk directly + into a file bypassing hyperslab selection, data conversion, and + filter pipeline. The user must be careful with the function and + clearly understand the I/O process of the library. + (SLU - 2013/2/11) + Documentation ------------- -- cgit v0.12 From 9d07161dd9b380449195e36a1d4805cc8ea424cb Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 11 Feb 2013 20:28:08 -0500 Subject: [svn-r23248] Made modification of comments for h5rget_name_*f for the loc_id identifier. Cleaned up comments. --- fortran/src/H5Rff_F03.f90 | 112 +++++++++++++++++----------------------------- fortran/src/H5Rff_F90.f90 | 28 ++++++------ 2 files changed, 55 insertions(+), 85 deletions(-) diff --git a/fortran/src/H5Rff_F03.f90 b/fortran/src/H5Rff_F03.f90 index 88ec8cf..bf68f7a 100644 --- a/fortran/src/H5Rff_F03.f90 +++ b/fortran/src/H5Rff_F03.f90 @@ -258,9 +258,7 @@ CONTAINS ! name - name of the object at the specified location ! Outputs: ! ref - reference to the specified object -! hdferr: - error code -! Success: 0 -! Failure: -1 +! hdferr - returns 0 if successful and -1 if fails ! AUTHOR ! Elena Pourmal ! August 12, 1999 @@ -309,9 +307,7 @@ CONTAINS ! space_id - dataspace identifier that describes selected region ! OUTPUTS ! ref - reference to the dataset region -! hdferr: - error code -! Success: 0 -! Failure: -1 +! hdferr - returns 0 if successful and -1 if fails ! AUTHOR ! Elena Pourmal ! August 12, 1999 @@ -376,9 +372,7 @@ CONTAINS ! H5T_STD_REF_DSETREG ! Outputs: ! ref - reference created by the function call. -! hdferr - error code -! Success: 0 -! Failure: -1 +! hdferr - returns 0 if successful and -1 if fails. ! OPTIONAL ! space_id - dataspace identifier that describes selected region ! @@ -425,9 +419,7 @@ CONTAINS ! ref - reference to open ! Outputs: ! obj_id - object_identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 +! hdferr - returns 0 if successful and -1 if fails ! AUTHOR ! Elena Pourmal ! August 12, 1999 @@ -465,14 +457,12 @@ CONTAINS ! Opens the dataset region ! ! Inputs: -! dset_id - identifier of the dataset containing -! reference to teh regions -! ref - reference to open +! dset_id - identifier of the dataset containing +! reference to teh regions +! ref - reference to open ! Outputs: -! obj_id - dataspace identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 +! obj_id - dataspace identifier +! hdferr - returns 0 if successful and -1 if fails ! ! AUTHOR ! Elena Pourmal @@ -517,9 +507,8 @@ CONTAINS ! ref - Reference to open. ! Outputs: ! ref_obj_id - identifier of referenced object -! hdferr - error code -! Success: 0 -! Failure: -1 +! hdferr - returns 0 if successful and -1 if fails +! ! AUTHOR ! M. Scot Breitenfeld ! June 20, 2008 @@ -553,37 +542,32 @@ CONTAINS ! Retrieves a name of a referenced object. ! ! Inputs: -! loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. +! loc_id - Identifier for the file containing the reference or for any object in that file. ! ref - An object or dataset region reference. ! ! Outputs: ! name - A name associated with the referenced object or dataset region. -! -! hdferr: - error code -! Success: 0 -! Failure: -1 +! hdferr - Returns 0 if successful and -1 if fails. ! ! Optional parameters: -! size - The size of the name buffer. +! size - The size of the name buffer, returning 0 (zero) if no name is associated +! with the identifier. ! ! AUTHOR ! M. Scot Breitenfeld ! March 28, 2008 ! -! Signature:S +! Signature: SUBROUTINE h5rget_name_object_f(loc_id, ref, name, hdferr, size) USE, INTRINSIC :: ISO_C_BINDING IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for the dataset containing the reference - ! or for the group that dataset is in. - TYPE(hobj_ref_t_f), INTENT(IN), TARGET :: ref ! Object reference - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! The size of the name buffer, - ! returning 0 (zero) if no name is associated - ! with the identifier - CHARACTER(LEN=*), INTENT(OUT) :: name ! A name associated with the referenced object or dataset region. - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), INTENT(IN) :: loc_id + TYPE(hobj_ref_t_f), INTENT(IN), TARGET :: ref + INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size + CHARACTER(LEN=*), INTENT(OUT) :: name + INTEGER, INTENT(OUT) :: hdferr !***** - INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference + INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference INTEGER(SIZE_T) :: size_default INTEGER(SIZE_T) :: name_len @@ -595,7 +579,6 @@ CONTAINS hdferr = h5rget_name_ptr_c(loc_id, 0, f_ptr, name, name_len, size_default) - IF(PRESENT(size)) size = size_default END SUBROUTINE h5rget_name_object_f @@ -608,18 +591,15 @@ CONTAINS ! Retrieves a name of a dataset region. ! ! Inputs: -! loc_id - Identifier for the dataset containing the reference or -! for the group that dataset is in. +! loc_id - Identifier for the file containing the reference or for any object in that file. ! ref - An object or dataset region reference. ! ! Outputs: ! name - A name associated with the referenced object or dataset region. -! hdferr - error code -! Success: 0 -! Failure: -1 +! hdferr - Returns 0 if successful and -1 if fails. ! ! Optional parameters: -! size - The size of the name buffer. +! size - The size of the name buffer, returning 0 (zero) if no name is associated with the identifier ! ! AUTHOR ! M. Scot Breitenfeld @@ -629,13 +609,11 @@ CONTAINS SUBROUTINE h5rget_name_region_f(loc_id, ref, name, hdferr, size) USE, INTRINSIC :: ISO_C_BINDING IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for the dataset containing the reference - ! or for the group that dataset is in. - TYPE(hdset_reg_ref_t_f), INTENT(IN), TARGET :: ref ! Object reference - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! The size of the name buffer, - ! returning 0 (zero) if no name is associated with the identifier - CHARACTER(LEN=*), INTENT(OUT) :: name ! A name associated with the referenced object or dataset region. - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), INTENT(IN) :: loc_id + TYPE(hdset_reg_ref_t_f), INTENT(IN), TARGET :: ref + INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size + CHARACTER(LEN=*), INTENT(OUT) :: name + INTEGER, INTENT(OUT) :: hdferr !***** INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference INTEGER(SIZE_T) :: size_default @@ -661,20 +639,17 @@ CONTAINS ! Retrieves a name of a referenced object. ! ! Inputs: - ! loc_id - Identifier for the dataset containing the reference or - ! for the group that dataset is in. + ! loc_id - Identifier for the file containing the reference or for any object in that file. ! ref_type - Type of reference. ! ref - An object or dataset region reference. ! ! Outputs: ! name - A name associated with the referenced object or dataset ptr. - ! - ! hdferr - error code - ! Success: 0 - ! Failure: -1 + ! hdferr - Returns 0 if successful and -1 if fails. ! ! Optional parameters: - ! size - The size of the name buffer. + ! size - The size of the name buffer, returning 0 (zero) if no name is associated + ! with the identifier ! ! AUTHOR ! M. Scot Breitenfeld @@ -684,15 +659,12 @@ CONTAINS SUBROUTINE h5rget_name_ptr_f(loc_id, ref_type, ref, name, hdferr, size) USE, INTRINSIC :: ISO_C_BINDING IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for the dataset containing the reference - ! or for the group that dataset is in. - INTEGER, INTENT(IN) :: ref_type ! Type of reference. - TYPE(C_PTR), INTENT(IN) :: ref ! An object or dataset region reference. - CHARACTER(LEN=*), INTENT(OUT) :: name ! A name associated with the referenced object or dataset ptr. - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! The size of the name buffer, - ! returning 0 (zero) if no name is associated - ! with the identifier + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER, INTENT(IN) :: ref_type + TYPE(C_PTR), INTENT(IN) :: ref + CHARACTER(LEN=*), INTENT(OUT) :: name + INTEGER, INTENT(OUT) :: hdferr + INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size !***** INTEGER(SIZE_T) :: size_default INTEGER(SIZE_T) :: name_len @@ -727,9 +699,7 @@ CONTAINS ! H5G_DATASET_F 2 ! H5G_TYPE_F 3 ! - ! hdferr - error code - ! Success: 0 - ! Failure: -1 + ! hdferr - Returns 0 if successful and -1 if fails. ! ! AUTHOR ! M. Scot Breitenfeld diff --git a/fortran/src/H5Rff_F90.f90 b/fortran/src/H5Rff_F90.f90 index 0190e57..913176e 100644 --- a/fortran/src/H5Rff_F90.f90 +++ b/fortran/src/H5Rff_F90.f90 @@ -386,7 +386,7 @@ CONTAINS ! Retrieves a name of a referenced object. ! ! INPUTS -! loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. +! loc_id - Identifier for the file containing the reference or for any object in that file. ! ref - An object or dataset region reference. ! ! OUTPUTS @@ -397,7 +397,8 @@ CONTAINS ! Failure: -1 ! ! OPTIONAL PARAMETERS -! size - The size of the name buffer. +! size - The size of the name buffer, returning 0 (zero) if +! no name is associated with the identifier ! ! AUTHOR ! M. Scot Breitenfeld @@ -406,7 +407,8 @@ CONTAINS ! SOURCES SUBROUTINE h5rget_name_object_f(loc_id, ref, name, hdferr, size) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for the dataset containing the reference + INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for the file containing the reference or + ! for any object in that file. ! or for the group that dataset is in. TYPE(hobj_ref_t_f), INTENT(IN) :: ref ! Object reference INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! The size of the name buffer, @@ -453,8 +455,8 @@ CONTAINS ! Retrieves a name of a dataset region. ! ! INPUTS -! loc_id - Identifier for the dataset containing the reference or -! for the group that dataset is in. +! loc_id - Identifier for the file containing the reference or +! for any object in that file. ! ref - An object or dataset region reference. ! ! OUTPUTS @@ -464,7 +466,8 @@ CONTAINS ! Failure: -1 ! ! OPTIONAL PARAMETERS -! size - The size of the name buffer. +! size - The size of the name buffer, returning 0 (zero) if no +! name is associated with the identifier ! ! AUTHOR ! M. Scot Breitenfeld @@ -473,14 +476,11 @@ CONTAINS ! SOURCE SUBROUTINE h5rget_name_region_f(loc_id, ref, name, hdferr, size) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for the dataset containing the reference - ! or for the group that dataset is in. - TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Object reference - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! The size of the name buffer, - ! returning 0 (zero) if no name is associated - ! with the identifier - CHARACTER(LEN=*), INTENT(OUT) :: name ! A name associated with the referenced object or dataset region. - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), INTENT(IN) :: loc_id + TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref + INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size + CHARACTER(LEN=*), INTENT(OUT) :: name + INTEGER, INTENT(OUT) :: hdferr !***** INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference INTEGER(SIZE_T) :: size_default -- cgit v0.12 From 6ad28abc14a8ced8ce10bf5bf25f74fea0344fcf Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 12 Feb 2013 08:41:43 -0500 Subject: [svn-r23249] Correct typo in normal depends statement. Add MEMORY_CHECK settings to match existing VALGRIND statements --- CTestConfig.cmake | 2 ++ tools/h5dump/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 8d00095..5d8f25c 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -20,6 +20,8 @@ SET (CTEST_DROP_SITE_CDASH TRUE) SET (UPDATE_TYPE svn) SET (VALGRIND_COMMAND "/usr/bin/valgrind") SET (VALGRIND_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe") +SET (CTEST_MEMORYCHECK_COMMAND "/usr/bin/valgrind") +SET (CTEST_MEMORYCHECK_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe") SET (CTEST_TEST_TIMEOUT 3600 CACHE STRING "Maximum time allowed before CTest will kill the test.") diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 56f49ac..4d6e080 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -1616,7 +1616,7 @@ IF (BUILD_TESTING) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DUMP-clear-out3 COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/std/out3.h5) - SET_TESTS_PROPERTIES (H5DUMP-h5import-out3 PROPERTIES DEPENDS H5DUMP-tbin3) + SET_TESTS_PROPERTIES (H5DUMP-clear-out3 PROPERTIES DEPENDS H5DUMP-tbin3) ADD_TEST (NAME H5DUMP-h5import-out3 COMMAND h5import out3.bin -c out3.h5import -o out3.h5) SET_TESTS_PROPERTIES (H5DUMP-h5import-out3 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") SET_TESTS_PROPERTIES (H5DUMP-h5import-out3 PROPERTIES DEPENDS H5DUMP-clear-out3) -- cgit v0.12 From 4680324b24ffda929ae04738fda35f735b656677 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 12 Feb 2013 10:11:20 -0500 Subject: [svn-r23250] Merge changes from normal cache file --- config/cmake/mccacheinit.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index b472acf..8ca3879 100755 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -8,6 +8,8 @@ SET (BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libraries" FORCE) SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) +SET (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) + SET (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE) SET (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) @@ -58,7 +60,7 @@ SET (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) -SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) +SET (HDF5_NO_PACKAGES ON CACHE BOOL "CPACK - Disable packaging" FORCE) SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building" FORCE) @@ -74,3 +76,6 @@ SET (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Debug" FORCE) SET (CTEST_BUILD_CONFIGURATION "Debug" CACHE STRING "Build Debug" FORCE) +SET (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) + +SET (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) -- cgit v0.12 From 334cebba07e528cd6dc2095fde74fc1d384c2edb Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 12 Feb 2013 13:09:29 -0500 Subject: [svn-r23251] Fix test dependency flow --- tools/h5dump/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 4d6e080..9e081c6 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -1275,6 +1275,10 @@ IF (BUILD_TESTING) -E remove twithddl.txt ) SET_TESTS_PROPERTIES (H5DUMP-clear-twithddlfile-export PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-clear-twithddlfile-export PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DUMP-clear-twithddlfile-export") ADD_H5_TEST_EXPORT (twithddlfile packedbits.h5 0 --enable-error-stack --ddl=twithddl.txt -y -o) ADD_TEST ( NAME H5DUMP-output-cmp-meta-twithddlfile @@ -1282,7 +1286,7 @@ IF (BUILD_TESTING) -E compare_files twithddl.txt twithddl.exp ) SET_TESTS_PROPERTIES (H5DUMP-output-cmp-meta-twithddlfile PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-output-cmp-meta-twithddlfile PROPERTIES DEPENDS "H5DUMP-clear-twithddlfile-export") + SET_TESTS_PROPERTIES (H5DUMP-output-cmp-meta-twithddlfile PROPERTIES DEPENDS "(H5DUMP-output-cmp-twithddlfile") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) # test for maximum display datasets -- cgit v0.12 From f08e413f1dce21f7e29a07348a9d87505a8a379c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 12 Feb 2013 13:19:28 -0500 Subject: [svn-r23252] Fix test dependency flow --- tools/h5import/CMakeLists.txt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index 235cb9f..1f0b3ad 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -141,12 +141,9 @@ IF (BUILD_TESTING) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5IMPORT-${testname}-clear-objects") ADD_TEST (NAME H5IMPORT-${testname} COMMAND $ ${importfile} -c ${conffile} -o ${testfile}) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}-clear-objects) SET (last_test "H5IMPORT-${testname}") # If using memchecker add tests without using scripts @@ -264,10 +261,12 @@ IF (BUILD_TESTING) ENDMACRO (ADD_H5_DUMPTEST testname datasetname testfile) MACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) - ADD_TEST ( - NAME H5IMPORT-DUMP-${testname}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname} ${datasetname} ${testfile} --- DEFLATE filter not available" - ) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5IMPORT-DUMP-${testname}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname} ${datasetname} ${testfile} --- DEFLATE filter not available" + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) # -------------------------------------------------------------------- -- cgit v0.12 From 7ca11cb3e05367cc96b3ff7f09393dcf314867dd Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 12 Feb 2013 15:47:31 -0500 Subject: [svn-r23253] update memcheck ignore tests --- config/cmake/CTestCustom.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index c33201f..871caeb 100755 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -41,10 +41,15 @@ SET (CTEST_CUSTOM_MEMCHECK_IGNORE H5COPY-clear-refs H5COPY-clear-ext-links H5COPY-clear-misc + H5COPY-clearall-objects ######### tools/h5diff ######### H5DIFF-clearall-objects ######### tools/h5dump ######### H5DUMP-clearall-objects + H5DUMP-clear-objects-tbin1 + H5DUMP-clear-objects-tbin2 + H5DUMP-clear-objects-tbin3 + H5DUMP-clear-objects-tbin4 H5DUMP-clear-out1 H5DUMP-clear-out3 H5DUMP-clear-objects -- cgit v0.12 From 472566b5431eb9bef07ec1ee9573b8a527de5af6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 12 Feb 2013 16:01:26 -0500 Subject: [svn-r23254] Make tests independent of each other Tested: local linux --- tools/h5copy/CMakeLists.txt | 139 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 113 insertions(+), 26 deletions(-) diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index 970cc12..cfe9186 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -87,40 +87,106 @@ IF (BUILD_TESTING) # Perform h5copy according to passing parmeters # MACRO (ADD_H5_F_TEST testname resultcode infile outfile fparam vparam sparam srcname dparam dstname) + # Remove any output file left over from previous test run ADD_TEST ( - NAME H5COPY_F-${testname} - COMMAND $ -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + NAME H5COPY_F-clear-objects-${testname} + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${outfile} ) IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test}) + SET_TESTS_PROPERTIES (H5COPY_F-clear-objects-${testname} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") + ADD_TEST ( + NAME H5COPY_F-${testname} + COMMAND $ -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + ) + SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS H5COPY_F-clear-objects-${testname}) SET (last_test "H5COPY_F-${testname}") ADD_H5_DIFF_TEST (${testname} ${resultcode} ${last_test} ${infile} ${outfile} ${srcname} ${dstname}) ENDMACRO (ADD_H5_F_TEST) MACRO (ADD_H5_TEST testname resultcode infile outfile vparam sparam srcname dparam dstname) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-clear-objects-${testname} + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${outfile} + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY-clear-objects-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") ADD_TEST ( NAME H5COPY-${testname} COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) + SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-clear-objects-${testname}) + SET (last_test "H5COPY-${testname}") + ADD_H5_DIFF_TEST (${testname} ${resultcode} ${last_test} ${infile} ${outfile} ${srcname} ${dstname}) + ENDMACRO (ADD_H5_TEST) + + MACRO (ADD_H5_TEST2 testname resultcode infile outfile psparam pdparam vparam sparam srcname dparam dstname) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-clear-objects-${testname} + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${outfile} + ) IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS ${last_test}) + SET_TESTS_PROPERTIES (H5COPY-clear-objects-${testname} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") + ADD_TEST ( + NAME H5COPY-${testname}-prefill + COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${outfile} -v -s ${psparam} -d ${pdparam} + ) + SET_TESTS_PROPERTIES (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-clear-objects-${testname}) + ADD_TEST ( + NAME H5COPY-${testname} + COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + ) + SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill) SET (last_test "H5COPY-${testname}") ADD_H5_DIFF_TEST (${testname} ${resultcode} ${last_test} ${infile} ${outfile} ${srcname} ${dstname}) - ENDMACRO (ADD_H5_TEST) + ENDMACRO (ADD_H5_TEST2) + + MACRO (ADD_H5_TEST3 testname resultcode infile outfile pfile psparam pdparam vparam sparam srcname dparam dstname) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-clear-objects-${testname} + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${outfile} + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY-clear-objects-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ADD_TEST ( + NAME H5COPY-${testname}-prefill + COMMAND $ -i ./testfiles/${pfile} -o ./testfiles/${infile} -v -s ${psparam} -d ${pdparam} + ) + SET_TESTS_PROPERTIES (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-clear-objects-${testname}) + ADD_TEST ( + NAME H5COPY-${testname} + COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + ) + SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill) + SET (last_test "H5COPY-${testname}") + ADD_H5_DIFF_TEST (${testname} ${resultcode} ${last_test} ${infile} ${outfile} ${srcname} ${dstname}) + ENDMACRO (ADD_H5_TEST3) MACRO (ADD_H5_DIFF_TEST testname resultcode testdepends infile outfile srcname dstname) # resultcode=2 will cause the test to skip the diff test IF (NOT ${resultcode} STREQUAL "2") ADD_TEST ( - NAME H5COPY-DIFF_${testname} + NAME H5COPY-DIFF-${testname} COMMAND $ -q ./testfiles/${infile} ./testfiles/${outfile} ${srcname} ${dstname} ) - SET_TESTS_PROPERTIES(H5COPY-DIFF_${testname} PROPERTIES DEPENDS ${testdepends}) - SET (last_test "H5COPY-DIFF_${testname}") + SET_TESTS_PROPERTIES(H5COPY-DIFF-${testname} PROPERTIES DEPENDS ${testdepends}) + SET (last_test "H5COPY-DIFF-${testname}") IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5COPY-DIFF_${testname} PROPERTIES WILL_FAIL "true") + SET_TESTS_PROPERTIES (H5COPY-DIFF-${testname} PROPERTIES WILL_FAIL "true") ENDIF (${resultcode} STREQUAL "1") ENDIF (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_DIFF_TEST) @@ -129,12 +195,24 @@ IF (BUILD_TESTING) # Test result with h5ls # MACRO (ADD_H5LS_TEST file filetest) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-h5ls-clear-objects-${file}-${filetest} + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${file}.out.h5 + ./testfiles/${file}.out.out + ./testfiles/${file}.out.out.err + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY-h5ls-clear-objects-${file}-${filetest} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") # If using memchecker add tests without using scripts IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5COPY-h5ls_${file}-${filetest} COMMAND $ -Svr ./testfiles/${file}.out.h5) + ADD_TEST (NAME H5COPY-h5ls-${file}-${filetest} COMMAND $ -Svr ./testfiles/${file}.out.h5) ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5COPY-h5ls_${file}-${filetest} + NAME H5COPY-h5ls-${file}-${filetest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS=-Svr;./testfiles/${file}.out.h5" @@ -146,10 +224,8 @@ IF (BUILD_TESTING) -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-h5ls_${file}-${filetest} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-h5ls_${file}-${filetest}") + SET_TESTS_PROPERTIES (H5COPY-h5ls-${file}-${filetest} PROPERTIES DEPENDS H5COPY-h5ls-clear-objects-${file}-${filetest}) + SET (last_test "H5COPY-h5ls-${file}-${filetest}") ENDMACRO (ADD_H5LS_TEST) # @@ -157,6 +233,18 @@ IF (BUILD_TESTING) # files instead of checking with h5ls. # MACRO (ADD_H5_CMP_TEST testname resultcode infile outfile vparam sparam srcname dparam dstname) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-CMP-clear-objects-${testname} + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${outfile} + ./testfiles/${testname}.out.out + ./testfiles/${testname}.out.out.err + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY-CMP-clear-objects-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") # If using memchecker add tests without using scripts IF (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5COPY-CMP-${testname} COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) @@ -238,13 +326,13 @@ IF (BUILD_TESTING) ADD_H5_TEST (grp_nested 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_nested -d grp_nested) # "Test copying dataset within group in source file to group in destination" - ADD_H5_TEST (simple_group 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s /grp_dsets/simple -d /grp_dsets/simple_group) + ADD_H5_TEST2 (simple_group 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 grp_dsets grp_dsets -v -s /grp_dsets/simple -d /grp_dsets/simple_group) # "Test copying & renaming group" ADD_H5_TEST (grp_rename 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_dsets -d grp_rename) # "Test copying 'full' group hierarchy into group in destination file" - ADD_H5_TEST (grp_dsets_rename 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_dsets -d /grp_rename/grp_dsets) + ADD_H5_TEST2 (grp_dsets_rename 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) # "Test copying objects into group hier. that doesn't exist yet in destination file" ADD_H5_TEST (A_B1_simple 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s simple -d /A/B1/simple) @@ -254,7 +342,8 @@ IF (BUILD_TESTING) ADD_H5_TEST (G_H_grp_nested 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s /grp_nested -d /G/H/grp_nested) # Verify that the file created above is correct - ADD_H5LS_TEST (${HDF_FILE1} basic) + # This test is not independent of the above tests + #ADD_H5LS_TEST (${HDF_FILE1} basic) ############# COPY REFERENCES ############## @@ -276,7 +365,8 @@ IF (BUILD_TESTING) ADD_H5_F_TEST (region_ref 2 ${HDF_FILE2}.h5 ${HDF_FILE2}.out.h5 ref -v -s / -d /COPY) # Verify that the file created above is correct - ADD_H5LS_TEST (${HDF_FILE2} refs) + # This test is not independent of the above tests + #ADD_H5LS_TEST (${HDF_FILE2} refs) ############# COPY EXT LINKS ############## @@ -319,7 +409,8 @@ IF (BUILD_TESTING) ADD_H5_F_TEST (ext_link_group_f 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 ext -v -s /group_ext -d /copy2_group) # Verify that the file created above is correct - ADD_H5LS_TEST (${HDF_EXT_SRC_FILE} links) + # This test is not independent of the above tests + #ADD_H5LS_TEST (${HDF_EXT_SRC_FILE} links) ############# Test misc. ############## # Remove any output file left over from previous test run @@ -355,14 +446,10 @@ IF (BUILD_TESTING) #------------------------------------------- # "Test copying objects to the same file " # - # create temporary test file with some objects - ADD_H5_TEST (samefile1_pre 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s /simple -d /simple) - ADD_H5_TEST (samefile2_pre 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s /grp_dsets -d /grp_dsets) - # actual test cases # - dataset - ADD_H5_TEST (samefile1 0 ${HDF_FILE1}.out.h5 ${HDF_FILE1}.out.h5 -v -s /simple -d /simple_cp) + ADD_H5_TEST3 (samefile1 0 ${HDF_FILE1}.out.h5 ${HDF_FILE1}.out.h5 ${HDF_FILE1}.h5 /simple /simple -v -s /simple -d /simple_cp) # - group with some datasets - ADD_H5_TEST (samefile2 0 ${HDF_FILE1}.out.h5 ${HDF_FILE1}.out.h5 -v -s /grp_dsets -d /grp_dsets_cp) + ADD_H5_TEST3 (samefile2 0 ${HDF_FILE1}.out.h5 ${HDF_FILE1}.out.h5 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) ENDIF (BUILD_TESTING) ############################################################################## -- cgit v0.12 From e8a075365663ced4997a67b33000c2fde5bcd224 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Tue, 12 Feb 2013 16:36:54 -0500 Subject: [svn-r23260] Bug fix: HDFFV-8267 The ERROR macro had a typo of missing a separator comma. When used, it seg. fault. Added the comma back in. Fix is reviewed in Crucible HDF5-107. Tested: h5committest passed. Also tested using the ERROR macro in the Mac (Owl) platform. Before fix, it seg. fault. After fix, it prints the message as intended. --- test/testhdf5.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testhdf5.h b/test/testhdf5.h index c92c0f0..907fce9 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -142,7 +142,7 @@ if(VERBOSE_HI) \ print_func(" Call to routine: %15s at line %4d in %s returned " \ "invalid result\n", where, (int)__LINE__, __FILE__); \ - TestErrPrintf("*** UNEXPECTED RESULT from %s at line %4d in %s\n" \ + TestErrPrintf("*** UNEXPECTED RESULT from %s at line %4d in %s\n", \ where, (int)__LINE__, __FILE__); \ } while(0) -- cgit v0.12 From d8b3b84ca2b4cc5e1ab20fb5ed757a38d77eb843 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 13 Feb 2013 11:03:49 -0500 Subject: [svn-r23262] Updated with bug fix entry of HDFFV-8267. Since this is a testing code error that does not affect the function of the library or tools, I started a new "Testing" section for this sort of changes. --- release_docs/RELEASE.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index fa0e6ec..994bb00 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1068,6 +1068,10 @@ Bug Fixes since HDF5-1.8.0 release in "New Features" section. (BMR - 2008/08/10) + Testing + ------- + - Fixed a typo in the ERROR macro in test/testhdf5.h. It segmentation + faulted when used before. (AKC - 2013/02/12 HDFFV-8267) Supported Platforms -- cgit v0.12 From 3b1e202378a2a3d53c013616859bd3aafc2dc9a3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 13 Feb 2013 12:37:10 -0500 Subject: [svn-r23263] Test dependencies were incorrect and test outside macros did not always execute in the correct order. Created new macro for h5import test verification. Corrected intra-macro test dependencies. Fixed clear tests. Tested: local linux --- tools/h5dump/CMakeLists.txt | 303 +++++++++++++++++++++----------------------- 1 file changed, 142 insertions(+), 161 deletions(-) diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 9e081c6..19b1420 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -680,11 +680,11 @@ IF (BUILD_TESTING) SET (last_test "H5DUMP-${testname}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5DUMP-clear-h5dump-${testname}-objects + NAME H5DUMP-h5dump-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove h5dump-${testname}.out h5dump-${testname}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-clear-h5dump-${testname}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-h5dump-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") ADD_TEST ( NAME H5DUMP-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" @@ -696,7 +696,7 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=h5dump-${testname}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-h5dump-${testname} PROPERTIES DEPENDS "H5DUMP-clear-h5dump-${testname}-objects") + SET_TESTS_PROPERTIES (H5DUMP-h5dump-${testname} PROPERTIES DEPENDS "H5DUMP-h5dump-${testname}-clear-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_HELP_TEST) @@ -724,14 +724,14 @@ IF (BUILD_TESTING) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-${resultfile}") +# SET (last_test "H5DUMP-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5DUMP-clear-${resultfile}-objects + NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.out ${resultfile}.out.err + -E remove ${resultfile}.bin ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-clear-${resultfile}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") ADD_TEST ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -743,7 +743,7 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-clear-${resultfile}-objects") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) @@ -758,14 +758,14 @@ IF (BUILD_TESTING) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-${resultfile}") +# SET (last_test "H5DUMP-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5DUMP-clear-${resultfile}-objects + NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.txt ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-clear-${resultfile}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") ADD_TEST ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -777,27 +777,78 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-clear-${resultfile}-objects") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") ADD_TEST ( - NAME H5DUMP-output-cmp-${resultfile} + NAME H5DUMP-${resultfile}-output-cmp COMMAND ${CMAKE_COMMAND} -E compare_files ${resultfile}.txt ${resultfile}.exp ) - SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-${resultfile}) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST_EXPORT file) + MACRO (ADD_H5_TEST_EXPORT_DDL resultfile targetfile resultcode ddlfile) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $ --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile}) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + IF (NOT ${resultcode} STREQUAL "0") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") + ENDIF (NOT ${resultcode} STREQUAL "0") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") +# SET (last_test "H5DUMP-${resultfile}") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5DUMP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${ddlfile}.txt ${resultfile}.txt ${resultfile}.out ${resultfile}.out.err + ) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + ADD_TEST ( + NAME H5DUMP-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=--ddl=${ddlfile}.txt;${ARGN};${resultfile}.txt;${targetfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + ADD_TEST ( + NAME H5DUMP-${resultfile}-output-cmp + COMMAND ${CMAKE_COMMAND} + -E compare_files ${resultfile}.txt ${resultfile}.exp + ) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) + ADD_TEST ( + NAME H5DUMP-${resultfile}-output-cmp-ddl + COMMAND ${CMAKE_COMMAND} + -E compare_files ${ddlfile}.txt ${ddlfile}.exp + ) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES DEPENDS H5DUMP-${resultfile}-output-cmp) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST_EXPORT_DDL file) + MACRO (ADD_H5_EXPORT_TEST resultfile targetfile resultcode) ADD_TEST ( + NAME H5DUMP-output-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${resultfile}.txt + ) + SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + ADD_TEST ( NAME H5DUMP-output-${resultfile} COMMAND $ ${ARGN} ${resultfile}.txt ${targetfile} ) SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-output-${resultfile}") + SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}-clear-objects) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-output-cmp-${resultfile} @@ -805,21 +856,18 @@ IF (BUILD_TESTING) -E compare_files ${resultfile}.txt ${resultfile}.exp ) SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-output-cmp-${resultfile}") + SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_EXPORT_TEST file) MACRO (ADD_H5_MASK_TEST resultfile resultcode) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5DUMP-clear-${resultfile}-objects + NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-clear-${resultfile}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") ADD_TEST ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -832,18 +880,18 @@ IF (BUILD_TESTING) -D "TEST_MASK_ERROR=true" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-clear-${resultfile}-objects") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_MASK_TEST file) MACRO (ADD_H5ERR_MASK_TEST resultfile resultcode) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5DUMP-clear-${resultfile}-objects + NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-clear-${resultfile}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") ADD_TEST ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -857,10 +905,40 @@ IF (BUILD_TESTING) -D "TEST_MASK_ERROR=true" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-clear-${resultfile}-objects") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5ERR_MASK_TEST file) + MACRO (ADD_H5_TEST_IMPORT conffile resultfile testfile resultcode) + # If using memchecker add tests without using scripts + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5DUMP-IMPORT-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${conffile}.out ${conffile}.out.err ${resultfile}.bin ${resultfile}.h5 + ) + SET_TESTS_PROPERTIES (H5DUMP-IMPORT-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + ADD_TEST ( + NAME H5DUMP-IMPORT-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN};-o;${resultfile}.bin;${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" + -D "TEST_OUTPUT=${conffile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${conffile}.ddl" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5DUMP-IMPORT-${resultfile} PROPERTIES DEPENDS "H5DUMP-IMPORT-${resultfile}-clear-objects") + ADD_TEST (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND h5import ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5) + SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-${resultfile}) + ADD_TEST (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND h5diff ${testfile} ${resultfile}.h5 /integer /integer) + SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-h5import-${resultfile}) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST_IMPORT file) + MACRO (ADD_H5_PBITS_TEST resultfile resultcode) # If using memchecker add tests without using scripts IF (HDF5_ENABLE_USING_MEMCHECKER) @@ -869,17 +947,17 @@ IF (BUILD_TESTING) IF (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-${resultfile}") + IF (NOT "${last_pbits_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test}) + ENDIF (NOT "${last_pbits_test}" STREQUAL "") +# SET (last_test "H5DUMP-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5DUMP-clear-${resultfile}-objects + NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-clear-${resultfile}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") ADD_TEST ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -891,7 +969,7 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-clear-${resultfile}-objects") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_PBITS_TEST file) @@ -915,17 +993,17 @@ IF (BUILD_TESTING) IF (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true") ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-XML-${resultfile}") + IF (NOT "${last_xml_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) + ENDIF (NOT "${last_xml_test}" STREQUAL "") +# SET (last_xml_test "H5DUMP-XML-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5DUMP-XML-clear-${resultfile}-objects + NAME H5DUMP-XML-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-XML-clear-${resultfile}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") + SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") ADD_TEST ( NAME H5DUMP-XML-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -937,7 +1015,7 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${resultfile}.xml" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS "H5DUMP-XML-clear-${resultfile}-objects") + SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS "H5DUMP-XML-${resultfile}-clear-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_XML_H5_TEST file) @@ -1268,26 +1346,7 @@ IF (BUILD_TESTING) ADD_H5_TEST_EXPORT (trawdatafile packedbits.h5 0 --enable-error-stack -y -o) ADD_H5_TEST_EXPORT (tnoddlfile packedbits.h5 0 --enable-error-stack -O -y -o) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5DUMP-clear-twithddlfile-export - COMMAND ${CMAKE_COMMAND} - -E remove twithddl.txt - ) - SET_TESTS_PROPERTIES (H5DUMP-clear-twithddlfile-export PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-clear-twithddlfile-export PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-clear-twithddlfile-export") - ADD_H5_TEST_EXPORT (twithddlfile packedbits.h5 0 --enable-error-stack --ddl=twithddl.txt -y -o) - ADD_TEST ( - NAME H5DUMP-output-cmp-meta-twithddlfile - COMMAND ${CMAKE_COMMAND} - -E compare_files twithddl.txt twithddl.exp - ) - SET_TESTS_PROPERTIES (H5DUMP-output-cmp-meta-twithddlfile PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-output-cmp-meta-twithddlfile PROPERTIES DEPENDS "(H5DUMP-output-cmp-twithddlfile") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_H5_TEST_EXPORT_DDL (twithddlfile packedbits.h5 0 twithddl --enable-error-stack --ddl=twithddl.txt -y -o) # test for maximum display datasets ADD_H5_TEST (twidedisplay 0 --enable-error-stack -w0 packedbits.h5) @@ -1538,110 +1597,32 @@ IF (BUILD_TESTING) ADD_H5_TEST (tvms 0 --enable-error-stack tvms.h5) # test for binary output - ADD_H5_TEST (tbin1LE 0 --enable-error-stack -d integer -o out1LE.bin -b LE tbinary.h5) + ADD_H5_TEST (tbin1LE 0 --enable-error-stack -d integer -o tbin1LE.bin -b LE tbinary.h5) # test for string binary output ADD_H5_EXPORT_TEST (tstr2bin2 tstr2.h5 0 --enable-error-stack -d /g2/dset2 -b -o) ADD_H5_EXPORT_TEST (tstr2bin6 tstr2.h5 0 --enable-error-stack -d /g6/dset6 -b -o) # NATIVE default. the NATIVE test can be validated with h5import/h5diff - ADD_TEST (NAME H5DUMP-clear-objects-tbin1 COMMAND ${CMAKE_COMMAND} -E remove out1.bin) - SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin1 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin1 PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_H5_TEST (tbin1 0 --enable-error-stack -d integer -o out1.bin -b tbinary.h5) - IF (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5DUMP-tbin1 PROPERTIES DEPENDS H5DUMP-clear-objects-tbin1) - SET (last_test "H5DUMP-tbin1") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-clear-out1D COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/std/out1D.h5) - SET_TESTS_PROPERTIES (H5DUMP-clear-out1D PROPERTIES DEPENDS H5DUMP-tbin1) - ADD_TEST (NAME H5DUMP-h5import-out1D COMMAND h5import out1.bin -c tbin1.out -o out1D.h5) - SET_TESTS_PROPERTIES (H5DUMP-h5import-out1D PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-h5import-out1D PROPERTIES DEPENDS H5DUMP-clear-out1D) - ADD_TEST (NAME H5DUMP-h5diff-out1D COMMAND h5diff tbinary.h5 out1D.h5 /integer /integer) - SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1D PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1D PROPERTIES DEPENDS H5DUMP-h5import-out1D) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - + ADD_H5_TEST_IMPORT (tbin1 out1D tbinary.h5 0 --enable-error-stack -d integer -b) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-clear-out1 COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/std/out1.h5) - SET_TESTS_PROPERTIES (H5DUMP-clear-out1 PROPERTIES DEPENDS H5DUMP-tbin1) - ADD_TEST (NAME H5DUMP-h5import-out1 COMMAND h5import out1.bin -c out3.h5import -o out1.h5) - SET_TESTS_PROPERTIES (H5DUMP-h5import-out1 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-h5import-out1 PROPERTIES DEPENDS H5DUMP-clear-out1) - ADD_TEST (NAME H5DUMP-h5diff-out1 COMMAND h5diff tbinary.h5 out1.h5 /integer /integer) - SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1 PROPERTIES DEPENDS H5DUMP-h5import-out1) + ADD_TEST (NAME H5DUMP-tbin2-bin-clear-objects COMMAND ${CMAKE_COMMAND} -E remove out2.bin) + SET_TESTS_PROPERTIES (H5DUMP-tbin2-bin-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o out2.bin tbinary.h5) + SET_TESTS_PROPERTIES (H5DUMP-tbin2 PROPERTIES DEPENDS H5DUMP-tbin2-bin-clear-objects) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-clear-objects-tbin2 COMMAND ${CMAKE_COMMAND} -E remove out2.bin) - SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin2 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin2 PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o out2.bin tbinary.h5) - IF (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5DUMP-tbin2 PROPERTIES DEPENDS H5DUMP-clear-objects-tbin2) - SET (last_test "H5DUMP-tbin2") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - # the NATIVE test can be validated with h5import/h5diff - ADD_TEST (NAME H5DUMP-clear-objects-tbin3 COMMAND ${CMAKE_COMMAND} -E remove out3.bin) - SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin3 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin3 PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_H5_TEST (tbin3 0 --enable-error-stack -d integer -o out3.bin -b NATIVE tbinary.h5) - IF (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5DUMP-tbin3 PROPERTIES DEPENDS H5DUMP-clear-objects-tbin3) - SET (last_test "H5DUMP-tbin3") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-clear-out3D COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/std/out3D.h5) - SET_TESTS_PROPERTIES (H5DUMP-clear-out3D PROPERTIES DEPENDS H5DUMP-tbin3) - ADD_TEST (NAME H5DUMP-h5import-out3D COMMAND h5import out3.bin -c tbin3.out -o out3D.h5) - SET_TESTS_PROPERTIES (H5DUMP-h5import-out3D PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-h5import-out3D PROPERTIES DEPENDS H5DUMP-clear-out3D) - ADD_TEST (NAME H5DUMP-h5diff-out3D COMMAND h5diff tbinary.h5 out3D.h5 /integer /integer -q) - SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3D PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3D PROPERTIES DEPENDS H5DUMP-h5import-out3D) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - + ADD_H5_TEST_IMPORT (tbin3 out3D tbinary.h5 0 --enable-error-stack -d integer -b NATIVE) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-clear-out3 COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/std/out3.h5) - SET_TESTS_PROPERTIES (H5DUMP-clear-out3 PROPERTIES DEPENDS H5DUMP-tbin3) - ADD_TEST (NAME H5DUMP-h5import-out3 COMMAND h5import out3.bin -c out3.h5import -o out3.h5) - SET_TESTS_PROPERTIES (H5DUMP-h5import-out3 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-h5import-out3 PROPERTIES DEPENDS H5DUMP-clear-out3) - ADD_TEST (NAME H5DUMP-h5diff-out3 COMMAND h5diff tbinary.h5 out3.h5 /integer /integer -q) - SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3 PROPERTIES DEPENDS H5DUMP-h5import-out3) + ADD_TEST (NAME H5DUMP-tbin4-bin-clear-objects COMMAND ${CMAKE_COMMAND} -E remove out4.bin) + SET_TESTS_PROPERTIES (H5DUMP-tbin4-bin-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o out4.bin tbinary.h5) + SET_TESTS_PROPERTIES (H5DUMP-tbin4 PROPERTIES DEPENDS H5DUMP-tbin4-bin-clear-objects) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-clear-objects-tbin4 COMMAND ${CMAKE_COMMAND} -E remove out4.bin) - SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin4 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin4 PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o out4.bin tbinary.h5) - IF (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5DUMP-tbin4 PROPERTIES DEPENDS H5DUMP-clear-objects-tbin4) - SET (last_test "H5DUMP-tbin4") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - # test for dataset region references ADD_H5_TEST (tdatareg 0 --enable-error-stack tdatareg.h5) ADD_H5ERR_MASK_TEST (tdataregR 0 --enable-error-stack -R tdatareg.h5) @@ -1797,10 +1778,10 @@ IF (BUILD_TESTING) tpbitsUnsignedLongLong16.out.err ) SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP_PACKED_BITS-clearall-objects") + IF (NOT "${last_pbits_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES DEPENDS ${last_pbits_test}) + ENDIF (NOT "${last_pbits_test}" STREQUAL "") + SET (last_pbits_test "H5DUMP_PACKED_BITS-clearall-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) # test failure handling @@ -2018,9 +1999,9 @@ IF (BUILD_TESTING) tvlstr.h5.out.err ) SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + IF (NOT "${last_xml_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES DEPENDS ${last_xml_test}) + ENDIF (NOT "${last_xml_test}" STREQUAL "") SET (last_test "H5DUMP-XML-clearall-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) -- cgit v0.12 From 366d72904699de02a5785e8adf30e96f7305fcb4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 13 Feb 2013 13:54:14 -0500 Subject: [svn-r23264] Remove tests from valgrind processing --- tools/h5dump/CMakeLists.txt | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 19b1420..1a8c7cb 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -837,20 +837,20 @@ IF (BUILD_TESTING) ENDMACRO (ADD_H5_TEST_EXPORT_DDL file) MACRO (ADD_H5_EXPORT_TEST resultfile targetfile resultcode) - ADD_TEST ( - NAME H5DUMP-output-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.txt - ) - SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( - NAME H5DUMP-output-${resultfile} - COMMAND $ ${ARGN} ${resultfile}.txt ${targetfile} - ) - SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}-clear-objects) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( + NAME H5DUMP-output-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${resultfile}.txt + ) + SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + ADD_TEST ( + NAME H5DUMP-output-${resultfile} + COMMAND $ ${ARGN} ${resultfile}.txt ${targetfile} + ) + SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}-clear-objects) + ADD_TEST ( NAME H5DUMP-output-cmp-${resultfile} COMMAND ${CMAKE_COMMAND} -E compare_files ${resultfile}.txt ${resultfile}.exp @@ -1095,6 +1095,8 @@ IF (BUILD_TESTING) tattrreg.out.err tattrregR.out tattrregR.out.err + tbin1LE.bin + tbinregR.txt tbinregR.out tbinregR.out.err tbigdims.out @@ -1229,7 +1231,7 @@ IF (BUILD_TESTING) tnoddlfile.out.err trawdatafile.out trawdatafile.out.err - twithddlfile.txt + trawdatafile.txt tno-subset.out tno-subset.out.err tnullspace.out -- cgit v0.12 From a6b09480ff95560f583f007690b0977e001cefc2 Mon Sep 17 00:00:00 2001 From: Frank Baker Date: Wed, 13 Feb 2013 17:13:00 -0500 Subject: [svn-r23267] Description: Update copyright to 2013. Tested: Firefox --- COPYING | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/COPYING b/COPYING index 9e816c8..25e79e7 100644 --- a/COPYING +++ b/COPYING @@ -4,7 +4,7 @@ HDF5 (Hierarchical Data Format 5) Software Library and Utilities ----------------------------------------------------------------------------- HDF5 (Hierarchical Data Format 5) Software Library and Utilities -Copyright 2006-2012 by The HDF Group. +Copyright 2006-2013 by The HDF Group. NCSA HDF5 (Hierarchical Data Format 5) Software Library and Utilities Copyright 1998-2006 by the Board of Trustees of the University of Illinois. -- cgit v0.12 From b9edfdfa25adffc1c7ce949f63600770598f2bdc Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 14 Feb 2013 11:35:56 -0500 Subject: [svn-r23269] HDFFV-8311: Correct test dependency Tested: local linux --- tools/h5import/CMakeLists.txt | 235 +++++++++++++++++++++++++++++++++--------- 1 file changed, 185 insertions(+), 50 deletions(-) diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index 1f0b3ad..ec442fc 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -128,28 +128,29 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## MACRO (ADD_H5_TEST testname importfile conffile testfile) - ADD_TEST ( - NAME H5IMPORT-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${testfile} - ${testfile}.new - ${testfile}.new.err - ${testfile}.out - ${testfile}.out.err - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + # If using memchecker skip macro based tests + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5IMPORT-${testname} COMMAND $ ${importfile} -c ${conffile} -o ${testfile}) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5IMPORT-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${testfile} + ${testfile}.new + ${testfile}.new.err + ${testfile}.out + ${testfile}.out.err + ) - ADD_TEST (NAME H5IMPORT-${testname} COMMAND $ ${importfile} -c ${conffile} -o ${testfile}) - SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}-clear-objects) - SET (last_test "H5IMPORT-${testname}") + ADD_TEST (NAME H5IMPORT-${testname} COMMAND $ ${importfile} -c ${conffile} -o ${testfile}) + SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}-clear-objects) - # If using memchecker add tests without using scripts - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5IMPORT-H5DMP-${testname} + NAME H5IMPORT-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=${testfile}" @@ -160,9 +161,9 @@ IF (BUILD_TESTING) -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-H5DMP-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}) + SET_TESTS_PROPERTIES (H5IMPORT-${testname}-H5DMP PROPERTIES DEPENDS H5IMPORT-${testname}) ADD_TEST ( - NAME H5IMPORT-H5DMP_CMP-${testname} + NAME H5IMPORT-${testname}-H5DMP_CMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=testfiles/${testfile}" @@ -173,13 +174,12 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${testfile}.new" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-H5DMP_CMP-${testname} PROPERTIES DEPENDS H5IMPORT-H5DMP-${testname}) - SET (last_test "H5IMPORT-H5DMP_CMP-${testname}") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST testname importfile conffile testfile) MACRO (ADD_H5_DUMPTEST testname datasetname testfile) - # If using memchecker add tests without using scripts + # If using memchecker skip tests IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5IMPORT-DUMP-${testname}-clear-objects @@ -194,9 +194,6 @@ IF (BUILD_TESTING) d${testfile}.dff d${testfile}.dff.err ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") IF ("${ARGN}" STREQUAL "BINARY") ADD_TEST ( @@ -251,12 +248,6 @@ IF (BUILD_TESTING) -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DIFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}") - SET (last_test "H5IMPORT-DUMP-${testname}-H5DIFF") - ELSE (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5IMPORT-DUMP-${testname}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname} ${datasetname} ${testfile}" - ) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_DUMPTEST testname datasetname testfile) @@ -282,27 +273,171 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5IMPORT-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - binfp64.bin - binin8.bin - binin8w.bin - binin16.bin - binin32.bin - binuin16.bin - binuin32.bin - ${HDF5_REFERENCE_TEST_FILES} - ) - SET (last_test "H5IMPORT-clear-objects") + IF (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5IMPORT-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + binfp64.bin + binin8.bin + binin8w.bin + binin16.bin + binin32.bin + binuin16.bin + binuin32.bin + txtin32.h5 + txtin32.h5.new + txtin32.h5.new.err + txtin32.h5.out + txtin32.h5.out.err + txtin16.h5 + txtin16.h5.new + txtin16.h5.new.err + txtin16.h5.out + txtin16.h5.out.err + txtin8.h5 + txtin8.h5.new + txtin8.h5.new.err + txtin8.h5.out + txtin8.h5.out.err + txtuin16.h5 + txtuin16.h5.new + txtuin16.h5.new.err + txtuin16.h5.out + txtuin16.h5.out.err + txtuin32.h5 + txtuin32.h5.new + txtuin32.h5.new.err + txtuin32.h5.out + txtuin32.h5.out.err + txtfp32.h5 + txtfp32.h5.new + txtfp32.h5.new.err + txtfp32.h5.out + txtfp32.h5.out.err + txtfp64.h5 + txtfp64.h5.new + txtfp64.h5.new.err + txtfp64.h5.out + txtfp64.h5.out.err + binfp64.h5 + binfp64.h5.new + binfp64.h5.new.err + binfp64.h5.out + binfp64.h5.out.err + binin8.h5 + binin8.h5.new + binin8.h5.new.err + binin8.h5.out + binin8.h5.out.err + binin8w.h5 + binin8w.h5.new + binin8w.h5.new.err + binin8w.h5.out + binin8w.h5.out.err + binin16.h5 + binin16.h5.new + binin16.h5.new.err + binin16.h5.out + binin16.h5.out.err + binin32.h5 + binin32.h5.new + binin32.h5.new.err + binin32.h5.out + binin32.h5.out.err + binuin16.h5 + binuin16.h5.new + binuin16.h5.new.err + binuin16.h5.out + binuin16.h5.out.err + binuin32.h5 + binuin32.h5.new + binuin32.h5.new.err + binuin32.h5.out + binuin32.h5.out.err + txtstr.h5 + txtstr.h5.new + txtstr.h5.new.err + txtstr.h5.out + txtstr.h5.out.err + textpfe.h5 + textpfe.h5.new + textpfe.h5.new.err + textpfe.h5.out + textpfe.h5.out.err + dbinfp64.h5 + dbinfp64.h5.bin + dbinfp64.h5.imp + dbinfp64.h5.imp.err + dbinfp64.h5.dmp + dbinfp64.h5.dmp.err + dbinfp64.h5.dff + dbinfp64.h5.dff.err + dbinin8.h5 + dbinin8.h5.bin + dbinin8.h5.imp + dbinin8.h5.imp.err + dbinin8.h5.dmp + dbinin8.h5.dmp.err + dbinin8.h5.dff + dbinin8.h5.dff.err + dbinin8w.h5 + dbinin8w.h5.bin + dbinin8w.h5.imp + dbinin8w.h5.imp.err + dbinin8w.h5.dmp + dbinin8w.h5.dmp.err + dbinin8w.h5.dff + dbinin8w.h5.dff.err + dbinin16.h5 + dbinin16.h5.bin + dbinin16.h5.imp + dbinin16.h5.imp.err + dbinin16.h5.dmp + dbinin16.h5.dmp.err + dbinin16.h5.dff + dbinin16.h5.dff.err + dbinin32.h5 + dbinin32.h5.bin + dbinin32.h5.imp + dbinin32.h5.imp.err + dbinin32.h5.dmp + dbinin32.h5.dmp.err + dbinin32.h5.dff + dbinin32.h5.dff.err + dbinuin16.h5 + dbinuin16.h5.bin + dbinuin16.h5.imp + dbinuin16.h5.imp.err + dbinuin16.h5.dmp + dbinuin16.h5.dmp.err + dbinuin16.h5.dff + dbinuin16.h5.dff.err + dbinuin32.h5 + dbinuin32.h5.bin + dbinuin32.h5.imp + dbinuin32.h5.imp.err + dbinuin32.h5.dmp + dbinuin32.h5.dmp.err + dbinuin32.h5.dff + dbinuin32.h5.dff.err + dtxtstr.h5 + dtxtstr.h5.bin + dtxtstr.h5.imp + dtxtstr.h5.imp.err + dtxtstr.h5.dmp + dtxtstr.h5.dmp.err + dtxtstr.h5.dff + dtxtstr.h5.dff.err + ) + SET (last_test "H5IMPORT-clear-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5IMPORT-h5importtest COMMAND $) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5IMPORT-h5importtest PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5IMPORT-h5importtest") # ----- TESTING "ASCII I32 rank 3 - Output BE " ; ADD_H5_TEST (ASCII_I32 testfiles/txtin32.txt testfiles/txtin32.conf txtin32.h5) -- cgit v0.12 From 115a5b36ddb95ceafec4a8c38c054eb3bbf7469d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 14 Feb 2013 11:37:37 -0500 Subject: [svn-r23270] Cleanup old test comments --- tools/h5dump/CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 1a8c7cb..3f39ae3 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -724,7 +724,6 @@ IF (BUILD_TESTING) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") -# SET (last_test "H5DUMP-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-${resultfile}-clear-objects @@ -758,7 +757,6 @@ IF (BUILD_TESTING) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") -# SET (last_test "H5DUMP-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-${resultfile}-clear-objects @@ -799,7 +797,6 @@ IF (BUILD_TESTING) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") -# SET (last_test "H5DUMP-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-${resultfile}-clear-objects @@ -950,7 +947,6 @@ IF (BUILD_TESTING) IF (NOT "${last_pbits_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test}) ENDIF (NOT "${last_pbits_test}" STREQUAL "") -# SET (last_test "H5DUMP-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-${resultfile}-clear-objects @@ -996,7 +992,6 @@ IF (BUILD_TESTING) IF (NOT "${last_xml_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) ENDIF (NOT "${last_xml_test}" STREQUAL "") -# SET (last_xml_test "H5DUMP-XML-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-XML-${resultfile}-clear-objects -- cgit v0.12 From 7feda84aeb7c8e7a8c1d10ee7f7d286ddc287510 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 14 Feb 2013 13:10:24 -0500 Subject: [svn-r23271] HDFFV-8311: Correct test dependency Tested: local linux --- tools/h5copy/CMakeLists.txt | 465 ++++++++++++++++---------------- tools/h5copy/testfiles/h5copy_misc1.out | 2 +- 2 files changed, 237 insertions(+), 230 deletions(-) diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index cfe9186..b18e704 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -62,20 +62,6 @@ IF (BUILD_TESTING) ARGS -E copy_if_different ${listfiles} ${dest} ) ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) - - # - # This section can be removed, but leave here for a reference later. - # Purpose: '-l3' ignores top 3 lines when copy text file. - # - #FOREACH (listfiles ${LIST_OTHER_TEST_FILES}) - # SET (lsdest "${PROJECT_BINARY_DIR}/testfiles/${listfiles}") - # ADD_CUSTOM_COMMAND ( - # TARGET h5copy - # POST_BUILD - # COMMAND ${XLATE_UTILITY} - # ARGS ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/${listfiles} ${lsdest} -l3 - # ) - #ENDFOREACH (listfiles ${LIST_OTHER_TEST_FILES}) ############################################################################## ############################################################################## @@ -86,177 +72,225 @@ IF (BUILD_TESTING) # # Perform h5copy according to passing parmeters # - MACRO (ADD_H5_F_TEST testname resultcode infile outfile fparam vparam sparam srcname dparam dstname) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY_F-clear-objects-${testname} - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${outfile} - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY_F-clear-objects-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + MACRO (ADD_H5_F_TEST testname resultcode infile fparam vparam sparam srcname dparam dstname) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY_F-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${testname}.out.h5 + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( NAME H5COPY_F-${testname} - COMMAND $ -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + COMMAND $ -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS H5COPY_F-clear-objects-${testname}) - SET (last_test "H5COPY_F-${testname}") - ADD_H5_DIFF_TEST (${testname} ${resultcode} ${last_test} ${infile} ${outfile} ${srcname} ${dstname}) + IF (HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS H5COPY_F-${testname-clear-objects}) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + + # resultcode=2 will cause the test to skip the diff test + IF (NOT ${resultcode} STREQUAL "2") + ADD_TEST ( + NAME H5COPY_F-${testname}-DIFF + COMMAND $ -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + ) + SET_TESTS_PROPERTIES(H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) + IF (${resultcode} STREQUAL "1") + SET_TESTS_PROPERTIES (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") + ENDIF (${resultcode} STREQUAL "1") + ENDIF (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_F_TEST) - MACRO (ADD_H5_TEST testname resultcode infile outfile vparam sparam srcname dparam dstname) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY-clear-objects-${testname} - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${outfile} - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-clear-objects-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + MACRO (ADD_H5_TEST testname resultcode infile vparam sparam srcname dparam dstname) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${testname}.out.h5 + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( NAME H5COPY-${testname} - COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-clear-objects-${testname}) - SET (last_test "H5COPY-${testname}") - ADD_H5_DIFF_TEST (${testname} ${resultcode} ${last_test} ${infile} ${outfile} ${srcname} ${dstname}) + IF (HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + + # resultcode=2 will cause the test to skip the diff test + IF (NOT ${resultcode} STREQUAL "2") + ADD_TEST ( + NAME H5COPY-${testname}-DIFF + COMMAND $ -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + ) + SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) + IF (${resultcode} STREQUAL "1") + SET_TESTS_PROPERTIES (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") + ENDIF (${resultcode} STREQUAL "1") + ENDIF (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_TEST) - MACRO (ADD_H5_TEST2 testname resultcode infile outfile psparam pdparam vparam sparam srcname dparam dstname) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY-clear-objects-${testname} - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${outfile} - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-clear-objects-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + MACRO (ADD_H5_TEST2 testname resultcode infile psparam pdparam vparam sparam srcname dparam dstname) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${testname}.out.h5 + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( NAME H5COPY-${testname}-prefill - COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${outfile} -v -s ${psparam} -d ${pdparam} + COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) - SET_TESTS_PROPERTIES (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-clear-objects-${testname}) + IF (HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY-${testname}-prefill PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( NAME H5COPY-${testname} - COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill) - SET (last_test "H5COPY-${testname}") - ADD_H5_DIFF_TEST (${testname} ${resultcode} ${last_test} ${infile} ${outfile} ${srcname} ${dstname}) + # resultcode=2 will cause the test to skip the diff test + IF (NOT ${resultcode} STREQUAL "2") + ADD_TEST ( + NAME H5COPY-${testname}-DIFF + COMMAND $ -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + ) + SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) + IF (${resultcode} STREQUAL "1") + SET_TESTS_PROPERTIES (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") + ENDIF (${resultcode} STREQUAL "1") + ENDIF (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_TEST2) - MACRO (ADD_H5_TEST3 testname resultcode infile outfile pfile psparam pdparam vparam sparam srcname dparam dstname) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY-clear-objects-${testname} - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${outfile} - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-clear-objects-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + MACRO (ADD_H5_TEST_SAME testname resultcode pfile psparam pdparam vparam sparam srcname dparam dstname) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY_SAME-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${testname}.out.h5 + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( - NAME H5COPY-${testname}-prefill - COMMAND $ -i ./testfiles/${pfile} -o ./testfiles/${infile} -v -s ${psparam} -d ${pdparam} + NAME H5COPY_SAME-${testname}-prefill + COMMAND $ -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) - SET_TESTS_PROPERTIES (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-clear-objects-${testname}) + IF (HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS H5COPY_SAME-${testname}-clear-objects) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( - NAME H5COPY-${testname} - COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + NAME H5COPY_SAME-${testname} + COMMAND $ -i ./testfiles/${testname}.out.h5 -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill) - SET (last_test "H5COPY-${testname}") - ADD_H5_DIFF_TEST (${testname} ${resultcode} ${last_test} ${infile} ${outfile} ${srcname} ${dstname}) - ENDMACRO (ADD_H5_TEST3) - - MACRO (ADD_H5_DIFF_TEST testname resultcode testdepends infile outfile srcname dstname) + SET_TESTS_PROPERTIES (H5COPY_SAME-${testname} PROPERTIES DEPENDS H5COPY_SAME-${testname}-prefill) # resultcode=2 will cause the test to skip the diff test IF (NOT ${resultcode} STREQUAL "2") ADD_TEST ( - NAME H5COPY-DIFF-${testname} - COMMAND $ -q ./testfiles/${infile} ./testfiles/${outfile} ${srcname} ${dstname} + NAME H5COPY_SAME-${testname}-DIFF + COMMAND $ -q ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) - SET_TESTS_PROPERTIES(H5COPY-DIFF-${testname} PROPERTIES DEPENDS ${testdepends}) - SET (last_test "H5COPY-DIFF-${testname}") + SET_TESTS_PROPERTIES(H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5COPY-DIFF-${testname} PROPERTIES WILL_FAIL "true") + SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") ENDIF (${resultcode} STREQUAL "1") ENDIF (NOT ${resultcode} STREQUAL "2") - ENDMACRO (ADD_H5_DIFF_TEST) + ENDMACRO (ADD_H5_TEST_SAME) # # Test result with h5ls # - MACRO (ADD_H5LS_TEST file filetest) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY-h5ls-clear-objects-${file}-${filetest} - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${file}.out.h5 - ./testfiles/${file}.out.out - ./testfiles/${file}.out.out.err - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-h5ls-clear-objects-${file}-${filetest} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + MACRO (ADD_H5LS_TEST infile filetest) # If using memchecker add tests without using scripts IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5COPY-h5ls-${file}-${filetest} COMMAND $ -Svr ./testfiles/${file}.out.h5) + ADD_TEST (NAME H5COPY-h5ls-${infile}-${filetest} COMMAND $ -Svr ./testfiles/${filetest}.out.h5) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY-h5ls-${infile}-${filetest} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") ELSE (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-h5ls-${infile}-${filetest}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${filetest}.out.h5 + ./testfiles/${filetest}.out.out + ./testfiles/${filetest}.out.out.err + ) ADD_TEST ( NAME H5COPY-h5ls-${file}-${filetest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" - -D "TEST_ARGS=-Svr;./testfiles/${file}.out.h5" + -D "TEST_ARGS=-Svr;./testfiles/${filetest}.out.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${file}.out.out" + -D "TEST_OUTPUT=./testfiles/${filetest}.out.out" -D "TEST_EXPECT=0" - -D "TEST_REFERENCE=./testfiles/${file}.out.ls" + -D "TEST_REFERENCE=./testfiles/${infile}.out.ls" -D "TEST_MASK=true" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) + SET_TESTS_PROPERTIES (H5COPY-h5ls-${infile}-${filetest} PROPERTIES DEPENDS H5COPY-h5ls-${infile}-${filetest}-clear-objects) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5COPY-h5ls-${file}-${filetest} PROPERTIES DEPENDS H5COPY-h5ls-clear-objects-${file}-${filetest}) - SET (last_test "H5COPY-h5ls-${file}-${filetest}") ENDMACRO (ADD_H5LS_TEST) # # Similiar to ADD_H5_TEST macro. Compare to outputs from source & target # files instead of checking with h5ls. # - MACRO (ADD_H5_CMP_TEST testname resultcode infile outfile vparam sparam srcname dparam dstname) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY-CMP-clear-objects-${testname} - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${outfile} - ./testfiles/${testname}.out.out - ./testfiles/${testname}.out.out.err - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-CMP-clear-objects-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + MACRO (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname) # If using memchecker add tests without using scripts IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5COPY-CMP-${testname} COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) + ADD_TEST (NAME H5COPY-CMP-${testname} COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) IF (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") ENDIF (${resultcode} STREQUAL "1") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") ELSE (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-CMP-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${testname}.out.h5 + ./testfiles/${testname}.out.out + ./testfiles/${testname}.out.out.err + ) ADD_TEST ( NAME H5COPY-CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" - -D "TEST_ARGS=-i;./testfiles/${infile};-o;./testfiles/${outfile};${vparam};${sparam};${srcname};${dparam};${dstname}" + -D "TEST_ARGS=-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${vparam};${sparam};${srcname};${dparam};${dstname}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=./testfiles/${testname}.out.out" -D "TEST_EXPECT=${resultcode}" @@ -264,11 +298,8 @@ IF (BUILD_TESTING) -D "TEST_MASK=true" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) + SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-CMP-${testname}") ENDMACRO (ADD_H5_CMP_TEST) ############################################################################## @@ -285,61 +316,89 @@ IF (BUILD_TESTING) SET (HDF_EXT_SRC_FILE h5copy_extlinks_src) SET (HDF_EXT_TRG_FILE h5copy_extlinks_trg) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${HDF_FILE1}.out.h5 - ./testfiles/${HDF_FILE1}.out.out - ./testfiles/${HDF_FILE1}.out.out.err - ./testfiles/${HDF_FILE2}.out.h5 - ./testfiles/${HDF_FILE2}.out.out - ./testfiles/${HDF_FILE2}.out.out.err - ./testfiles/${HDF_EXT_SRC_FILE}.out.h5 - ./testfiles/${HDF_EXT_SRC_FILE}.out.out - ./testfiles/${HDF_EXT_SRC_FILE}.out.out.err - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-clearall-objects") + IF (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + simple.out.h5 + chunk.out.h5 + compact.out.h5 + compound.out.h5 + compressed.out.h5 + named_vl.out.h5 + nested_vl.out.h5 + simple_top.out.h5 + dsrename.out.h5 + grp_empty.out.h5 + grp_dsets.out.h5 + grp_nested.out.h5 + simple_group.out.h5 + grp_rename.out.h5 + grp_dsets_rename.out.h5 + A_B1_simple.out.h5 + A_B2_simple2.out.h5 + C_D_simple.out.h5 + E_F_grp_dsets.out.h5 + G_H_grp_nested.out.h5 + region_ref.out.h5 + ext_link.out.h5 + ext_link_f.out.h5 + ext_dangle_noobj.out.h5 + ext_dangle_noobj_f.out.h5 + ext_dangle_nofile.out.h5 + ext_dangle_nofile_f.out.h5 + ext_link_group.out.h5 + ext_link_group_f.out.h5 + samefile1.out.h5 + samefile2.out.h5 + h5copy_misc1.out.h5 + h5copy_misc1.out.out + h5copy_misc1.out.out.err + ) + SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5COPY-clearall-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) # "Test copying various forms of datasets" - ADD_H5_TEST (simple 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s simple -d simple) - ADD_H5_TEST (chunk 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s chunk -d chunk) - ADD_H5_TEST (compact 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s compact -d compact) - ADD_H5_TEST (compound 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s compound -d compound) - ADD_H5_TEST (compressed 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s compressed -d compressed) - ADD_H5_TEST (named_vl 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s named_vl -d named_vl) - ADD_H5_TEST (nested_vl 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s nested_vl -d nested_vl) + ADD_H5_TEST (simple 0 ${HDF_FILE1}.h5 -v -s simple -d simple) + ADD_H5_TEST (chunk 0 ${HDF_FILE1}.h5 -v -s chunk -d chunk) + ADD_H5_TEST (compact 0 ${HDF_FILE1}.h5 -v -s compact -d compact) + ADD_H5_TEST (compound 0 ${HDF_FILE1}.h5 -v -s compound -d compound) + ADD_H5_TEST (compressed 0 ${HDF_FILE1}.h5 -v -s compressed -d compressed) + ADD_H5_TEST (named_vl 0 ${HDF_FILE1}.h5 -v -s named_vl -d named_vl) + ADD_H5_TEST (nested_vl 0 ${HDF_FILE1}.h5 -v -s nested_vl -d nested_vl) # "Test copying dataset within group in source file to root of destination" - ADD_H5_TEST (simple_top 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_dsets/simple -d simple_top) + ADD_H5_TEST (simple_top 0 ${HDF_FILE1}.h5 -v -s grp_dsets/simple -d simple_top) # "Test copying & renaming dataset" - ADD_H5_TEST (rename 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s compound -d rename) + ADD_H5_TEST (dsrename 0 ${HDF_FILE1}.h5 -v -s compound -d rename) # "Test copying empty, 'full' & 'nested' groups" - ADD_H5_TEST (grp_empty 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_empty -d grp_empty) - ADD_H5_TEST (grp_dsets 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_dsets -d grp_dsets) - ADD_H5_TEST (grp_nested 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_nested -d grp_nested) + ADD_H5_TEST (grp_empty 0 ${HDF_FILE1}.h5 -v -s grp_empty -d grp_empty) + ADD_H5_TEST (grp_dsets 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) + ADD_H5_TEST (grp_nested 0 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) # "Test copying dataset within group in source file to group in destination" - ADD_H5_TEST2 (simple_group 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 grp_dsets grp_dsets -v -s /grp_dsets/simple -d /grp_dsets/simple_group) + ADD_H5_TEST2 (simple_group 0 ${HDF_FILE1}.h5 grp_dsets grp_dsets -v -s /grp_dsets/simple -d /grp_dsets/simple_group) # "Test copying & renaming group" - ADD_H5_TEST (grp_rename 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_dsets -d grp_rename) + ADD_H5_TEST (grp_rename 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) # "Test copying 'full' group hierarchy into group in destination file" - ADD_H5_TEST2 (grp_dsets_rename 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) + ADD_H5_TEST2 (grp_dsets_rename 0 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) # "Test copying objects into group hier. that doesn't exist yet in destination file" - ADD_H5_TEST (A_B1_simple 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s simple -d /A/B1/simple) - ADD_H5_TEST (A_B2_simple2 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s simple -d /A/B2/simple2) - ADD_H5_TEST (C_D_simple 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s /grp_dsets/simple -d /C/D/simple) - ADD_H5_TEST (E_F_grp_dsets 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) - ADD_H5_TEST (G_H_grp_nested 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s /grp_nested -d /G/H/grp_nested) + ADD_H5_TEST (A_B1_simple 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B1/simple) + ADD_H5_TEST (A_B2_simple2 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B2/simple2) + ADD_H5_TEST (C_D_simple 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets/simple -d /C/D/simple) + ADD_H5_TEST (E_F_grp_dsets 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) + ADD_H5_TEST (G_H_grp_nested 0 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) # Verify that the file created above is correct # This test is not independent of the above tests @@ -347,22 +406,8 @@ IF (BUILD_TESTING) ############# COPY REFERENCES ############## - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY-clear-refs - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${HDF_FILE2}.out.h5 - ./testfiles/${HDF_FILE2}.out.out - ./testfiles/${HDF_FILE2}.out.out.err - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-clear-refs PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-clear-refs") - # "Test copying object and region references" - ADD_H5_F_TEST (region_ref 2 ${HDF_FILE2}.h5 ${HDF_FILE2}.out.h5 ref -v -s / -d /COPY) + ADD_H5_F_TEST (region_ref 2 ${HDF_FILE2}.h5 ref -v -s / -d /COPY) # Verify that the file created above is correct # This test is not independent of the above tests @@ -370,86 +415,48 @@ IF (BUILD_TESTING) ############# COPY EXT LINKS ############## - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY-clear-ext-links - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${HDF_EXT_SRC_FILE}.out.h5 - ./testfiles/${HDF_EXT_SRC_FILE}.out.out - ./testfiles/${HDF_EXT_SRC_FILE}.out.out.err - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-clear-ext-links PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-clear-ext-links") - # "Test copying external link directly without -f ext" - ADD_H5_TEST (ext_link 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 -v -s /group_ext/extlink_dset -d /copy1_dset) + ADD_H5_TEST (ext_link 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_dset -d /copy1_dset) # "Test copying external link directly with -f ext" - ADD_H5_F_TEST (ext_link_f 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 ext -v -s /group_ext/extlink_dset -d /copy2_dset) + ADD_H5_F_TEST (ext_link_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_dset -d /copy2_dset) # "Test copying dangling external link (no obj) directly without -f ext" - ADD_H5_TEST (ext_dangle_noobj 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_1) + ADD_H5_TEST (ext_dangle_noobj 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_1) # "Test copying dangling external link (no obj) directly with -f ext" - ADD_H5_F_TEST (ext_dangle_noobj_f 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 ext -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2) + ADD_H5_F_TEST (ext_dangle_noobj_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2) # "Test copying dangling external link (no file) directly without -f ext" - ADD_H5_TEST (ext_dangle_nofile 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_1) + ADD_H5_TEST (ext_dangle_nofile 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_1) # "Test copying dangling external link (no file) directly with -f ext" - ADD_H5_F_TEST (ext_dangle_nofile_f 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 ext -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2) + ADD_H5_F_TEST (ext_dangle_nofile_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2) # "Test copying a group contains external links without -f ext" - ADD_H5_TEST (ext_link_group 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 -v -s /group_ext -d /copy1_group) + ADD_H5_TEST (ext_link_group 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext -d /copy1_group) # "Test copying a group contains external links with -f ext" - ADD_H5_F_TEST (ext_link_group_f 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 ext -v -s /group_ext -d /copy2_group) + ADD_H5_F_TEST (ext_link_group_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext -d /copy2_group) # Verify that the file created above is correct # This test is not independent of the above tests #ADD_H5LS_TEST (${HDF_EXT_SRC_FILE} links) ############# Test misc. ############## - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY-clear-misc - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/h5copy_misc1.out.out - ./testfiles/h5copy_misc1.out.out.err - ./testfiles/${HDF_FILE1}.out.h5 - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-clear-misc PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-clear-misc") #----------------------------------------------------------------- # "Test copying object into group which doesn't exist, without -p" # - ADD_H5_CMP_TEST (h5copy_misc1 1 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s /simple -d /g1/g2/simple) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY-clear-samefile - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${HDF_FILE1}.out.h5 - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-clear-samefile PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-clear-samefile") + ADD_H5_CMP_TEST (h5copy_misc1 1 ${HDF_FILE1}.h5 -v -s /simple -d /g1/g2/simple) #------------------------------------------- # "Test copying objects to the same file " # # - dataset - ADD_H5_TEST3 (samefile1 0 ${HDF_FILE1}.out.h5 ${HDF_FILE1}.out.h5 ${HDF_FILE1}.h5 /simple /simple -v -s /simple -d /simple_cp) + ADD_H5_TEST_SAME (samefile1 0 ${HDF_FILE1}.h5 /simple /simple -v -s /simple -d /simple_cp) # - group with some datasets - ADD_H5_TEST3 (samefile2 0 ${HDF_FILE1}.out.h5 ${HDF_FILE1}.out.h5 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) + ADD_H5_TEST_SAME (samefile2 0 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) ENDIF (BUILD_TESTING) ############################################################################## diff --git a/tools/h5copy/testfiles/h5copy_misc1.out b/tools/h5copy/testfiles/h5copy_misc1.out index 10dd1a6..1624f2b 100644 --- a/tools/h5copy/testfiles/h5copy_misc1.out +++ b/tools/h5copy/testfiles/h5copy_misc1.out @@ -1,3 +1,3 @@ -Copying file <./testfiles/h5copytst.h5> and object to file <./testfiles/h5copytst.out.h5> and object +Copying file <./testfiles/h5copytst.h5> and object to file <./testfiles/h5copy_misc1.out.h5> and object Error in copy...Exiting h5copy error: group doesn't exist. Use -p to create parent groups. -- cgit v0.12 From 90f4f156174b2a6c6f77bd5ce906d36e5b1f0729 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 14 Feb 2013 13:16:43 -0500 Subject: [svn-r23272] Correct typos --- tools/h5copy/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index b18e704..60e940a 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -73,7 +73,7 @@ IF (BUILD_TESTING) # Perform h5copy according to passing parmeters # MACRO (ADD_H5_F_TEST testname resultcode infile fparam vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5COPY_F-${testname}-clear-objects @@ -92,7 +92,7 @@ IF (BUILD_TESTING) SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") ELSE (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS H5COPY_F-${testname-clear-objects}) + SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS H5COPY_F-${testname}-clear-objects) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) # resultcode=2 will cause the test to skip the diff test -- cgit v0.12 From 06e935bae9255a6a71a962d6437437071e7b5f05 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 14 Feb 2013 13:37:02 -0500 Subject: [svn-r23273] HDFFV-8311: Correct test dependency Tested: local linux --- tools/h5diff/CMakeLists.txt | 26 +++++++++++++------------- tools/h5import/CMakeLists.txt | 12 ++++++------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index 87eca15..a8fed57 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -344,10 +344,9 @@ IF (BUILD_TESTING) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DIFF-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5DIFF-clear-${resultfile}-objects + NAME H5DIFF-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${resultfile}.out ./testfiles/${resultfile}.out.err ) @@ -363,7 +362,7 @@ IF (BUILD_TESTING) -D "TEST_APPEND=EXIT CODE:" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS "H5DIFF-clear-${resultfile}-objects") + SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS "H5DIFF-${resultfile}-clear-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) IF (H5_HAVE_PARALLEL) ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN}) @@ -381,10 +380,9 @@ IF (BUILD_TESTING) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "PH5DIFF-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME PH5DIFF-clear-${resultfile}-objects + NAME PH5DIFF-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${resultfile}_p.out ./testfiles/${resultfile}_p.out.err ) @@ -402,7 +400,7 @@ IF (BUILD_TESTING) -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/prunTest.cmake" ) - SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS "PH5DIFF-clear-${resultfile}-objects") + SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS "PH5DIFF-${resultfile}-clear-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_PH5_TEST file) @@ -413,15 +411,14 @@ IF (BUILD_TESTING) # If using memchecker add tests without using scripts IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5DIFF-clear-${testname}-objects + NAME H5DIFF-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out ./testfiles/${testname}.out.err ) # if there was a previous test IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DIFF-clear-${testname}-objects PROPERTIES DEPENDS ${last_test}) + SET_TESTS_PROPERTIES (H5DIFF-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DIFF-clear-${testname}-objects") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DIFF-${testname} COMMAND $ ${ARGN}) @@ -429,10 +426,13 @@ IF (BUILD_TESTING) SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES WILL_FAIL "true") ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DIFF-${testname}") + IF (HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES DEPENDS H5DIFF-${testname}-clear-objects) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_NO_OUTPUT_TEST) ############################################################################## diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index ec442fc..97f7be9 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -197,7 +197,7 @@ IF (BUILD_TESTING) IF ("${ARGN}" STREQUAL "BINARY") ADD_TEST ( - NAME H5IMPORT-DUMP-${testname}-H5DUMP + NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-b;testfiles/${testfile}" @@ -209,7 +209,7 @@ IF (BUILD_TESTING) ) ELSE ("${ARGN}" STREQUAL "BINARY") ADD_TEST ( - NAME H5IMPORT-DUMP-${testname}-H5DUMP + NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-y;--width=1;testfiles/${testfile}" @@ -220,7 +220,7 @@ IF (BUILD_TESTING) -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) ENDIF ("${ARGN}" STREQUAL "BINARY") - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DUMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects") + SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects") ADD_TEST ( NAME H5IMPORT-DUMP-${testname} @@ -233,10 +233,10 @@ IF (BUILD_TESTING) -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname} PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-H5DUMP") + SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname} PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-H5DMP") ADD_TEST ( - NAME H5IMPORT-DUMP-${testname}-H5DIFF + NAME H5IMPORT-DUMP-${testname}-H5DFF COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=-v;d${testfile};testfiles/${testfile};${datasetname};${datasetname}" @@ -247,7 +247,7 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=testfiles/d${testfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DIFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}") + SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_DUMPTEST testname datasetname testfile) -- cgit v0.12 From 0336d9cdb4a8cb24b8e764f5d509aa33847b9ca2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 14 Feb 2013 13:37:52 -0500 Subject: [svn-r23274] HDFFV-8311: Correct test dependency Tested: local linux --- config/cmake/CTestCustom.cmake | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 871caeb..f09e12d 100755 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -38,9 +38,6 @@ SET (CTEST_CUSTOM_MEMCHECK_IGNORE hl_test-clear-objects hl_fortran_test-clear-objects ######### tools/h5copy ######### - H5COPY-clear-refs - H5COPY-clear-ext-links - H5COPY-clear-misc H5COPY-clearall-objects ######### tools/h5diff ######### H5DIFF-clearall-objects @@ -56,22 +53,7 @@ SET (CTEST_CUSTOM_MEMCHECK_IGNORE H5DUMP_PACKED_BITS-clearall-objects H5DUMP-XML-clearall-objects ######### tools/h5import ######### - H5IMPORT-ASCII_I32-clear-objects - H5IMPORT-ASCII_I16-clear-objects - H5IMPORT-ASCII_I8-clear-objects - H5IMPORT-ASCII_UI16-clear-objects - H5IMPORT-ASCII_UI32-clear-objects - H5IMPORT-ASCII_F32-clear-objects - H5IMPORT-ASCII_F64-clear-objects - H5IMPORT-BINARY_F64-clear-objects - H5IMPORT-BINARY_I8-clear-objects - H5IMPORT-BINARY_I16-clear-objects - H5IMPORT-BINARY_I32-clear-objects - H5IMPORT-BINARY_UI16-clear-objects - H5IMPORT-BINARY_UI32-clear-objects - H5IMPORT-STR-clear-objects - H5IMPORT-BINARY_I8_EOF-clear-objects - H5IMPORT-ASCII_F64_R1-clear-objects + H5IMPORT-clear-objects ######### tools/h5jam ######### H5JAM-SETUP-N_twithub_u10_c-clear-objects H5JAM-SETUP-N_twithub_u10_c -- cgit v0.12 From bf80a61b1471f819266a4ea1d405eb740a082f9b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 14 Feb 2013 13:43:03 -0500 Subject: [svn-r23275] HDFFV-8311: Correct test dependency Tested: local linux --- config/cmake/CTestCustom.cmake | 7 ------- 1 file changed, 7 deletions(-) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index f09e12d..9d6f276 100755 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -43,13 +43,6 @@ SET (CTEST_CUSTOM_MEMCHECK_IGNORE H5DIFF-clearall-objects ######### tools/h5dump ######### H5DUMP-clearall-objects - H5DUMP-clear-objects-tbin1 - H5DUMP-clear-objects-tbin2 - H5DUMP-clear-objects-tbin3 - H5DUMP-clear-objects-tbin4 - H5DUMP-clear-out1 - H5DUMP-clear-out3 - H5DUMP-clear-objects H5DUMP_PACKED_BITS-clearall-objects H5DUMP-XML-clearall-objects ######### tools/h5import ######### -- cgit v0.12 From ba355ce8872af7f5a8fd4c9ea7e814cab2900847 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 14 Feb 2013 13:48:10 -0500 Subject: [svn-r23276] HDFFV-8311: Correct test dependency Tested: local linux --- tools/h5ls/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index 5cce6cb..70943b5 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -145,10 +145,9 @@ IF (BUILD_TESTING) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5LS-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5LS-clear-${resultfile}-objects + NAME H5LS-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${resultfile}.out ./testfiles/${resultfile}.out.err ) @@ -163,7 +162,7 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS "H5LS-clear-${resultfile}-objects") + SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS "H5LS-${resultfile}-clear-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) -- cgit v0.12 From 8bdc6f991eafb571f9351a6b00e164944eb301d7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 14 Feb 2013 14:13:30 -0500 Subject: [svn-r23277] Change name of output file. --- tools/h5copy/testh5copy.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/h5copy/testh5copy.sh.in b/tools/h5copy/testh5copy.sh.in index c7acd9a..6793b47 100644 --- a/tools/h5copy/testh5copy.sh.in +++ b/tools/h5copy/testh5copy.sh.in @@ -514,10 +514,10 @@ TEST_MISC() FILEOUT="$TESTDIR/`basename h5copytst.h5 .h5`.out.h5" # Remove any output file left over from previous test run - rm -f $FILEOUT + rm -f $h5copy_misc1.out.h5 echo "Test copying object into group which doesn't exist, without -p" - TOOLTEST_FAIL h5copy_misc1.out -v -i $TESTFILE -o $FILEOUT -s /simple -d /g1/g2/simple + TOOLTEST_FAIL h5copy_misc1.out -v -i $TESTFILE -o h5copy_misc1.out.h5 -s /simple -d /g1/g2/simple echo "Test copying objects to the same file " rm -f $FILEOUT -- cgit v0.12 From 325c3b869fc2686356d993d071bfa73069f6ea79 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 14 Feb 2013 15:00:50 -0500 Subject: [svn-r23278] HDFFV-8311: Correct test dependency Tested: local linux --- tools/h5stat/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 9afb365..447df70 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -99,10 +99,9 @@ IF (BUILD_TESTING) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5STAT-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5STAT-clear-${resultfile}-objects + NAME H5STAT-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) @@ -117,7 +116,7 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS "H5STAT-clear-${resultfile}-objects") + SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS "H5STAT-${resultfile}-clear-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) -- cgit v0.12 From 4149edf1182d39e0b578a39b5f19c815aea562bc Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 14 Feb 2013 15:32:15 -0500 Subject: [svn-r23282] Add folder to outfile name --- tools/h5copy/testh5copy.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/h5copy/testh5copy.sh.in b/tools/h5copy/testh5copy.sh.in index 6793b47..cd5f677 100644 --- a/tools/h5copy/testh5copy.sh.in +++ b/tools/h5copy/testh5copy.sh.in @@ -517,7 +517,7 @@ TEST_MISC() rm -f $h5copy_misc1.out.h5 echo "Test copying object into group which doesn't exist, without -p" - TOOLTEST_FAIL h5copy_misc1.out -v -i $TESTFILE -o h5copy_misc1.out.h5 -s /simple -d /g1/g2/simple + TOOLTEST_FAIL h5copy_misc1.out -v -i $TESTFILE -o $TESTDIR/h5copy_misc1.out.h5 -s /simple -d /g1/g2/simple echo "Test copying objects to the same file " rm -f $FILEOUT -- cgit v0.12 From 43189639fdddf429ce758e940f8acc2044b9f3ce Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 15 Feb 2013 14:35:21 -0500 Subject: [svn-r23286] HDFFV-8311: Correct test dependency Tested: local linux --- MANIFEST | 18 +- config/cmake/CTestCustom.cmake | 43 +--- tools/misc/CMakeLists.txt | 281 ++++++++++++++------------ tools/misc/testh5mkgrp.sh.in | 126 +++++++++--- tools/testfiles/h5mkgrp_help.ls | 4 - tools/testfiles/h5mkgrp_nested.ls | 13 -- tools/testfiles/h5mkgrp_nested_latest.ls | 16 -- tools/testfiles/h5mkgrp_nested_lp.ls | 13 ++ tools/testfiles/h5mkgrp_nested_mult.ls | 19 -- tools/testfiles/h5mkgrp_nested_mult_latest.ls | 24 --- tools/testfiles/h5mkgrp_nested_mult_lp.ls | 21 ++ tools/testfiles/h5mkgrp_nested_mult_p.ls | 16 ++ tools/testfiles/h5mkgrp_nested_p.ls | 10 + tools/testfiles/h5mkgrp_several.ls | 5 +- tools/testfiles/h5mkgrp_several_l.ls | 13 ++ tools/testfiles/h5mkgrp_several_latest.ls | 16 -- tools/testfiles/h5mkgrp_several_p.ls | 10 + tools/testfiles/h5mkgrp_several_v.ls | 10 + tools/testfiles/h5mkgrp_single.ls | 5 +- tools/testfiles/h5mkgrp_single_l.ls | 9 + tools/testfiles/h5mkgrp_single_latest.ls | 12 -- tools/testfiles/h5mkgrp_single_p.ls | 7 + tools/testfiles/h5mkgrp_single_v.ls | 7 + tools/testfiles/h5mkgrp_version.ls | 4 - 24 files changed, 377 insertions(+), 325 deletions(-) delete mode 100644 tools/testfiles/h5mkgrp_help.ls delete mode 100644 tools/testfiles/h5mkgrp_nested.ls delete mode 100644 tools/testfiles/h5mkgrp_nested_latest.ls create mode 100644 tools/testfiles/h5mkgrp_nested_lp.ls delete mode 100644 tools/testfiles/h5mkgrp_nested_mult.ls delete mode 100644 tools/testfiles/h5mkgrp_nested_mult_latest.ls create mode 100644 tools/testfiles/h5mkgrp_nested_mult_lp.ls create mode 100644 tools/testfiles/h5mkgrp_nested_mult_p.ls create mode 100644 tools/testfiles/h5mkgrp_nested_p.ls create mode 100644 tools/testfiles/h5mkgrp_several_l.ls delete mode 100644 tools/testfiles/h5mkgrp_several_latest.ls create mode 100644 tools/testfiles/h5mkgrp_several_p.ls create mode 100644 tools/testfiles/h5mkgrp_several_v.ls create mode 100644 tools/testfiles/h5mkgrp_single_l.ls delete mode 100644 tools/testfiles/h5mkgrp_single_latest.ls create mode 100644 tools/testfiles/h5mkgrp_single_p.ls create mode 100644 tools/testfiles/h5mkgrp_single_v.ls delete mode 100644 tools/testfiles/h5mkgrp_version.ls diff --git a/MANIFEST b/MANIFEST index e0ffe8f..86527c9 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2128,16 +2128,18 @@ ./tools/h5copy/testfiles/h5copy_misc1.out # test files for h5mkgrp -./tools/testfiles/h5mkgrp_help.ls -./tools/testfiles/h5mkgrp_nested.ls -./tools/testfiles/h5mkgrp_nested_latest.ls -./tools/testfiles/h5mkgrp_nested_mult.ls -./tools/testfiles/h5mkgrp_nested_mult_latest.ls +./tools/testfiles/h5mkgrp_nested-p.ls +./tools/testfiles/h5mkgrp_nested_lp.ls +./tools/testfiles/h5mkgrp_nested_mult-p.ls +./tools/testfiles/h5mkgrp_nested_mult_lp.ls ./tools/testfiles/h5mkgrp_several.ls -./tools/testfiles/h5mkgrp_several_latest.ls +./tools/testfiles/h5mkgrp_several-v.ls +./tools/testfiles/h5mkgrp_several-p.ls +./tools/testfiles/h5mkgrp_several_l.ls ./tools/testfiles/h5mkgrp_single.ls -./tools/testfiles/h5mkgrp_single_latest.ls -./tools/testfiles/h5mkgrp_version.ls +./tools/testfiles/h5mkgrp_single-v.ls +./tools/testfiles/h5mkgrp_single-p.ls +./tools/testfiles/h5mkgrp_single_l.ls # high level libraries diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 9d6f276..ec7b10e 100755 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -205,47 +205,8 @@ SET (CTEST_CUSTOM_MEMCHECK_IGNORE ######### tools/h5stat ######### H5STAT-clearall-objects ######### tools/misc ######### - h5repart_20K-clear-objects - h5repart_5K-clear-objects - h5repart_sec2-clear-objects - H5MKGRP_CMP-clear-h5mkgrp_help - H5MKGRP_CMP-clear-h5mkgrp_version - H5MKGRP-clear-h5mkgrp_single - H5MKGRP-h5mkgrp_single #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_single #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_single-v - H5MKGRP-h5mkgrp_single-v #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_single-v #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_single-p - H5MKGRP-h5mkgrp_single-p #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_single-p #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_single_latest-l - H5MKGRP-h5mkgrp_single_latest-l #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_single_latest-l #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_several - H5MKGRP-h5mkgrp_several #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_several #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_several-v - H5MKGRP-h5mkgrp_several-v #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_several-v #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_several-p - H5MKGRP-h5mkgrp_several-p #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_several-p #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_several_latest-l - H5MKGRP-h5mkgrp_several_latest-l #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_several_latest-l #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_nested-p - H5MKGRP-h5mkgrp_nested-p #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_nested-p #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_nested_latest-lp - H5MKGRP-h5mkgrp_nested_latest-lp #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_nested_latest-lp #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_nested_mult-p - H5MKGRP-h5mkgrp_nested_mult-p #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_nested_mult-p #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_nested_mult_latest-lp - H5MKGRP-h5mkgrp_nested_mult_latest-lp #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_nested_mult_latest-lp #uses runTest.cmake + H5REPART-clearall-objects + H5MKGRP-clearall-objects ######### examples ######### EXAMPLES-clear-objects cpp_ex-clear-objects diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index d310d3d..3106a3a 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -62,7 +62,7 @@ IF (BUILD_TESTING) SET_TARGET_PROPERTIES (h5repart_test PROPERTIES FOLDER tools) # -------------------------------------------------------------------- - # Copy all the HDF5 files from the test directory into the source directory + # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- SET (HDF5_REFERENCE_TEST_FILES family_file00000.h5 @@ -97,37 +97,43 @@ IF (BUILD_TESTING) ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) SET (HDF5_MKGRP_TEST_FILES - #h5mkgrp_help + #h5mkgrp_help.txt #h5mkgrp_version - h5mkgrp_single - h5mkgrp_single_latest - h5mkgrp_several - h5mkgrp_several_latest - h5mkgrp_nested - h5mkgrp_nested_latest - h5mkgrp_nested_mult - h5mkgrp_nested_mult_latest + h5mkgrp_single.ls + h5mkgrp_single_v.ls + h5mkgrp_single_p.ls + h5mkgrp_single_l.ls + h5mkgrp_several.ls + h5mkgrp_several_v.ls + h5mkgrp_several_p.ls + h5mkgrp_several_l.ls + h5mkgrp_nested_p.ls + h5mkgrp_nested_lp.ls + h5mkgrp_nested_mult_p.ls + h5mkgrp_nested_mult_lp.ls ) - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/../testfiles") + # make test dir + FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + FOREACH (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_mkgrp_file}") + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_mkgrp_file}") #MESSAGE (STATUS " Copying ${h5_mkgrp_file}") ADD_CUSTOM_COMMAND ( TARGET h5mkgrp POST_BUILD - COMMAND ${XLATE_UTILITY} - ARGS ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_mkgrp_file}.ls ${dest}.ls -l3 + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_mkgrp_file} ${dest} ) ENDFOREACH (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) ADD_CUSTOM_COMMAND ( TARGET h5mkgrp POST_BUILD - COMMAND ${XLATE_UTILITY} - ARGS ${PROJECT_SOURCE_DIR}/testfiles/h5mkgrp_help.txt ${PROJECT_BINARY_DIR}/h5mkgrp_help.txt -l0 + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/testfiles/h5mkgrp_help.txt ${PROJECT_BINARY_DIR}/testfiles/h5mkgrp_help.txt ) - CONFIGURE_FILE (${PROJECT_SOURCE_DIR}/testfiles/h5mkgrp_version.txt.in ${PROJECT_BINARY_DIR}/h5mkgrp_version.txt @ONLY) + CONFIGURE_FILE (${PROJECT_SOURCE_DIR}/testfiles/h5mkgrp_version.txt.in ${PROJECT_BINARY_DIR}/testfiles/h5mkgrp_version.txt @ONLY) ############################################################################## ############################################################################## @@ -136,102 +142,71 @@ IF (BUILD_TESTING) ############################################################################## MACRO (ADD_H5_TEST resultfile resultcode resultoption) - IF (NOT ${resultoption} STREQUAL " ") - ADD_TEST ( - NAME H5MKGRP-clear-${resultfile}${resultoption} - COMMAND ${CMAKE_COMMAND} - -E remove - ${PROJECT_BINARY_DIR}/../testfiles/${resultfile}.h5 - ${PROJECT_BINARY_DIR}/${resultfile}.out - ${PROJECT_BINARY_DIR}/${resultfile}.out.err - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5MKGRP-clear-${resultfile}${resultoption} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST ( - NAME H5MKGRP-${resultfile}${resultoption} - COMMAND $ ${resultoption} ${PROJECT_BINARY_DIR}/../testfiles/${resultfile}.h5 ${ARGN} - ) - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}${resultoption} PROPERTIES DEPENDS H5MKGRP-clear-${resultfile}${resultoption}) - SET (last_test "H5MKGRP-${resultfile}${resultoption}") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5MKGRP-h5ls-${resultfile}${resultoption} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-v;-r;../testfiles/${resultfile}.h5" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_MASK_MOD=true" - -D "TEST_REFERENCE=${resultfile}.ls" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5MKGRP-h5ls-${resultfile}${resultoption} PROPERTIES DEPENDS H5MKGRP-${resultfile}${resultoption}) - SET (last_test "H5MKGRP-h5ls-${resultfile}${resultoption}") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (NOT ${resultoption} STREQUAL " ") + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5MKGRP-clear-${resultfile} + NAME H5MKGRP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove - ${PROJECT_BINARY_DIR}/../testfiles/${resultfile}.h5 - ${PROJECT_BINARY_DIR}/${resultfile}.out - ${PROJECT_BINARY_DIR}/${resultfile}.out.err + ${resultfile}.h5 + ${resultfile}.out + ${resultfile}.out.err ) + SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + + ADD_TEST ( + NAME H5MKGRP-${resultfile} + COMMAND $ ${resultoption} ${resultfile}.h5 ${ARGN} + ) + SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + IF (HDF5_ENABLE_USING_MEMCHECKER) IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5MKGRP-clear-${resultfile} PROPERTIES DEPENDS ${last_test}) + SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}-clear-objects) ADD_TEST ( - NAME H5MKGRP-${resultfile} - COMMAND $ ${PROJECT_BINARY_DIR}/../testfiles/${resultfile}.h5 ${ARGN} + NAME H5MKGRP-${resultfile}-h5ls + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-v;-r;${resultfile}.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_MASK_MOD=true" + -D "TEST_REFERENCE=${resultfile}.ls" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES DEPENDS H5MKGRP-clear-${resultfile}) - SET (last_test "H5MKGRP-${resultfile}") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5MKGRP-h5ls-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-v;-r;../testfiles/${resultfile}.h5" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_MASK_MOD=true" - -D "TEST_REFERENCE=${resultfile}.ls" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5MKGRP-h5ls-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}) - SET (last_test "H5MKGRP-h5ls-${resultfile}") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDIF (NOT ${resultoption} STREQUAL " ") + SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}-h5ls PROPERTIES DEPENDS H5MKGRP-${resultfile}) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST resultfile resultcode resultoption) MACRO (ADD_H5_CMP resultfile resultcode) - ADD_TEST ( - NAME H5MKGRP_CMP-clear-${resultfile} - COMMAND ${CMAKE_COMMAND} - -E remove - ${PROJECT_BINARY_DIR}/../testfiles/${resultfile}.h5 - ${PROJECT_BINARY_DIR}/${resultfile}.out - ${PROJECT_BINARY_DIR}/${resultfile}.out.err - ) IF (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5MKGRP_CMP-${resultfile} COMMAND $ ${ARGN}) ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( + NAME H5MKGRP_CMP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.h5 + ${resultfile}.out + ${resultfile}.out.err + ) + SET_TESTS_PROPERTIES (H5MKGRP_CMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + ADD_TEST ( NAME H5MKGRP_CMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=${resultfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) + SET_TESTS_PROPERTIES (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-clear-${resultfile}) ENDMACRO (ADD_H5_CMP resultfile resultcode) ############################################################################## @@ -242,71 +217,115 @@ IF (BUILD_TESTING) # Remove any output file left over from previous test run ADD_TEST ( - NAME h5repart_20K-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - fst_family00000.h5 + NAME H5REPART-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + fst_family00000.h5 + scd_family00000.h5 + scd_family00001.h5 + scd_family00002.h5 + scd_family00003.h5 + family_to_sec2.h5 ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPART-clearall-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5REPART-clearall-objects") + # repartition family member size to 20,000 bytes. - ADD_TEST (NAME h5repart_20K COMMAND $ -m 20000 family_file%05d.h5 fst_family%05d.h5) - SET_TESTS_PROPERTIES (h5repart_20K PROPERTIES DEPENDS h5repart_20K-clear-objects) + ADD_TEST (NAME H5REPART-h5repart_20K COMMAND $ -m 20000 family_file%05d.h5 fst_family%05d.h5) + SET_TESTS_PROPERTIES (H5REPART-h5repart_20K PROPERTIES DEPENDS H5REPART-clearall-objects) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME h5repart_5K-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - scd_family00000.h5 - scd_family00001.h5 - scd_family00002.h5 - scd_family00003.h5 - ) - SET_TESTS_PROPERTIES (h5repart_5K-clear-objects PROPERTIES DEPENDS h5repart_20K) # repartition family member size to 5 KB. - ADD_TEST (NAME h5repart_5K COMMAND $ -m 5k family_file%05d.h5 scd_family%05d.h5) - SET_TESTS_PROPERTIES (h5repart_5K PROPERTIES DEPENDS h5repart_5K-clear-objects) + ADD_TEST (NAME H5REPART-h5repart_5K COMMAND $ -m 5k family_file%05d.h5 scd_family%05d.h5) + SET_TESTS_PROPERTIES (H5REPART-h5repart_5K PROPERTIES DEPENDS H5REPART-clearall-objects) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME h5repart_sec2-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - family_to_sec2.h5 - ) - SET_TESTS_PROPERTIES (h5repart_sec2-clear-objects PROPERTIES DEPENDS h5repart_5K) # convert family file to sec2 file of 20,000 bytes - ADD_TEST (NAME h5repart_sec2 COMMAND $ -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5) - SET_TESTS_PROPERTIES (h5repart_sec2 PROPERTIES DEPENDS h5repart_sec2-clear-objects) + ADD_TEST (NAME H5REPART-h5repart_sec2 COMMAND $ -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5) + SET_TESTS_PROPERTIES (H5REPART-h5repart_sec2 PROPERTIES DEPENDS H5REPART-clearall-objects) # test the output files repartitioned above. - ADD_TEST (NAME h5repart_test COMMAND $) - SET_TESTS_PROPERTIES (h5repart_test PROPERTIES DEPENDS h5repart_sec2) + ADD_TEST (NAME H5REPART-h5repart_test COMMAND $) + SET_TESTS_PROPERTIES (H5REPART-h5repart_test PROPERTIES DEPENDS H5REPART-clearall-objects H5REPART-h5repart_20KH5REPART-h5repart_5K H5REPART-h5repart_sec2) SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5repart_test ) + + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5MKGRP-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + h5mkgrp_help.out + h5mkgrp_help.out.err + h5mkgrp_version.out + h5mkgrp_version.out.err + h5mkgrp_single.h5 + h5mkgrp_single.out + h5mkgrp_single.out.err + h5mkgrp_single_v.h5 + h5mkgrp_single_v.out + h5mkgrp_single_v.out.err + h5mkgrp_single_p.h5 + h5mkgrp_single_p.out + h5mkgrp_single_p.out.err + h5mkgrp_single_l.h5 + h5mkgrp_single_l.out + h5mkgrp_single_l.out.err + h5mkgrp_several.h5 + h5mkgrp_several.out + h5mkgrp_several.out.err + h5mkgrp_several_v.h5 + h5mkgrp_several_v.out + h5mkgrp_several_v.out.err + h5mkgrp_several_p.h5 + h5mkgrp_several_p.out + h5mkgrp_several_p.out.err + h5mkgrp_several_l.h5 + h5mkgrp_several_l.out + h5mkgrp_several_l.out.err + h5mkgrp_nested_p.h5 + h5mkgrp_nested_p.out + h5mkgrp_nested_p.out.err + h5mkgrp_nested_lp.h5 + h5mkgrp_nested_lp.out + h5mkgrp_nested_lp.out.err + h5mkgrp_nested_mult_p.h5 + h5mkgrp_nested_mult_p.out + h5mkgrp_nested_mult_p.out.err + h5mkgrp_nested_mult_lp.h5 + h5mkgrp_nested_mult_lp.out + h5mkgrp_nested_mult_lp.out.err + ) + SET_TESTS_PROPERTIES (H5MKGRP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5MKGRP-clearall-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5MKGRP-clearall-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) # Check that help & version is displayed properly ADD_H5_CMP (h5mkgrp_help 0 "-h") ADD_H5_CMP (h5mkgrp_version 0 "-V") # Create single group at root level - ADD_H5_TEST (h5mkgrp_single 0 " " single) - ADD_H5_TEST (h5mkgrp_single 0 "-v" single) - ADD_H5_TEST (h5mkgrp_single 0 "-p" single) - ADD_H5_TEST (h5mkgrp_single_latest 0 "-l" latest) + ADD_H5_TEST (h5mkgrp_single 0 "" single) + ADD_H5_TEST (h5mkgrp_single_v 0 "-v" single) + ADD_H5_TEST (h5mkgrp_single_p 0 "-p" single) + ADD_H5_TEST (h5mkgrp_single_l 0 "-l" latest) # Create several groups at root level - ADD_H5_TEST (h5mkgrp_several 0 " " one two) - ADD_H5_TEST (h5mkgrp_several 0 "-v" one two) - ADD_H5_TEST (h5mkgrp_several 0 "-p" one two) - ADD_H5_TEST (h5mkgrp_several_latest 0 "-l" one two) + ADD_H5_TEST (h5mkgrp_several 0 "" one two) + ADD_H5_TEST (h5mkgrp_several_v 0 "-v" one two) + ADD_H5_TEST (h5mkgrp_several_p 0 "-p" one two) + ADD_H5_TEST (h5mkgrp_several_l 0 "-l" one two) # Create various nested groups - ADD_H5_TEST (h5mkgrp_nested 0 "-p" /one/two) - ADD_H5_TEST (h5mkgrp_nested_latest 0 "-lp" /one/two) - ADD_H5_TEST (h5mkgrp_nested_mult 0 "-p" /one/two /three/four) - ADD_H5_TEST (h5mkgrp_nested_mult_latest 0 "-lp" /one/two /three/four) + ADD_H5_TEST (h5mkgrp_nested_p 0 "-p" /one/two) + ADD_H5_TEST (h5mkgrp_nested_lp 0 "-lp" /one/two) + ADD_H5_TEST (h5mkgrp_nested_mult_p 0 "-p" /one/two /three/four) + ADD_H5_TEST (h5mkgrp_nested_mult_lp 0 "-lp" /one/two /three/four) ENDIF (BUILD_TESTING) ############################################################################## diff --git a/tools/misc/testh5mkgrp.sh.in b/tools/misc/testh5mkgrp.sh.in index dc127e8..5ec1a28 100644 --- a/tools/misc/testh5mkgrp.sh.in +++ b/tools/misc/testh5mkgrp.sh.in @@ -31,15 +31,85 @@ H5LS=h5ls # The h5ls tool name H5LS_ARGS=-vr # Arguments to the h5ls tool H5LS_BIN=`pwd`/../h5ls/$H5LS # The path of the h5ls tool binary +CMP='cmp' +DIFF='diff -c' +CP='cp' +DIRNAME='dirname' +LS='ls' +AWK='awk' + nerrors=0 verbose=yes -INDIR=$srcdir/../testfiles -OUTDIR=../testfiles +# source dirs +SRC_TOOLS="$srcdir/../" + +SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" +# testfiles source dirs for tools +SRC_H5MKGRP_TESTFILES="$SRC_TOOLS/misc/testfiles" + +TESTDIR=./testfiles +test -d $TESTDIR || mkdir -p $TESTDIR + +###################################################################### +# test files +# -------------------------------------------------------------------- +# All the test files copy from source directory to test directory +# NOTE: Keep this framework to add/remove test files. +# Any test files from other tools can be used in this framework. +# This list are also used for checking exist. +# Comment '#' without space can be used. +# -------------------------------------------------------------------- + CMP='cmp -s' DIFF='diff -c' -test -d $OUTDIR || mkdir $OUTDIR +# +# copy test files and expected output files from source dirs to test dir +# +COPY_TESTFILES=" +$SRC_H5MKGRP_TESTFILES/h5mkgrp_help.txt +$SRC_TOOLS_TESTFILES/h5mkgrp_single.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_single_v.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_single_p.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_single_l.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_several.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_several_v.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_several_p.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_several_l.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_nested_p.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_nested_lp.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_nested_mult_p.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_nested_mult_lp.ls +" + +COPY_TESTFILES_TO_TESTDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_TESTFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + # skip cp if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $tstfile` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $CP -f $tstfile $TESTDIR + if [ $? -ne 0 ]; then + echo "Error: FAILED to copy $tstfile ." + + # Comment out this to CREATE expected file + exit $EXIT_FAILURE + fi + fi + fi + done +} # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". @@ -71,9 +141,7 @@ TOOLTEST() { TESTING $H5MKGRP $@ ( - echo "#############################" - echo " output for '$H5MKGRP $@'" - echo "#############################" + cd $TESTDIR $RUNSERIAL $H5MKGRP_BIN $@ ) > output.out RET=$? @@ -96,17 +164,15 @@ TOOLTEST() # H5LSTEST() { - expect="$INDIR/`basename $1 .h5`.ls" - actual="$OUTDIR/`basename $1 .h5`.out" + expect="$TESTDIR/`basename $1 .h5`.ls" + actual="$TESTDIR/`basename $1 .h5`.out" actual_sav=${actual}-sav # Stderr is included in stdout so that the diff can detect # any unexpected output from that stream too. VERIFY_H5LS $@ ( - echo "#############################" - echo "Expected output for '$H5LS $@'" - echo "#############################" + cd $TESTDIR $RUNSERIAL $H5LS_BIN $H5LS_ARGS $@ ) 2>&1 |sed 's/Modified:.*/Modified: XXXX-XX-XX XX:XX:XX XXX/' >$actual @@ -142,7 +208,7 @@ H5LSTEST() # $* are groups to create RUNTEST() { - FILEOUT=$OUTDIR/$1 + FILEOUT=$1 shift H5MKGRP_ARGS=$1 shift @@ -158,9 +224,8 @@ RUNTEST() # Remove output file created, if the "no cleanup" environment variable is # not defined -echo "FILEOUT=" $FILEOUT if test -z "$HDF5_NOCLEANUP"; then - rm -f $FILEOUT + rm -f $TESTDIR/$FILEOUT fi } @@ -172,16 +237,17 @@ echo "FILEOUT=" $FILEOUT # $* are groups to create CMPTEST() { - FILEOUT=$OUTDIR/$1 - expect="$srcdir/testfiles/`basename $1 .h5`.txt" - actual="$OUTDIR/`basename $1 .h5`.out" - actual_err="$OUTDIR/`basename $1 .h5`.err" + FILEOUT=$1 + expect="$TESTDIR/`basename $1 .h5`.txt" + actual="$TESTDIR/`basename $1 .h5`.out" + actual_err="$TESTDIR/`basename $1 .h5`.err" shift # Stderr is included in stdout so that the diff can detect # any unexpected output from that stream too. TESTING $H5MKGRP $@ ( + cd $TESTDIR $RUNSERIAL $H5MKGRP_BIN $@ ) >$actual 2>$actual_err cat $actual_err >> $actual @@ -208,28 +274,30 @@ CMPTEST() ############################################################################## ### T H E T E S T S ### ############################################################################## +# prepare for test +COPY_TESTFILES_TO_TESTDIR # Check that help & version is displayed properly CMPTEST h5mkgrp_help.h5 "-h" -RUNTEST h5mkgrp_version.h5 "-V" +#CMPTEST h5mkgrp_version.h5 "-V" # Create single group at root level RUNTEST h5mkgrp_single.h5 " " single -RUNTEST h5mkgrp_single.h5 "-v" single -RUNTEST h5mkgrp_single.h5 "-p" single -RUNTEST h5mkgrp_single_latest.h5 "-l" latest +RUNTEST h5mkgrp_single_v.h5 "-v" single +RUNTEST h5mkgrp_single_p.h5 "-p" single +RUNTEST h5mkgrp_single_l.h5 "-l" latest # Create several groups at root level RUNTEST h5mkgrp_several.h5 " " one two -RUNTEST h5mkgrp_several.h5 "-v" one two -RUNTEST h5mkgrp_several.h5 "-p" one two -RUNTEST h5mkgrp_several_latest.h5 "-l" one two +RUNTEST h5mkgrp_several_v.h5 "-v" one two +RUNTEST h5mkgrp_several_p.h5 "-p" one two +RUNTEST h5mkgrp_several_l.h5 "-l" one two # Create various nested groups -RUNTEST h5mkgrp_nested.h5 "-p" /one/two -RUNTEST h5mkgrp_nested_latest.h5 "-lp" /one/two -RUNTEST h5mkgrp_nested_mult.h5 "-p" /one/two /three/four -RUNTEST h5mkgrp_nested_mult_latest.h5 "-lp" /one/two /three/four +RUNTEST h5mkgrp_nested_p.h5 "-p" /one/two +RUNTEST h5mkgrp_nested_lp.h5 "-lp" /one/two +RUNTEST h5mkgrp_nested_mult_p.h5 "-p" /one/two /three/four +RUNTEST h5mkgrp_nested_mult_lp.h5 "-lp" /one/two /three/four if test $nerrors -eq 0 ; then diff --git a/tools/testfiles/h5mkgrp_help.ls b/tools/testfiles/h5mkgrp_help.ls deleted file mode 100644 index ad2bd0f..0000000 --- a/tools/testfiles/h5mkgrp_help.ls +++ /dev/null @@ -1,4 +0,0 @@ -############################# -Expected output for 'h5ls ../testfiles/h5mkgrp_help.h5' -############################# -../testfiles/h5mkgrp_help.h5: unable to open file diff --git a/tools/testfiles/h5mkgrp_nested.ls b/tools/testfiles/h5mkgrp_nested.ls deleted file mode 100644 index 472656d..0000000 --- a/tools/testfiles/h5mkgrp_nested.ls +++ /dev/null @@ -1,13 +0,0 @@ -############################# -Expected output for 'h5ls ../testfiles/h5mkgrp_nested.h5' -############################# -Opened "../testfiles/h5mkgrp_nested.h5" with sec2 driver. -/ Group - Location: 1:96 - Links: 1 -/one Group - Location: 1:800 - Links: 1 -/one/two Group - Location: 1:1832 - Links: 1 diff --git a/tools/testfiles/h5mkgrp_nested_latest.ls b/tools/testfiles/h5mkgrp_nested_latest.ls deleted file mode 100644 index c00292d..0000000 --- a/tools/testfiles/h5mkgrp_nested_latest.ls +++ /dev/null @@ -1,16 +0,0 @@ -############################# -Expected output for 'h5ls ../testfiles/h5mkgrp_nested_latest.h5' -############################# -Opened "../testfiles/h5mkgrp_nested_latest.h5" with sec2 driver. -/ Group - Location: 1:48 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX -/one Group - Location: 1:195 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX -/one/two Group - Location: 1:342 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX diff --git a/tools/testfiles/h5mkgrp_nested_lp.ls b/tools/testfiles/h5mkgrp_nested_lp.ls new file mode 100644 index 0000000..1fe8ce8 --- /dev/null +++ b/tools/testfiles/h5mkgrp_nested_lp.ls @@ -0,0 +1,13 @@ +Opened "h5mkgrp_nested_lp.h5" with sec2 driver. +/ Group + Location: 1:48 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/one Group + Location: 1:195 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/one/two Group + Location: 1:342 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX diff --git a/tools/testfiles/h5mkgrp_nested_mult.ls b/tools/testfiles/h5mkgrp_nested_mult.ls deleted file mode 100644 index 6a22ffd..0000000 --- a/tools/testfiles/h5mkgrp_nested_mult.ls +++ /dev/null @@ -1,19 +0,0 @@ -############################# -Expected output for 'h5ls ../testfiles/h5mkgrp_nested_mult.h5' -############################# -Opened "../testfiles/h5mkgrp_nested_mult.h5" with sec2 driver. -/ Group - Location: 1:96 - Links: 1 -/one Group - Location: 1:800 - Links: 1 -/one/two Group - Location: 1:1832 - Links: 1 -/three Group - Location: 1:2864 - Links: 1 -/three/four Group - Location: 1:3568 - Links: 1 diff --git a/tools/testfiles/h5mkgrp_nested_mult_latest.ls b/tools/testfiles/h5mkgrp_nested_mult_latest.ls deleted file mode 100644 index 0b19ff9..0000000 --- a/tools/testfiles/h5mkgrp_nested_mult_latest.ls +++ /dev/null @@ -1,24 +0,0 @@ -############################# -Expected output for 'h5ls ../testfiles/h5mkgrp_nested_mult_latest.h5' -############################# -Opened "../testfiles/h5mkgrp_nested_mult_latest.h5" with sec2 driver. -/ Group - Location: 1:48 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX -/one Group - Location: 1:195 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX -/one/two Group - Location: 1:342 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX -/three Group - Location: 1:489 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX -/three/four Group - Location: 1:636 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX diff --git a/tools/testfiles/h5mkgrp_nested_mult_lp.ls b/tools/testfiles/h5mkgrp_nested_mult_lp.ls new file mode 100644 index 0000000..50380ec --- /dev/null +++ b/tools/testfiles/h5mkgrp_nested_mult_lp.ls @@ -0,0 +1,21 @@ +Opened "h5mkgrp_nested_mult_lp.h5" with sec2 driver. +/ Group + Location: 1:48 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/one Group + Location: 1:195 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/one/two Group + Location: 1:342 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/three Group + Location: 1:489 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/three/four Group + Location: 1:636 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX diff --git a/tools/testfiles/h5mkgrp_nested_mult_p.ls b/tools/testfiles/h5mkgrp_nested_mult_p.ls new file mode 100644 index 0000000..f2b3b4b --- /dev/null +++ b/tools/testfiles/h5mkgrp_nested_mult_p.ls @@ -0,0 +1,16 @@ +Opened "h5mkgrp_nested_mult_p.h5" with sec2 driver. +/ Group + Location: 1:96 + Links: 1 +/one Group + Location: 1:800 + Links: 1 +/one/two Group + Location: 1:1832 + Links: 1 +/three Group + Location: 1:2864 + Links: 1 +/three/four Group + Location: 1:3568 + Links: 1 diff --git a/tools/testfiles/h5mkgrp_nested_p.ls b/tools/testfiles/h5mkgrp_nested_p.ls new file mode 100644 index 0000000..3034dbb --- /dev/null +++ b/tools/testfiles/h5mkgrp_nested_p.ls @@ -0,0 +1,10 @@ +Opened "h5mkgrp_nested_p.h5" with sec2 driver. +/ Group + Location: 1:96 + Links: 1 +/one Group + Location: 1:800 + Links: 1 +/one/two Group + Location: 1:1832 + Links: 1 diff --git a/tools/testfiles/h5mkgrp_several.ls b/tools/testfiles/h5mkgrp_several.ls index bbf5c92..68a3f9c 100644 --- a/tools/testfiles/h5mkgrp_several.ls +++ b/tools/testfiles/h5mkgrp_several.ls @@ -1,7 +1,4 @@ -############################# -Expected output for 'h5ls ../testfiles/h5mkgrp_several.h5' -############################# -Opened "../testfiles/h5mkgrp_several.h5" with sec2 driver. +Opened "h5mkgrp_several.h5" with sec2 driver. / Group Location: 1:96 Links: 1 diff --git a/tools/testfiles/h5mkgrp_several_l.ls b/tools/testfiles/h5mkgrp_several_l.ls new file mode 100644 index 0000000..5e1b4be --- /dev/null +++ b/tools/testfiles/h5mkgrp_several_l.ls @@ -0,0 +1,13 @@ +Opened "h5mkgrp_several_l.h5" with sec2 driver. +/ Group + Location: 1:48 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/one Group + Location: 1:195 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/two Group + Location: 1:342 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX diff --git a/tools/testfiles/h5mkgrp_several_latest.ls b/tools/testfiles/h5mkgrp_several_latest.ls deleted file mode 100644 index a3b5224..0000000 --- a/tools/testfiles/h5mkgrp_several_latest.ls +++ /dev/null @@ -1,16 +0,0 @@ -############################# -Expected output for 'h5ls ../testfiles/h5mkgrp_several_latest.h5' -############################# -Opened "../testfiles/h5mkgrp_several_latest.h5" with sec2 driver. -/ Group - Location: 1:48 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX -/one Group - Location: 1:195 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX -/two Group - Location: 1:342 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX diff --git a/tools/testfiles/h5mkgrp_several_p.ls b/tools/testfiles/h5mkgrp_several_p.ls new file mode 100644 index 0000000..43f1ce5 --- /dev/null +++ b/tools/testfiles/h5mkgrp_several_p.ls @@ -0,0 +1,10 @@ +Opened "h5mkgrp_several_p.h5" with sec2 driver. +/ Group + Location: 1:96 + Links: 1 +/one Group + Location: 1:800 + Links: 1 +/two Group + Location: 1:1832 + Links: 1 diff --git a/tools/testfiles/h5mkgrp_several_v.ls b/tools/testfiles/h5mkgrp_several_v.ls new file mode 100644 index 0000000..a6df87b --- /dev/null +++ b/tools/testfiles/h5mkgrp_several_v.ls @@ -0,0 +1,10 @@ +Opened "h5mkgrp_several_v.h5" with sec2 driver. +/ Group + Location: 1:96 + Links: 1 +/one Group + Location: 1:800 + Links: 1 +/two Group + Location: 1:1832 + Links: 1 diff --git a/tools/testfiles/h5mkgrp_single.ls b/tools/testfiles/h5mkgrp_single.ls index e9932f7..f2bd01c 100644 --- a/tools/testfiles/h5mkgrp_single.ls +++ b/tools/testfiles/h5mkgrp_single.ls @@ -1,7 +1,4 @@ -############################# -Expected output for 'h5ls ../testfiles/h5mkgrp_single.h5' -############################# -Opened "../testfiles/h5mkgrp_single.h5" with sec2 driver. +Opened "h5mkgrp_single.h5" with sec2 driver. / Group Location: 1:96 Links: 1 diff --git a/tools/testfiles/h5mkgrp_single_l.ls b/tools/testfiles/h5mkgrp_single_l.ls new file mode 100644 index 0000000..1763a61 --- /dev/null +++ b/tools/testfiles/h5mkgrp_single_l.ls @@ -0,0 +1,9 @@ +Opened "h5mkgrp_single_l.h5" with sec2 driver. +/ Group + Location: 1:48 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/latest Group + Location: 1:195 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX diff --git a/tools/testfiles/h5mkgrp_single_latest.ls b/tools/testfiles/h5mkgrp_single_latest.ls deleted file mode 100644 index b6e6ea4..0000000 --- a/tools/testfiles/h5mkgrp_single_latest.ls +++ /dev/null @@ -1,12 +0,0 @@ -############################# -Expected output for 'h5ls ../testfiles/h5mkgrp_single_latest.h5' -############################# -Opened "../testfiles/h5mkgrp_single_latest.h5" with sec2 driver. -/ Group - Location: 1:48 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX -/latest Group - Location: 1:195 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX diff --git a/tools/testfiles/h5mkgrp_single_p.ls b/tools/testfiles/h5mkgrp_single_p.ls new file mode 100644 index 0000000..e82dc31 --- /dev/null +++ b/tools/testfiles/h5mkgrp_single_p.ls @@ -0,0 +1,7 @@ +Opened "h5mkgrp_single_p.h5" with sec2 driver. +/ Group + Location: 1:96 + Links: 1 +/single Group + Location: 1:800 + Links: 1 diff --git a/tools/testfiles/h5mkgrp_single_v.ls b/tools/testfiles/h5mkgrp_single_v.ls new file mode 100644 index 0000000..7360865 --- /dev/null +++ b/tools/testfiles/h5mkgrp_single_v.ls @@ -0,0 +1,7 @@ +Opened "h5mkgrp_single_v.h5" with sec2 driver. +/ Group + Location: 1:96 + Links: 1 +/single Group + Location: 1:800 + Links: 1 diff --git a/tools/testfiles/h5mkgrp_version.ls b/tools/testfiles/h5mkgrp_version.ls deleted file mode 100644 index 907f0ad..0000000 --- a/tools/testfiles/h5mkgrp_version.ls +++ /dev/null @@ -1,4 +0,0 @@ -############################# -Expected output for 'h5ls ../testfiles/h5mkgrp_version.h5' -############################# -../testfiles/h5mkgrp_version.h5: unable to open file -- cgit v0.12 From 69ced48cf8d19456bef242378149ed2b9ba9902f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 15 Feb 2013 15:12:18 -0500 Subject: [svn-r23287] Correct file names --- MANIFEST | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/MANIFEST b/MANIFEST index 86527c9..e60e234 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2128,17 +2128,17 @@ ./tools/h5copy/testfiles/h5copy_misc1.out # test files for h5mkgrp -./tools/testfiles/h5mkgrp_nested-p.ls +./tools/testfiles/h5mkgrp_nested_p.ls ./tools/testfiles/h5mkgrp_nested_lp.ls -./tools/testfiles/h5mkgrp_nested_mult-p.ls +./tools/testfiles/h5mkgrp_nested_mult_p.ls ./tools/testfiles/h5mkgrp_nested_mult_lp.ls ./tools/testfiles/h5mkgrp_several.ls -./tools/testfiles/h5mkgrp_several-v.ls -./tools/testfiles/h5mkgrp_several-p.ls +./tools/testfiles/h5mkgrp_several_v.ls +./tools/testfiles/h5mkgrp_several_p.ls ./tools/testfiles/h5mkgrp_several_l.ls ./tools/testfiles/h5mkgrp_single.ls -./tools/testfiles/h5mkgrp_single-v.ls -./tools/testfiles/h5mkgrp_single-p.ls +./tools/testfiles/h5mkgrp_single_v.ls +./tools/testfiles/h5mkgrp_single_p.ls ./tools/testfiles/h5mkgrp_single_l.ls -- cgit v0.12 From ff30c6132921afe805adf07cc9ebf226786a5cd1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 15 Feb 2013 16:46:24 -0500 Subject: [svn-r23288] Fix mismatched block statement --- config/cmake/grepTest.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake/grepTest.cmake b/config/cmake/grepTest.cmake index 365d9c3..74ac912 100644 --- a/config/cmake/grepTest.cmake +++ b/config/cmake/grepTest.cmake @@ -57,7 +57,7 @@ IF (${TEST_EXPECT} STREQUAL "1") IF (NOT ${TEST_RESULT} STREQUAL "0") MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") ENDIF (NOT ${TEST_RESULT} STREQUAL "0") -ENDIF (${TEST_EXPECT} STREQUAL "0") +ENDIF (${TEST_EXPECT} STREQUAL "1") # everything went fine... MESSAGE ("Passed: The output of ${TEST_PROGRAM} matched") -- cgit v0.12 From 1eeac2048a58c0cb662eab3579ab428c8cd95d60 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 15 Feb 2013 16:46:45 -0500 Subject: [svn-r23289] HDFFV-8311: Correct test dependency Tested: local linux --- tools/h5repack/CMakeLists.txt | 397 ++++++++++++++++++++++++------------------ 1 file changed, 227 insertions(+), 170 deletions(-) diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 7166357..156f6d8 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -150,24 +150,23 @@ IF (BUILD_TESTING) IF (${testtype} STREQUAL "SKIP") IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5REPACK-${testname}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out.${testfile}" + NAME H5REPACK_OLD-${testname}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" ) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ELSE (${testtype} STREQUAL "SKIP") ADD_TEST ( - NAME H5REPACK-${testname} - COMMAND $ ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out.${testfile} + NAME H5REPACK_OLD-${testname} + COMMAND $ ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) + SET_TESTS_PROPERTIES (H5REPACK_OLD-${testname} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") ADD_TEST ( - NAME H5REPACK-DIFF_${testname} - COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out.${testfile} + NAME H5REPACK_OLD-${testname}_DFF + COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - SET_TESTS_PROPERTIES (H5REPACK-DIFF_${testname} PROPERTIES DEPENDS H5REPACK-${testname}) - SET (last_test "H5REPACK-DIFF_${testname}") + SET_TESTS_PROPERTIES (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname}) ENDIF (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_TEST_OLD) @@ -176,23 +175,22 @@ IF (BUILD_TESTING) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5REPACK-${testname}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out.${testfile}" + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" ) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ELSE (${testtype} STREQUAL "SKIP") ADD_TEST ( NAME H5REPACK-${testname} - COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out.${testfile} + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") ADD_TEST ( - NAME H5REPACK-DIFF_${testname} - COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out.${testfile} + NAME H5REPACK-${testname}_DFF + COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - SET_TESTS_PROPERTIES (H5REPACK-DIFF_${testname} PROPERTIES DEPENDS H5REPACK-${testname}) - SET (last_test "H5REPACK-DIFF_${testname}") + SET_TESTS_PROPERTIES (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname}) ENDIF (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_TEST) @@ -200,22 +198,22 @@ IF (BUILD_TESTING) IF (${testtype} STREQUAL "SKIP") IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5REPACK-${testname}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out.${resultfile}" + NAME H5REPACK_CMP-${testname}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ELSE (${testtype} STREQUAL "SKIP") # If using memchecker add tests without using scripts IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5REPACK-${testname} COMMAND $ ${ARGN} testfiles/${resultfile} testfiles/out.${resultfile}) + ADD_TEST (NAME H5REPACK_CMP-${testname} COMMAND $ ${ARGN} testfiles/${resultfile} testfiles/out-${testname}.${resultfile}) ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5REPACK-${testname} + NAME H5REPACK_CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=${ARGN};testfiles/${resultfile};testfiles/out.${resultfile}" + -D "TEST_ARGS:STRING=${ARGN};testfiles/${resultfile};testfiles/out-${testname}.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${resultfile}.out" + -D "TEST_OUTPUT=./testfiles/${resultfile}-${testname}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_FILTER:STRING=${testfilter}" -D "TEST_REFERENCE=testfiles/${resultfile}.ddl" @@ -223,9 +221,8 @@ IF (BUILD_TESTING) ) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) + SET_TESTS_PROPERTIES (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK-${testname}") ENDIF (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_CMP_TEST) @@ -234,28 +231,37 @@ IF (BUILD_TESTING) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5REPACK_VERIFY_LAYOUT-${testname}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out.${resultfile}" + COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ELSE (${testtype} STREQUAL "SKIP") IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5REPACK_VERIFY_LAYOUT-${testname} + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ADD_TEST ( + NAME H5REPACK_VERIFY_LAYOUT-${testname}_DFF + COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}) IF (${resultcode} STREQUAL "0") ADD_TEST ( - NAME H5REPACK_VERIFY_LAYOUT-${testname} + NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-d;${testdset};-pH;testfiles/out.${testfile}" + -D "TEST_ARGS:STRING=-d;${testdset};-pH;testfiles/out-${testname}.${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${testfile}-v.out" + -D "TEST_OUTPUT=./testfiles/${testfile}-${testname}-v.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_FILTER:STRING=${testfilter}" -D "TEST_REFERENCE=${testfilter}" -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK_VERIFY_LAYOUT-${testname}") + SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) ELSE (${resultcode} STREQUAL "0") IF (${testfilter} STREQUAL "CHUNKED") SET (nottestfilter "(CONTIGUOUS|COMPACT)") @@ -267,21 +273,18 @@ IF (BUILD_TESTING) SET (nottestfilter "(CONTIGUOUS|CHUNK)") ENDIF (${testfilter} STREQUAL "COMPACT") ADD_TEST ( - NAME H5REPACK_VERIFY_LAYOUT_ALL-${testname} + NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-pH;testfiles/out.${testfile}" + -D "TEST_ARGS:STRING=-pH;testfiles/out-${testname}.${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${testfile}-v.out" + -D "TEST_OUTPUT=./testfiles/${testfile}-${testname}-v.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_FILTER:STRING=${nottestfilter}" -D "TEST_REFERENCE=${testfilter}" -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT_ALL-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK_VERIFY_LAYOUT_ALL-${testname}") + SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) ENDIF (${resultcode} STREQUAL "0") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDIF (${testtype} STREQUAL "SKIP") @@ -289,25 +292,21 @@ IF (BUILD_TESTING) MACRO (ADD_H5_TEST_META testname testfile) ADD_TEST ( - NAME H5REPACK-${testname}_N - COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out_N.${testname}.h5 + NAME H5REPACK_META-${testname}_N + COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ) IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-${testname}_N PROPERTIES DEPENDS ${last_test}) + SET_TESTS_PROPERTIES (H5REPACK_META-${testname}_N PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") ADD_TEST ( - NAME H5REPACK-${testname}_M - COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out_M.${testname}.h5 + NAME H5REPACK_META-${testname}_M + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5 ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-${testname}_M PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST (NAME H5REPACK-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/testfiles/out_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out_M.${testname}.h5) - SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES WILL_FAIL "true") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK-${testname}") + SET_TESTS_PROPERTIES (H5REPACK_META-${testname}_M PROPERTIES DEPENDS H5REPACK_META-${testname}_N) + + ADD_TEST (NAME H5REPACK_META-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5) + SET_TESTS_PROPERTIES (H5REPACK_META-${testname} PROPERTIES WILL_FAIL "true") + SET_TESTS_PROPERTIES (H5REPACK_META-${testname} PROPERTIES DEPENDS H5REPACK_META-${testname}_M) ENDMACRO (ADD_H5_TEST_META) ############################################################################## @@ -316,43 +315,158 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## + # -------------------------------------------------------------------- + # test file names + # -------------------------------------------------------------------- + SET (INFO_FILE testfiles/h5repack.info) + + SET (FILE0 h5repack_fill.h5) + SET (FILE1 h5repack_objs.h5) + SET (FILE2 h5repack_attr.h5) + SET (FILE3 h5repack_hlink.h5) + SET (FILE4 h5repack_layout.h5) + SET (FILE5 h5repack_early.h5) + SET (FILE7 h5repack_szip.h5) + SET (FILE8 h5repack_deflate.h5) + SET (FILE9 h5repack_shuffle.h5) + SET (FILE10 h5repack_fletcher.h5) + SET (FILE11 h5repack_filters.h5) + SET (FILE12 h5repack_nbit.h5) + SET (FILE13 h5repack_soffset.h5) + SET (FILE14 h5repack_layouto.h5 ) # A file with an older version of the layout message (copy of test/tlayouto.h5) + SET (FILE15 h5repack_named_dtypes.h5) + SET (FILE16 tfamily%05d.h5) # located in common testfiles folder + SET (FILE18 h5repack_layout2.h5) + SET (FILE_REF h5repack_refs.h5) + SET (FILE_ATTR_REF h5repack_attr_refs.h5) + # Remove any output file left over from previous test run ADD_TEST ( NAME H5REPACK-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove - ./testfiles/h5repack_filters.h5.out - ./testfiles/h5repack_filters.h5.out.err - ./testfiles/h5repack_layout.h5-v.out - ./testfiles/h5repack_layout.h5-v.out.err - ./testfiles/h5repack_layout2.h5-v.out - ./testfiles/h5repack_layout2.h5-v.out.err - ./testfiles/h5repack_layout3.h5-v.out - ./testfiles/h5repack_layout3.h5-v.out.err - ./testfiles/out.tfamily%05d.h5 - ./testfiles/out.h5diff_attr1.h5 - ./testfiles/out.h5repack_attr.h5 - ./testfiles/out.h5repack_attr_refs.h5 - ./testfiles/out.h5repack_deflate.h5 - ./testfiles/out.h5repack_early.h5 - ./testfiles/out.h5repack_fill.h5 - ./testfiles/out.h5repack_filters.h5 - ./testfiles/out.h5repack_fletcher.h5 - ./testfiles/out.h5repack_hlink.h5 - ./testfiles/out.h5repack_layout.h5 - ./testfiles/out.h5repack_layouto.h5 - ./testfiles/out.h5repack_layout2.h5 - ./testfiles/out.h5repack_layout3.h5 - ./testfiles/out.h5repack_named_dtypes.h5 - ./testfiles/out.h5repack_nbit.h5 - ./testfiles/out.h5repack_objs.h5 - ./testfiles/out.h5repack_refs.h5 - ./testfiles/out.h5repack_shuffle.h5 - ./testfiles/out.h5repack_soffset.h5 - ./testfiles/out_M.meta_short.h5 - ./testfiles/out_N.meta_short.h5 - ./testfiles/out_M.meta_long.h5 - ./testfiles/out_N.meta_long.h5 + ./testfiles/h5repack_filters.h5-gzip_verbose_filters.out + ./testfiles/h5repack_filters.h5-gzip_verbose_filters.out.err + ./testfiles/h5repack_layout.h5-chunk_18x13-v.out + ./testfiles/h5repack_layout.h5-chunk_18x13-v.out.err + ./testfiles/h5repack_layout.h5-chunk_20x10-v.out + ./testfiles/h5repack_layout.h5-chunk_20x10-v.out.err + ./testfiles/h5repack_layout.h5-chunk_compa-v.out + ./testfiles/h5repack_layout.h5-chunk_compa-v.out.err + ./testfiles/h5repack_layout.h5-chunk_conti-v.out + ./testfiles/h5repack_layout.h5-chunk_conti-v.out.err + ./testfiles/h5repack_layout.h5-compa-v.out + ./testfiles/h5repack_layout.h5-compa-v.out.err + ./testfiles/h5repack_layout.h5-conti-v.out + ./testfiles/h5repack_layout.h5-conti-v.out.err + ./testfiles/h5repack_layout.h5-dset2_chunk_20x10-v.out + ./testfiles/h5repack_layout.h5-dset2_chunk_20x10-v.out.err + ./testfiles/h5repack_layout.h5-dset2_compa-v.out + ./testfiles/h5repack_layout.h5-dset2_compa-v.out.err + ./testfiles/h5repack_layout.h5-dset2_conti-v.out + ./testfiles/h5repack_layout.h5-dset2_conti-v.out.err + ./testfiles/h5repack_layout.h5-dset_compa_chunk-v.out + ./testfiles/h5repack_layout.h5-dset_compa_chunk-v.out.err + ./testfiles/h5repack_layout.h5-dset_compa_compa-v.out + ./testfiles/h5repack_layout.h5-dset_compa_compa-v.out.err + ./testfiles/h5repack_layout.h5-dset_compa_conti-v.out + ./testfiles/h5repack_layout.h5-dset_compa_conti-v.out.err + ./testfiles/h5repack_layout.h5-dset_conti_chunk-v.out + ./testfiles/h5repack_layout.h5-dset_conti_chunk-v.out.err + ./testfiles/h5repack_layout.h5-dset_conti_compa-v.out + ./testfiles/h5repack_layout.h5-dset_conti_compa-v.out.err + ./testfiles/h5repack_layout.h5-dset_conti_conti-v.out + ./testfiles/h5repack_layout.h5-dset_conti_conti-v.out.err + ./testfiles/h5repack_layout.h5-layout_long_switches-v.out + ./testfiles/h5repack_layout.h5-layout_long_switches-v.out.err + ./testfiles/h5repack_layout.h5-layout_short_switches-v.out + ./testfiles/h5repack_layout.h5-layout_short_switches-v.out.err + ./testfiles/h5repack_layout2.h5-contig_small_compa-v.out + ./testfiles/h5repack_layout2.h5-contig_small_compa-v.out.err + ./testfiles/h5repack_layout2.h5-contig_small_fixed_compa-v.out + ./testfiles/h5repack_layout2.h5-contig_small_fixed_compa-v.out.err + ./testfiles/h5repack_layout3.h5-chunk2chunk-v.out + ./testfiles/h5repack_layout3.h5-chunk2chunk-v.out.err + ./testfiles/h5repack_layout3.h5-chunk2compa-v.out + ./testfiles/h5repack_layout3.h5-chunk2compa-v.out.err + ./testfiles/h5repack_layout3.h5-chunk2conti-v.out + ./testfiles/h5repack_layout3.h5-chunk2conti-v.out.err + ./testfiles/h5repack_layout3.h5-error1-v.out + ./testfiles/h5repack_layout3.h5-error1-v.out.err + ./testfiles/h5repack_layout3.h5-error2-v.out + ./testfiles/h5repack_layout3.h5-error2-v.out.err + ./testfiles/h5repack_layout3.h5-error3-v.out + ./testfiles/h5repack_layout3.h5-error3-v.out.err + ./testfiles/out-family.tfamily%05d.h5 + ./testfiles/out-HDFFV-7840.h5diff_attr1.h5 + ./testfiles/out-attr.h5repack_attr.h5 + ./testfiles/out-native_attr.h5repack_attr.h5 + ./testfiles/out-HDFFV-5932.h5repack_attr_refs.h5 + ./testfiles/out-deflate_copy.h5repack_deflate.h5 + ./testfiles/out-deflate_remove.h5repack_deflate.h5 + ./testfiles/out-early.h5repack_early.h5 + ./testfiles/out-fill.h5repack_fill.h5 + ./testfiles/out-native_fill.h5repack_fill.h5 + ./testfiles/out-gzip_verbose_filters.h5repack_filters.h5 + ./testfiles/out-fletcher_copy.h5repack_fletcher.h5 + ./testfiles/out-fletcher_remove.h5repack_fletcher.h5 + ./testfiles/out-hlink.h5repack_hlink.h5 + ./testfiles/out-chunk_18x13.h5repack_layout.h5 + ./testfiles/out-chunk_20x10.h5repack_layout.h5 + ./testfiles/out-chunk_compa.h5repack_layout.h5 + ./testfiles/out-chunk_conti.h5repack_layout.h5 + ./testfiles/out-compa.h5repack_layout.h5 + ./testfiles/out-conti.h5repack_layout.h5 + ./testfiles/out-deflate_file.h5repack_layout.h5 + ./testfiles/out-deflate_limit.h5repack_layout.h5 + ./testfiles/out-dset2_chunk_20x10.h5repack_layout.h5 + ./testfiles/out-dset2_compa.h5repack_layout.h5 + ./testfiles/out-dset2_conti.h5repack_layout.h5 + ./testfiles/out-dset_compa_chunk.h5repack_layout.h5 + ./testfiles/out-dset_compa_compa.h5repack_layout.h5 + ./testfiles/out-dset_compa_conti.h5repack_layout.h5 + ./testfiles/out-dset_conti_chunk.h5repack_layout.h5 + ./testfiles/out-dset_conti_compa.h5repack_layout.h5 + ./testfiles/out-dset_conti_conti.h5repack_layout.h5 + ./testfiles/out-fletcher_all.h5repack_layout.h5 + ./testfiles/out-fletcher_individual.h5repack_layout.h5 + ./testfiles/out-global_filters.h5repack_layout.h5 + ./testfiles/out-gzip_all.h5repack_layout.h5 + ./testfiles/out-gzip_individual.h5repack_layout.h5 + ./testfiles/out-layout.h5repack_layout.h5 + ./testfiles/out-layout_long_switches.h5repack_layout.h5 + ./testfiles/out-layout_short_switches.h5repack_layout.h5 + ./testfiles/out-old_style_layout_short_switches.h5repack_layout.h5 + ./testfiles/out-shuffle_all.h5repack_layout.h5 + ./testfiles/out-shuffle_individual.h5repack_layout.h5 + ./testfiles/out-upgrade_layout.h5repack_layouto.h5 + ./testfiles/out-contig_small_compa.h5repack_layout2.h5 + ./testfiles/out-contig_small_fixed_compa.h5repack_layout2.h5 + ./testfiles/out-chunk2chunk.h5repack_layout3.h5 + ./testfiles/out-chunk2compa.h5repack_layout3.h5 + ./testfiles/out-chunk2conti.h5repack_layout3.h5 + ./testfiles/out-error1.h5repack_layout3.h5 + ./testfiles/out-error2.h5repack_layout3.h5 + ./testfiles/out-error3.h5repack_layout3.h5 + ./testfiles/out-error4.h5repack_layout3.h5 + ./testfiles/out-committed_dt.h5repack_named_dtypes.h5 + ./testfiles/out-nbit_add.h5repack_nbit.h5 + ./testfiles/out-nbit_copy.h5repack_nbit.h5 + ./testfiles/out-nbit_remove.h5repack_nbit.h5 + ./testfiles/out-add_alignment.h5repack_objs.h5 + ./testfiles/out-add_userblock.h5repack_objs.h5 + ./testfiles/out-objs.h5repack_objs.h5 + ./testfiles/out-gt_mallocsize.h5repack_objs.h5 + ./testfiles/out-bug1814.h5repack_refs.h5 + ./testfiles/out-shuffle_copy.h5repack_shuffle.h5 + ./testfiles/out-shuffle_remove.h5repack_shuffle.h5 + ./testfiles/out-scale_add.h5repack_soffset.h5 + ./testfiles/out-scale_copy.h5repack_soffset.h5 + ./testfiles/out-scale_remove.h5repack_soffset.h5 + ./testfiles/out-meta_short_M.meta_short.h5 + ./testfiles/out-meta_short_N.meta_short.h5 + ./testfiles/out-meta_long_M.meta_long.h5 + ./testfiles/out-meta_long_N.meta_long.h5 # from the h5repacktst h5repack_attr.h5 h5repack_attr_out.h5 @@ -398,32 +512,6 @@ IF (BUILD_TESTING) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK-clearall-objects") - - # -------------------------------------------------------------------- - # test file names - # -------------------------------------------------------------------- - SET (INFO_FILE testfiles/h5repack.info) - - SET (FILE0 h5repack_fill.h5) - SET (FILE1 h5repack_objs.h5) - SET (FILE2 h5repack_attr.h5) - SET (FILE3 h5repack_hlink.h5) - SET (FILE4 h5repack_layout.h5) - SET (FILE5 h5repack_early.h5) - SET (FILE7 h5repack_szip.h5) - SET (FILE8 h5repack_deflate.h5) - SET (FILE9 h5repack_shuffle.h5) - SET (FILE10 h5repack_fletcher.h5) - SET (FILE11 h5repack_filters.h5) - SET (FILE12 h5repack_nbit.h5) - SET (FILE13 h5repack_soffset.h5) - SET (FILE14 h5repack_layouto.h5 ) # A file with an older version of the layout message (copy of test/tlayouto.h5) - SET (FILE15 h5repack_named_dtypes.h5) - SET (FILE16 tfamily%05d.h5) # located in common testfiles folder - SET (FILE18 h5repack_layout2.h5) - SET (FILE_REF h5repack_refs.h5) - SET (FILE_ATTR_REF h5repack_attr_refs.h5) ADD_TEST (NAME H5REPACK-testh5repack_detect_szip COMMAND $) IF (HDF5_ENABLE_SZIP_SUPPORT) @@ -438,15 +526,10 @@ IF (BUILD_TESTING) SET (passRegex "no") SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") ENDIF (HDF5_ENABLE_SZIP_SUPPORT) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK-testh5repack_detect_szip") + SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS H5REPACK-clearall-objects) ADD_TEST (NAME H5REPACK-h5repacktest COMMAND $) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-h5repacktest PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPACK-h5repacktest PROPERTIES DEPENDS H5REPACK-testh5repack_detect_szip) SET (last_test "H5REPACK-h5repacktest") # @@ -740,47 +823,29 @@ IF (BUILD_TESTING) ######################################################### # layout options (these files have no filters) ######################################################### - ADD_H5_TEST (dset2_chunk_20x10 "TEST" ${FILE4} --layout=dset2:CHUNK=20x10) - ADD_H5_VERIFY_TEST (dset2_chunk_20x10 "TEST" 0 ${FILE4} dset2 CHUNKED) - ADD_H5_TEST (chunk_20x10 "TEST" ${FILE4} -l CHUNK=20x10) - ADD_H5_VERIFY_TEST (chunk_20x10 "TEST" 1 ${FILE4} null CHUNKED) - ADD_H5_TEST (dset2_conti "TEST" ${FILE4} -l dset2:CONTI) - ADD_H5_VERIFY_TEST (dset2_conti "TEST" 0 ${FILE4} dset2 CONTIGUOUS) - ADD_H5_TEST (conti "TEST" ${FILE4} -l CONTI) - ADD_H5_VERIFY_TEST (conti "TEST" 1 ${FILE4} null CONTIGUOUS) - ADD_H5_TEST (dset2_compa "TEST" ${FILE4} -l dset2:COMPA) - ADD_H5_VERIFY_TEST (dset2_compa "TEST" 0 ${FILE4} dset2 COMPACT) - ADD_H5_TEST (compa "TEST" ${FILE4} -l COMPA) - ADD_H5_VERIFY_TEST (compa "TEST" 1 ${FILE4} null COMPACT) + ADD_H5_VERIFY_TEST (dset2_chunk_20x10 "TEST" 0 ${FILE4} dset2 CHUNKED --layout=dset2:CHUNK=20x10) + ADD_H5_VERIFY_TEST (chunk_20x10 "TEST" 1 ${FILE4} null CHUNKED -l CHUNK=20x10) + ADD_H5_VERIFY_TEST (dset2_conti "TEST" 0 ${FILE4} dset2 CONTIGUOUS -l dset2:CONTI) + ADD_H5_VERIFY_TEST (conti "TEST" 1 ${FILE4} null CONTIGUOUS -l CONTI) + ADD_H5_VERIFY_TEST (dset2_compa "TEST" 0 ${FILE4} dset2 COMPACT -l dset2:COMPA) + ADD_H5_VERIFY_TEST (compa "TEST" 1 ${FILE4} null COMPACT -l COMPA) ################################################################ # layout conversions (file has no filters) ############################################################### - ADD_H5_TEST (dset_compa_conti "TEST" ${FILE4} -l dset_compact:CONTI) - ADD_H5_VERIFY_TEST (dset_compa_conti "TEST" 0 ${FILE4} dset_compact CONTIGUOUS) - ADD_H5_TEST (dset_compa_chunk "TEST" ${FILE4} -l dset_compact:CHUNK=2x5) - ADD_H5_VERIFY_TEST (dset_compa_chunk "TEST" 0 ${FILE4} dset_compact CHUNKED) - ADD_H5_TEST (dset_compa_compa "TEST" ${FILE4} -l dset_compact:COMPA) - ADD_H5_VERIFY_TEST (dset_compa_compa "TEST" 0 ${FILE4} dset_compact COMPACT) - ADD_H5_TEST (dset_conti_compa "TEST" ${FILE4} -l dset_contiguous:COMPA) - ADD_H5_VERIFY_TEST (dset_conti_compa "TEST" 0 ${FILE4} dset_contiguous COMPACT) - ADD_H5_TEST (dset_conti_chunk "TEST" ${FILE4} -l dset_contiguous:CHUNK=3x6) - ADD_H5_VERIFY_TEST (dset_conti_chunk "TEST" 0 ${FILE4} dset_contiguous CHUNKED) - ADD_H5_TEST (dset_conti_conti "TEST" ${FILE4} -l dset_contiguous:CONTI) - ADD_H5_VERIFY_TEST (dset_conti_conti "TEST" 0 ${FILE4} dset_contiguous CONTIGUOUS) - ADD_H5_TEST (chunk_compa "TEST" ${FILE4} -l dset_chunk:COMPA) - ADD_H5_VERIFY_TEST (chunk_compa "TEST" 0 ${FILE4} dset_chunk COMPACT) - ADD_H5_TEST (chunk_conti "TEST" ${FILE4} -l dset_chunk:CONTI) - ADD_H5_VERIFY_TEST (chunk_conti "TEST" 0 ${FILE4} dset_chunk CONTIGUOUS) - ADD_H5_TEST (chunk_18x13 "TEST" ${FILE4} -l dset_chunk:CHUNK=18x13) - ADD_H5_VERIFY_TEST (chunk_18x13 "TEST" 0 ${FILE4} dset_chunk CHUNKED) + ADD_H5_VERIFY_TEST (dset_compa_conti "TEST" 0 ${FILE4} dset_compact CONTIGUOUS -l dset_compact:CONTI) + ADD_H5_VERIFY_TEST (dset_compa_chunk "TEST" 0 ${FILE4} dset_compact CHUNKED -l dset_compact:CHUNK=2x5) + ADD_H5_VERIFY_TEST (dset_compa_compa "TEST" 0 ${FILE4} dset_compact COMPACT -l dset_compact:COMPA) + ADD_H5_VERIFY_TEST (dset_conti_compa "TEST" 0 ${FILE4} dset_contiguous COMPACT -l dset_contiguous:COMPA) + ADD_H5_VERIFY_TEST (dset_conti_chunk "TEST" 0 ${FILE4} dset_contiguous CHUNKED -l dset_contiguous:CHUNK=3x6) + ADD_H5_VERIFY_TEST (dset_conti_conti "TEST" 0 ${FILE4} dset_contiguous CONTIGUOUS -l dset_contiguous:CONTI) + ADD_H5_VERIFY_TEST (chunk_compa "TEST" 0 ${FILE4} dset_chunk COMPACT -l dset_chunk:COMPA) + ADD_H5_VERIFY_TEST (chunk_conti "TEST" 0 ${FILE4} dset_chunk CONTIGUOUS -l dset_chunk:CONTI) + ADD_H5_VERIFY_TEST (chunk_18x13 "TEST" 0 ${FILE4} dset_chunk CHUNKED -l dset_chunk:CHUNK=18x13) # test convert small size dataset ( < 1k) to compact layout without -m - ADD_H5_TEST (contig_small_compa "TEST" ${FILE18} -l contig_small:COMPA) - ADD_H5_VERIFY_TEST (contig_small_compa "TEST" 0 ${FILE18} contig_small COMPACT) - - ADD_H5_TEST (contig_small_fixed_compa "TEST" ${FILE18} -l chunked_small_fixed:COMPA) - ADD_H5_VERIFY_TEST (contig_small_fixed_compa "TEST" 0 ${FILE18} chunked_small_fixed COMPACT) + ADD_H5_VERIFY_TEST (contig_small_compa "TEST" 0 ${FILE18} contig_small COMPACT -l contig_small:COMPA) + ADD_H5_VERIFY_TEST (contig_small_fixed_compa "TEST" 0 ${FILE18} chunked_small_fixed COMPACT -l chunked_small_fixed:COMPA) #--------------------------------------------------------------------------- # Test file contains chunked datasets (need multiple dsets) with @@ -788,17 +853,14 @@ IF (BUILD_TESTING) # Use first dset to test. #--------------------------------------------------------------------------- # chunk to chunk - specify chunk dim bigger than any current dim -ADD_H5_TEST (chunk2chunk "TEST" h5repack_layout3.h5 -l chunk_unlimit1:CHUNK=100x300) -ADD_H5_VERIFY_TEST (chunk2chunk "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK) +ADD_H5_VERIFY_TEST (chunk2chunk "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:CHUNK=100x300) # chunk to contiguous -ADD_H5_TEST (chunk2conti "TEST" h5repack_layout3.h5 -l chunk_unlimit1:CONTI) -ADD_H5_VERIFY_TEST (chunk2conti "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CONTI) +ADD_H5_VERIFY_TEST (chunk2conti "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CONTI -l chunk_unlimit1:CONTI) # chunk to compact - convert big dataset (should be > 64k) for this purpose, # should remain as original layout (chunk) -ADD_H5_TEST (chunk2compa "TEST" h5repack_layout3.h5 -l chunk_unlimit1:COMPA) -ADD_H5_VERIFY_TEST (chunk2compa "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK) +ADD_H5_VERIFY_TEST (chunk2compa "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:COMPA) #-------------------------------------------------------------------------- # Test -f for some specific cases. Chunked dataset with unlimited max dims. @@ -808,16 +870,13 @@ ADD_H5_VERIFY_TEST (chunk2compa "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUN # - should not change max dims from unlimit # chunk dim is bigger than dataset dim. ( dset size < 64k ) -ADD_H5_TEST (error1 "TEST" h5repack_layout3.h5 -f chunk_unlimit1:NONE) -ADD_H5_VERIFY_TEST (error1 "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 H5S_UNLIMITED) +ADD_H5_VERIFY_TEST (error1 "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 H5S_UNLIMITED -f chunk_unlimit1:NONE) # chunk dim is bigger than dataset dim. ( dset size > 64k ) -ADD_H5_TEST (error2 "TEST" h5repack_layout3.h5 -f chunk_unlimit2:NONE) -ADD_H5_VERIFY_TEST (error2 "TEST" 0 h5repack_layout3.h5 chunk_unlimit2 H5S_UNLIMITED) +ADD_H5_VERIFY_TEST (error2 "TEST" 0 h5repack_layout3.h5 chunk_unlimit2 H5S_UNLIMITED -f chunk_unlimit2:NONE) # chunk dims are smaller than dataset dims. ( dset size < 64k ) -ADD_H5_TEST (error3 "TEST" h5repack_layout3.h5 -f chunk_unlimit3:NONE) -ADD_H5_VERIFY_TEST (error3 "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 H5S_UNLIMITED) +ADD_H5_VERIFY_TEST (error3 "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 H5S_UNLIMITED -f chunk_unlimit3:NONE) # file input - should not fail ADD_H5_TEST (error4 "TEST" h5repack_layout3.h5 -f NONE) @@ -829,22 +888,20 @@ ADD_H5_TEST (error4 "TEST" h5repack_layout3.h5 -f NONE) ADD_H5_TEST (native_attr "TEST" ${FILE2} -n) # latest file format with long switches. use FILE4=h5repack_layout.h5 (no filters) - SET (arg ${FILE4} --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype]) + SET (arg --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype]) SET (TESTTYPE "TEST") IF (NOT USE_FILTER_DEFLATE) SET (TESTTYPE "SKIP") ENDIF (NOT USE_FILTER_DEFLATE) - ADD_H5_TEST (layout_long_switches ${TESTTYPE} ${arg}) - ADD_H5_VERIFY_TEST (layout_long_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED) + ADD_H5_VERIFY_TEST (layout_long_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) # latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) - SET (arg ${FILE4} -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) + SET (arg -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) SET (TESTTYPE "TEST") IF (NOT USE_FILTER_DEFLATE) SET (TESTTYPE "SKIP") ENDIF (NOT USE_FILTER_DEFLATE) - ADD_H5_TEST (layout_short_switches ${TESTTYPE} ${arg}) - ADD_H5_VERIFY_TEST (layout_short_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED) + ADD_H5_VERIFY_TEST (layout_short_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) # several global filters SET (arg ${FILE4} --filter GZIP=1 --filter SHUF) -- cgit v0.12 From 32da9c96aed341fa67670e84b82ca9292bd1506c Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 17 Feb 2013 11:30:06 -0500 Subject: [svn-r23290] Snapshot version 1.9 release 144 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.txt b/README.txt index 224be1b..12d614f 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.144 currently under development +HDF5 version 1.9.145 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 76b7717..3f6d59f 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -467,7 +467,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 134 +LT_VERS_REVISION = 135 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index d94d73c..ae521c0 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 134 +LT_VERS_REVISION = 135 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 0fce423..27c18a6 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.144. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.145. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.144' -PACKAGE_STRING='HDF5 1.9.144' +PACKAGE_VERSION='1.9.145' +PACKAGE_STRING='HDF5 1.9.145' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1484,7 +1484,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.144 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.145 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1554,7 +1554,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.144:";; + short | recursive ) echo "Configuration of HDF5 1.9.145:";; esac cat <<\_ACEOF @@ -1750,7 +1750,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.144 +HDF5 configure 1.9.145 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2844,7 +2844,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.144, which was +It was created by HDF5 $as_me 1.9.145, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3676,7 +3676,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.144' + VERSION='1.9.145' cat >>confdefs.h <<_ACEOF @@ -31723,7 +31723,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.144, which was +This file was extended by HDF5 $as_me 1.9.145, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31789,7 +31789,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.144 +HDF5 config.status 1.9.145 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -34562,7 +34562,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.144 +HDF5 config.lt 1.9.145 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. diff --git a/configure.ac b/configure.ac index c6959f9..72bb163 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.144], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.145], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 6a816b0..8631a97 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -517,7 +517,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 134 +LT_VERS_REVISION = 135 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 149fd6d..c1c64e5 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -458,7 +458,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 134 +LT_VERS_REVISION = 135 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index d1b1977..bd1ecac 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -474,7 +474,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 134 +LT_VERS_REVISION = 135 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index afef6f7..3115a9e 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -457,7 +457,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 134 +LT_VERS_REVISION = 135 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 994bb00..9dc895c 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.144 currently under development +HDF5 version 1.9.145 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 63439c4..079fb96 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 144 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 145 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.144" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.145" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index d9dca2d..d31b371 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -522,7 +522,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 134 +LT_VERS_REVISION = 135 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 7787026..8064464 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.144" +#define H5_PACKAGE_STRING "HDF5 1.9.145" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.144" +#define H5_PACKAGE_VERSION "1.9.145" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.144" +#define H5_VERSION "1.9.145" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From a976ca99a9de1fbe2496c23fa941b7c3e8af3967 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Sun, 17 Feb 2013 21:01:18 -0500 Subject: [svn-r23293] Fix for HDFFV-8268: Fortran wrapper for H5Fget_file_image function. Tested: (jam, gnu,intel compilers) --- MANIFEST | 3 + fortran/examples/Makefile.in | 2 +- fortran/src/CMakeLists.txt | 1 + fortran/src/H5Ff.c | 34 +++++++ fortran/src/H5Fff_F03.f90 | 104 +++++++++++++++++++++ fortran/src/H5Fff_F90.f90 | 43 +++++++++ fortran/src/H5Lf.c | 2 +- fortran/src/H5f90proto.h | 2 + fortran/src/HDF5.f90 | 1 + fortran/src/Makefile.am | 9 +- fortran/src/Makefile.in | 22 +++-- fortran/src/h5fc.in | 8 +- fortran/src/hdf5_fortrandll.def.in | 1 + fortran/test/CMakeLists.txt | 1 + fortran/test/Makefile.am | 2 +- fortran/test/Makefile.in | 7 +- fortran/test/fortranlib_test_F03.f90 | 5 + fortran/test/tH5F_F03.f90 | 171 +++++++++++++++++++++++++++++++++++ 18 files changed, 396 insertions(+), 22 deletions(-) create mode 100644 fortran/src/H5Fff_F03.f90 create mode 100644 fortran/src/H5Fff_F90.f90 create mode 100644 fortran/test/tH5F_F03.f90 diff --git a/MANIFEST b/MANIFEST index e60e234..25c118c8 100644 --- a/MANIFEST +++ b/MANIFEST @@ -293,6 +293,8 @@ ./fortran/src/H5FDmpioff.f90 ./fortran/src/H5Ff.c ./fortran/src/H5Fff.f90 +./fortran/src/H5Fff_F90.f90 +./fortran/src/H5Fff_F03.f90 ./fortran/src/H5Gf.c ./fortran/src/H5Gff.f90 ./fortran/src/H5If.c @@ -354,6 +356,7 @@ ./fortran/test/tH5E_F03.f90 ./fortran/test/tH5E.f90 ./fortran/test/tH5F.f90 +./fortran/test/tH5F_F03.f90 ./fortran/test/tH5G.f90 ./fortran/test/tH5G_1_8.f90 ./fortran/test/tH5I.f90 diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index 5f6124c..a3b0b98 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -70,7 +70,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/run-fortran-ex.sh.in $(srcdir)/testh5fc.sh.in \ $(top_srcdir)/bin/mkinstalldirs \ $(top_srcdir)/config/commence.am \ diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 765bb65..c41916a 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -188,6 +188,7 @@ SET (f90_F_SRCS ${HDF5_F90_SRC_SOURCE_DIR}/H5Aff${F_STATUS}.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Dff${F_STATUS}.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Eff${F_STATUS}.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Fff${F_STATUS}.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Lff${F_STATUS}.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Off${F_STATUS}.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Pff${F_STATUS}.f90 diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c index 1259d4d..4910aca 100644 --- a/fortran/src/H5Ff.c +++ b/fortran/src/H5Ff.c @@ -679,3 +679,37 @@ nh5fget_filesize_c(hid_t_f *file_id, hsize_t_f *size) done: return ret_value; } + +/****if* H5Ff/h5fget_file_image_c + * NAME + * h5fget_file_image_c + * PURPOSE + * Calls h5fget_file_image + * INPUTS + * file_id - Target file identifier. + * buf_ptr - Pointer to the buffer into which the image of the HDF5 file is to be copied. + * buf_len - Size of the supplied buffer. + * OUTPUTS + * buf_req - The size in bytes of the buffer required to store the file image. + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * November 26, 2012 + * SOURCE +*/ +int_f +nh5fget_file_image_c(hid_t_f *file_id, void *buf_ptr, size_t_f *buf_len, size_t_f *buf_req) +/******/ +{ + herr_t ret_value=0; /* Return value */ + + /* + * Call h5fget_file_image function + */ + if ((*buf_req = (size_t_f)H5Fget_file_image((hid_t)*file_id, buf_ptr, (size_t)*buf_len)) < 0) + HGOTO_DONE(FAIL); + +done: + return ret_value; +} diff --git a/fortran/src/H5Fff_F03.f90 b/fortran/src/H5Fff_F03.f90 new file mode 100644 index 0000000..eda4e24 --- /dev/null +++ b/fortran/src/H5Fff_F03.f90 @@ -0,0 +1,104 @@ +!****h* ROBODoc/H5F (F03) +! +! NAME +! H5F_PROVISIONAL +! +! PURPOSE +! This file contains Fortran 2003 interfaces for H5F functions. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! Copyright by The HDF Group. * +! 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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +! access to either file, you may request a copy from help@hdfgroup.org. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! *** IMPORTANT *** +! If you add a new H5T function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + + +MODULE H5F_PROVISIONAL + + USE H5GLOBAL + USE, INTRINSIC :: ISO_C_BINDING + + +CONTAINS +!****s* H5F (F03)/h5fget_file_image_f_F03 +! +! NAME +! h5fget_file_image_f +! +! PURPOSE +! Retrieves a copy of the image of an existing, open file. +! +! Inputs: +! file_id - Target file identifier. +! buf_ptr - Pointer to the buffer into which the image of the HDF5 file is to be copied. +! buf_len - Size of the supplied buffer. +! +! Outputs: +! hdferr - error code: +! 0 on success and -1 on failure +! Optional: +! buf_size - The size in bytes of the buffer required to store the file image. +! +! AUTHOR +! M. Scot Breitenfeld +! November 26, 2012 +! +! Fortran2003 Interface: + SUBROUTINE h5fget_file_image_f(file_id, buf_ptr, buf_len, hdferr, buf_size) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: file_id + TYPE(C_PTR) , INTENT(INOUT) :: buf_ptr + INTEGER(SIZE_T) , INTENT(IN) :: buf_len + INTEGER(SIZE_T) , INTENT(OUT), OPTIONAL :: buf_size + INTEGER , INTENT(OUT) :: hdferr +!***** + + INTEGER(SIZE_T) :: buf_size_default + + INTERFACE + INTEGER FUNCTION h5fget_file_image_c(file_id, buf_ptr, buf_len, buf_size) + USE, INTRINSIC :: ISO_C_BINDING + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_FILE_IMAGE_C'::h5fget_file_image_c + !DEC$ENDIF + INTEGER(HID_T) , INTENT(IN) :: file_id + TYPE(C_PTR) , VALUE :: buf_ptr + INTEGER(SIZE_T) , INTENT(IN) :: buf_len + INTEGER(SIZE_T), INTENT(IN) :: buf_size + END FUNCTION h5fget_file_image_c + END INTERFACE + + + IF(PRESENT(buf_size))THEN + buf_ptr = C_NULL_PTR + ENDIF + + hdferr = h5fget_file_image_c(file_id, buf_ptr, buf_len, buf_size_default) + + IF(PRESENT(buf_size))THEN + buf_size = buf_size_default + ENDIF + + END SUBROUTINE h5fget_file_image_f + +END MODULE H5F_PROVISIONAL diff --git a/fortran/src/H5Fff_F90.f90 b/fortran/src/H5Fff_F90.f90 new file mode 100644 index 0000000..a23bb3d --- /dev/null +++ b/fortran/src/H5Fff_F90.f90 @@ -0,0 +1,43 @@ +!****h* ROBODoc/H5F (F90) +! +! NAME +! H5F_PROVISIONAL +! +! PURPOSE +! This file contains Fortran 90 interfaces for H5F functions. It +! containsthe same functions as H5Fff_F03.f90, when applicable, +! but excludes the Fortran 2003 functions and the interface listings. +! This file will be compiled instead of H5Fff_F03.f90 if Fortran 2003 +! functions are not enabled. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! Copyright by The HDF Group. * +! 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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +! access to either file, you may request a copy from help@hdfgroup.org. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! *** IMPORTANT *** +! If you add a new H5F function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + + +MODULE H5F_PROVISIONAL + + USE H5GLOBAL + IMPLICIT NONE + +END MODULE H5F_PROVISIONAL diff --git a/fortran/src/H5Lf.c b/fortran/src/H5Lf.c index e5b01ed..c5138b6 100644 --- a/fortran/src/H5Lf.c +++ b/fortran/src/H5Lf.c @@ -725,7 +725,7 @@ nh5lget_name_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, if(NULL == (c_name = (char *)HDmalloc(c_size))) HGOTO_DONE(FAIL) - if((*size = (size_t)H5Lget_name_by_idx((hid_t)*loc_id, c_group_name, (H5_index_t)*index_field, + if((*size = (size_t_f)H5Lget_name_by_idx((hid_t)*loc_id, c_group_name, (H5_index_t)*index_field, (H5_iter_order_t)*order, (hsize_t)*n,c_name, c_size, (hid_t)*lapl_id)) < 0) HGOTO_DONE(FAIL) diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 9340c2a..53b6874 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -93,6 +93,7 @@ typedef struct H5O_info_t_f { #define nh5fget_obj_count_c H5_FC_FUNC_(h5fget_obj_count_c, H5FGET_OBJ_COUNT_C) #define nh5fget_obj_ids_c H5_FC_FUNC_(h5fget_obj_ids_c, H5FGET_OBJ_IDS_C) #define nh5fget_freespace_c H5_FC_FUNC_(h5fget_freespace_c, H5FGET_FREESPACE_C) +#define nh5fget_file_image_c H5_FC_FUNC_(h5fget_file_image_c, H5FGET_FILE_IMAGE_C) #define nh5fget_name_c H5_FC_FUNC_(h5fget_name_c, H5FGET_NAME_C) #define nh5fget_filesize_c H5_FC_FUNC_(h5fget_filesize_c, H5FGET_FILESIZE_C) @@ -108,6 +109,7 @@ H5_FCDLL int_f nh5fget_access_plist_c (hid_t_f *file_id, hid_t_f *access_id); H5_FCDLL int_f nh5fget_obj_count_c (hid_t_f *file_id, int_f *obj_type, size_t_f *obj_count); H5_FCDLL int_f nh5fget_obj_ids_c (hid_t_f *file_id, int_f *obj_type, size_t_f *max_objs, hid_t_f *obj_ids, size_t_f *num_objs); H5_FCDLL int_f nh5fget_freespace_c (hid_t_f *file_id, hssize_t_f *free_space); +H5_FCDLL int_f nh5fget_file_image_c(hid_t_f *file_id, void *buf_ptr, size_t_f *buf_len, size_t_f *buf_req); H5_FCDLL int_f nh5fflush_c (hid_t_f *obj_id, int_f *scope); H5_FCDLL int_f nh5fget_name_c(hid_t_f *obj_id, size_t_f *size, _fcd buf, size_t_f *buflen); H5_FCDLL int_f nh5fget_filesize_c(hid_t_f *file_id, hsize_t_f *size); diff --git a/fortran/src/HDF5.f90 b/fortran/src/HDF5.f90 index cb3d8bf..75af333 100644 --- a/fortran/src/HDF5.f90 +++ b/fortran/src/HDF5.f90 @@ -30,6 +30,7 @@ MODULE HDF5 USE H5GLOBAL USE H5F + USE H5F_PROVISIONAL USE H5G USE H5E USE H5E_PROVISIONAL diff --git a/fortran/src/Makefile.am b/fortran/src/Makefile.am index e6ef610..12c38e2 100644 --- a/fortran/src/Makefile.am +++ b/fortran/src/Makefile.am @@ -76,7 +76,7 @@ libhdf5_fortran_la_SOURCES=H5f90global.f90 \ H5_DBLE_Interface$(F_DBLE).f90 \ H5f90kit.c H5_f.c H5Af.c H5Df.c H5Ef.c H5Ff.c H5Gf.c \ H5If.c H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c H5Tf.c H5Zf.c \ - H5Aff$(F_STATUS).f90 H5Dff$(F_STATUS).f90 H5Eff$(F_STATUS).f90 H5Lff$(F_STATUS).f90 \ + H5Aff$(F_STATUS).f90 H5Dff$(F_STATUS).f90 H5Eff$(F_STATUS).f90 H5Fff$(F_STATUS).f90 H5Lff$(F_STATUS).f90 \ H5Off$(F_STATUS).f90 H5Pff$(F_STATUS).f90 H5Rff$(F_STATUS).f90 H5Tff$(F_STATUS).f90 $(PARALLEL_COND_SRC) # HDF5 Fortran library depends on HDF5 Library. @@ -201,6 +201,7 @@ H5Dff.lo: $(srcdir)/H5Dff.f90 H5f90global.lo H5Aff$(F_STATUS).lo: $(srcdir)/H5Aff$(F_STATUS).f90 H5f90global.lo H5Dff$(F_STATUS).lo: $(srcdir)/H5Dff$(F_STATUS).f90 H5f90global.lo H5Eff$(F_STATUS).lo: $(srcdir)/H5Eff$(F_STATUS).f90 H5f90global.lo +H5Fff$(F_STATUS).lo: $(srcdir)/H5Fff$(F_STATUS).f90 H5f90global.lo H5Lff$(F_STATUS).lo: $(srcdir)/H5Lff$(F_STATUS).f90 H5f90global.lo H5Off$(F_STATUS).lo: $(srcdir)/H5Off$(F_STATUS).f90 H5f90global.lo H5Pff$(F_STATUS).lo: $(srcdir)/H5Pff$(F_STATUS).f90 H5f90global.lo @@ -217,11 +218,11 @@ H5Rff.lo: $(srcdir)/H5Rff.f90 H5f90global.lo H5Sff.lo: $(srcdir)/H5Sff.f90 H5f90global.lo H5Tff.lo: $(srcdir)/H5Tff.f90 H5f90global.lo H5Zff.lo: $(srcdir)/H5Zff.f90 H5f90global.lo -H5_DBLE_Interface$(F_DBLE).lo: $(srcdir)/H5_DBLE_Interface$(F_DBLE).f90 H5Aff$(F_STATUS).lo H5Dff$(F_STATUS).lo H5Eff$(F_STATUS).lo H5Pff$(F_STATUS).lo +H5_DBLE_Interface$(F_DBLE).lo: $(srcdir)/H5_DBLE_Interface$(F_DBLE).f90 H5Aff$(F_STATUS).lo H5Dff$(F_STATUS).lo H5Fff$(F_STATUS).lo H5Eff$(F_STATUS).lo H5Pff$(F_STATUS).lo HDF5.lo: $(srcdir)/HDF5.f90 H5f90global.lo H5_ff$(F_STATUS).lo H5_ff.lo H5Aff.lo H5Aff$(F_STATUS).lo \ H5Dff.lo H5Dff$(F_STATUS).lo \ H5Eff.lo H5Eff$(F_STATUS).lo \ - H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ + H5Fff.lo H5Fff$(F_STATUS).lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ H5Off.lo H5Off$(F_STATUS).lo H5Pff.lo H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo H5Rff.lo \ H5Sff.lo H5Tff.lo H5Tff$(F_STATUS).lo H5Zff.lo \ H5_DBLE_Interface$(F_DBLE).lo @@ -230,7 +231,7 @@ HDF5mpio.lo: $(srcdir)/H5FDmpioff.f90 H5f90global.lo H5_ff$(F_STATUS).lo H5Aff.lo H5Aff$(F_STATUS).lo \ H5Dff.lo H5Dff$(F_STATUS).lo \ H5Eff.lo H5Eff$(F_STATUS).lo \ - H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ + H5Fff.lo H5Fff$(F_STATUS).lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ H5Off.lo H5Off$(F_STATUS).lo H5Pff.lo H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo H5Rff.lo \ H5Sff.lo H5Tff.lo H5Tff$(F_STATUS).lo H5Zff.lo \ H5_DBLE_Interface$(F_DBLE).lo H5FDmpioff.lo diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 8631a97..45fa4a4 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -128,9 +128,10 @@ am__libhdf5_fortran_la_SOURCES_DIST = H5f90global.f90 \ H5_DBLE_Interface$(F_DBLE).f90 H5f90kit.c H5_f.c H5Af.c H5Df.c \ H5Ef.c H5Ff.c H5Gf.c H5If.c H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c \ H5Tf.c H5Zf.c H5Aff$(F_STATUS).f90 H5Dff$(F_STATUS).f90 \ - H5Eff$(F_STATUS).f90 H5Lff$(F_STATUS).f90 H5Off$(F_STATUS).f90 \ - H5Pff$(F_STATUS).f90 H5Rff$(F_STATUS).f90 H5Tff$(F_STATUS).f90 \ - HDF5.f90 H5FDmpiof.c HDF5mpio.f90 H5FDmpioff.f90 + H5Eff$(F_STATUS).f90 H5Fff$(F_STATUS).f90 H5Lff$(F_STATUS).f90 \ + H5Off$(F_STATUS).f90 H5Pff$(F_STATUS).f90 H5Rff$(F_STATUS).f90 \ + H5Tff$(F_STATUS).f90 HDF5.f90 H5FDmpiof.c HDF5mpio.f90 \ + H5FDmpioff.f90 @BUILD_PARALLEL_CONDITIONAL_FALSE@am__objects_1 = HDF5.lo @BUILD_PARALLEL_CONDITIONAL_TRUE@am__objects_1 = H5FDmpiof.lo \ @BUILD_PARALLEL_CONDITIONAL_TRUE@ HDF5mpio.lo H5FDmpioff.lo @@ -141,9 +142,9 @@ am_libhdf5_fortran_la_OBJECTS = H5f90global.lo H5fortran_types.lo \ H5f90kit.lo H5_f.lo H5Af.lo H5Df.lo H5Ef.lo H5Ff.lo H5Gf.lo \ H5If.lo H5Lf.lo H5Of.lo H5Pf.lo H5Rf.lo H5Sf.lo H5Tf.lo \ H5Zf.lo H5Aff$(F_STATUS).lo H5Dff$(F_STATUS).lo \ - H5Eff$(F_STATUS).lo H5Lff$(F_STATUS).lo H5Off$(F_STATUS).lo \ - H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo H5Tff$(F_STATUS).lo \ - $(am__objects_1) + H5Eff$(F_STATUS).lo H5Fff$(F_STATUS).lo H5Lff$(F_STATUS).lo \ + H5Off$(F_STATUS).lo H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo \ + H5Tff$(F_STATUS).lo $(am__objects_1) libhdf5_fortran_la_OBJECTS = $(am_libhdf5_fortran_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -556,7 +557,7 @@ libhdf5_fortran_la_SOURCES = H5f90global.f90 \ H5_DBLE_Interface$(F_DBLE).f90 \ H5f90kit.c H5_f.c H5Af.c H5Df.c H5Ef.c H5Ff.c H5Gf.c \ H5If.c H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c H5Tf.c H5Zf.c \ - H5Aff$(F_STATUS).f90 H5Dff$(F_STATUS).f90 H5Eff$(F_STATUS).f90 H5Lff$(F_STATUS).f90 \ + H5Aff$(F_STATUS).f90 H5Dff$(F_STATUS).f90 H5Eff$(F_STATUS).f90 H5Fff$(F_STATUS).f90 H5Lff$(F_STATUS).f90 \ H5Off$(F_STATUS).f90 H5Pff$(F_STATUS).f90 H5Rff$(F_STATUS).f90 H5Tff$(F_STATUS).f90 $(PARALLEL_COND_SRC) @@ -1101,6 +1102,7 @@ H5Dff.lo: $(srcdir)/H5Dff.f90 H5f90global.lo H5Aff$(F_STATUS).lo: $(srcdir)/H5Aff$(F_STATUS).f90 H5f90global.lo H5Dff$(F_STATUS).lo: $(srcdir)/H5Dff$(F_STATUS).f90 H5f90global.lo H5Eff$(F_STATUS).lo: $(srcdir)/H5Eff$(F_STATUS).f90 H5f90global.lo +H5Fff$(F_STATUS).lo: $(srcdir)/H5Fff$(F_STATUS).f90 H5f90global.lo H5Lff$(F_STATUS).lo: $(srcdir)/H5Lff$(F_STATUS).f90 H5f90global.lo H5Off$(F_STATUS).lo: $(srcdir)/H5Off$(F_STATUS).f90 H5f90global.lo H5Pff$(F_STATUS).lo: $(srcdir)/H5Pff$(F_STATUS).f90 H5f90global.lo @@ -1117,11 +1119,11 @@ H5Rff.lo: $(srcdir)/H5Rff.f90 H5f90global.lo H5Sff.lo: $(srcdir)/H5Sff.f90 H5f90global.lo H5Tff.lo: $(srcdir)/H5Tff.f90 H5f90global.lo H5Zff.lo: $(srcdir)/H5Zff.f90 H5f90global.lo -H5_DBLE_Interface$(F_DBLE).lo: $(srcdir)/H5_DBLE_Interface$(F_DBLE).f90 H5Aff$(F_STATUS).lo H5Dff$(F_STATUS).lo H5Eff$(F_STATUS).lo H5Pff$(F_STATUS).lo +H5_DBLE_Interface$(F_DBLE).lo: $(srcdir)/H5_DBLE_Interface$(F_DBLE).f90 H5Aff$(F_STATUS).lo H5Dff$(F_STATUS).lo H5Fff$(F_STATUS).lo H5Eff$(F_STATUS).lo H5Pff$(F_STATUS).lo HDF5.lo: $(srcdir)/HDF5.f90 H5f90global.lo H5_ff$(F_STATUS).lo H5_ff.lo H5Aff.lo H5Aff$(F_STATUS).lo \ H5Dff.lo H5Dff$(F_STATUS).lo \ H5Eff.lo H5Eff$(F_STATUS).lo \ - H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ + H5Fff.lo H5Fff$(F_STATUS).lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ H5Off.lo H5Off$(F_STATUS).lo H5Pff.lo H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo H5Rff.lo \ H5Sff.lo H5Tff.lo H5Tff$(F_STATUS).lo H5Zff.lo \ H5_DBLE_Interface$(F_DBLE).lo @@ -1130,7 +1132,7 @@ HDF5mpio.lo: $(srcdir)/H5FDmpioff.f90 H5f90global.lo H5_ff$(F_STATUS).lo H5Aff.lo H5Aff$(F_STATUS).lo \ H5Dff.lo H5Dff$(F_STATUS).lo \ H5Eff.lo H5Eff$(F_STATUS).lo \ - H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ + H5Fff.lo H5Fff$(F_STATUS).lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ H5Off.lo H5Off$(F_STATUS).lo H5Pff.lo H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo H5Rff.lo \ H5Sff.lo H5Tff.lo H5Tff$(F_STATUS).lo H5Zff.lo \ H5_DBLE_Interface$(F_DBLE).lo H5FDmpioff.lo diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in index 2d7b5b4..d24a0ae 100644 --- a/fortran/src/h5fc.in +++ b/fortran/src/h5fc.in @@ -233,8 +233,12 @@ for arg in $@ ; do *) allargs="$allargs $arg" if [ -s "$arg" ] ; then ext=`expr "$arg" : '.*\(\..*\)'` - if [ "$ext" = ".f" -o "$ext" = ".F" -o "$ext" = ".f90" -o \ - "$ext" = ".for" -o "$ext" = ".FOR" -o "$ext" = ".F90" ] ; then + if [ "$ext" = ".f" -o "$ext" = ".F" -o \ + "$ext" = ".for" -o "$ext" = ".FOR" -o \ + "$ext" = ".ftn" -o "$ext" = ".FTN" -o \ + ["$ext" = ".f[0-9][0-9]"] -o \ + ["$ext" = ".F[0-9][0-9]"] \ + ] ; then do_compile="yes" compile_args="$compile_args $arg" fname=`basename $arg $ext` diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index bf7596d..4ce185b 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -228,6 +228,7 @@ H5F_mp_H5FGET_ACCESS_PLIST_F H5F_mp_H5FIS_HDF5_F H5F_mp_H5FGET_NAME_F H5F_mp_H5FGET_FILESIZE_F +@H5_NOF03EXP@H5F_PROVISIONAL_mp_H5FGET_FILE_IMAGE_F ; H5G H5G_mp_H5GOPEN_F H5G_mp_H5GCREATE_F diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 5b41a32..5b9ca11 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -105,6 +105,7 @@ IF (HDF5_ENABLE_F2003) fortranlib_test_F03.f90 tH5F.f90 tH5E_F03.f90 + tH5F_F03.f90 tH5L_F03.f90 tH5O_F03.f90 tH5P_F03.f90 diff --git a/fortran/test/Makefile.am b/fortran/test/Makefile.am index 42dd127..84f55e5 100644 --- a/fortran/test/Makefile.am +++ b/fortran/test/Makefile.am @@ -68,7 +68,7 @@ fortranlib_test_1_8_SOURCES = fortranlib_test_1_8.f90 \ if FORTRAN_2003_CONDITIONAL_F fortranlib_test_F03_SOURCES = fortranlib_test_F03.f90 \ - tH5F.f90 tH5E_F03.f90 tH5L_F03.f90 tH5O_F03.f90 tH5P_F03.f90 tH5T_F03.f90 + tH5F.f90 tH5E_F03.f90 tH5F_F03.f90 tH5L_F03.f90 tH5O_F03.f90 tH5P_F03.f90 tH5T_F03.f90 endif diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index b9f05e3..7476160 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -136,11 +136,12 @@ fortranlib_test_1_8_LDADD = $(LDADD) fortranlib_test_1_8_DEPENDENCIES = libh5test_fortran.la $(LIBH5TEST) \ $(LIBH5F) $(LIBHDF5) am__fortranlib_test_F03_SOURCES_DIST = fortranlib_test_F03.f90 \ - tH5F.f90 tH5E_F03.f90 tH5L_F03.f90 tH5O_F03.f90 tH5P_F03.f90 \ - tH5T_F03.f90 + tH5F.f90 tH5E_F03.f90 tH5F_F03.f90 tH5L_F03.f90 tH5O_F03.f90 \ + tH5P_F03.f90 tH5T_F03.f90 @FORTRAN_2003_CONDITIONAL_F_TRUE@am_fortranlib_test_F03_OBJECTS = fortranlib_test_F03.$(OBJEXT) \ @FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5F.$(OBJEXT) \ @FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5E_F03.$(OBJEXT) \ +@FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5F_F03.$(OBJEXT) \ @FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5L_F03.$(OBJEXT) \ @FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5O_F03.$(OBJEXT) \ @FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5P_F03.$(OBJEXT) \ @@ -527,7 +528,7 @@ fortranlib_test_1_8_SOURCES = fortranlib_test_1_8.f90 \ tH5F.f90 tH5O.f90 tH5A_1_8.f90 tH5G_1_8.f90 @FORTRAN_2003_CONDITIONAL_F_TRUE@fortranlib_test_F03_SOURCES = fortranlib_test_F03.f90 \ -@FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5F.f90 tH5E_F03.f90 tH5L_F03.f90 tH5O_F03.f90 tH5P_F03.f90 tH5T_F03.f90 +@FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5F.f90 tH5E_F03.f90 tH5F_F03.f90 tH5L_F03.f90 tH5O_F03.f90 tH5P_F03.f90 tH5T_F03.f90 fflush1_SOURCES = fflush1.f90 fflush2_SOURCES = fflush2.f90 diff --git a/fortran/test/fortranlib_test_F03.f90 b/fortran/test/fortranlib_test_F03.f90 index 606b050..111d35e 100644 --- a/fortran/test/fortranlib_test_F03.f90 +++ b/fortran/test/fortranlib_test_F03.f90 @@ -163,6 +163,11 @@ PROGRAM fortranlibtest_F03 CALL obj_info(ret_total_error) CALL write_test_status(ret_total_error, ' Testing object info functions ', total_error) + ret_total_error = 0 + CALL test_get_file_image(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing get file image ', total_error) + + WRITE(*,*) WRITE(*,*) ' ============================================ ' diff --git a/fortran/test/tH5F_F03.f90 b/fortran/test/tH5F_F03.f90 new file mode 100644 index 0000000..4484144 --- /dev/null +++ b/fortran/test/tH5F_F03.f90 @@ -0,0 +1,171 @@ +!****h* root/fortran/test/tH5F_F03.f90 +! +! NAME +! tH5F_F03.f90 +! +! FUNCTION +! Test FORTRAN HDF5 H5F APIs which are dependent on FORTRAN 2003 +! features. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! Copyright by The HDF Group. * +! 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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +! access to either file, you may request a copy from help@hdfgroup.org. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! Tests the H5F APIs functionalities of: +! h5fget_file_image_f +! +! CONTAINS SUBROUTINES +! test_get_file_image +! +!***** + +! ***************************************** +! *** H 5 F T E S T S +! ***************************************** + +SUBROUTINE test_get_file_image(total_error) + ! + ! Tests the wrapper for h5fget_file_image + ! + USE HDF5 + USE ISO_C_BINDING + + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error ! returns error + + CHARACTER(kind=c_char), ALLOCATABLE, DIMENSION(:), TARGET :: file_image_ptr ! Image from file + CHARACTER(kind=c_char), ALLOCATABLE, DIMENSION(:), TARGET :: image_ptr ! Image from h5fget_file_image_f + + INTEGER, DIMENSION(1:100), TARGET :: data ! Write data + INTEGER :: i, file_sz + INTEGER(hid_t) :: file_id = -1 ! File identifier + INTEGER(hid_t) :: dset_id = -1 ! Dataset identifier + INTEGER(hid_t) :: space_id = -1 ! Dataspace identifier + INTEGER(hsize_t), DIMENSION(1:2) :: dims ! Dataset dimensions + INTEGER(size_t) :: itmp_a, itmp_b ! General purpose integers + INTEGER(size_t) :: image_size ! Size of image + TYPE(C_PTR) :: f_ptr ! Pointer + INTEGER(hid_t) :: fapl ! File access property + INTEGER :: error ! Error flag + + ! Create new properties for file access + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) + CALL check("h5pcreate_f", error, total_error) + + ! Set standard I/O driver + CALL h5pset_fapl_stdio_f(fapl, error) + CALL check("h5pset_fapl_stdio_f", error, total_error) + + ! Create the file + CALL h5fcreate_f("tget_file_image.h5", H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl) + CALL check("h5fcreate_f", error, total_error) + + ! Set up data space for new data set + dims(1:2) = (/10,10/) + + CALL h5screate_simple_f(2, dims, space_id, error) + CALL check("h5screate_simple_f", error, total_error) + + ! Create a dataset + CALL h5dcreate_f(file_id, "dset 0", H5T_NATIVE_INTEGER, space_id, dset_id, error) + CALL check("h5dcreate_f", error, total_error) + + ! Write some data to the data set + DO i = 1, 100 + data(i) = i + ENDDO + + f_ptr = C_LOC(data(1)) + CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, f_ptr, error) + CALL check("h5dwrite_f",error, total_error) + + ! Flush the file + CALL h5fflush_f(file_id, H5F_SCOPE_GLOBAL_F, error) + CALL check("h5fflush_f",error, total_error) + + ! Open the test file using standard I/O calls + OPEN(UNIT=10,FILE='tget_file_image.h5', ACCESS='STREAM') + ! Get the size of the test file + ! + ! Since we use the eoa to calculate the image size, the file size + ! may be larger. This is OK, as long as (in this specialized instance) + ! the remainder of the file is all '\0's. + ! + ! With latest mods to truncate call in core file drive, + ! file size should match image size; get the file size + INQUIRE(UNIT=10, SIZE=file_sz) + CLOSE(UNIT=10) + + ! I. Get buffer size needed to hold the buffer + + ! A. Preferred way to get the size + f_ptr = C_NULL_PTR + CALL h5fget_file_image_f(file_id, f_ptr, INT(0, size_t), error, image_size) + CALL check("h5fget_file_image_f",error, total_error) + CALL verify("h5fget_file_image_f", file_sz, INT(image_size), total_error) + + ! B. f_ptr set to point to an incorrect buffer, should pass anyway + f_ptr = C_LOC(data(1)) + itmp_a = 1 + CALL h5fget_file_image_f(file_id, f_ptr, itmp_a, error, image_size) + CALL check("h5fget_file_image_f",error, total_error) + CALL VERIFY("h5fget_file_image_f", INT(itmp_a), 1, total_error) ! Routine should not change the value + CALL VERIFY("h5fget_file_image_f", file_sz, INT(image_size), total_error) + + ! Allocate a buffer of the appropriate size + ALLOCATE(image_ptr(1:image_size)) + + ! Load the image of the file into the buffer + f_ptr = C_LOC(image_ptr(1)(1:1)) + CALL h5fget_file_image_f(file_id, f_ptr, image_size, error) + CALL check("h5fget_file_image_f",error, total_error) + + ! Close dset and space + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5sclose_f(space_id, error) + CALL check("h5sclose_f", error, total_error) + ! Close the test file + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error, total_error) + + ! Allocate a buffer for the test file image + ALLOCATE(file_image_ptr(1:image_size)) + + ! Open the test file using standard I/O calls + OPEN(UNIT=10,FILE='tget_file_image.h5', ACCESS='STREAM') + + ! Read the test file from disk into the buffer + DO i = 1, image_size + READ(10) file_image_ptr(i) + ENDDO + + CLOSE(10) + + ! verify the file and the image contain the same data + DO i = 1, image_size + ! convert one byte to an unsigned integer + IF( ICHAR(file_image_ptr(i)) .NE. ICHAR(image_ptr(i)))THEN + total_error = total_error + 1 + EXIT + ENDIF + ENDDO + + ! release resources + DEALLOCATE(file_image_ptr,image_ptr) + +END SUBROUTINE test_get_file_image -- cgit v0.12 From a4521b79019c9c28c9751e030597b1d9df3c850e Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Sun, 17 Feb 2013 21:22:29 -0500 Subject: [svn-r23294] Related to: HDFFV-8265 Fortran2003 option does not work under windows; Need to manage .def files more efficiently Changed the comment notes from adding to the 'hdf5_fortrandll.def' to instead adding to the 'hdf5_fortrandll.def.in' file. --- fortran/src/H5Aff.f90 | 2 +- fortran/src/H5Aff_F03.f90 | 2 +- fortran/src/H5Aff_F90.f90 | 2 +- fortran/src/H5Dff.f90 | 2 +- fortran/src/H5Dff_F03.f90 | 2 +- fortran/src/H5Dff_F90.f90 | 2 +- fortran/src/H5Eff.f90 | 2 +- fortran/src/H5Eff_F03.f90 | 2 +- fortran/src/H5Eff_F90.f90 | 2 +- fortran/src/H5FDmpioff.f90 | 2 +- fortran/src/H5Fff.f90 | 2 +- fortran/src/H5Fff_F03.f90 | 2 +- fortran/src/H5Fff_F90.f90 | 2 +- fortran/src/H5Gff.f90 | 2 +- fortran/src/H5Iff.f90 | 2 +- fortran/src/H5Lff.f90 | 2 +- fortran/src/H5Lff_F03.f90 | 2 +- fortran/src/H5Lff_F90.f90 | 2 +- fortran/src/H5Off.f90 | 2 +- fortran/src/H5Off_F03.f90 | 2 +- fortran/src/H5Off_F90.f90 | 2 +- fortran/src/H5Pff.f90 | 2 +- fortran/src/H5Pff_F03.f90 | 2 +- fortran/src/H5Pff_F90.f90 | 2 +- fortran/src/H5Rff.f90 | 2 +- fortran/src/H5Rff_F03.f90 | 2 +- fortran/src/H5Rff_F90.f90 | 2 +- fortran/src/H5Sff.f90 | 2 +- fortran/src/H5Tff.f90 | 2 +- fortran/src/H5Tff_F03.f90 | 2 +- fortran/src/H5Tff_F90.f90 | 2 +- fortran/src/H5Zff.f90 | 2 +- fortran/src/H5_ff.f90 | 2 +- fortran/src/H5_ff_F03.f90 | 2 +- 34 files changed, 34 insertions(+), 34 deletions(-) diff --git a/fortran/src/H5Aff.f90 b/fortran/src/H5Aff.f90 index 1926dd1..25f7fa7 100644 --- a/fortran/src/H5Aff.f90 +++ b/fortran/src/H5Aff.f90 @@ -28,7 +28,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5A function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Aff_F03.f90 b/fortran/src/H5Aff_F03.f90 index b9e6c92..26c911a 100644 --- a/fortran/src/H5Aff_F03.f90 +++ b/fortran/src/H5Aff_F03.f90 @@ -61,7 +61,7 @@ ! (B) ! *** IMPORTANT *** ! If you add a new H5A function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Aff_F90.f90 b/fortran/src/H5Aff_F90.f90 index 7e14f7a..974b023 100644 --- a/fortran/src/H5Aff_F90.f90 +++ b/fortran/src/H5Aff_F90.f90 @@ -33,7 +33,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5A function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Dff.f90 b/fortran/src/H5Dff.f90 index b1e1df1..3ad868c 100644 --- a/fortran/src/H5Dff.f90 +++ b/fortran/src/H5Dff.f90 @@ -30,7 +30,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Dff_F03.f90 b/fortran/src/H5Dff_F03.f90 index 61d5dfc..be4bd69 100644 --- a/fortran/src/H5Dff_F03.f90 +++ b/fortran/src/H5Dff_F03.f90 @@ -74,7 +74,7 @@ ! ! *** IMPORTANT *** ! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Dff_F90.f90 b/fortran/src/H5Dff_F90.f90 index 3bb0fc0..46ea3ad 100644 --- a/fortran/src/H5Dff_F90.f90 +++ b/fortran/src/H5Dff_F90.f90 @@ -42,7 +42,7 @@ ! (3) ! *** IMPORTANT *** ! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. !***** diff --git a/fortran/src/H5Eff.f90 b/fortran/src/H5Eff.f90 index 2e137df..7b56376 100644 --- a/fortran/src/H5Eff.f90 +++ b/fortran/src/H5Eff.f90 @@ -28,7 +28,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5E function to the module you must add the function name -! to the Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! to the Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Eff_F03.f90 b/fortran/src/H5Eff_F03.f90 index 164f203..3ba3ce96 100644 --- a/fortran/src/H5Eff_F03.f90 +++ b/fortran/src/H5Eff_F03.f90 @@ -33,7 +33,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5E function to the module you must add the function name -! to the Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! to the Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Eff_F90.f90 b/fortran/src/H5Eff_F90.f90 index e698a84..158ec12 100644 --- a/fortran/src/H5Eff_F90.f90 +++ b/fortran/src/H5Eff_F90.f90 @@ -28,7 +28,7 @@ ! ! *** IMPORTANT *** ! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. !***** diff --git a/fortran/src/H5FDmpioff.f90 b/fortran/src/H5FDmpioff.f90 index d9faef3..5c81bc8 100644 --- a/fortran/src/H5FDmpioff.f90 +++ b/fortran/src/H5FDmpioff.f90 @@ -26,7 +26,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5P function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Fff.f90 b/fortran/src/H5Fff.f90 index 0c70ad4..faa1967 100644 --- a/fortran/src/H5Fff.f90 +++ b/fortran/src/H5Fff.f90 @@ -28,7 +28,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5F function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Fff_F03.f90 b/fortran/src/H5Fff_F03.f90 index eda4e24..1ccd39a 100644 --- a/fortran/src/H5Fff_F03.f90 +++ b/fortran/src/H5Fff_F03.f90 @@ -25,7 +25,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5T function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Fff_F90.f90 b/fortran/src/H5Fff_F90.f90 index a23bb3d..b6e659b 100644 --- a/fortran/src/H5Fff_F90.f90 +++ b/fortran/src/H5Fff_F90.f90 @@ -29,7 +29,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5F function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Gff.f90 b/fortran/src/H5Gff.f90 index 155185a..d4d7496 100644 --- a/fortran/src/H5Gff.f90 +++ b/fortran/src/H5Gff.f90 @@ -28,7 +28,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5G function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Iff.f90 b/fortran/src/H5Iff.f90 index 86e88b9..7c9a843 100644 --- a/fortran/src/H5Iff.f90 +++ b/fortran/src/H5Iff.f90 @@ -28,7 +28,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5I function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Lff.f90 b/fortran/src/H5Lff.f90 index 8043d74..4660e52 100644 --- a/fortran/src/H5Lff.f90 +++ b/fortran/src/H5Lff.f90 @@ -27,7 +27,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5L function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Lff_F03.f90 b/fortran/src/H5Lff_F03.f90 index e2c54a7..83f80ac 100644 --- a/fortran/src/H5Lff_F03.f90 +++ b/fortran/src/H5Lff_F03.f90 @@ -32,7 +32,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5A function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Lff_F90.f90 b/fortran/src/H5Lff_F90.f90 index c802af7..dd62b7b 100644 --- a/fortran/src/H5Lff_F90.f90 +++ b/fortran/src/H5Lff_F90.f90 @@ -30,7 +30,7 @@ ! ! *** IMPORTANT *** ! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. !***** diff --git a/fortran/src/H5Off.f90 b/fortran/src/H5Off.f90 index ce8c55c..1437e9f 100644 --- a/fortran/src/H5Off.f90 +++ b/fortran/src/H5Off.f90 @@ -31,7 +31,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5O function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Off_F03.f90 b/fortran/src/H5Off_F03.f90 index f4ddd3e..0cf4d46 100644 --- a/fortran/src/H5Off_F03.f90 +++ b/fortran/src/H5Off_F03.f90 @@ -28,7 +28,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5P function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Off_F90.f90 b/fortran/src/H5Off_F90.f90 index 53553d6..5688c5d 100644 --- a/fortran/src/H5Off_F90.f90 +++ b/fortran/src/H5Off_F90.f90 @@ -30,7 +30,7 @@ ! ! *** IMPORTANT *** ! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. !***** diff --git a/fortran/src/H5Pff.f90 b/fortran/src/H5Pff.f90 index 4254b7f..203460a 100644 --- a/fortran/src/H5Pff.f90 +++ b/fortran/src/H5Pff.f90 @@ -27,7 +27,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5P function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. !***** diff --git a/fortran/src/H5Pff_F03.f90 b/fortran/src/H5Pff_F03.f90 index b601e69..7fb6ff9 100644 --- a/fortran/src/H5Pff_F03.f90 +++ b/fortran/src/H5Pff_F03.f90 @@ -28,7 +28,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5P function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Pff_F90.f90 b/fortran/src/H5Pff_F90.f90 index ebdd185..5b75643 100644 --- a/fortran/src/H5Pff_F90.f90 +++ b/fortran/src/H5Pff_F90.f90 @@ -29,7 +29,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5P function you must add the function name to the -! Windows dll file '*hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. !***** diff --git a/fortran/src/H5Rff.f90 b/fortran/src/H5Rff.f90 index 89ffc10..64f1365 100644 --- a/fortran/src/H5Rff.f90 +++ b/fortran/src/H5Rff.f90 @@ -31,7 +31,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5R function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Rff_F03.f90 b/fortran/src/H5Rff_F03.f90 index bf68f7a..7a9b080 100644 --- a/fortran/src/H5Rff_F03.f90 +++ b/fortran/src/H5Rff_F03.f90 @@ -31,7 +31,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5R function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Rff_F90.f90 b/fortran/src/H5Rff_F90.f90 index 913176e..3871d99 100644 --- a/fortran/src/H5Rff_F90.f90 +++ b/fortran/src/H5Rff_F90.f90 @@ -31,7 +31,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5R function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. !***** diff --git a/fortran/src/H5Sff.f90 b/fortran/src/H5Sff.f90 index 9ef8ca8..1bae584 100644 --- a/fortran/src/H5Sff.f90 +++ b/fortran/src/H5Sff.f90 @@ -31,7 +31,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5S function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Tff.f90 b/fortran/src/H5Tff.f90 index fd857a8..89bd972 100644 --- a/fortran/src/H5Tff.f90 +++ b/fortran/src/H5Tff.f90 @@ -28,7 +28,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5T function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Tff_F03.f90 b/fortran/src/H5Tff_F03.f90 index 902e2ac..d16553a 100644 --- a/fortran/src/H5Tff_F03.f90 +++ b/fortran/src/H5Tff_F03.f90 @@ -28,7 +28,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5T function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Tff_F90.f90 b/fortran/src/H5Tff_F90.f90 index 021773d..a95b31f 100644 --- a/fortran/src/H5Tff_F90.f90 +++ b/fortran/src/H5Tff_F90.f90 @@ -30,7 +30,7 @@ ! ! *** IMPORTANT *** ! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. !***** diff --git a/fortran/src/H5Zff.f90 b/fortran/src/H5Zff.f90 index ec68286..7b67b5b 100644 --- a/fortran/src/H5Zff.f90 +++ b/fortran/src/H5Zff.f90 @@ -28,7 +28,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5Z function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5_ff.f90 b/fortran/src/H5_ff.f90 index c51b039..f9c20ac 100644 --- a/fortran/src/H5_ff.f90 +++ b/fortran/src/H5_ff.f90 @@ -30,7 +30,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5_ff_F03.f90 b/fortran/src/H5_ff_F03.f90 index f3e7098..d418ed5 100644 --- a/fortran/src/H5_ff_F03.f90 +++ b/fortran/src/H5_ff_F03.f90 @@ -27,7 +27,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. !***** -- cgit v0.12 From 4e084875491f1beef1421e8b76aa7b74ef7b5aeb Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Sun, 17 Feb 2013 22:10:17 -0500 Subject: [svn-r23295] Did not intend to check in this file with the previous ci. reverted check in. --- fortran/src/h5fc.in | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in index d24a0ae..2d7b5b4 100644 --- a/fortran/src/h5fc.in +++ b/fortran/src/h5fc.in @@ -233,12 +233,8 @@ for arg in $@ ; do *) allargs="$allargs $arg" if [ -s "$arg" ] ; then ext=`expr "$arg" : '.*\(\..*\)'` - if [ "$ext" = ".f" -o "$ext" = ".F" -o \ - "$ext" = ".for" -o "$ext" = ".FOR" -o \ - "$ext" = ".ftn" -o "$ext" = ".FTN" -o \ - ["$ext" = ".f[0-9][0-9]"] -o \ - ["$ext" = ".F[0-9][0-9]"] \ - ] ; then + if [ "$ext" = ".f" -o "$ext" = ".F" -o "$ext" = ".f90" -o \ + "$ext" = ".for" -o "$ext" = ".FOR" -o "$ext" = ".F90" ] ; then do_compile="yes" compile_args="$compile_args $arg" fname=`basename $arg $ext` -- cgit v0.12 From 2ec529c0355edd272e8c17a14bb7c3d6b888091e Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Sun, 17 Feb 2013 22:46:06 -0500 Subject: [svn-r23296] Fix HDFFV-8312: Problem using NAG compiler and F2003 interface added character bounds for C_LOC arguments. Tested: jam (gnu) --- fortran/test/tH5T_F03.f90 | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/fortran/test/tH5T_F03.f90 b/fortran/test/tH5T_F03.f90 index 7336cf7..f7efcc4 100644 --- a/fortran/test/tH5T_F03.f90 +++ b/fortran/test/tH5T_F03.f90 @@ -405,7 +405,7 @@ END SUBROUTINE test_array_compound_atomic CALL check("h5tarray_create_f", error, total_error) ! Insert character array field - CALL h5tinsert_f(tid2, "c", H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%c(1))), tid4, error) + CALL h5tinsert_f(tid2, "c", H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%c(1)(1:1))), tid4, error) CALL check("h5tinsert2_f", error, total_error) ! Close array of floats field datatype @@ -551,7 +551,7 @@ END SUBROUTINE test_array_compound_atomic CALL H5Tget_member_offset_f(tid2, 2, off, error) CALL check("H5Tget_member_offset_f", error, total_error) CALL VERIFY("H5Tget_member_offset_f",INT(off),& - INT(H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%c(1)))), total_error) + INT(H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%c(1)(1:1)))), total_error) ! Check the 3rd field's datatype CALL H5Tget_member_type_f(tid2, 2, mtid2, error) @@ -1710,7 +1710,7 @@ SUBROUTINE t_opaque(total_error) ! CALL h5dcreate_f(file, dataset, dtype, space, dset, error) CALL check("h5dcreate_f",error, total_error) - f_ptr = C_LOC(wdata(1)) + f_ptr = C_LOC(wdata(1)(1:1)) CALL h5dwrite_f(dset, dtype, f_ptr, error) CALL check("h5dwrite_f",error, total_error) ! @@ -1774,7 +1774,7 @@ SUBROUTINE t_opaque(total_error) ! ! Read the data. ! - f_ptr = C_LOC(rdata(1)) + f_ptr = C_LOC(rdata(1)(1:1)) CALL h5dread_f(dset, dtype, f_ptr, error) CALL check("H5Dread_f",error, total_error) ! @@ -2123,7 +2123,7 @@ SUBROUTINE t_regref(total_error) CALL h5screate_simple_f(1, dims3, memspace, error) CALL check("h5screate_simple_f",error, total_error) - f_ptr = C_LOC(rdata2(1)) + f_ptr = C_LOC(rdata2(1)(1:1)) CALL h5dread_f( dset2, H5T_NATIVE_INTEGER_1, f_ptr, error, memspace, space) CALL check("H5Dread_f",error, total_error) CALL verifystring("h5dread_f",rdata2(1)(1:npoints),TRIM(chrref_correct(i)), total_error) @@ -2473,24 +2473,24 @@ SUBROUTINE t_vlstring_readwrite(total_error) ! Initialize array of C pointers - wdata(1) = C_LOC(A(1)) - wdata(2) = C_LOC(B(1)) - wdata(3) = C_LOC(C(1)) - wdata(4) = C_LOC(D(1)) + wdata(1) = C_LOC(A(1)(1:1)) + wdata(2) = C_LOC(B(1)(1:1)) + wdata(3) = C_LOC(C(1)(1:1)) + wdata(4) = C_LOC(D(1)(1:1)) data_w(1) = A(1) data_w(2) = B(1) data_w(3) = C(1) data_w(4) = D(1) - wdata2D(1,1) = C_LOC(A11(1)) - wdata2D(1,2) = C_LOC(A12(1)) - wdata2D(1,3) = C_LOC(A13(1)) - wdata2D(1,4) = C_LOC(A14(1)) - wdata2D(2,1) = C_LOC(A21(1)) - wdata2D(2,2) = C_LOC(A22(1)) - wdata2D(2,3) = C_LOC(A23(1)) - wdata2D(2,4) = C_LOC(A24(1)) + wdata2D(1,1) = C_LOC(A11(1)(1:1)) + wdata2D(1,2) = C_LOC(A12(1)(1:1)) + wdata2D(1,3) = C_LOC(A13(1)(1:1)) + wdata2D(1,4) = C_LOC(A14(1)(1:1)) + wdata2D(2,1) = C_LOC(A21(1)(1:1)) + wdata2D(2,2) = C_LOC(A22(1)(1:1)) + wdata2D(2,3) = C_LOC(A23(1)(1:1)) + wdata2D(2,4) = C_LOC(A24(1)(1:1)) data2D_w(1,1) = A11(1) data2D_w(1,2) = A12(1) -- cgit v0.12 From f3da4919c491d84b58be74fd90837c391b37fc7c Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 18 Feb 2013 10:28:36 -0500 Subject: [svn-r23297] Temporary fix: PGI COMPILERS seem to have a bug in the INQUIRE function, waiting for an answer from PGI how to resolve the problem. Tested: jam (pgi compiler) --- fortran/test/tH5F_F03.f90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fortran/test/tH5F_F03.f90 b/fortran/test/tH5F_F03.f90 index 4484144..dea9a5d 100644 --- a/fortran/test/tH5F_F03.f90 +++ b/fortran/test/tH5F_F03.f90 @@ -62,6 +62,10 @@ SUBROUTINE test_get_file_image(total_error) INTEGER(hid_t) :: fapl ! File access property INTEGER :: error ! Error flag + + RETURN ! DEBUG, PGI COMPILERS seem to have a bug in the INQUIRE functions, + ! waiting for an answer from PGI how to resolve the problem. + ! Create new properties for file access CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) CALL check("h5pcreate_f", error, total_error) -- cgit v0.12 From dbad502865d8817fe0db94dd6d6b9656ee257790 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Mon, 18 Feb 2013 14:46:03 -0500 Subject: [svn-r23304] Purpose: HDFFV-7643 - h5diff - incorrect exit-code returns for extra attribute exist Description: h5diff: Fixed to return correct exit code 1 when detect unique attribute. Prior to this fix, h5diff returned exit code 0 indicating two files are identical. Tested: jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), fred (mac64-LE), emu (solaris-BE), Windows (32-LE cmake), cmake (jam) --- release_docs/RELEASE.txt | 7 +++++-- tools/h5diff/CMakeLists.txt | 4 ++-- tools/h5diff/testfiles/h5diff_706.txt | 2 +- tools/h5diff/testfiles/h5diff_708.txt | 2 +- tools/lib/h5diff_attr.c | 7 +++++++ 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 9dc895c..ab3dfb3 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -751,9 +751,12 @@ Bug Fixes since HDF5-1.8.0 release Tools ----- + - h5diff: Fixed to return correct exit code 1 when detect unique extra + attribute. Prior to this fix, h5diff returned exit code 0 indicating + two files are identical. HDFFV-7643 (JKM 2013/02/15) - h5diff: Improved speed when comparing HDF5 files with lots of - attributes. Much slower performance was identified with release version - from 1.8.7 to 1.8.10 compared to 1.8.6. (JKM 2012/10/19) + attributes. Much slower performance was identified with release + version from 1.8.7 to 1.8.10 compared to 1.8.6. (JKM 2012/10/19) - h5repack: "h5repack -f NONE file1.h5 out.h5" command failed if source file contains chunked dataset and a chunk dim is bigger than the dataset dim. Another issue is that the command changed max dims diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index a8fed57..8eb5ad1 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -1092,13 +1092,13 @@ ADD_H5_TEST (h5diff_704 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_F ADD_H5_TEST (h5diff_705 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /dset) # same attr number , all different attr name -ADD_H5_TEST (h5diff_706 0 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /ntype) +ADD_H5_TEST (h5diff_706 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /ntype) # different attr number , same attr name (intersected) ADD_H5_TEST (h5diff_707 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /g2) # different attr number , all different attr name -ADD_H5_TEST (h5diff_708 0 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /g3) +ADD_H5_TEST (h5diff_708 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /g3) # when no attributes exist in both objects ADD_H5_TEST (h5diff_709 0 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /g4) diff --git a/tools/h5diff/testfiles/h5diff_706.txt b/tools/h5diff/testfiles/h5diff_706.txt index 38eeac5..5825150 100644 --- a/tools/h5diff/testfiles/h5diff_706.txt +++ b/tools/h5diff/testfiles/h5diff_706.txt @@ -10,4 +10,4 @@ datatype: and x integer1 x integer4 Attributes status: 0 common, 3 only in obj1, 3 only in obj2 -EXIT CODE: 0 +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_708.txt b/tools/h5diff/testfiles/h5diff_708.txt index add386b..a10a8b7 100644 --- a/tools/h5diff/testfiles/h5diff_708.txt +++ b/tools/h5diff/testfiles/h5diff_708.txt @@ -14,4 +14,4 @@ group : and x integer10 x integer3 Attributes status: 0 common, 3 only in obj1, 2 only in obj2 -EXIT CODE: 0 +EXIT CODE: 1 diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 130a0d8..4899200 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -350,6 +350,13 @@ hsize_t diff_attr(hid_t loc1_id, if( build_match_list_attrs(loc1_id, loc2_id, &match_list_attrs, options) < 0) goto error; + /* if detect any unique extra attr */ + if(match_list_attrs->nattrs_only1 || match_list_attrs->nattrs_only2) + { + /* exit will be 1 */ + options->contents = 0; + } + for(u = 0; u < (unsigned)match_list_attrs->nattrs; u++) { if( (match_list_attrs->attrs[u].exist[0]) && (match_list_attrs->attrs[u].exist[1]) ) -- cgit v0.12 From aff5c20a6ae123dd4250ee46e1cdadbae00fd823 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 18 Feb 2013 15:56:21 -0500 Subject: [svn-r23305] HDFFV-8257: szip still used even if headers are not found. Change configure to test the result of the CHECK HEADERS call before checking for the library. Tested: local linux, h5committest --- Makefile.in | 2 +- bin/cmakehdf5 | 9 +- c++/Makefile.in | 2 +- c++/examples/Makefile.in | 2 +- c++/src/Makefile.in | 2 +- c++/test/Makefile.in | 2 +- configure | 181 ++++++++++--------- configure.ac | 183 ++++++++++--------- examples/Makefile.in | 2 +- fortran/Makefile.in | 2 +- fortran/examples/Makefile.in | 4 +- fortran/src/Makefile.in | 2 +- fortran/test/Makefile.in | 2 +- fortran/testpar/Makefile.in | 2 +- hl/Makefile.in | 2 +- hl/c++/Makefile.in | 2 +- hl/c++/examples/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/c++/test/Makefile.in | 2 +- hl/examples/Makefile.in | 2 +- hl/fortran/Makefile.in | 2 +- hl/fortran/examples/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/fortran/test/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- hl/test/Makefile.in | 2 +- hl/tools/Makefile.in | 2 +- hl/tools/gif2h5/Makefile.in | 2 +- perform/Makefile.in | 2 +- release_docs/USING_CMake.txt | 12 +- src/Makefile.in | 2 +- test/Makefile.in | 2 +- testpar/Makefile.in | 2 +- tools/Makefile.in | 2 +- tools/h5copy/Makefile.in | 2 +- tools/h5diff/Makefile.in | 2 +- tools/h5dump/Makefile.in | 2 +- tools/h5import/Makefile.in | 2 +- tools/h5jam/Makefile.in | 2 +- tools/h5ls/Makefile.in | 2 +- tools/h5repack/Makefile.in | 2 +- tools/h5stat/Makefile.in | 2 +- tools/lib/Makefile.in | 2 +- tools/lib/h5tools_dump.c | 2 +- tools/lib/h5tools_str.c | 379 ++++++++++++++++++++-------------------- tools/misc/Makefile.in | 2 +- 46 files changed, 444 insertions(+), 404 deletions(-) diff --git a/Makefile.in b/Makefile.in index 1472be5..a53e904 100644 --- a/Makefile.in +++ b/Makefile.in @@ -262,6 +262,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -313,7 +314,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/bin/cmakehdf5 b/bin/cmakehdf5 index cdd75c0..c024ad1 100755 --- a/bin/cmakehdf5 +++ b/bin/cmakehdf5 @@ -58,7 +58,7 @@ EOF #========== #========== cat > $cfgfile <<'EOF' -cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR) ######################################################## # This dashboard is maintained by The HDF Group # For any comments please contact cdashhelp@hdfgroup.org @@ -84,7 +84,12 @@ set (REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8") set (ADD_BUILD_OPTIONS "-DCMAKE_INSTALL_PREFIX:PATH=/usr/local/hdf5.1.8 -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=\"SVN\" -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") # Use multiple CPU cores to build -SET (CTEST_BUILD_FLAGS "-j4") +include(ProcessorCount) +ProcessorCount(N) +if(NOT N EQUAL 0) + set(CTEST_BUILD_FLAGS -j${N}) + set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) +endif() # ----------------------------------------------------------- # -- Get environment diff --git a/c++/Makefile.in b/c++/Makefile.in index 8c82ca9..232299d 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -227,6 +227,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -278,7 +279,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index e9bbf47..e8aa093 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -194,6 +194,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -245,7 +246,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 3f6d59f..af2d35e 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -269,6 +269,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -320,7 +321,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in index 00a8056..ef1455c 100644 --- a/c++/test/Makefile.in +++ b/c++/test/Makefile.in @@ -230,6 +230,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -281,7 +282,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/configure b/configure index 27c18a6..18545b2 100755 --- a/configure +++ b/configure @@ -681,7 +681,7 @@ INSTRUMENT_LIBRARY TRACE_API DEBUG_PKG H5_LONE_COLON -PTHREAD +HAVE_PTHREAD BUILD_SHARED_SZIP_CONDITIONAL_FALSE BUILD_SHARED_SZIP_CONDITIONAL_TRUE LL_PATH @@ -25273,11 +25273,14 @@ if test "x$ac_cv_header_dmalloc_h" = xyes; then : #define HAVE_DMALLOC_H 1 _ACEOF +else + unset HAVE_DMALLOC fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dmalloc_shutdown in -ldmalloc" >&5 + if test "x$HAVE_DMALLOC" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dmalloc_shutdown in -ldmalloc" >&5 $as_echo_n "checking for dmalloc_shutdown in -ldmalloc... " >&6; } if ${ac_cv_lib_dmalloc_dmalloc_shutdown+:} false; then : $as_echo_n "(cached) " >&6 @@ -25332,7 +25335,7 @@ else unset HAVE_DMALLOC fi - + fi if test -z "$HAVE_DMALLOC" -a -n "$HDF5_CONFIG_ABORT"; then as_fn_error $? "couldn't find dmalloc library" "$LINENO" 5 fi @@ -25387,18 +25390,19 @@ if test "x$ac_cv_header_dmalloc_h" = xyes; then : _ACEOF else - CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS" + CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS" unset HAVE_DMALLOC fi done - if test -n "$dmalloc_lib"; then - LDFLAGS="$LDFLAGS -L$dmalloc_lib" - AM_LDFLAGS="$AM_LDFLAGS -L$dmalloc_lib" - fi + if test "x$HAVE_DMALLOC" = "xyes"; then + if test -n "$dmalloc_lib"; then + LDFLAGS="$LDFLAGS -L$dmalloc_lib" + AM_LDFLAGS="$AM_LDFLAGS -L$dmalloc_lib" + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dmalloc_shutdown in -ldmalloc" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dmalloc_shutdown in -ldmalloc" >&5 $as_echo_n "checking for dmalloc_shutdown in -ldmalloc... " >&6; } if ${ac_cv_lib_dmalloc_dmalloc_shutdown+:} false; then : $as_echo_n "(cached) " >&6 @@ -25453,6 +25457,7 @@ else LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_DMALLOC fi + fi if test -z "$HAVE_DMALLOC" -a -n "$HDF5_CONFIG_ABORT"; then as_fn_error $? "couldn't find dmalloc library" "$LINENO" 5 @@ -25487,11 +25492,14 @@ if test "x$ac_cv_header_zlib_h" = xyes; then : #define HAVE_ZLIB_H 1 _ACEOF HAVE_ZLIB_H="yes" +else + unset HAVE_ZLIB fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress2 in -lz" >&5 + if test "x$HAVE_ZLIB" = "xyes" -a "x$HAVE_ZLIB_H" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress2 in -lz" >&5 $as_echo_n "checking for compress2 in -lz... " >&6; } if ${ac_cv_lib_z_compress2+:} false; then : $as_echo_n "(cached) " >&6 @@ -25546,14 +25554,17 @@ else unset HAVE_ZLIB fi - ac_fn_c_check_func "$LINENO" "compress2" "ac_cv_func_compress2" + fi + if test -z "$HAVE_ZLIB"; then + if test -n "$HDF5_CONFIG_ABORT"; then + as_fn_error $? "couldn't find zlib library" "$LINENO" 5 + fi + else + ac_fn_c_check_func "$LINENO" "compress2" "ac_cv_func_compress2" if test "x$ac_cv_func_compress2" = xyes; then : HAVE_COMPRESS2="yes" fi - - if test -z "$HAVE_ZLIB" -a -n "$HDF5_CONFIG_ABORT"; then - as_fn_error $? "couldn't find zlib library" "$LINENO" 5 fi ;; no) @@ -25567,8 +25578,8 @@ $as_echo "suppressed" >&6; } HAVE_ZLIB="yes" case "$withval" in *,*) - zlib_inc="`echo $withval |cut -f1 -d,`" - zlib_lib="`echo $withval |cut -f2 -d, -s`" + zlib_inc="`echo $withval | cut -f1 -d,`" + zlib_lib="`echo $withval | cut -f2 -d, -s`" ;; *) if test -n "$withval"; then @@ -25606,7 +25617,7 @@ if test "x$ac_cv_header_zlib_h" = xyes; then : _ACEOF HAVE_ZLIB_H="yes" else - CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS" + CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS" unset HAVE_ZLIB fi done @@ -25617,7 +25628,8 @@ done AM_LDFLAGS="$AM_LDFLAGS -L$zlib_lib" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress2 in -lz" >&5 + if test "x$HAVE_ZLIB" = "xyes" -a "x$HAVE_ZLIB_H" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress2 in -lz" >&5 $as_echo_n "checking for compress2 in -lz... " >&6; } if ${ac_cv_lib_z_compress2+:} false; then : $as_echo_n "(cached) " >&6 @@ -25672,14 +25684,18 @@ else LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_ZLIB fi - ac_fn_c_check_func "$LINENO" "compress2" "ac_cv_func_compress2" + fi + + if test -z "$HAVE_ZLIB"; then + if test -n "$HDF5_CONFIG_ABORT"; then + as_fn_error $? "couldn't find zlib library" "$LINENO" 5 + fi + else + ac_fn_c_check_func "$LINENO" "compress2" "ac_cv_func_compress2" if test "x$ac_cv_func_compress2" = xyes; then : HAVE_COMPRESS2="yes" fi - - if test -z "$HAVE_ZLIB" -a -n "$HDF5_CONFIG_ABORT"; then - as_fn_error $? "couldn't find zlib library" "$LINENO" 5 fi ;; esac @@ -25688,13 +25704,13 @@ if test "x$HAVE_ZLIB" = "xyes" -a "x$HAVE_ZLIB_H" = "xyes" -a "x$HAVE_COMPRESS2" $as_echo "#define HAVE_FILTER_DEFLATE 1" >>confdefs.h - USE_FILTER_DEFLATE="yes" + USE_FILTER_DEFLATE="yes" - ## Add "deflate" to external filter list - if test "X$EXTERNAL_FILTERS" != "X"; then - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," - fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}deflate(zlib)" + ## Add "deflate" to external filter list + if test "X$EXTERNAL_FILTERS" != "X"; then + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," + fi + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}deflate(zlib)" fi @@ -25725,11 +25741,14 @@ if test "x$ac_cv_header_szlib_h" = xyes; then : #define HAVE_SZLIB_H 1 _ACEOF HAVE_SZLIB_H="yes" +else + unset HAVE_SZLIB fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SZ_BufftoBuffCompress in -lsz" >&5 + if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SZ_BufftoBuffCompress in -lsz" >&5 $as_echo_n "checking for SZ_BufftoBuffCompress in -lsz... " >&6; } if ${ac_cv_lib_sz_SZ_BufftoBuffCompress+:} false; then : $as_echo_n "(cached) " >&6 @@ -25784,7 +25803,7 @@ else unset HAVE_SZLIB fi - + fi if test -z "$HAVE_SZLIB" -a -n "$HDF5_CONFIG_ABORT"; then as_fn_error $? "couldn't find szlib library" "$LINENO" 5 fi @@ -25839,7 +25858,7 @@ if test "x$ac_cv_header_szlib_h" = xyes; then : _ACEOF HAVE_SZLIB_H="yes" else - CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS" + CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS" unset HAVE_SZIP fi done @@ -25850,7 +25869,8 @@ done AM_LDFLAGS="$AM_LDFLAGS -L$szlib_lib" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SZ_BufftoBuffCompress in -lsz" >&5 + if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SZ_BufftoBuffCompress in -lsz" >&5 $as_echo_n "checking for SZ_BufftoBuffCompress in -lsz... " >&6; } if ${ac_cv_lib_sz_SZ_BufftoBuffCompress+:} false; then : $as_echo_n "(cached) " >&6 @@ -25905,6 +25925,7 @@ else LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_SZLIB fi + fi if test -z "$HAVE_SZLIB" -a -n "$HDF5_CONFIG_ABORT"; then as_fn_error $? "couldn't find szlib library" "$LINENO" 5 @@ -25913,22 +25934,22 @@ fi esac if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then - ## SZLIB library is available. Check if it can encode - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for szlib encoder" >&5 + ## SZLIB library is available. Check if it can encode + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for szlib encoder" >&5 $as_echo_n "checking for szlib encoder... " >&6; } - ## Set LD_LIBRARY_PATH so encoder test can find the library and run. - ## Also add LL_PATH substitution to Makefiles so they can use the - ## path as well, for testing examples. - if test -z "$LD_LIBRARY_PATH"; then + ## Set LD_LIBRARY_PATH so encoder test can find the library and run. + ## Also add LL_PATH substitution to Makefiles so they can use the + ## path as well, for testing examples. + if test -z "$LD_LIBRARY_PATH"; then export LD_LIBRARY_PATH="$szlib_lib" - else + else export LD_LIBRARY_PATH="$szlib_lib:$LD_LIBRARY_PATH" - fi + fi - LL_PATH="$LD_LIBRARY_PATH" + LL_PATH="$LD_LIBRARY_PATH" - if ${hdf5_cv_szlib_can_encode+:} false; then : + if ${hdf5_cv_szlib_can_encode+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -25967,31 +25988,30 @@ fi $as_echo "#define HAVE_FILTER_SZIP 1" >>confdefs.h - USE_FILTER_SZIP="yes" + USE_FILTER_SZIP="yes" - if test ${hdf5_cv_szlib_can_encode} = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + if test ${hdf5_cv_szlib_can_encode} = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - fi - if test ${hdf5_cv_szlib_can_encode} = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + fi + if test ${hdf5_cv_szlib_can_encode} = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - fi + fi - ## Add "szip" to external filter list - if test ${hdf5_cv_szlib_can_encode} = "yes"; then - if test "X$EXTERNAL_FILTERS" != "X"; then - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," - fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(encoder)" + ## Add "szip" to external filter list + if test ${hdf5_cv_szlib_can_encode} = "yes"; then + if test "X$EXTERNAL_FILTERS" != "X"; then + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," fi - if test ${hdf5_cv_szlib_can_encode} = "no"; then - if test "X$EXTERNAL_FILTERS" != "X"; then - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," - fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(no encoder)" + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(encoder)" + fi + if test ${hdf5_cv_szlib_can_encode} = "no"; then + if test "X$EXTERNAL_FILTERS" != "X"; then + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," fi - + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(no encoder)" + fi fi if test "X$USE_FILTER_SZIP" = "Xyes" && test "X$LL_PATH" != "X"; then @@ -26097,7 +26117,7 @@ rm -f confcache ## and/or a library path. If the library path is specified then it must ## be preceded by a comma. ## - PTHREAD=yes + HAVE_PTHREAD=yes # Check whether --with-pthread was given. if test "${with_pthread+set}" = set; then : @@ -26117,11 +26137,14 @@ if test "x$ac_cv_header_pthread_h" = xyes; then : #define HAVE_PTHREAD_H 1 _ACEOF +else + unset HAVE_PTHREAD fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5 + if test "x$HAVE_DMALLOC" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5 $as_echo_n "checking for pthread_self in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_self+:} false; then : $as_echo_n "(cached) " >&6 @@ -26173,16 +26196,17 @@ _ACEOF LIBS="-lpthread $LIBS" else - unset PTHREAD + unset HAVE_PTHREAD fi + fi ;; no) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread" >&5 $as_echo_n "checking for pthread... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5 $as_echo "suppressed" >&6; } - unset PTHREAD + unset HAVE_PTHREAD ;; *) case "$withval" in @@ -26221,7 +26245,7 @@ if test "x$ac_cv_header_pthread_h" = xyes; then : _ACEOF else - CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"; unset PTHREAD + CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"; unset HAVE_PTHREAD fi done @@ -26236,19 +26260,20 @@ if test "x$ac_cv_header_pthread_h" = xyes; then : _ACEOF else - unset PTHREAD + unset HAVE_PTHREAD fi done fi - if test -n "$pthread_lib"; then - saved_LDFLAGS="$LDFLAGS" - saved_AM_LDFLAGS="$AM_LDFLAGS" - LDFLAGS="$LDFLAGS -L$pthread_lib" - AM_LDFLAGS="$AM_LDFLAGS -L$pthread_lib" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5 + if test "x$HAVE_DMALLOC" = "xyes"; then + if test -n "$pthread_lib"; then + saved_LDFLAGS="$LDFLAGS" + saved_AM_LDFLAGS="$AM_LDFLAGS" + LDFLAGS="$LDFLAGS -L$pthread_lib" + AM_LDFLAGS="$AM_LDFLAGS -L$pthread_lib" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5 $as_echo_n "checking for pthread_self in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_self+:} false; then : $as_echo_n "(cached) " >&6 @@ -26300,12 +26325,11 @@ _ACEOF LIBS="-lpthread $LIBS" else - LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset PTHREAD + LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_PTHREAD fi - - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5 $as_echo_n "checking for pthread_self in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_self+:} false; then : $as_echo_n "(cached) " >&6 @@ -26357,9 +26381,10 @@ _ACEOF LIBS="-lpthread $LIBS" else - unset PTHREAD + unset HAVE_PTHREAD fi + fi fi ;; esac diff --git a/configure.ac b/configure.ac index 72bb163..b67e0e1 100644 --- a/configure.ac +++ b/configure.ac @@ -1615,9 +1615,10 @@ AC_ARG_WITH([dmalloc], case $withval in yes) HAVE_DMALLOC="yes" - AC_CHECK_HEADERS([dmalloc.h]) - AC_CHECK_LIB([dmalloc], [dmalloc_shutdown],, [unset HAVE_DMALLOC]) - + AC_CHECK_HEADERS([dmalloc.h],, [unset HAVE_DMALLOC]) + if test "x$HAVE_DMALLOC" = "xyes"; then + AC_CHECK_LIB([dmalloc], [dmalloc_shutdown],, [unset HAVE_DMALLOC]) + fi if test -z "$HAVE_DMALLOC" -a -n "$HDF5_CONFIG_ABORT"; then AC_MSG_ERROR([couldn't find dmalloc library]) fi @@ -1661,14 +1662,16 @@ case $withval in AM_CPPFLAGS="$AM_CPPFLAGS -I$dmalloc_inc" fi - AC_CHECK_HEADERS([dmalloc.h],,[CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"]) + AC_CHECK_HEADERS([dmalloc.h],,[CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_DMALLOC]) - if test -n "$dmalloc_lib"; then - LDFLAGS="$LDFLAGS -L$dmalloc_lib" - AM_LDFLAGS="$AM_LDFLAGS -L$dmalloc_lib" - fi + if test "x$HAVE_DMALLOC" = "xyes"; then + if test -n "$dmalloc_lib"; then + LDFLAGS="$LDFLAGS -L$dmalloc_lib" + AM_LDFLAGS="$AM_LDFLAGS -L$dmalloc_lib" + fi - AC_CHECK_LIB([dmalloc], [dmalloc_shutdown],, [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_DMALLOC]) + AC_CHECK_LIB([dmalloc], [dmalloc_shutdown],, [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_DMALLOC]) + fi if test -z "$HAVE_DMALLOC" -a -n "$HDF5_CONFIG_ABORT"; then AC_MSG_ERROR([couldn't find dmalloc library]) @@ -1692,12 +1695,16 @@ AC_ARG_WITH([zlib], case $withval in yes) HAVE_ZLIB="yes" - AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H="yes"]) - AC_CHECK_LIB([z], [compress2],, [unset HAVE_ZLIB]) - AC_CHECK_FUNC([compress2], [HAVE_COMPRESS2="yes"]) - - if test -z "$HAVE_ZLIB" -a -n "$HDF5_CONFIG_ABORT"; then - AC_MSG_ERROR([couldn't find zlib library]) + AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H="yes"], [unset HAVE_ZLIB]) + if test "x$HAVE_ZLIB" = "xyes" -a "x$HAVE_ZLIB_H" = "xyes"; then + AC_CHECK_LIB([z], [compress2],, [unset HAVE_ZLIB]) + fi + if test -z "$HAVE_ZLIB"; then + if test -n "$HDF5_CONFIG_ABORT"; then + AC_MSG_ERROR([couldn't find zlib library]) + fi + else + AC_CHECK_FUNC([compress2], [HAVE_COMPRESS2="yes"]) fi ;; no) @@ -1709,8 +1716,8 @@ case $withval in HAVE_ZLIB="yes" case "$withval" in *,*) - zlib_inc="`echo $withval |cut -f1 -d,`" - zlib_lib="`echo $withval |cut -f2 -d, -s`" + zlib_inc="`echo $withval | cut -f1 -d,`" + zlib_lib="`echo $withval | cut -f2 -d, -s`" ;; *) if test -n "$withval"; then @@ -1741,32 +1748,37 @@ case $withval in AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H="yes"], - [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"]) + [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_ZLIB]) if test -n "$zlib_lib"; then LDFLAGS="$LDFLAGS -L$zlib_lib" AM_LDFLAGS="$AM_LDFLAGS -L$zlib_lib" fi - AC_CHECK_LIB([z], [compress2],, - [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_ZLIB]) - AC_CHECK_FUNC([compress2], [HAVE_COMPRESS2="yes"]) + if test "x$HAVE_ZLIB" = "xyes" -a "x$HAVE_ZLIB_H" = "xyes"; then + AC_CHECK_LIB([z], [compress2],, + [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_ZLIB]) + fi - if test -z "$HAVE_ZLIB" -a -n "$HDF5_CONFIG_ABORT"; then - AC_MSG_ERROR([couldn't find zlib library]) + if test -z "$HAVE_ZLIB"; then + if test -n "$HDF5_CONFIG_ABORT"; then + AC_MSG_ERROR([couldn't find zlib library]) + fi + else + AC_CHECK_FUNC([compress2], [HAVE_COMPRESS2="yes"]) fi ;; esac if test "x$HAVE_ZLIB" = "xyes" -a "x$HAVE_ZLIB_H" = "xyes" -a "x$HAVE_COMPRESS2" = "xyes"; then - AC_DEFINE([HAVE_FILTER_DEFLATE], [1], [Define if support for deflate (zlib) filter is enabled]) - USE_FILTER_DEFLATE="yes" + AC_DEFINE([HAVE_FILTER_DEFLATE], [1], [Define if support for deflate (zlib) filter is enabled]) + USE_FILTER_DEFLATE="yes" - ## Add "deflate" to external filter list - if test "X$EXTERNAL_FILTERS" != "X"; then - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," - fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}deflate(zlib)" + ## Add "deflate" to external filter list + if test "X$EXTERNAL_FILTERS" != "X"; then + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," + fi + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}deflate(zlib)" fi @@ -1786,9 +1798,10 @@ AC_ARG_WITH([szlib], case $withval in yes) HAVE_SZLIB="yes" - AC_CHECK_HEADERS([szlib.h], [HAVE_SZLIB_H="yes"]) - AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, [unset HAVE_SZLIB]) - + AC_CHECK_HEADERS([szlib.h], [HAVE_SZLIB_H="yes"], [unset HAVE_SZLIB]) + if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then + AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, [unset HAVE_SZLIB]) + fi if test -z "$HAVE_SZLIB" -a -n "$HDF5_CONFIG_ABORT"; then AC_MSG_ERROR([couldn't find szlib library]) fi @@ -1834,15 +1847,17 @@ case $withval in AC_CHECK_HEADERS([szlib.h], [HAVE_SZLIB_H="yes"], - [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"]) + [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_SZIP]) if test -n "$szlib_lib"; then LDFLAGS="$LDFLAGS -L$szlib_lib" AM_LDFLAGS="$AM_LDFLAGS -L$szlib_lib" fi - AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, - [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_SZLIB]) + if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then + AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, + [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_SZLIB]) + fi if test -z "$HAVE_SZLIB" -a -n "$HDF5_CONFIG_ABORT"; then AC_MSG_ERROR([couldn't find szlib library]) @@ -1851,21 +1866,21 @@ case $withval in esac if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then - ## SZLIB library is available. Check if it can encode - AC_MSG_CHECKING([for szlib encoder]) + ## SZLIB library is available. Check if it can encode + AC_MSG_CHECKING([for szlib encoder]) - ## Set LD_LIBRARY_PATH so encoder test can find the library and run. - ## Also add LL_PATH substitution to Makefiles so they can use the - ## path as well, for testing examples. - if test -z "$LD_LIBRARY_PATH"; then + ## Set LD_LIBRARY_PATH so encoder test can find the library and run. + ## Also add LL_PATH substitution to Makefiles so they can use the + ## path as well, for testing examples. + if test -z "$LD_LIBRARY_PATH"; then export LD_LIBRARY_PATH="$szlib_lib" - else + else export LD_LIBRARY_PATH="$szlib_lib:$LD_LIBRARY_PATH" - fi + fi - AC_SUBST([LL_PATH]) LL_PATH="$LD_LIBRARY_PATH" + AC_SUBST([LL_PATH]) LL_PATH="$LD_LIBRARY_PATH" - AC_CACHE_VAL([hdf5_cv_szlib_can_encode], + AC_CACHE_VAL([hdf5_cv_szlib_can_encode], [AC_TRY_RUN([ #include @@ -1879,31 +1894,30 @@ if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then } ], [hdf5_cv_szlib_can_encode=yes], [hdf5_cv_szlib_can_encode=no],)]) - AC_DEFINE([HAVE_FILTER_SZIP], [1], + AC_DEFINE([HAVE_FILTER_SZIP], [1], [Define if support for szip filter is enabled]) - USE_FILTER_SZIP="yes" + USE_FILTER_SZIP="yes" - if test ${hdf5_cv_szlib_can_encode} = "yes"; then - AC_MSG_RESULT([yes]) - fi - if test ${hdf5_cv_szlib_can_encode} = "no"; then - AC_MSG_RESULT([no]) - fi + if test ${hdf5_cv_szlib_can_encode} = "yes"; then + AC_MSG_RESULT([yes]) + fi + if test ${hdf5_cv_szlib_can_encode} = "no"; then + AC_MSG_RESULT([no]) + fi - ## Add "szip" to external filter list - if test ${hdf5_cv_szlib_can_encode} = "yes"; then - if test "X$EXTERNAL_FILTERS" != "X"; then - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," - fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(encoder)" - fi - if test ${hdf5_cv_szlib_can_encode} = "no"; then - if test "X$EXTERNAL_FILTERS" != "X"; then - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," - fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(no encoder)" + ## Add "szip" to external filter list + if test ${hdf5_cv_szlib_can_encode} = "yes"; then + if test "X$EXTERNAL_FILTERS" != "X"; then + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," fi - + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(encoder)" + fi + if test ${hdf5_cv_szlib_can_encode} = "no"; then + if test "X$EXTERNAL_FILTERS" != "X"; then + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," + fi + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(no encoder)" + fi fi AM_CONDITIONAL([BUILD_SHARED_SZIP_CONDITIONAL], [test "X$USE_FILTER_SZIP" = "Xyes" && test "X$LL_PATH" != "X"]) @@ -1918,7 +1932,7 @@ AC_CACHE_SAVE ## and/or a library path. If the library path is specified then it must ## be preceded by a comma. ## -AC_SUBST([PTHREAD]) PTHREAD=yes +AC_SUBST([HAVE_PTHREAD]) HAVE_PTHREAD=yes AC_ARG_WITH([pthread], [AS_HELP_STRING([--with-pthread=DIR], [Use the Pthreads library [default=no]])],, @@ -1926,13 +1940,15 @@ AC_ARG_WITH([pthread], case "$withval" in yes) - AC_CHECK_HEADERS([pthread.h]) - AC_CHECK_LIB([pthread], [pthread_self],, [unset PTHREAD]) + AC_CHECK_HEADERS([pthread.h],, [unset HAVE_PTHREAD]) + if test "x$HAVE_DMALLOC" = "xyes"; then + AC_CHECK_LIB([pthread], [pthread_self],, [unset HAVE_PTHREAD]) + fi ;; no) AC_MSG_CHECKING([for pthread]) AC_MSG_RESULT([suppressed]) - unset PTHREAD + unset HAVE_PTHREAD ;; *) case "$withval" in @@ -1962,21 +1978,22 @@ case "$withval" in saved_AM_CPPFLAGS="$AM_CPPFLAGS" CPPFLAGS="$CPPFLAGS -I$pthread_inc" AM_CPPFLAGS="$AM_CPPFLAGS -I$pthread_inc" - AC_CHECK_HEADERS([pthread.h],, [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"; unset PTHREAD]) + AC_CHECK_HEADERS([pthread.h],, [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"; unset HAVE_PTHREAD]) else - AC_CHECK_HEADERS([pthread.h],, [unset PTHREAD]) + AC_CHECK_HEADERS([pthread.h],, [unset HAVE_PTHREAD]) fi - if test -n "$pthread_lib"; then - saved_LDFLAGS="$LDFLAGS" - saved_AM_LDFLAGS="$AM_LDFLAGS" - LDFLAGS="$LDFLAGS -L$pthread_lib" - AM_LDFLAGS="$AM_LDFLAGS -L$pthread_lib" - AC_CHECK_LIB([pthread], [pthread_self],, - [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset PTHREAD]) - - else - AC_CHECK_LIB([pthread], [pthread_self],, [unset PTHREAD]) + if test "x$HAVE_DMALLOC" = "xyes"; then + if test -n "$pthread_lib"; then + saved_LDFLAGS="$LDFLAGS" + saved_AM_LDFLAGS="$AM_LDFLAGS" + LDFLAGS="$LDFLAGS -L$pthread_lib" + AM_LDFLAGS="$AM_LDFLAGS -L$pthread_lib" + AC_CHECK_LIB([pthread], [pthread_self],, + [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_PTHREAD]) + else + AC_CHECK_LIB([pthread], [pthread_self],, [unset HAVE_PTHREAD]) + fi fi ;; esac diff --git a/examples/Makefile.in b/examples/Makefile.in index b6dfab5..064cb84 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -194,6 +194,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -245,7 +246,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/fortran/Makefile.in b/fortran/Makefile.in index 806eb30..acab031 100644 --- a/fortran/Makefile.in +++ b/fortran/Makefile.in @@ -231,6 +231,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -282,7 +283,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index a3b0b98..93a2af1 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -70,7 +70,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/run-fortran-ex.sh.in $(srcdir)/testh5fc.sh.in \ $(top_srcdir)/bin/mkinstalldirs \ $(top_srcdir)/config/commence.am \ @@ -202,6 +202,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -253,7 +254,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 45fa4a4..d1096f0 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -320,6 +320,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -371,7 +372,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index 7476160..6c226bc 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -305,6 +305,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -356,7 +357,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in index 1cbc87e..9a93367 100644 --- a/fortran/testpar/Makefile.in +++ b/fortran/testpar/Makefile.in @@ -229,6 +229,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -280,7 +281,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/Makefile.in b/hl/Makefile.in index dddd693..786bfba 100644 --- a/hl/Makefile.in +++ b/hl/Makefile.in @@ -231,6 +231,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -282,7 +283,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in index 4a33b33..60baefe 100644 --- a/hl/c++/Makefile.in +++ b/hl/c++/Makefile.in @@ -227,6 +227,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -278,7 +279,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index f617fec..8297d0a 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -193,6 +193,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -244,7 +245,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index c1c64e5..86cf954 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -260,6 +260,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -311,7 +312,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in index 0213f38..f8ad89b 100644 --- a/hl/c++/test/Makefile.in +++ b/hl/c++/test/Makefile.in @@ -226,6 +226,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -277,7 +278,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index f6126d4..2713377 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -193,6 +193,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -244,7 +245,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in index 6fe288c..8b7f728 100644 --- a/hl/fortran/Makefile.in +++ b/hl/fortran/Makefile.in @@ -231,6 +231,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -282,7 +283,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index 7dd855b..9f08f21 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -194,6 +194,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -245,7 +246,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index bd1ecac..c782ce0 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -276,6 +276,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -327,7 +328,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in index 7e69b79..2acee8c 100644 --- a/hl/fortran/test/Makefile.in +++ b/hl/fortran/test/Makefile.in @@ -240,6 +240,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -291,7 +292,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 3115a9e..9da314a 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -259,6 +259,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -310,7 +311,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index ad3f370..30b329e 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -267,6 +267,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -318,7 +319,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in index 23baa17..eca7b8f 100644 --- a/hl/tools/Makefile.in +++ b/hl/tools/Makefile.in @@ -228,6 +228,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -279,7 +280,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in index 8b98276..3d7e7fe 100644 --- a/hl/tools/gif2h5/Makefile.in +++ b/hl/tools/gif2h5/Makefile.in @@ -242,6 +242,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -293,7 +294,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/perform/Makefile.in b/perform/Makefile.in index 230469c..4cc5b2b 100644 --- a/perform/Makefile.in +++ b/perform/Makefile.in @@ -268,6 +268,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -319,7 +320,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/release_docs/USING_CMake.txt b/release_docs/USING_CMake.txt index 4397750..e4e05ed 100644 --- a/release_docs/USING_CMake.txt +++ b/release_docs/USING_CMake.txt @@ -4,14 +4,14 @@ Notes: This short instruction is written for users who want to quickly build HDF5 Applications from the HDF5 Examples package using the CMake tools. - Users can adapt these instructions for their own applicaltions, see the + Users can adapt these instructions for their own applications, see the "Minimum Project Files" section. More information about using CMake can be found at the KitWare site, www.cmake.org. CMake uses the command line, however the visual CMake tool is - available for the configuration step. The steps are similiar for + available for the configuration step. The steps are similar for all the operating systems supported by CMake. NOTES: @@ -62,7 +62,7 @@ Notes: This short instruction is written for users who want to quickly build available in your Start menu. For Linux, UNIX, and Mac users the executable is named "cmake-gui" and can be found where CMake was installed. - Specify the source and build directories. It is recommemded that you + Specify the source and build directories. It is recommended that you choose a build directory different then the source directory (for example on Windows, if the source is at c:\MyHDFstuff\hdf5, then use c:\MyHDFstuff\hdf5\build or c:\MyHDFstuff\build\hdf5). @@ -156,7 +156,7 @@ Notes: This short instruction is written for users who want to quickly build ======================================================================== - Using HDF5 Libraries with Visual Studio 2008 + Using Visual Studio 2008 with HDF5 Libraries built with Visual Studio 2008 ======================================================================== 8. Set up path for external libraries and headers @@ -168,11 +168,11 @@ Notes: This short instruction is written for users who want to quickly build and select "x64". 8.2 Find the box "Show directories for", choose "Include files", add the - header path (i.e. c:\Program Files\HDF Group\HDF5\hdf5-1.8.7\include) + header path (i.e. c:\Program Files\HDF Group\HDF5\hdf5-1.8.x\include) to the included directories. 8.3 Find the box "Show directories for", choose "Library files", add the - library path (i.e. c:\Program Files\HDF Group\HDF5\hdf5-1.8.7\lib) + library path (i.e. c:\Program Files\HDF Group\HDF5\hdf5-1.8.x\lib) to the library directories. 8.4 If using Fortran libraries, you will also need to setup the path diff --git a/src/Makefile.in b/src/Makefile.in index d31b371..c16e482 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -324,6 +324,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -375,7 +376,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/test/Makefile.in b/test/Makefile.in index 6f39794..64fd98a 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -593,6 +593,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -644,7 +645,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/testpar/Makefile.in b/testpar/Makefile.in index 394b3b1..2fbf5fc 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -255,6 +255,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -306,7 +307,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/Makefile.in b/tools/Makefile.in index 70e11ae..46c7d53 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -228,6 +228,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -279,7 +280,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in index da9d0b7..3278f80 100644 --- a/tools/h5copy/Makefile.in +++ b/tools/h5copy/Makefile.in @@ -234,6 +234,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -285,7 +286,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index 4676341..5567ceb 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -241,6 +241,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -292,7 +293,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index 6b4a6e6..4741683 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -240,6 +240,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -291,7 +292,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in index 16e8901..9ad2341 100644 --- a/tools/h5import/Makefile.in +++ b/tools/h5import/Makefile.in @@ -234,6 +234,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -285,7 +286,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in index ff8b089..fd170fd 100644 --- a/tools/h5jam/Makefile.in +++ b/tools/h5jam/Makefile.in @@ -248,6 +248,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -299,7 +300,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in index 7aa4329..1861b03 100644 --- a/tools/h5ls/Makefile.in +++ b/tools/h5ls/Makefile.in @@ -228,6 +228,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -279,7 +280,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 389339f..fe3a11c 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -248,6 +248,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -299,7 +300,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5stat/Makefile.in b/tools/h5stat/Makefile.in index 389e460..ec77732 100644 --- a/tools/h5stat/Makefile.in +++ b/tools/h5stat/Makefile.in @@ -263,6 +263,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -314,7 +315,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in index 6a76e1d..743e158 100644 --- a/tools/lib/Makefile.in +++ b/tools/lib/Makefile.in @@ -226,6 +226,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -277,7 +278,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index f83c664..dbb5f98 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -302,7 +302,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai */ curr_pos = ctx->sm_pos; - if (region_output && H5Tequal(type, H5T_STD_REF_DSETREG)) { + if (region_output && (size == H5R_DSET_REG_REF_BUF_SIZE)) { for (i = 0; i < nelmts; i++, ctx->cur_elmt++, elmt_counter++) { void* memref = mem + i * size; char ref_name[1024]; diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 1646351..e17ae89 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -685,7 +685,8 @@ char * h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t container, hid_t type, void *vp, h5tools_context_t *ctx) { - size_t n, offset, size=0, nelmts, start; + size_t nsize, offset, size=0, nelmts, start; + H5T_sign_t nsign; char *name; unsigned char *ucp_vp = (unsigned char *)vp; char *cp_vp = (char *)vp; @@ -715,15 +716,16 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai /* Append value depending on data type */ start = h5tools_str_len(str); + nsize = H5Tget_size(type); + nsign = H5Tget_sign(type); if (info->raw) { size_t i; - n = H5Tget_size(type); - if (1 == n) { + if (1 == nsize) { h5tools_str_append(str, OPT(info->fmt_raw, "0x%02x"), ucp_vp[0]); } else { - for (i = 0; i < n; i++) { + for (i = 0; i < nsize; i++) { if (i) h5tools_str_append(str, ":"); h5tools_str_append(str, OPT(info->fmt_raw, "%02x"), ucp_vp[i]); @@ -735,20 +737,23 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai return NULL; switch (type_class) { case H5T_FLOAT: - if (H5Tequal(type, H5T_NATIVE_FLOAT)) { + if (sizeof(float) == nsize) { + /* if (H5Tequal(type, H5T_NATIVE_FLOAT)) */ float tempfloat; HDmemcpy(&tempfloat, vp, sizeof(float)); h5tools_str_append(str, OPT(info->fmt_float, "%g"), tempfloat); } - else if (H5Tequal(type, H5T_NATIVE_DOUBLE)) { + else if (sizeof(double) == nsize) { + /* if (H5Tequal(type, H5T_NATIVE_DOUBLE)) */ double tempdouble; HDmemcpy(&tempdouble, vp, sizeof(double)); h5tools_str_append(str, OPT(info->fmt_double, "%g"), tempdouble); #if H5_SIZEOF_LONG_DOUBLE !=0 } - else if (H5Tequal(type, H5T_NATIVE_LDOUBLE)) { + else if (sizeof(long double) == nsize) { + /* if (H5Tequal(type, H5T_NATIVE_LDOUBLE)) */ long double templdouble; HDmemcpy(&templdouble, vp, sizeof(long double)); @@ -833,147 +838,140 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai } break; case H5T_INTEGER: - if (H5Tequal(type, H5T_NATIVE_INT)) { - HDmemcpy(&tempint, vp, sizeof(int)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(int)) - tempint = 0; - else - tempint = (tempint >> packed_data_offset) & packed_data_mask; - } - h5tools_str_append(str, OPT(info->fmt_int, "%d"), tempint); - } - else if (H5Tequal(type, H5T_NATIVE_UINT)) { - HDmemcpy(&tempuint, vp, sizeof(unsigned int)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(unsigned int)) - tempuint = 0; - else - tempuint = (tempuint >> packed_data_offset) & packed_data_mask; - } - h5tools_str_append(str, OPT(info->fmt_uint, "%u"), tempuint); - } - else if (info->ascii && (H5Tequal(type, H5T_NATIVE_SCHAR) || H5Tequal(type, H5T_NATIVE_UCHAR))) { - h5tools_print_char(str, info, (char) (*ucp_vp)); - } - else if (H5Tequal(type, H5T_NATIVE_SCHAR)) { - signed char tempchar; - HDmemcpy(&tempchar, cp_vp, sizeof(char)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(char)) - tempchar = 0; - else - tempchar = (tempchar >> packed_data_offset) & packed_data_mask; - } -#ifdef H5_VMS - h5tools_str_append(str, OPT(info->fmt_schar, "%hd"), tempchar); -#else - h5tools_str_append(str, OPT(info->fmt_schar, "%hhd"), tempchar); -#endif - } - else if (H5Tequal(type, H5T_NATIVE_UCHAR)) { - unsigned char tempuchar; - HDmemcpy(&tempuchar, ucp_vp, sizeof(unsigned char)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(unsigned char)) - tempuchar = 0; - else - tempuchar = (tempuchar >> packed_data_offset) & packed_data_mask; - } - h5tools_str_append(str, OPT(info->fmt_uchar, "%u"), tempuchar); - } - else if (H5Tequal(type, H5T_NATIVE_SHORT)) { - short tempshort; - - HDmemcpy(&tempshort, vp, sizeof(short)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(short)) - tempshort = 0; - else - tempshort = (tempshort >> packed_data_offset) & packed_data_mask; - } - h5tools_str_append(str, OPT(info->fmt_short, "%d"), tempshort); - } - else if (H5Tequal(type, H5T_NATIVE_USHORT)) { - unsigned short tempushort; - - HDmemcpy(&tempushort, vp, sizeof(unsigned short)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(unsigned short)) - tempushort = 0; - else - tempushort = (tempushort >> packed_data_offset) & packed_data_mask; - } - h5tools_str_append(str, OPT(info->fmt_ushort, "%u"), tempushort); - } - else if (H5Tequal(type, H5T_NATIVE_LONG)) { - HDmemcpy(&templong, vp, sizeof(long)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(long)) - templong = 0; - else - templong = (templong >> packed_data_offset) & packed_data_mask; + if (sizeof(char) == nsize) { + /* if ((H5Tequal(type, H5T_NATIVE_SCHAR) || H5Tequal(type, H5T_NATIVE_UCHAR))) */ + if (info->ascii) { + h5tools_print_char(str, info, (char) (*ucp_vp)); } - h5tools_str_append(str, OPT(info->fmt_long, "%ld"), templong); - } - else if (H5Tequal(type, H5T_NATIVE_ULONG)) { - HDmemcpy(&tempulong, vp, sizeof(unsigned long)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(unsigned long)) - tempulong = 0; - else - tempulong = (tempulong >> packed_data_offset) & packed_data_mask; + else if(H5T_SGN_NONE == nsign) { + /* if (H5Tequal(type, H5T_NATIVE_UCHAR)) */ + unsigned char tempuchar; + HDmemcpy(&tempuchar, ucp_vp, sizeof(unsigned char)); + if (packed_bits_num) { + if (packed_data_offset >= 8 * sizeof(unsigned char)) + tempuchar = 0; + else + tempuchar = (tempuchar >> packed_data_offset) & packed_data_mask; + } + h5tools_str_append(str, OPT(info->fmt_uchar, "%u"), tempuchar); } - h5tools_str_append(str, OPT(info->fmt_ulong, "%lu"), tempulong); - } - else if (H5Tequal(type, H5T_NATIVE_LLONG)) { - HDmemcpy(&templlong, vp, sizeof(long long)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(long long)) - templlong = 0; - else - templlong = (templlong >> packed_data_offset) & packed_data_mask; + else { + /* if (H5Tequal(type, H5T_NATIVE_SCHAR)) */ + signed char tempchar; + HDmemcpy(&tempchar, cp_vp, sizeof(char)); + if (packed_bits_num) { + if (packed_data_offset >= 8 * sizeof(char)) + tempchar = 0; + else + tempchar = (tempchar >> packed_data_offset) & packed_data_mask; + } + #ifdef H5_VMS + h5tools_str_append(str, OPT(info->fmt_schar, "%hd"), tempchar); + #else + h5tools_str_append(str, OPT(info->fmt_schar, "%hhd"), tempchar); + #endif } - h5tools_str_append(str, OPT(info->fmt_llong, fmt_llong), templlong); - } - else if (H5Tequal(type, H5T_NATIVE_ULLONG)) { - HDmemcpy(&tempullong, vp, sizeof(unsigned long long)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(unsigned long long)) - tempullong = 0; - else - tempullong = (tempullong >> packed_data_offset) & packed_data_mask; + } /* end if (sizeof(char) == nsize) */ + else if (sizeof(int) == nsize) { + if(H5T_SGN_NONE == nsign) { + /* if (H5Tequal(type, H5T_NATIVE_UINT)) */ + HDmemcpy(&tempuint, vp, sizeof(unsigned int)); + if (packed_bits_num) { + if (packed_data_offset >= 8 * sizeof(unsigned int)) + tempuint = 0; + else + tempuint = (tempuint >> packed_data_offset) & packed_data_mask; + } + h5tools_str_append(str, OPT(info->fmt_uint, "%u"), tempuint); } - h5tools_str_append(str, OPT(info->fmt_ullong, fmt_ullong), tempullong); - } - else if (H5Tequal(type, H5T_NATIVE_HSSIZE)) { - if (sizeof(hssize_t) == sizeof(int)) { + else { + /* if (H5Tequal(type, H5T_NATIVE_INT)) */ HDmemcpy(&tempint, vp, sizeof(int)); + if (packed_bits_num) { + if (packed_data_offset >= 8 * sizeof(int)) + tempint = 0; + else + tempint = (tempint >> packed_data_offset) & packed_data_mask; + } h5tools_str_append(str, OPT(info->fmt_int, "%d"), tempint); } - else if (sizeof(hssize_t) == sizeof(long)) { - HDmemcpy(&templong, vp, sizeof(long)); - h5tools_str_append(str, OPT(info->fmt_long, "%ld"), templong); + } /* end if (sizeof(int) == nsize) */ + else if (sizeof(short) == nsize) { + if(H5T_SGN_NONE == nsign) { + /* if (H5Tequal(type, H5T_NATIVE_USHORT)) */ + unsigned short tempushort; + + HDmemcpy(&tempushort, vp, sizeof(unsigned short)); + if (packed_bits_num) { + if (packed_data_offset >= 8 * sizeof(unsigned short)) + tempushort = 0; + else + tempushort = (tempushort >> packed_data_offset) & packed_data_mask; + } + h5tools_str_append(str, OPT(info->fmt_ushort, "%u"), tempushort); } else { - HDmemcpy(&templlong, vp, sizeof(long long)); - h5tools_str_append(str, OPT(info->fmt_llong, fmt_llong), templlong); - } - } - else if (H5Tequal(type, H5T_NATIVE_HSIZE)) { - if (sizeof(hsize_t) == sizeof(int)) { - HDmemcpy(&tempuint, vp, sizeof(unsigned int)); - h5tools_str_append(str, OPT(info->fmt_uint, "%u"), tempuint); + /* if (H5Tequal(type, H5T_NATIVE_SHORT)) */ + short tempshort; + + HDmemcpy(&tempshort, vp, sizeof(short)); + if (packed_bits_num) { + if (packed_data_offset >= 8 * sizeof(short)) + tempshort = 0; + else + tempshort = (tempshort >> packed_data_offset) & packed_data_mask; + } + h5tools_str_append(str, OPT(info->fmt_short, "%d"), tempshort); } - else if (sizeof(hsize_t) == sizeof(long)) { - HDmemcpy(&tempulong, vp, sizeof(long)); + } /* end if (sizeof(short) == nsize) */ + else if (sizeof(long) == nsize) { + if(H5T_SGN_NONE == nsign) { + /* if (H5Tequal(type, H5T_NATIVE_ULONG)) */ + HDmemcpy(&tempulong, vp, sizeof(unsigned long)); + if (packed_bits_num) { + if (packed_data_offset >= 8 * sizeof(unsigned long)) + tempulong = 0; + else + tempulong = (tempulong >> packed_data_offset) & packed_data_mask; + } h5tools_str_append(str, OPT(info->fmt_ulong, "%lu"), tempulong); } else { + /* if (H5Tequal(type, H5T_NATIVE_LONG)) */ + HDmemcpy(&templong, vp, sizeof(long)); + if (packed_bits_num) { + if (packed_data_offset >= 8 * sizeof(long)) + templong = 0; + else + templong = (templong >> packed_data_offset) & packed_data_mask; + } + h5tools_str_append(str, OPT(info->fmt_long, "%ld"), templong); + } + } /* end if (sizeof(long) == nsize) */ + else if (sizeof(long long) == nsize) { + if(H5T_SGN_NONE == nsign) { + /* if (H5Tequal(type, H5T_NATIVE_ULLONG)) */ HDmemcpy(&tempullong, vp, sizeof(unsigned long long)); + if (packed_bits_num) { + if (packed_data_offset >= 8 * sizeof(unsigned long long)) + tempullong = 0; + else + tempullong = (tempullong >> packed_data_offset) & packed_data_mask; + } h5tools_str_append(str, OPT(info->fmt_ullong, fmt_ullong), tempullong); } - } + else { + /* if (H5Tequal(type, H5T_NATIVE_LLONG)) */ + HDmemcpy(&templlong, vp, sizeof(long long)); + if (packed_bits_num) { + if (packed_data_offset >= 8 * sizeof(long long)) + templlong = 0; + else + templlong = (templlong >> packed_data_offset) & packed_data_mask; + } + h5tools_str_append(str, OPT(info->fmt_llong, fmt_llong), templlong); + } + } /* end if (sizeof(long long) == nsize) */ break; case H5T_COMPOUND: { @@ -1024,75 +1022,71 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai } else { size_t i; - n = H5Tget_size(type); - if (1 == n) { + if (1 == nsize) { h5tools_str_append(str, "0x%02x", ucp_vp[0]); } else { - for (i = 0; i < n; i++) + for (i = 0; i < nsize; i++) h5tools_str_append(str, "%s%02x", i ? ":" : "", ucp_vp[i]); } } } break; case H5T_REFERENCE: - if (H5Tequal(type, H5T_STD_REF_DSETREG)) { - if (h5tools_str_is_zero(vp, H5Tget_size(type))) { - h5tools_str_append(str, "NULL"); - } - else { - h5tools_str_sprint_region(str, info, container, vp); - } + if (h5tools_str_is_zero(vp, nsize)) { + h5tools_str_append(str, "NULL"); } - else if (H5Tequal(type, H5T_STD_REF_OBJ)) { - /* - * Object references -- show the type and OID of the referenced - * object. - */ - if (h5tools_str_is_zero(vp, H5Tget_size(type))) { - h5tools_str_append(str, "NULL"); + else { + if (nsize == H5R_DSET_REG_REF_BUF_SIZE) { + /* if (H5Tequal(type, H5T_STD_REF_DSETREG)) */ + h5tools_str_sprint_region(str, info, container, vp); } - else { - H5O_info_t oi; - const char *path; - - obj = H5Rdereference2(container, H5P_DEFAULT, H5R_OBJECT, vp); - H5Oget_info(obj, &oi); - - /* Print object type and close object */ - switch (oi.type) { - case H5O_TYPE_GROUP: - h5tools_str_append(str, H5_TOOLS_GROUP); - break; - - case H5O_TYPE_DATASET: - h5tools_str_append(str, H5_TOOLS_DATASET); - break; - - case H5O_TYPE_NAMED_DATATYPE: - h5tools_str_append(str, H5_TOOLS_DATATYPE); - break; - - default: - h5tools_str_append(str, "%u-", (unsigned) oi.type); - break; - } /* end switch */ - H5Oclose(obj); - - /* Print OID */ - if (info->obj_hidefileno) - h5tools_str_append(str, info->obj_format, oi.addr); - else - h5tools_str_append(str, info->obj_format, oi.fileno, oi.addr); - - /* Print name */ - path = lookup_ref_path(*(haddr_t *) vp); - if (path) { - h5tools_str_append(str, " "); - h5tools_str_append(str, path); - h5tools_str_append(str, " "); - } /* end if */ - } /* end else */ + else if (nsize == H5R_OBJ_REF_BUF_SIZE) { + /* if (H5Tequal(type, H5T_STD_REF_OBJ)) */ + /* + * Object references -- show the type and OID of the referenced + * object. + */ + H5O_info_t oi; + const char *path; + + obj = H5Rdereference2(container, H5P_DEFAULT, H5R_OBJECT, vp); + H5Oget_info(obj, &oi); + + /* Print object type and close object */ + switch (oi.type) { + case H5O_TYPE_GROUP: + h5tools_str_append(str, H5_TOOLS_GROUP); + break; + + case H5O_TYPE_DATASET: + h5tools_str_append(str, H5_TOOLS_DATASET); + break; + + case H5O_TYPE_NAMED_DATATYPE: + h5tools_str_append(str, H5_TOOLS_DATATYPE); + break; + + default: + h5tools_str_append(str, "%u-", (unsigned) oi.type); + break; + } /* end switch */ + H5Oclose(obj); + + /* Print OID */ + if (info->obj_hidefileno) + h5tools_str_append(str, info->obj_format, oi.addr); + else + h5tools_str_append(str, info->obj_format, oi.fileno, oi.addr); + + /* Print name */ + path = lookup_ref_path(*(haddr_t *) vp); + if (path) { + h5tools_str_append(str, " "); + h5tools_str_append(str, path); + h5tools_str_append(str, " "); + } /* end if */ + } /* end else if (H5Tequal(type, H5T_STD_REF_OBJ)) */ } break; case H5T_ARRAY: @@ -1206,12 +1200,11 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai { /* All other types get printed as hexadecimal */ size_t i; - n = H5Tget_size(type); - if (1 == n) { + if (1 == nsize) { h5tools_str_append(str, "0x%02x", ucp_vp[0]); } else { - for (i = 0; i < n; i++) + for (i = 0; i < nsize; i++) h5tools_str_append(str, "%s%02x", i ? ":" : "", ucp_vp[i]); } } diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in index 8c2e1c1..3320276 100644 --- a/tools/misc/Makefile.in +++ b/tools/misc/Makefile.in @@ -288,6 +288,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -339,7 +340,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ -- cgit v0.12 From 8a92fbce85ed5088fc1cabc8e40ac407218d06b8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Feb 2013 11:42:11 -0500 Subject: [svn-r23306] HDFFV-8311: Correct test dependency Tested: local linux --- tools/h5repack/h5repack.sh.in | 357 ++++++++++++++++++++++++------------------ 1 file changed, 204 insertions(+), 153 deletions(-) diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in index a732ffb..dc90426 100644 --- a/tools/h5repack/h5repack.sh.in +++ b/tools/h5repack/h5repack.sh.in @@ -189,7 +189,9 @@ SKIP() { DIFFTEST() { VERIFY h5diff output $@ - $RUNSERIAL $H5DIFF_BIN -q "$@" + ( + $RUNSERIAL $H5DIFF_BIN -q "$@" + ) RET=$? if [ $RET != 0 ] ; then echo "*FAILED*" @@ -208,44 +210,57 @@ DIFFTEST() TOOLTEST() { echo $@ - TOOLTEST_MAIN $@ - outfile=$TESTDIR/out.$1 - rm -f $outfile -} + infile=$TESTDIR/$2 + outfile=$TESTDIR/out-$1.$2 + shift + shift -# TOOLTEST main function, doesn't delete $output file -TOOLTEST_MAIN() -{ # Run test. TESTING $H5REPACK $@ - - infile=$TESTDIR/$1 - outfile=$TESTDIR/out.$1 - shift - $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ( + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ) RET=$? if [ $RET != 0 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" else - echo " PASSED" - DIFFTEST $infile $outfile + echo " PASSED" + DIFFTEST $infile $outfile fi + rm -f $outfile } #------------------------------------------ # Verifying layouts of a dataset VERIFY_LAYOUT_DSET() { - outfile=$TESTDIR/out.$1 - layoutfile=$TESTDIR/layout.$1 - dset=$2 - expectlayout=$3 + layoutfile=$TESTDIR/layout-$1.$2 + dset=$3 + expectlayout=$4 + infile=$TESTDIR/$2 + outfile=$TESTDIR/out-$1.$2 + shift + shift + shift + shift + + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + DIFFTEST $infile $outfile + fi #--------------------------------- # check the layout from a dataset VERIFY "a dataset layout" - $RUNSERIAL $H5DUMP_BIN -d $dset -pH $outfile > $layoutfile + ( + $RUNSERIAL $H5DUMP_BIN -d $dset -pH $outfile > $layoutfile + ) $GREP $expectlayout $layoutfile > /dev/null if [ $? -eq 0 ]; then echo " PASSED" @@ -262,17 +277,35 @@ VERIFY_LAYOUT_DSET() # Verifying layouts from entire file VERIFY_LAYOUT_ALL() { - outfile=$TESTDIR/out.$1 - layoutfile=$TESTDIR/layout.$1 - expectlayout=$2 + outfile=$TESTDIR/out-$1.$2 + layoutfile=$TESTDIR/layout-$1.$2 + expectlayout=$3 + shift + shift + shift + + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + DIFFTEST $infile $outfile + fi + #--------------------------------- # check the layout from a dataset # check if the other layouts still exsit VERIFY "layouts" + ( # if CONTIGUOUS if [ $expectlayout = "CONTIGUOUS" ]; then - $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile + TESTING $H5DUMP_BIN -pH $outfile + ( + $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile + ) $GREP "COMPACT" $layoutfile > /dev/null if [ $? -eq 0 ]; then echo " FAILED" @@ -287,7 +320,10 @@ VERIFY_LAYOUT_ALL() else # if COMPACT if [ $expectlayout = "COMPACT" ]; then - $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile + TESTING $H5DUMP_BIN -pH $outfile + ( + $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile + ) $GREP "CHUNKED" $layoutfile > /dev/null if [ $? -eq 0 ]; then echo " FAILED" @@ -302,7 +338,10 @@ VERIFY_LAYOUT_ALL() else # if CHUNKED if [ $expectlayout = "CHUNKED" ]; then - $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile + TESTING $H5DUMP_BIN -pH $outfile + ( + $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile + ) $GREP "CONTIGUOUS" $layoutfile > /dev/null if [ $? -eq 0 ]; then echo " FAILED" @@ -317,6 +356,7 @@ VERIFY_LAYOUT_ALL() fi fi fi + ) # clean up tmp files rm -f $outfile @@ -327,13 +367,16 @@ VERIFY_LAYOUT_ALL() # TOOLTEST0() { + infile=$TESTDIR/$2 + outfile=$TESTDIR/out-$1.$2 + shift + shift + # Run test. TESTING $H5REPACK $@ - - infile=$TESTDIR/$1 - outfile=$TESTDIR/out.$1 - shift - $RUNSERIAL $H5REPACK_BIN -i $infile -o $outfile "$@" + ( + $RUNSERIAL $H5REPACK_BIN -i $infile -o $outfile "$@" + ) RET=$? if [ $RET != 0 ] ; then echo "*FAILED*" @@ -351,13 +394,16 @@ TOOLTEST0() # TOOLTEST1() { + infile=$TESTDIR/$2 + outfile=$TESTDIR/out-$1.$2 + shift + shift + # Run test. TESTING $H5REPACK $@ - - infile=$TESTDIR/$1 - outfile=$TESTDIR/out.$1 - shift - $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ( + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ) RET=$? if [ $RET != 0 ] ; then echo "*FAILED*" @@ -374,16 +420,20 @@ TOOLTEST1() # TOOLTESTV() { - # Run test. - TESTING $H5REPACK $@ - expect="$TESTDIR/$1.ddl" - actual="$TESTDIR/`basename $1 .ddl`.out" - actual_err="$TESTDIR/`basename $1 .ddl`.err" + expect="$TESTDIR/$2.ddl" + actual="$TESTDIR/`basename $2 .ddl`.out" + actual_err="$TESTDIR/`basename $2 .ddl`.err" - infile=$TESTDIR/$1 - outfile=$TESTDIR/out.$1 + infile=$TESTDIR/$2 + outfile=$TESTDIR/out-$1.$2 + shift shift - $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile >$actual 2>$actual_err + + # Run test. + TESTING $H5REPACK $@ + ( + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ) >$actual 2>$actual_err RET=$? if [ $RET != 0 ] ; then echo "*FAILED*" @@ -427,17 +477,41 @@ TOOLTESTV() # Verify the output file of second run is larger than the one of 1st run. TOOLTEST_META() { - input_file=$1 - outfile="$TESTDIR/out.$1" + infile=$TESTDIR/$2 + outfile=$TESTDIR/out-$1.$2 + shift + shift - # Use TOOLTEST_MAIN to run because it does not remove the output file. - # 1st run, without metadata option - TOOLTEST_MAIN $1 + # Run test. + TESTING $H5REPACK $@ + ( + $RUNSERIAL $H5REPACK_BIN $infile $outfile + ) + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + DIFFTEST $infile $outfile + fi # get the size of the first output file size1=`wc -c $outfile | cut -d' ' -f1` # 2nd run with metadata option - TOOLTEST_MAIN $* + # Run test. + TESTING $H5REPACK $@ + ( + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ) + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + DIFFTEST $infile $outfile + fi # get the size of the second output file size2=`wc -c $outfile | cut -d' ' -f1` @@ -492,12 +566,12 @@ fi COPY_TESTFILES_TO_TESTDIR # copy files (these files have no filters) -TOOLTEST h5repack_fill.h5 -TOOLTEST h5repack_objs.h5 -TOOLTEST h5repack_attr.h5 -TOOLTEST h5repack_hlink.h5 -TOOLTEST h5repack_layout.h5 -TOOLTEST h5repack_early.h5 +TOOLTEST fill h5repack_fill.h5 +TOOLTEST objs h5repack_objs.h5 +TOOLTEST attr h5repack_attr.h5 +TOOLTEST hlink h5repack_hlink.h5 +TOOLTEST layout h5repack_layout.h5 +TOOLTEST early h5repack_early.h5 # use h5repack_layout.h5 to write some filters (this file has no filters) @@ -507,7 +581,7 @@ arg="h5repack_layout.h5 -f dset1:GZIP=1 -l dset1:CHUNK=20x10" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST gzip_individual $arg fi # gzip for all @@ -515,7 +589,7 @@ arg="h5repack_layout.h5 -f GZIP=1" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST gzip_all $arg fi # szip with individual object @@ -523,7 +597,7 @@ arg="h5repack_layout.h5 -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST szip_individual $arg fi # szip for all @@ -531,7 +605,7 @@ arg="h5repack_layout.h5 -f SZIP=8,NN" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST szip_all $arg fi # shuffle with individual object @@ -539,7 +613,7 @@ arg="h5repack_layout.h5 -f dset2:SHUF -l dset2:CHUNK=20x10" if test $USE_FILTER_SHUFFLE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST shuffle_individual $arg fi @@ -548,7 +622,7 @@ arg="h5repack_layout.h5 -f SHUF" if test $USE_FILTER_SHUFFLE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST shuffle_all $arg fi # fletcher32 with individual object @@ -556,7 +630,7 @@ arg="h5repack_layout.h5 -f dset2:FLET -l dset2:CHUNK=20x10" if test $USE_FILTER_FLETCHER32 != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST fletcher_individual $arg fi # fletcher32 for all @@ -564,7 +638,7 @@ arg="h5repack_layout.h5 -f FLET" if test $USE_FILTER_FLETCHER32 != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST fletcher_all $arg fi # all filters @@ -572,7 +646,7 @@ arg="h5repack_layout.h5 -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2: if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_SHUFFLE != "yes" -o $USE_FILTER_FLETCHER32 != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST all_filters $arg fi # verbose gzip with individual object @@ -581,7 +655,7 @@ if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else # compare output - TOOLTESTV $arg + TOOLTESTV gzip_verbose_filters $arg fi ########################################################### @@ -593,7 +667,7 @@ arg="h5repack_szip.h5" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST szip_copy $arg fi # szip remove @@ -601,7 +675,7 @@ arg="h5repack_szip.h5 --filter=dset_szip:NONE" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST szip_remove $arg fi # deflate copy @@ -609,7 +683,7 @@ arg="h5repack_deflate.h5" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST deflate_copy $arg fi # deflate remove @@ -617,7 +691,7 @@ arg="h5repack_deflate.h5 -f dset_deflate:NONE" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST deflate_remove $arg fi # shuffle copy @@ -625,7 +699,7 @@ arg="h5repack_shuffle.h5" if test $USE_FILTER_SHUFFLE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST shuffle_copy $arg fi # shuffle remove @@ -633,7 +707,7 @@ arg="h5repack_shuffle.h5 -f dset_shuffle:NONE" if test $USE_FILTER_SHUFFLE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST shuffle_remove $arg fi # fletcher32 copy @@ -641,7 +715,7 @@ arg="h5repack_fletcher.h5" if test $USE_FILTER_FLETCHER32 != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST fletcher_copy $arg fi # fletcher32 remove @@ -649,7 +723,7 @@ arg="h5repack_fletcher.h5 -f dset_fletcher32:NONE" if test $USE_FILTER_FLETCHER32 != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST fletcher_remove $arg fi # nbit copy @@ -657,7 +731,7 @@ arg="h5repack_nbit.h5" if test $USE_FILTER_NBIT != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST nbit_copy $arg fi # nbit remove @@ -665,7 +739,7 @@ arg="h5repack_nbit.h5 -f dset_nbit:NONE" if test $USE_FILTER_NBIT != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST nbit_remove $arg fi # nbit add @@ -673,7 +747,7 @@ arg="h5repack_nbit.h5 -f dset_int31:NBIT" if test $USE_FILTER_NBIT != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST nbit_add $arg fi # scaleoffset copy @@ -681,7 +755,7 @@ arg="h5repack_soffset.h5" if test $USE_FILTER_SCALEOFFSET != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST scale_copy $arg fi # scaleoffset add @@ -689,7 +763,7 @@ arg="h5repack_soffset.h5 -f dset_none:SOFF=31,IN" if test $USE_FILTER_SCALEOFFSET != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST scale_add $arg fi # scaleoffset remove @@ -697,7 +771,7 @@ arg="h5repack_soffset.h5 -f dset_scaleoffset:NONE" if test $USE_FILTER_SCALEOFFSET != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST scale_remove $arg fi # remove all filters @@ -705,7 +779,7 @@ arg="h5repack_filters.h5 -f NONE" if test $USE_FILTER_FLETCHER32 != "yes" -o $USE_FILTER_DEFLATE != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SHUFFLE != "yes" -o $USE_FILTER_NBIT != "yes" -o $USE_FILTER_SCALEOFFSET != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST remove_all $arg fi #filter conversions @@ -714,14 +788,14 @@ arg="h5repack_deflate.h5 -f dset_deflate:SZIP=8,NN" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST deflate_convert $arg fi arg="h5repack_szip.h5 -f dset_szip:GZIP=1" if test $USE_FILTER_SZIP != "yes" -o $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST szip_convert $arg fi @@ -730,7 +804,7 @@ arg="h5repack_layout.h5 -f GZIP=1 -m 1024" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST deflate_limit $arg fi #file @@ -738,67 +812,50 @@ arg="h5repack_layout.h5 -e $TESTDIR/h5repack.info" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST deflate_file $arg fi ######################################################### # layout options (these files have no filters) ######################################################### -TOOLTEST_MAIN h5repack_layout.h5 --layout dset2:CHUNK=20x10 -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset2 CHUNKED +VERIFY_LAYOUT_DSET dset2_chunk_20x10 h5repack_layout.h5 dset2 CHUNKED --layout dset2:CHUNK=20x10 -TOOLTEST_MAIN h5repack_layout.h5 -l CHUNK=20x10 -VERIFY_LAYOUT_ALL h5repack_layout.h5 CHUNKED +VERIFY_LAYOUT_ALL chunk_20x10 h5repack_layout.h5 CHUNKED -l CHUNK=20x10 -TOOLTEST_MAIN h5repack_layout.h5 -l dset2:CONTI -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset2 CONTIGUOUS +VERIFY_LAYOUT_DSET dset2_conti h5repack_layout.h5 dset2 CONTIGUOUS -l dset2:CONTI -TOOLTEST_MAIN h5repack_layout.h5 -l CONTI -VERIFY_LAYOUT_ALL h5repack_layout.h5 CONTIGUOUS +VERIFY_LAYOUT_ALL conti h5repack_layout.h5 CONTIGUOUS -l CONTI -TOOLTEST_MAIN h5repack_layout.h5 -l dset2:COMPA -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset2 COMPACT +VERIFY_LAYOUT_DSET dset2_compa h5repack_layout.h5 dset2 COMPACT -l dset2:COMPA -TOOLTEST_MAIN h5repack_layout.h5 -l COMPA -VERIFY_LAYOUT_ALL h5repack_layout.h5 COMPACT +VERIFY_LAYOUT_ALL compa h5repack_layout.h5 COMPACT -l COMPA ################################################################ # layout conversions (file has no filters) ############################################################### -TOOLTEST_MAIN h5repack_layout.h5 -l dset_compact:CONTI -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_compact CONTIGUOUS +VERIFY_LAYOUT_DSET dset_compa_conti h5repack_layout.h5 dset_compact CONTIGUOUS -l dset_compact:CONTI -TOOLTEST_MAIN h5repack_layout.h5 -l dset_compact:CHUNK=2x5 -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_compact CHUNKED +VERIFY_LAYOUT_DSET dset_compa_chunk h5repack_layout.h5 dset_compact CHUNKED -l dset_compact:CHUNK=2x5 -TOOLTEST_MAIN h5repack_layout.h5 -l dset_compact:COMPA -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_compact COMPACT +VERIFY_LAYOUT_DSET dset_compa_compa h5repack_layout.h5 dset_compact COMPACT -l dset_compact:COMPA -TOOLTEST_MAIN h5repack_layout.h5 -l dset_contiguous:COMPA -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_contiguous COMPACT +VERIFY_LAYOUT_DSET dset_conti_compa h5repack_layout.h5 dset_contiguous COMPACT -l dset_contiguous:COMPA -TOOLTEST_MAIN h5repack_layout.h5 -l dset_contiguous:CHUNK=3x6 -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_contiguous CHUNKED +VERIFY_LAYOUT_DSET dset_conti_chunk h5repack_layout.h5 dset_contiguous CHUNKED -l dset_contiguous:CHUNK=3x6 -TOOLTEST_MAIN h5repack_layout.h5 -l dset_contiguous:CONTI -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_contiguous CONTIGUOUS +VERIFY_LAYOUT_DSET dset_conti_conti h5repack_layout.h5 dset_contiguous CONTIGUOUS -l dset_contiguous:CONTI -TOOLTEST_MAIN h5repack_layout.h5 -l dset_chunk:COMPA -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_chunk COMPACT +VERIFY_LAYOUT_DSET chunk_compa h5repack_layout.h5 dset_chunk COMPACT -l dset_chunk:COMPA -TOOLTEST_MAIN h5repack_layout.h5 -l dset_chunk:CONTI -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_chunk CONTIGUOUS +VERIFY_LAYOUT_DSET chunk_conti h5repack_layout.h5 dset_chunk CONTIGUOUS -l dset_chunk:CONTI -TOOLTEST_MAIN h5repack_layout.h5 -l dset_chunk:CHUNK=18x13 -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_chunk CHUNKED +VERIFY_LAYOUT_DSET chunk_18x13 h5repack_layout.h5 dset_chunk CHUNKED -l dset_chunk:CHUNK=18x13 # test convert small size dataset ( < 1k) to compact layout without -m -TOOLTEST_MAIN h5repack_layout2.h5 -l contig_small:COMPA -VERIFY_LAYOUT_DSET h5repack_layout2.h5 contig_small COMPACT +VERIFY_LAYOUT_DSET contig_small_compa h5repack_layout2.h5 contig_small COMPACT -l contig_small:COMPA -TOOLTEST_MAIN h5repack_layout2.h5 -l chunked_small_fixed:COMPA -VERIFY_LAYOUT_DSET h5repack_layout2.h5 chunked_small_fixed COMPACT +VERIFY_LAYOUT_DSET contig_small_fixed_compa h5repack_layout2.h5 chunked_small_fixed COMPACT -l chunked_small_fixed:COMPA #--------------------------------------------------------------------------- # Test file contains chunked datasets (need multiple dsets) with @@ -806,17 +863,14 @@ VERIFY_LAYOUT_DSET h5repack_layout2.h5 chunked_small_fixed COMPACT # Use first dset to test. #--------------------------------------------------------------------------- # chunk to chunk - specify chunk dim bigger than any current dim -TOOLTEST_MAIN h5repack_layout3.h5 -l chunk_unlimit1:CHUNK=100x300 -VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 CHUNK +VERIFY_LAYOUT_DSET chunk2chunk h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:CHUNK=100x300 # chunk to contiguous -TOOLTEST_MAIN h5repack_layout3.h5 -l chunk_unlimit1:CONTI -VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 CONTI +VERIFY_LAYOUT_DSET chunk2conti h5repack_layout3.h5 chunk_unlimit1 CONTI -l chunk_unlimit1:CONTI # chunk to compact - convert big dataset (should be > 64k) for this purpose, # should remain as original layout (chunk) -TOOLTEST_MAIN h5repack_layout3.h5 -l chunk_unlimit1:COMPA -VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 CHUNK +VERIFY_LAYOUT_DSET chunk2compa h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:COMPA #-------------------------------------------------------------------------- # Test -f for some specific cases. Chunked dataset with unlimited max dims. @@ -826,24 +880,22 @@ VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 CHUNK # - should not change max dims from unlimit # chunk dim is bigger than dataset dim. ( dset size < 64k ) -TOOLTEST_MAIN h5repack_layout3.h5 -f chunk_unlimit1:NONE -VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 H5S_UNLIMITED +VERIFY_LAYOUT_DSET error1 h5repack_layout3.h5 chunk_unlimit1 H5S_UNLIMITED -f chunk_unlimit1:NONE # chunk dim is bigger than dataset dim. ( dset size > 64k ) -TOOLTEST_MAIN h5repack_layout3.h5 -f chunk_unlimit2:NONE -VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit2 H5S_UNLIMITED +VERIFY_LAYOUT_DSET error2 h5repack_layout3.h5 chunk_unlimit2 H5S_UNLIMITED -f chunk_unlimit2:NONE # chunk dims are smaller than dataset dims. ( dset size < 64k ) -TOOLTEST_MAIN h5repack_layout3.h5 -f chunk_unlimit3:NONE -VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit3 H5S_UNLIMITED +#TOOLTEST_MAIN h5repack_layout3.h5 -f chunk_unlimit3:NONE +VERIFY_LAYOUT_DSET error3 h5repack_layout3.h5 chunk_unlimit3 H5S_UNLIMITED -f chunk_unlimit3:NONE # file input - should not fail -TOOLTEST h5repack_layout3.h5 -f NONE +TOOLTEST error4 h5repack_layout3.h5 -f NONE # Native option # Do not use FILE1, as the named dtype will be converted to native, and h5diff will # report a difference. -TOOLTEST h5repack_fill.h5 -n -TOOLTEST h5repack_attr.h5 -n +TOOLTEST native_fill h5repack_fill.h5 -n +TOOLTEST native_attr h5repack_attr.h5 -n # latest file format with long switches. use FILE4=h5repack_layout.h5 (no filters) @@ -851,8 +903,7 @@ arg="h5repack_layout.h5 --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --nati if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST_MAIN $arg - VERIFY_LAYOUT_ALL h5repack_layout.h5 CHUNKED + VERIFY_LAYOUT_ALL layout_long_switches h5repack_layout.h5 CHUNKED --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype] fi # latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) @@ -860,8 +911,7 @@ arg="h5repack_layout.h5 -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dty if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST_MAIN $arg - VERIFY_LAYOUT_ALL h5repack_layout.h5 CHUNKED + VERIFY_LAYOUT_ALL layout_short_switches h5repack_layout.h5 CHUNKED -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype] fi # several global filters @@ -870,7 +920,7 @@ arg="h5repack_layout.h5 --filter GZIP=1 --filter SHUF" if test $USE_FILTER_DEFLATE != "yes" -o $USE_FILTER_SHUFFLE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST global_filters $arg fi # syntax of -i infile -o outfile @@ -879,46 +929,47 @@ arg="h5repack_layout.h5 -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dty if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST0 $arg + TOOLTEST0 old_style_layout_short_switches $arg fi # add a userblock to file -arg="h5repack_objs.h5 -u ublock.bin -b 2048" -TOOLTEST $arg +arg="h5repack_objs.h5 -u $TESTDIR/ublock.bin -b 2048" +TOOLTEST add_userblock $arg # add alignment arg="h5repack_objs.h5 -t 1 -a 1 " -TOOLTEST $arg +TOOLTEST add_alignment $arg # Check repacking file with old version of layout message (should get upgraded # to new version and be readable, etc.) -TOOLTEST h5repack_layouto.h5 +TOOLTEST pgrade_layout h5repack_layouto.h5 # test for datum size > H5TOOLS_MALLOCSIZE -TOOLTEST h5repack_objs.h5 -f GZIP=1 +TOOLTEST gt_mallocsize h5repack_objs.h5 -f GZIP=1 # Check repacking file with committed datatypes in odd configurations -TOOLTEST h5repack_named_dtypes.h5 +TOOLTEST committed_dt h5repack_named_dtypes.h5 # tests family driver (file is located in common testfiles folder, uses TOOLTEST1 -TOOLTEST1 tfamily%05d.h5 +TOOLTEST1 family tfamily%05d.h5 # test various references (bug 1814 and 1726) -TOOLTEST h5repack_refs.h5 +TOOLTEST bug1814 h5repack_refs.h5 # test attribute with various references (bug1797 / HDFFV-5932) # the references in attribute of compund or vlen datatype -TOOLTEST h5repack_attr_refs.h5 +TOOLTEST HDFFV-5932 h5repack_attr_refs.h5 # Add test for memory leak in attirbute. This test is verified by CTEST. # 1. leak from vlen string # 2. leak from compound type without reference member # (HDFFV-7840, ) # Note: this test is experimental for sharing test file among tools -TOOLTEST h5diff_attr1.h5 +TOOLTEST HDFFV-7840 h5diff_attr1.h5 # tests for metadata block size option -TOOLTEST_META h5repack_layout.h5 --metadata_block_size=8192 +TOOLTEST_META meta_short h5repack_layout.h5 -M 8192 +TOOLTEST_META meta_long h5repack_layout.h5 --metadata_block_size=8192 if test $nerrors -eq 0 ; then echo "All $TESTNAME tests passed." -- cgit v0.12 From 2c0357db8080e48f89f3a0160306c37c66f95b53 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Feb 2013 13:43:47 -0500 Subject: [svn-r23307] HDFFV-8311: Correct test dependency Remove h5ls references Tested: local linux --- tools/h5copy/CMakeLists.txt | 51 ------ tools/h5copy/testh5copy.sh.in | 367 +++++++++++++++++++++++------------------- 2 files changed, 199 insertions(+), 219 deletions(-) diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index 60e940a..7f68e76 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -44,9 +44,6 @@ IF (BUILD_TESTING) SET (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out - ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_src.out.ls - ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_ref.out.ls - ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copytst.out.ls ) FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") @@ -227,42 +224,6 @@ IF (BUILD_TESTING) ENDMACRO (ADD_H5_TEST_SAME) # - # Test result with h5ls - # - MACRO (ADD_H5LS_TEST infile filetest) - # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5COPY-h5ls-${infile}-${filetest} COMMAND $ -Svr ./testfiles/${filetest}.out.h5) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-h5ls-${infile}-${filetest} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY-h5ls-${infile}-${filetest}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${filetest}.out.h5 - ./testfiles/${filetest}.out.out - ./testfiles/${filetest}.out.out.err - ) - ADD_TEST ( - NAME H5COPY-h5ls-${file}-${filetest} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS=-Svr;./testfiles/${filetest}.out.h5" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${filetest}.out.out" - -D "TEST_EXPECT=0" - -D "TEST_REFERENCE=./testfiles/${infile}.out.ls" - -D "TEST_MASK=true" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5COPY-h5ls-${infile}-${filetest} PROPERTIES DEPENDS H5COPY-h5ls-${infile}-${filetest}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5LS_TEST) - - # # Similiar to ADD_H5_TEST macro. Compare to outputs from source & target # files instead of checking with h5ls. # @@ -399,20 +360,12 @@ IF (BUILD_TESTING) ADD_H5_TEST (C_D_simple 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets/simple -d /C/D/simple) ADD_H5_TEST (E_F_grp_dsets 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) ADD_H5_TEST (G_H_grp_nested 0 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) - - # Verify that the file created above is correct - # This test is not independent of the above tests - #ADD_H5LS_TEST (${HDF_FILE1} basic) ############# COPY REFERENCES ############## # "Test copying object and region references" ADD_H5_F_TEST (region_ref 2 ${HDF_FILE2}.h5 ref -v -s / -d /COPY) - # Verify that the file created above is correct - # This test is not independent of the above tests - #ADD_H5LS_TEST (${HDF_FILE2} refs) - ############# COPY EXT LINKS ############## # "Test copying external link directly without -f ext" @@ -439,10 +392,6 @@ IF (BUILD_TESTING) # "Test copying a group contains external links with -f ext" ADD_H5_F_TEST (ext_link_group_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext -d /copy2_group) - # Verify that the file created above is correct - # This test is not independent of the above tests - #ADD_H5LS_TEST (${HDF_EXT_SRC_FILE} links) - ############# Test misc. ############## #----------------------------------------------------------------- diff --git a/tools/h5copy/testh5copy.sh.in b/tools/h5copy/testh5copy.sh.in index cd5f677..d30d8d8 100644 --- a/tools/h5copy/testh5copy.sh.in +++ b/tools/h5copy/testh5copy.sh.in @@ -57,9 +57,6 @@ $SRC_H5COPY_TESTFILES/h5copy_extlinks_trg.h5 # List of expect files that will be copied over to local test dir LIST_OTHER_TEST_FILES=" -$SRC_H5COPY_TESTFILES/h5copy_extlinks_src.out.ls -$SRC_H5COPY_TESTFILES/h5copy_ref.out.ls -$SRC_H5COPY_TESTFILES/h5copytst.out.ls $SRC_H5COPY_TESTFILES/h5copy_misc1.out " @@ -151,15 +148,6 @@ VERIFY() # Print a line-line message left justified in a field of 70 characters # beginning with the word "Verifying". # -VERIFY_H5LS() -{ - SPACES=" " - echo "Verifying h5ls file structure $* $SPACES" | cut -c1-70 | tr -d '\012' -} - -# Print a line-line message left justified in a field of 70 characters -# beginning with the word "Verifying". -# VERIFY_OUTPUT() { SPACES=" " @@ -183,24 +171,34 @@ TOOLTEST() { actualout="$TESTDIR/tooltest.actualout" actualerr="$TESTDIR/tooltest.actualerr" - runh5diff=yes - if [ "$1" = -i ]; then - inputfile=$2 - else - runh5diff=no - fi - if [ "$3" = -o ]; then - outputfile=$4 - else - runh5diff=no - fi + runh5diff=yes + if [ "$1" = -i ]; then + inputfile=$2 + else + if [ "$1" = -f ]; then + inputfile=$4 + else + inputfile=$3 + fi + runh5diff=no + fi + if [ "$3" = -o ]; then + outputfile=$4 + else + if [ "$1" = -f ]; then + outputfile=$6 + else + outputfile=$5 + fi + runh5diff=no + fi TESTING $H5COPY $@ ( - echo "#############################" - echo " output for '$H5COPY $@'" - echo "#############################" - $RUNSERIAL $H5COPY_BIN $@ + echo "#############################" + echo " output for '$H5COPY $@'" + echo "#############################" + $RUNSERIAL $H5COPY_BIN $@ ) > $actualout 2> $actualerr RET=$? if [ $RET != 0 ]; then @@ -210,15 +208,141 @@ TOOLTEST() nerrors="`expr $nerrors + 1`" else echo " PASSED" + + if [ $runh5diff != no ]; then + H5DIFFTEST $inputfile $outputfile $7 $9 + fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actualout $actualerr + rm -f $actualout $actualerr $outputfile + fi + fi +} + +# TOOLTEST back-to-back +TOOLTEST_PREFILL() +{ + actualout="$TESTDIR/tooltest.actualout" + actualerr="$TESTDIR/tooltest.actualerr" + runh5diff=yes + if [ "$1" = -i ]; then + inputfile=$2 + else + runh5diff=no + fi + if [ "$3" = -o ]; then + outputfile=$4 + else + runh5diff=no + fi + + grp_name=$5 + grp_name2=$6 + obj_name=$7 + obj_name2=$8 + + TESTING $H5COPY $@ + ( + echo "#############################" + echo " output for '$H5COPY $@'" + echo "#############################" + $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name2 + ) > $actualout 2> $actualerr + RET=$? + if [ $RET != 0 ]; then + echo "*FAILED*" + echo "failed result is:" + cat $actualout + nerrors="`expr $nerrors + 1`" + else + TESTING $H5COPY $@ + ( + echo "#############################" + echo " output for '$H5COPY $@'" + echo "#############################" + $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $obj_name -d $obj_name2 + ) > $actualout 2> $actualerr + RET=$? + if [ $RET != 0 ]; then + echo "*FAILED*" + echo "failed result is:" + cat $actualout + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + + if [ $runh5diff != no ]; then + H5DIFFTEST $inputfile $outputfile $obj_name $obj_name2 + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actualout $actualerr $outputfile + fi fi fi +} + +# TOOLTEST back-to-back +TOOLTEST_SAME() +{ + actualout="$TESTDIR/tooltest.actualout" + actualerr="$TESTDIR/tooltest.actualerr" + runh5diff=yes + if [ "$1" = -i ]; then + inputfile=$2 + else + runh5diff=no + fi + if [ "$3" = -o ]; then + outputfile=$4 + else + runh5diff=no + fi - if [ $runh5diff != no ]; then - H5DIFFTEST $inputfile $outputfile $7 $9 + grp_name=$5 + grp_name2=$6 + + TESTING $H5COPY $@ + ( + echo "#############################" + echo " output for '$H5COPY $@'" + echo "#############################" + $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name + ) > $actualout 2> $actualerr + RET=$? + if [ $RET != 0 ]; then + echo "*FAILED*" + echo "failed result is:" + cat $actualout + nerrors="`expr $nerrors + 1`" + else + TESTING $H5COPY $@ + ( + echo "#############################" + echo " output for '$H5COPY $@'" + echo "#############################" + $RUNSERIAL $H5COPY_BIN -i $outputfile -o $outputfile -v -s $grp_name -d $grp_name2 + ) > $actualout 2> $actualerr + RET=$? + if [ $RET != 0 ]; then + echo "*FAILED*" + echo "failed result is:" + cat $actualout + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + + if [ $runh5diff != no ]; then + H5DIFFTEST $outputfile $outputfile $grp_name $grp_name2 + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actualout $actualerr $outputfile + fi + fi fi } @@ -259,18 +383,18 @@ TOOLTEST_FAIL() actualerr_sav=${actualerr}-sav shift if [ "$1" = -i ]; then - inputfile=$2 + inputfile=$2 fi if [ "$3" = -o ]; then - outputfile=$4 + outputfile=$4 fi TESTING $H5COPY $@ ( - #echo "#############################" - #echo " output for '$H5COPY $@'" - #echo "#############################" - $RUNSERIAL $H5COPY_BIN $@ + #echo "#############################" + #echo " output for '$H5COPY $@'" + #echo "#############################" + $RUNSERIAL $H5COPY_BIN $@ ) > $actualout 2> $actualerr RET=$? @@ -298,7 +422,7 @@ TOOLTEST_FAIL() # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actualout $actualerr $actualout_sav $actualerr_sav + rm -f $actualout $actualerr $actualout_sav $actualerr_sav $outputfile fi } @@ -311,10 +435,10 @@ H5DIFFTEST() $RUNSERIAL $H5DIFF_BIN -q "$@" RET=$? if [ $RET != 0 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" else - echo " PASSED" + echo " PASSED" fi } @@ -327,50 +451,13 @@ H5DIFFTEST_FAIL() RET=$? if [ $h5haveexitcode = 'yes' -a $RET != 1 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" else - echo " PASSED" + echo " PASSED" fi } -# Call the h5ls tool to verify the correct output data in the destination file -# -H5LSTEST() -{ - expect="$TESTDIR/`basename $1 .h5`.ls" - actual="$TESTDIR/`basename $1 .h5`.ls.actualout" - - # Stderr is included in stdout so that the diff can detect - # any unexpected output from that stream too. - # - # Note: The modification time and storage utilization are masked off - # so that the output is more portable - VERIFY_H5LS $@ - ( - $RUNSERIAL $H5LS_BIN $H5LS_ARGS $@ - ) 2>&1 |sed 's/Modified:.*/Modified: XXXX-XX-XX XX:XX:XX XXX/' |sed 's/Storage:.*/Storage:
/' >$actual - - - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - elif $CMP $expect $actual; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.ls) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' - fi - - # Clean up output file - if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err - fi -} - # Copy single datasets of various forms from one group to another, # adding object copied to the destination file each time # @@ -379,82 +466,54 @@ H5LSTEST() COPY_OBJECTS() { TESTFILE="$TESTDIR/h5copytst.h5" - FILEOUT="$TESTDIR/`basename h5copytst.h5 .h5`.out.h5" - - # Remove any output file left over from previous test run - rm -f $FILEOUT - echo "Testing from `basename $TESTFILE` to `basename $FILEOUT` for the following tests:" echo "Test copying various forms of datasets" - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s simple -d simple - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s chunk -d chunk - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s compact -d compact - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s compound -d compound - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s compressed -d compressed - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s named_vl -d named_vl - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s nested_vl -d nested_vl + TOOLTEST -i $TESTFILE -o $TESTDIR/simple.out.h5 -v -s simple -d simple + TOOLTEST -i $TESTFILE -o $TESTDIR/chunk.out.h5 -v -s chunk -d chunk + TOOLTEST -i $TESTFILE -o $TESTDIR/compact.out.h5 -v -s compact -d compact + TOOLTEST -i $TESTFILE -o $TESTDIR/compound.out.h5 -v -s compound -d compound + TOOLTEST -i $TESTFILE -o $TESTDIR/compressed.out.h5 -v -s compressed -d compressed + TOOLTEST -i $TESTFILE -o $TESTDIR/named_vl.out.h5 -v -s named_vl -d named_vl + TOOLTEST -i $TESTFILE -o $TESTDIR/nested_vl.out.h5 -v -s nested_vl -d nested_vl echo "Test copying dataset within group in source file to root of destination" - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_dsets/simple -d simple_top + TOOLTEST -i $TESTFILE -o $TESTDIR/simple_top.out.h5 -v -s grp_dsets/simple -d simple_top echo "Test copying & renaming dataset" - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s compound -d rename + TOOLTEST -i $TESTFILE -o $TESTDIR/dsrename.out.h5 -v -s compound -d rename echo "Test copying empty, 'full' & 'nested' groups" - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_empty -d grp_empty - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_dsets - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_nested -d grp_nested + TOOLTEST -i $TESTFILE -o $TESTDIR/grp_empty.out.h5 -v -s grp_empty -d grp_empty + TOOLTEST -i $TESTFILE -o $TESTDIR/grp_dsets.out.h5 -v -s grp_dsets -d grp_dsets + TOOLTEST -i $TESTFILE -o $TESTDIR/grp_nested.out.h5 -v -s grp_nested -d grp_nested echo "Test copying dataset within group in source file to group in destination" - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s /grp_dsets/simple -d /grp_dsets/simple_group + TOOLTEST_PREFILL -i $TESTFILE -o $TESTDIR/simple_group.out.h5 grp_dsets grp_dsets /grp_dsets/simple /grp_dsets/simple_group echo "Test copying & renaming group" - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename + TOOLTEST -i $TESTFILE -o $TESTDIR/grp_rename.out.h5 -v -s grp_dsets -d grp_rename echo "Test copying 'full' group hierarchy into group in destination file" - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets + TOOLTEST_PREFILL -i $TESTFILE -o $TESTDIR/grp_dsets_rename.out.h5 grp_dsets grp_rename grp_dsets /grp_rename/grp_dsets echo "Test copying objects into group hier. that doesn't exist yet in destination file" - TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s simple -d /A/B1/simple - TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s simple -d /A/B2/simple2 - TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets/simple -d /C/D/simple - TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets - TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested - - # Verify that the file created above is correct - H5LSTEST $FILEOUT - - # Remove output file created, if the "no cleanup" environment variable is - # not defined - if test -z "$HDF5_NOCLEANUP"; then - rm -f $FILEOUT - fi + TOOLTEST -i $TESTFILE -o $TESTDIR/A_B1_simple.out.h5 -vp -s simple -d /A/B1/simple + TOOLTEST -i $TESTFILE -o $TESTDIR/A_B2_simple2.out.h5 -vp -s simple -d /A/B2/simple2 + TOOLTEST -i $TESTFILE -o $TESTDIR/C_D_simple.out.h5 -vp -s /grp_dsets/simple -d /C/D/simple + TOOLTEST -i $TESTFILE -o $TESTDIR/E_F_grp_dsets.out.h5 -vp -s /grp_dsets -d /E/F/grp_dsets + TOOLTEST -i $TESTFILE -o $TESTDIR/G_H_grp_nested.out.h5 -vp -s /grp_nested -d /G/H/grp_nested } # Copy references in various way. -# adding to the destination file each time compare the result # # Assumed arguments: # COPY_REFERENCES() { TESTFILE="$TESTDIR/h5copy_ref.h5" - FILEOUT="$TESTDIR/`basename h5copy_ref.h5 .h5`.out.h5" - - # Remove any output file left over from previous test run - rm -f $FILEOUT echo "Test copying object and region references" - TOOLTEST -f ref -i $TESTFILE -o $FILEOUT -v -s / -d /COPY - - # Verify that the file created above is correct - H5LSTEST $FILEOUT - - # Remove output file created, if the "no cleanup" environment variable is - # not defined - if test -z "$HDF5_NOCLEANUP"; then - rm -f $FILEOUT - fi + TOOLTEST_F -f ref -i $TESTFILE -o $TESTDIR/region_ref.out.h5 -v -s / -d /COPY } # Copy external links. @@ -465,43 +524,30 @@ COPY_REFERENCES() COPY_EXT_LINKS() { TESTFILE="$TESTDIR/h5copy_extlinks_src.h5" - FILEOUT="$TESTDIR/`basename h5copy_extlinks_src.h5 .h5`.out.h5" - - # Remove any output file left over from previous test run - rm -f $FILEOUT echo "Test copying external link directly without -f ext" - TOOLTEST -v -i $TESTFILE -o $FILEOUT -s /group_ext/extlink_dset -d /copy1_dset + TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_link.out.h5 -s /group_ext/extlink_dset -d /copy1_dset echo "Test copying external link directly with -f ext" - TOOLTEST -f ext -i $TESTFILE -o $FILEOUT -v -s /group_ext/extlink_dset -d /copy2_dset + TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_link_f.out.h5 -v -s /group_ext/extlink_dset -d /copy2_dset echo "Test copying dangling external link (no obj) directly without -f ext" - TOOLTEST -v -i $TESTFILE -o $FILEOUT -s /group_ext/extlink_notyet1 -d /copy_dangle1_1 + TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_dangle_noobj.out.h5 -s /group_ext/extlink_notyet1 -d /copy_dangle1_1 echo "Test copying dangling external link (no obj) directly with -f ext" - TOOLTEST -f ext -i $TESTFILE -o $FILEOUT -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2 + TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_noobj_f.out.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2 echo "Test copying dangling external link (no file) directly without -f ext" - TOOLTEST -v -i $TESTFILE -o $FILEOUT -s /group_ext/extlink_notyet2 -d /copy_dangle2_1 + TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_dangle_nofile.out.h5 -s /group_ext/extlink_notyet2 -d /copy_dangle2_1 echo "Test copying dangling external link (no file) directly with -f ext" - TOOLTEST -f ext -i $TESTFILE -o $FILEOUT -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2 + TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_nofile_f.out.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2 echo "Test copying a group contains external links without -f ext" - TOOLTEST -v -i $TESTFILE -o $FILEOUT -s /group_ext -d /copy1_group + TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_link_group.out.h5 -s /group_ext -d /copy1_group echo "Test copying a group contains external links with -f ext" - TOOLTEST -f ext -v -i $TESTFILE -o $FILEOUT -s /group_ext -d /copy2_group - - # Verify that the file created above is correct - H5LSTEST $FILEOUT - - # Remove output file created, if the "no cleanup" environment variable is - # not defined - if test -z "$HDF5_NOCLEANUP"; then - rm -f $FILEOUT - fi + TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_link_group_f.out.h5 -v -s /group_ext -d /copy2_group } # Test misc. @@ -511,28 +557,13 @@ COPY_EXT_LINKS() TEST_MISC() { TESTFILE="$TESTDIR/h5copytst.h5" - FILEOUT="$TESTDIR/`basename h5copytst.h5 .h5`.out.h5" - - # Remove any output file left over from previous test run - rm -f $h5copy_misc1.out.h5 echo "Test copying object into group which doesn't exist, without -p" - TOOLTEST_FAIL h5copy_misc1.out -v -i $TESTFILE -o $TESTDIR/h5copy_misc1.out.h5 -s /simple -d /g1/g2/simple + TOOLTEST_FAIL h5copy_misc1.out -i $TESTFILE -o $TESTDIR/h5copy_misc1.out.h5 -v -s /simple -d /g1/g2/simple echo "Test copying objects to the same file " - rm -f $FILEOUT - # create temporary test file ($FILEOUT) with some objects - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s /simple -d /simple - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s /grp_dsets -d /grp_dsets - # actual test cases - TOOLTEST -i $FILEOUT -o $FILEOUT -v -s /simple -d /simple_cp - TOOLTEST -i $FILEOUT -o $FILEOUT -v -s /grp_dsets -d /grp_dsets_cp - - # Remove output file created, if the "no cleanup" environment variable is - # not defined - if test -z "$HDF5_NOCLEANUP"; then - rm -f $FILEOUT - fi + TOOLTEST_SAME -i $TESTFILE -o $TESTDIR/samefile1.out.h5 /simple /simple_cp + TOOLTEST_SAME -i $TESTFILE -o $TESTDIR/samefile2.out.h5 /grp_dsets /grp_dsets_cp } ############################################################################## -- cgit v0.12 From e142838d1f030bdedbb3a69e13c7ac73b4a5fd1d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 21 Feb 2013 10:47:51 -0500 Subject: [svn-r23308] HDFFV-8311: Correct test dependency Tested: local linux --- config/cmake/userblockTest.cmake | 10 +- tools/h5jam/CMakeLists.txt | 533 ++++++++++++++++++--------------------- tools/h5jam/testh5jam.sh.in | 31 ++- 3 files changed, 266 insertions(+), 308 deletions(-) diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake index 5e8a808..8910bb2 100644 --- a/config/cmake/userblockTest.cmake +++ b/config/cmake/userblockTest.cmake @@ -65,17 +65,17 @@ IF (TEST_CHECKUB STREQUAL "YES") COMMAND ${TEST_GET_PROGRAM} -c ${TEST_O_STRING_LEN} ${TEST_OFILE} WORKING_DIRECTORY ${TEST_FOLDER} RESULT_VARIABLE TEST_RESULT - OUTPUT_FILE ${TEST_UFILE}.cmp + OUTPUT_FILE ${TEST_HFILE}-ub.cmp OUTPUT_VARIABLE TEST_ERROR ERROR_VARIABLE TEST_ERROR OUTPUT_STRIP_TRAILING_WHITESPACE ) #cat $ufile >> $cmpfile FILE (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) - FILE (APPEND ${TEST_UFILE}.cmp "${TEST_STREAM}") + FILE (APPEND ${TEST_HFILE}-ub.cmp "${TEST_STREAM}") ELSE (NOT TEST_O_STRING_LEN STREQUAL "0") FILE (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) - FILE (WRITE ${TEST_UFILE}.cmp ${TEST_STREAM}) + FILE (WRITE ${TEST_HFILE}-ub.cmp ${TEST_STREAM}) ENDIF (NOT TEST_O_STRING_LEN STREQUAL "0") #$JAM_BIN/getub -c $size $hfile > $tfile @@ -91,14 +91,14 @@ IF (TEST_CHECKUB STREQUAL "YES") # now compare the outputs EXECUTE_PROCESS ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_UFILE}.cmp ${TEST_HFILE}.cmp + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_HFILE}-ub.cmp ${TEST_HFILE}.cmp RESULT_VARIABLE TEST_RESULT ) MESSAGE (STATUS "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}+${TEST_O_STRING_LEN}") # if the return value is !=${TEST_EXPECT} bail out IF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_UFILE} did not match ${TEST_HFILE}.\n${TEST_ERROR}") + MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_HFILE}-ub did not match ${TEST_HFILE}.\n${TEST_ERROR}") ENDIF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) ELSE (TEST_CHECKUB STREQUAL "YES") # call 'ubsize' to get the size of the user block diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index 437fed3..7b96d5f 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -112,6 +112,13 @@ IF (BUILD_TESTING) ENDIF (NOT "${resultcode}" STREQUAL "0") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( + NAME H5JAM-${expectfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${expectfile}.out + ${expectfile}.out.err + ) + ADD_TEST ( NAME H5JAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -122,6 +129,7 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) + SET_TESTS_PROPERTIES (H5JAM-${expectfile} PROPERTIES DEPENDS H5JAM-${expectfile}-clear-objects) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (TEST_H5JAM_OUTPUT) @@ -138,6 +146,13 @@ IF (BUILD_TESTING) ENDIF (NOT "${resultcode}" STREQUAL "0") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( + NAME H5JAM-UNJAM-${expectfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${expectfile}.out + ${expectfile}.out.err + ) + ADD_TEST ( NAME H5JAM-UNJAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -148,50 +163,38 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) + SET_TESTS_PROPERTIES (H5JAM-UNJAM-${expectfile} PROPERTIES DEPENDS H5JAM-UNJAM-${expectfile}-clear-objects) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (TEST_H5UNJAM_OUTPUT) - MACRO (CLEANUP testname) - ADD_TEST ( - NAME H5JAM-CLEANUP-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${ARGN} - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-CLEANUP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5JAM-CLEANUP-${testname}-clear-objects") - ENDMACRO(CLEANUP testname testfile) - - MACRO (CHECKFILE testname expected actual) + MACRO (CHECKFILE testname testdepends expected actual) # If using memchecker add tests without using scripts IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5JAM-CHECKFILE-${testname}-clear-objects + NAME H5JAM-${testname}-CHECKFILE-clear-objects COMMAND ${CMAKE_COMMAND} -E remove - ${expected}.new - ${expected}.new.err + ${actual}.new + ${actual}.new.err ${actual}.out ${actual}.out.err ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-CHECKFILE-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-clear-objects PROPERTIES DEPENDS ${testdepends}) ADD_TEST ( - NAME H5JAM-CHECKFILE-H5DMP-${testname} + NAME H5JAM-${testname}-CHECKFILE-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=testfiles/${expected}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${expected}.new" + -D "TEST_OUTPUT=${actual}.new" -D "TEST_EXPECT=0" -D "TEST_FILTER=(^(HDF5)[^\n]*)" -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-CHECKFILE-H5DMP-${testname} PROPERTIES DEPENDS H5JAM-CHECKFILE-${testname}-clear-objects) + SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-clear-objects) ADD_TEST ( - NAME H5JAM-CHECKFILE-H5DMP_CMP-${testname} + NAME H5JAM-${testname}-CHECKFILE-H5DMP_CMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=${actual}" @@ -199,168 +202,211 @@ IF (BUILD_TESTING) -D "TEST_OUTPUT=${actual}.out" -D "TEST_EXPECT=0" -D "TEST_FILTER=(^(HDF5)[^\n]*)" - -D "TEST_REFERENCE=${expected}.new" + -D "TEST_REFERENCE=${actual}.new" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-CHECKFILE-H5DMP_CMP-${testname} PROPERTIES DEPENDS H5JAM-CHECKFILE-H5DMP-${testname}) - SET (last_test "H5JAM-CHECKFILE-H5DMP_CMP-${testname}") + SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-H5DMP_CMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-H5DMP) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO(CHECKFILE testname expected actual) - - MACRO (SETUP testname infile outfile) - ADD_TEST ( - NAME H5JAM-SETUP-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${outfile} - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-SETUP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST ( - NAME H5JAM-SETUP-${testname} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${infile} ${PROJECT_BINARY_DIR}/${outfile} - ) - SET_TESTS_PROPERTIES (H5JAM-SETUP-${testname} PROPERTIES DEPENDS H5JAM-SETUP-${testname}-clear-objects) - SET (last_test "H5JAM-SETUP-${testname}") - ENDMACRO(SETUP testname infile outfile) + ENDMACRO(CHECKFILE testname testdepends expected actual) - MACRO (CHECK_UB_1 testname testfile ufile) + MACRO (UNJAMTEST testname setfile infile ufile chkfile outfile) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5JAM-CHECK_UB_1-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${testfile}.len.txt - ${testfile}.cmp - ${ufile}.cmp + NAME H5JAM-${testname}-UNJAM-SETUP-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${infile} + ) + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM-SETUP + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${setfile} ${PROJECT_BINARY_DIR}/${infile} + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-SETUP PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP-clear-objects) + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-CHECK_UB_1-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP) + IF (NOT "${ufile}" STREQUAL "NONE") + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM_D-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${ufile} + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) + ADD_TEST (NAME H5JAM-${testname}-UNJAM COMMAND $ -i ${infile} -u ${ufile} -o ${outfile}) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) + SET (compare_test ${ufile}) + ELSE (NOT "${ufile}" STREQUAL "NONE") + IF (NOT "${ARGN}" STREQUAL "--delete") + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM_D-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${outfile}.ufile.txt ${outfile}.ufile.txt.err + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) + ADD_TEST (NAME H5JAM-${testname}-UNJAM COMMAND $ -i ${infile} -o ${outfile}) + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-i;${infile};-o;${outfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${outfile}.ufile.txt" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) + SET (compare_test "${outfile}.ufile.txt") + ELSE (NOT "${ARGN}" STREQUAL "--delete") + ADD_TEST (NAME H5JAM-${testname}-UNJAM COMMAND $ -i ${infile} -o ${outfile}) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) + SET (compare_test "") + ENDIF (NOT "${ARGN}" STREQUAL "--delete") + ENDIF (NOT "${ufile}" STREQUAL "NONE") + IF (NOT "${compare_test}" STREQUAL "") + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${infile}.len.txt + ${infile}.cmp + ${infile}-ub.cmp + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}-UNJAM") + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM-CHECK_UB_1 + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_GET_PROGRAM=$" + -D "TEST_CHECKUB=YES" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_HFILE=${infile}" + -D "TEST_UFILE=${compare_test}" + -D "TEST_EXPECT=0" + -D "TEST_OFILE=" + -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects) + ENDIF (NOT "${compare_test}" STREQUAL "") + ADD_TEST ( - NAME H5JAM-CHECK_UB_1-${testname} + NAME H5JAM-${testname}-UNJAM-CHECK_NOUB COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_GET_PROGRAM=$" - -D "TEST_CHECKUB=YES" + -D "TEST_CHECKUB=NO" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_HFILE=${testfile}" - -D "TEST_UFILE=${ufile}" + -D "TEST_HFILE=${outfile}" -D "TEST_EXPECT=0" - -D "TEST_OFILE=${ARGN}" + -D "TEST_UFILE=NULL" + -D "TEST_OFILE=NULL" -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-CHECK_UB_1-${testname} PROPERTIES DEPENDS H5JAM-CHECK_UB_1-${testname}-clear-objects) - SET (last_test "H5JAM-CHECK_UB_1-${testname}") + IF (NOT "${compare_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1) + ELSE (NOT "${compare_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM) + ENDIF (NOT "${compare_test}" STREQUAL "") + + CHECKFILE (${testname} "H5JAM-${testname}-UNJAM-CHECK_NOUB" ${chkfile} ${outfile}) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO(CHECK_UB_1 testname testfile ufile) + ENDMACRO(UNJAMTEST testname infile ufile outfile) - MACRO (CHECK_NOUB testname testfile) + MACRO (JAMTEST testname jamfile infile chkfile outfile) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5JAM-CHECK_NOUB-${testname} + NAME H5JAM-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5 + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5JAM-${testname} COMMAND $ -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN}) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5JAM-${testname} PROPERTIES DEPENDS H5JAM-${testname}-clear-objects) + SET (compare_test ${outfile}) + SET (compare_orig testfiles/${infile}) + IF ("${ARGN}" STREQUAL "--clobber") + SET (compare_orig "") + ENDIF ("${ARGN}" STREQUAL "--clobber") + + ADD_TEST ( + NAME H5JAM-${testname}-CHECK_UB_1-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${compare_test}.len.txt + ${compare_test}.cmp + ${compare_test}-ub.cmp + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}") + ADD_TEST ( + NAME H5JAM-${testname}-CHECK_UB_1 COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_GET_PROGRAM=$" - -D "TEST_CHECKUB=NO" + -D "TEST_CHECKUB=YES" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_HFILE=${testfile}" + -D "TEST_HFILE=${compare_test}" + -D "TEST_UFILE=testfiles/${jamfile}" -D "TEST_EXPECT=0" - -D "TEST_UFILE=NULL" - -D "TEST_OFILE=NULL" + -D "TEST_OFILE=${compare_orig}" -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-CHECK_NOUB-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5JAM-CHECK_NOUB-${testname}") + SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-CHECK_UB_1-clear-objects) + CHECKFILE (${testname} "H5JAM-${testname}-CHECK_UB_1" ${chkfile} ${outfile}) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO(CHECK_NOUB testname testfile) + ENDMACRO (JAMTEST testname jamfile infile outfile) - MACRO (UNJAMTEST testname infile ufile outfile) - ADD_TEST ( - NAME H5JAM-UNJAM-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${outfile} - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-UNJAM-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - IF (NOT "${ufile}" STREQUAL "NONE") + MACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5JAM-UNJAM_D-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${ufile} + NAME H5JAM-${testname}_NONE-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${chkfile} ${chkfile}.cpy.h5 ) - SET_TESTS_PROPERTIES (H5JAM-UNJAM_D-${testname}-clear-objects PROPERTIES DEPENDS H5JAM-UNJAM-${testname}-clear-objects) - ADD_TEST (NAME H5JAM-UNJAM-${testname} COMMAND $ -i ${infile} -u ${ufile} -o ${outfile}) - SET_TESTS_PROPERTIES (H5JAM-UNJAM-${testname} PROPERTIES DEPENDS H5JAM-UNJAM_D-${testname}-clear-objects) - SET (compare_test ${ufile}) - ELSE (NOT "${ufile}" STREQUAL "NONE") - IF (NOT "${ARGN}" STREQUAL "--delete") - ADD_TEST ( - NAME H5JAM-UNJAM_D-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${outfile}.ufile.txt ${outfile}.ufile.txt.err - ) - SET_TESTS_PROPERTIES (H5JAM-UNJAM_D-${testname}-clear-objects PROPERTIES DEPENDS H5JAM-UNJAM-${testname}-clear-objects) - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5JAM-UNJAM-${testname} COMMAND $ -i ${infile} -o ${outfile}) - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5JAM-UNJAM-${testname} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-i;${infile};-o;${outfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${outfile}.ufile.txt" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5JAM-UNJAM-${testname} PROPERTIES DEPENDS H5JAM-UNJAM_D-${testname}-clear-objects) - SET (compare_test "${outfile}.ufile.txt") - ELSE (NOT "${ARGN}" STREQUAL "--delete") - ADD_TEST (NAME H5JAM-UNJAM-${testname} COMMAND $ -i ${infile} -o ${outfile}) - SET_TESTS_PROPERTIES (H5JAM-UNJAM-${testname} PROPERTIES DEPENDS H5JAM-UNJAM-${testname}-clear-objects) - SET (compare_test "") - ENDIF (NOT "${ARGN}" STREQUAL "--delete") - ENDIF (NOT "${ufile}" STREQUAL "NONE") - SET (last_test "H5JAM-UNJAM-${testname}") - IF (NOT "${compare_test}" STREQUAL "") - CHECK_UB_1 (${testname} ${infile} ${compare_test}) - ENDIF (NOT "${compare_test}" STREQUAL "") - CHECK_NOUB (${testname} ${outfile}) - ENDMACRO(UNJAMTEST testname infile ufile outfile) + ADD_TEST ( + NAME H5JAM-${testname}_NONE-SETUP + COMMAND ${CMAKE_COMMAND} -E copy_if_different testfiles/${setfile} ${chkfile} + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-SETUP PROPERTIES DEPENDS H5JAM-${testname}_NONE-clear-objects) - MACRO (JAMTEST testname jamfile infile outfile) - ADD_TEST ( - NAME H5JAM-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5 - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5JAM-${testname}-clear-objects") - IF ("${outfile}" STREQUAL "NONE") ADD_TEST ( - NAME H5JAM-NONE_COPY-${testname} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${infile} ${infile}.cpy.h5 + NAME H5JAM-${testname}_NONE_COPY + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${chkfile} ${chkfile}.cpy.h5 ) - SET_TESTS_PROPERTIES (H5JAM-NONE_COPY-${testname} PROPERTIES DEPENDS ${last_test}) - SET (last_test "H5JAM-NONE_COPY-${testname}") - ADD_TEST (NAME H5JAM-${testname} COMMAND $ -u testfiles/${jamfile} -i ${infile} ${ARGN}) - SET (compare_test ${infile}) - SET (compare_orig ${infile}.cpy.h5) - ELSE ("${outfile}" STREQUAL "NONE") - ADD_TEST (NAME H5JAM-${testname} COMMAND $ -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN}) - SET (compare_test ${outfile}) - SET (compare_orig testfiles/${infile}) - ENDIF ("${outfile}" STREQUAL "NONE") - SET_TESTS_PROPERTIES (H5JAM-${testname} PROPERTIES DEPENDS ${last_test}) - SET (last_test "H5JAM-${testname}") - IF ("${ARGN}" STREQUAL "--clobber") - SET (compare_orig "") - ENDIF ("${ARGN}" STREQUAL "--clobber") - CHECK_UB_1 (${testname} ${compare_test} testfiles/${jamfile} ${compare_orig}) - ENDMACRO (JAMTEST testname jamfile infile outfile) + SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE_COPY PROPERTIES DEPENDS H5JAM-${testname}_NONE-SETUP) + + ADD_TEST (NAME H5JAM-${testname}_NONE COMMAND $ -u testfiles/${jamfile} -i ${chkfile} ${ARGN}) + SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE PROPERTIES DEPENDS H5JAM-${testname}_NONE_COPY) + + SET (compare_test ${chkfile}) + SET (compare_orig ${chkfile}.cpy.h5) + IF ("${ARGN}" STREQUAL "--clobber") + SET (compare_orig "") + ENDIF ("${ARGN}" STREQUAL "--clobber") + + ADD_TEST ( + NAME H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${compare_test}.len.txt + ${compare_test}.cmp + ${compare_test}-ub.cmp + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}_NONE") + ADD_TEST ( + NAME H5JAM-${testname}_NONE-CHECK_UB_1 + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_GET_PROGRAM=$" + -D "TEST_CHECKUB=YES" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_HFILE=${compare_test}" + -D "TEST_UFILE=testfiles/${jamfile}" + -D "TEST_EXPECT=0" + -D "TEST_OFILE=${compare_orig}" + -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects) + CHECKFILE (${testname} "H5JAM-${testname}_NONE-CHECK_UB_1" ${infile} ${chkfile}) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) ############################################################################## ############################################################################## @@ -377,118 +423,45 @@ IF (BUILD_TESTING) # don't allow HDF5 format file as an user block file TEST_H5JAM_OUTPUT(h5jam-ub-nohdf5 1 -i testfiles/tall.h5 -u testfiles/tall.h5 -o tall-tmp.h5) - JAMTEST (tall_u10 u10.txt tall.h5 ta2.h5) - CHECKFILE (tall_u10 tall.h5 ta2.h5) -# CLEANUP (tall_u10 ta2.h5) - JAMTEST (tall_u511 u511.txt tall.h5 ta3.h5) - CHECKFILE (tall_u511 tall.h5 ta3.h5) -# CLEANUP (tall_u511 ta3.h5) - JAMTEST (tall_u512 u512.txt tall.h5 ta4.h5) - CHECKFILE (tall_u512 tall.h5 ta4.h5) -# CLEANUP (tall_u512 ta4.h5) - JAMTEST (tall_u513 u513.txt tall.h5 ta5.h5) - CHECKFILE (tall_u513 tall.h5 ta5.h5) -# CLEANUP (tall_u513 ta5.h5) - - SETUP (ta_u10 tall.h5 ta.h5) - JAMTEST (ta_u10 u10.txt ta.h5 NONE) - CHECKFILE (ta_u10 tall.h5 ta.h5) - SETUP (ta_u511 tall.h5 ta.h5 NOCLEAN) - JAMTEST (ta_u511 u511.txt ta.h5 NONE) - CHECKFILE (ta_u511 tall.h5 ta.h5) - SETUP (ta_u512 tall.h5 ta.h5 NOCLEAN) - JAMTEST (ta_u512 u512.txt ta.h5 NONE) - CHECKFILE (ta_u512 tall.h5 ta.h5) - SETUP (ta_u513 tall.h5 ta.h5 NOCLEAN) - JAMTEST (ta_u513 u513.txt ta.h5 NONE) - CHECKFILE (ta_u513 tall.h5 ta.h5) -# CLEANUP (ta ta.h5) - - JAMTEST (twithub_u10 u10.txt twithub.h5 tax2.h5) - CHECKFILE (twithub_u10 tall.h5 tax2.h5) -# CLEANUP (twithub_u10 tax2.h5) - JAMTEST (twithub_u511 u511.txt twithub.h5 tax3.h5) - CHECKFILE (twithub_u511 tall.h5 tax3.h5) -# CLEANUP (twithub_u511 tax3.h5) - JAMTEST (twithub_u512 u512.txt twithub.h5 tax4.h5) - CHECKFILE (twithub_u512 tall.h5 tax4.h5) -# CLEANUP (twithub_u512 tax4.h5) - JAMTEST (twithub_u513 u513.txt twithub.h5 tax5.h5) - CHECKFILE (twithub_u513 tall.h5 tax5.h5) -# CLEANUP (twithub_u513 tax5.h5) - - JAMTEST (twithub513_u10 u10.txt twithub513.h5 tax6.h5) - CHECKFILE (twithub513_u10 tall.h5 tax6.h5) -# CLEANUP (twithub513_u10 tax6.h5) - JAMTEST (twithub513_u511 u511.txt twithub513.h5 tax7.h5) - CHECKFILE (twithub513_u511 tall.h5 tax7.h5) -# CLEANUP (twithub513_u511 tax7.h5) - JAMTEST (twithub513_u512 u512.txt twithub513.h5 tax8.h5) - CHECKFILE (twithub513_u512 tall.h5 tax8.h5) -# CLEANUP (twithub513_u512 tax8.h5) - JAMTEST (twithub513_u513 u513.txt twithub513.h5 tax9.h5) - CHECKFILE (twithub513_u513 tall.h5 tax9.h5) -# CLEANUP (twithub513_u513 tax9.h5) - - JAMTEST (twithub_u10_c u10.txt twithub.h5 taz2.h5 --clobber) - CHECKFILE (twithub_u10_c tall.h5 taz2.h5) -# CLEANUP (twithub_u10_c taz2.h5) - JAMTEST (twithub_u511_c u511.txt twithub.h5 taz3.h5 --clobber) - CHECKFILE (twithub_u511_c tall.h5 taz3.h5) -# CLEANUP (twithub_u511_c taz3.h5) - JAMTEST (twithub_u512_c u512.txt twithub.h5 taz4.h5 --clobber) - CHECKFILE (twithub_u512_c tall.h5 taz4.h5) -# CLEANUP (twithub_u512_c taz4.h5) - JAMTEST (twithub_u513_c u513.txt twithub.h5 taz5.h5 --clobber) - CHECKFILE (twithub_u513_c tall.h5 taz5.h5) -# CLEANUP (twithub_u513_c taz5.h5) - - JAMTEST (twithub513_u10_c u10.txt twithub513.h5 taz6.h5 --clobber) - CHECKFILE (twithub513_u10_c tall.h5 taz6.h5) -# CLEANUP (twithub513_u10_c taz6.h5) - JAMTEST (twithub513_u511_c u511.txt twithub513.h5 taz7.h5 --clobber) - CHECKFILE (twithub513_u511_c tall.h5 taz7.h5) -# CLEANUP (twithub513_u511_c taz7.h5) - JAMTEST (twithub513_u512_c u512.txt twithub513.h5 taz8.h5 --clobber) - CHECKFILE (twithub513_u512_c tall.h5 taz8.h5) -# CLEANUP (twithub513_u512_c taz8.h5) - JAMTEST (twithub513_u513_c u513.txt twithub513.h5 taz9.h5 --clobber) - CHECKFILE (twithub513_u513_c tall.h5 taz9.h5) -# CLEANUP (twithub513_u513_c taz9.h5) - - SETUP (N_twithub_u10_c twithub.h5 tay2.h5) - JAMTEST (N_twithub_u10_c u10.txt tay2.h5 NONE --clobber) - CHECKFILE (N_twithub_u10_c tall.h5 tay2.h5) -# CLEANUP (N_twithub_u10_c tay2.h5) - SETUP (N_twithub_u511_c twithub.h5 tay3.h5) - JAMTEST (N_twithub_u511_c u511.txt tay3.h5 NONE --clobber) - CHECKFILE (N_twithub_u511_c tall.h5 tay3.h5) -# CLEANUP (N_twithub_u511_c tay3.h5) - SETUP (N_twithub_u512_c twithub.h5 tay4.h5) - JAMTEST (N_twithub_u512_c u512.txt tay4.h5 NONE --clobber) - CHECKFILE (N_twithub_u512_c tall.h5 tay4.h5) -# CLEANUP (N_twithub_u512_c tay4.h5) - SETUP (N_twithub_u513_c twithub.h5 tay5.h5) - JAMTEST (N_twithub_u513_c u513.txt tay5.h5 NONE --clobber) - CHECKFILE (N_twithub_u513_c tall.h5 tay5.h5) -# CLEANUP (N_twithub_u513_c tay5.h5) - - SETUP (N_twithub513_u10_c twithub513.h5 tay6.h5) - JAMTEST (N_twithub513_u10_c u10.txt tay6.h5 NONE --clobber) - CHECKFILE (N_twithub513_u10_c tall.h5 tay6.h5) -# CLEANUP (N_twithub513_u10_c tay6.h5) - SETUP (N_twithub513_u511_c twithub513.h5 tay7.h5) - JAMTEST (N_twithub513_u511_c u511.txt tay7.h5 NONE --clobber) - CHECKFILE (N_twithub513_u511_c tall.h5 tay7.h5) -# CLEANUP (N_twithub513_u511_c tay7.h5) - SETUP (N_twithub513_u512_c twithub513.h5 tay8.h5) - JAMTEST (N_twithub513_u512_c u512.txt tay8.h5 NONE --clobber) - CHECKFILE (N_twithub513_u512_c tall.h5 tay8.h5) -# CLEANUP (N_twithub513_u512_c tay8.h5) - SETUP (N_twithub513_u513_c twithub513.h5 tay9.h5) - JAMTEST (N_twithub513_u513_c u513.txt tay9.h5 NONE --clobber) - CHECKFILE (N_twithub513_u513_c tall.h5 tay9.h5) -# CLEANUP (N_twithub513_u513_c tay9.h5) + JAMTEST (tall_u10 u10.txt tall.h5 tall.h5 ta2.h5) + JAMTEST (tall_u511 u511.txt tall.h5 tall.h5 ta3.h5) + JAMTEST (tall_u512 u512.txt tall.h5 tall.h5 ta4.h5) + JAMTEST (tall_u513 u513.txt tall.h5 tall.h5 ta5.h5) + + JAMTEST_NONE (N_ta_u10 u10.txt tall.h5 tall.h5 ta6.h5) + JAMTEST_NONE (N_ta_u511 u511.txt tall.h5 tall.h5 ta7.h5) + JAMTEST_NONE (N_ta_u512 u512.txt tall.h5 tall.h5 ta8.h5) + JAMTEST_NONE (N_ta_u513 u513.txt tall.h5 tall.h5 ta9.h5) + + JAMTEST (twithub_u10 u10.txt twithub.h5 tall.h5 tax2.h5) + JAMTEST (twithub_u511 u511.txt twithub.h5 tall.h5 tax3.h5) + JAMTEST (twithub_u512 u512.txt twithub.h5 tall.h5 tax4.h5) + JAMTEST (twithub_u513 u513.txt twithub.h5 tall.h5 tax5.h5) + + JAMTEST (twithub513_u10 u10.txt twithub513.h5 tall.h5 tax6.h5) + JAMTEST (twithub513_u511 u511.txt twithub513.h5 tall.h5 tax7.h5) + JAMTEST (twithub513_u512 u512.txt twithub513.h5 tall.h5 tax8.h5) + JAMTEST (twithub513_u513 u513.txt twithub513.h5 tall.h5 tax9.h5) + + JAMTEST (twithub_u10_c u10.txt twithub.h5 tall.h5 taz2.h5 --clobber) + JAMTEST (twithub_u511_c u511.txt twithub.h5 tall.h5 taz3.h5 --clobber) + JAMTEST (twithub_u512_c u512.txt twithub.h5 tall.h5 taz4.h5 --clobber) + JAMTEST (twithub_u513_c u513.txt twithub.h5 tall.h5 taz5.h5 --clobber) + + JAMTEST (twithub513_u10_c u10.txt twithub513.h5 tall.h5 taz6.h5 --clobber) + JAMTEST (twithub513_u511_c u511.txt twithub513.h5 tall.h5 taz7.h5 --clobber) + JAMTEST (twithub513_u512_c u512.txt twithub513.h5 tall.h5 taz8.h5 --clobber) + JAMTEST (twithub513_u513_c u513.txt twithub513.h5 tall.h5 taz9.h5 --clobber) + + JAMTEST_NONE (N_twithub_u10_c u10.txt tall.h5 twithub.h5 tay2.h5 --clobber) + JAMTEST_NONE (N_twithub_u511_c u511.txt tall.h5 twithub.h5 tay3.h5 --clobber) + JAMTEST_NONE (N_twithub_u512_c u512.txt tall.h5 twithub.h5 tay4.h5 --clobber) + JAMTEST_NONE (N_twithub_u513_c u513.txt tall.h5 twithub.h5 tay5.h5 --clobber) + + JAMTEST_NONE (N_twithub513_u10_c u10.txt tall.h5 twithub513.h5 tay6.h5 --clobber) + JAMTEST_NONE (N_twithub513_u511_c u511.txt tall.h5 twithub513.h5 tay7.h5 --clobber) + JAMTEST_NONE (N_twithub513_u512_c u512.txt tall.h5 twithub513.h5 tay8.h5 --clobber) + JAMTEST_NONE (N_twithub513_u513_c u513.txt tall.h5 twithub513.h5 tay9.h5 --clobber) #------------------------------- # Testing h5unjam @@ -496,32 +469,14 @@ IF (BUILD_TESTING) # help page TEST_H5UNJAM_OUTPUT(h5unjam-help 0 -h) - SETUP (twithub_tall twithub.h5 tai1.h5) - UNJAMTEST (twithub_tall tai1.h5 o10.txt taa1.h5) - CHECKFILE (twithub_tall tall.h5 taa1.h5) -# CLEANUP (twithub_tall taa1.h5 tai1.h5 o10.txt) - SETUP (twithub513_tall twithub513.h5 tai2.h5) - UNJAMTEST (twithub513_tall tai2.h5 o512.txt taa2.h5) - CHECKFILE (twithub513_tall tall.h5 taa2.h5) -# CLEANUP (twithub513_tall taa2.h5 tai2.h5 o512.txt) - - SETUP (N_twithub_tall twithub.h5 tai3.h5) - UNJAMTEST (N_twithub_tall tai3.h5 NONE taa3.h5) - CHECKFILE (N_twithub_tall tall.h5 taa3.h5) -# CLEANUP (N_twithub_tall taa3.h5 tai3.h5) - SETUP (N_twithub513_tall twithub513.h5 tai4.h5) - UNJAMTEST (N_twithub513_tall tai4.h5 NONE taa4.h5) - CHECKFILE (N_twithub513_tall tall.h5 taa4.h5) -# CLEANUP (N_twithub513_tall taa4.h5 tai4.h5) - - SETUP (D_twithub_tall twithub.h5 taj2.h5) - UNJAMTEST (D_twithub_tall taj2.h5 NONE tac2.h5 --delete) - CHECKFILE (D_twithub_tall tall.h5 tac2.h5) -# CLEANUP (D_twithub_tall tac2.h5 taj2.h5) - SETUP (D_twithub513_tall twithub513.h5 taj3.h5) - UNJAMTEST (D_twithub513_tall taj3.h5 NONE tac3.h5 --delete) - CHECKFILE (D_twithub513_tall tall.h5 tac3.h5) -# CLEANUP (D_twithub513_tall tac3.h5 taj3.h5) + UNJAMTEST (twithub_tall twithub.h5 tai1.h5 o10.txt tall.h5 taa1.h5) + UNJAMTEST (twithub513_tall twithub513.h5 tai2.h5 o512.txt tall.h5 taa2.h5) + + UNJAMTEST (N_twithub_tall twithub.h5 tai3.h5 NONE tall.h5 taa3.h5) + UNJAMTEST (N_twithub513_tall twithub513.h5 tai4.h5 NONE tall.h5 taa4.h5) + + UNJAMTEST (D_twithub_tall twithub.h5 taj2.h5 NONE tall.h5 tac2.h5 --delete) + UNJAMTEST (D_twithub513_tall twithub513.h5 taj3.h5 NONE tall.h5 tac3.h5 --delete) ENDIF (BUILD_TESTING) diff --git a/tools/h5jam/testh5jam.sh.in b/tools/h5jam/testh5jam.sh.in index b2c6bec..86edbee 100644 --- a/tools/h5jam/testh5jam.sh.in +++ b/tools/h5jam/testh5jam.sh.in @@ -377,7 +377,7 @@ JAMTEST() { compare_orig="xxofile.h5" cleanup="$cleanup $compare_orig" else - # output goes to $4, compare ofile to ubfile + # output goes to $3, compare ofile to ubfile ofile="$3" compare_test="$ofile" compare_orig="$ifile" @@ -539,19 +539,22 @@ JAMTEST $TESTDIR/u513.txt $TESTDIR/tall.h5 ta5.h5 CHECKFILE $TESTDIR/tall.h5 ta5.h5 CLEANUP ta5.h5 -SETUP $TESTDIR/tall.h5 ta.h5 -JAMTEST $TESTDIR/u10.txt ta.h5 -CHECKFILE $TESTDIR/tall.h5 ta.h5 -SETUP $TESTDIR/tall.h5 ta.h5 -JAMTEST $TESTDIR/u511.txt ta.h5 -CHECKFILE $TESTDIR/tall.h5 ta.h5 -SETUP $TESTDIR/tall.h5 ta.h5 -JAMTEST $TESTDIR/u512.txt ta.h5 -CHECKFILE $TESTDIR/tall.h5 ta.h5 -SETUP $TESTDIR/tall.h5 ta.h5 -JAMTEST $TESTDIR/u513.txt ta.h5 -CHECKFILE $TESTDIR/tall.h5 ta.h5 -CLEANUP ta.h5 +SETUP $TESTDIR/tall.h5 ta6.h5 +JAMTEST $TESTDIR/u10.txt ta6.h5 +CHECKFILE $TESTDIR/tall.h5 ta6.h5 +CLEANUP ta6.h5 +SETUP $TESTDIR/tall.h5 ta7.h5 +JAMTEST $TESTDIR/u511.txt ta7.h5 +CHECKFILE $TESTDIR/tall.h5 ta7.h5 +CLEANUP ta7.h5 +SETUP $TESTDIR/tall.h5 ta8.h5 +JAMTEST $TESTDIR/u512.txt ta8.h5 +CHECKFILE $TESTDIR/tall.h5 ta8.h5 +CLEANUP ta8.h5 +SETUP $TESTDIR/tall.h5 ta9.h5 +JAMTEST $TESTDIR/u513.txt ta9.h5 +CHECKFILE $TESTDIR/tall.h5 ta9.h5 +CLEANUP ta9.h5 JAMTEST $TESTDIR/u10.txt $TESTDIR/twithub.h5 tax2.h5 CHECKFILE $TESTDIR/tall.h5 tax2.h5 -- cgit v0.12 From 47af32527b2695daa87db08679b505e0a3a85454 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 21 Feb 2013 14:39:29 -0500 Subject: [svn-r23310] Correct duplicate test command --- tools/h5jam/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index 7b96d5f..95777b3 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -241,7 +241,6 @@ IF (BUILD_TESTING) COMMAND ${CMAKE_COMMAND} -E remove ${outfile}.ufile.txt ${outfile}.ufile.txt.err ) SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) - ADD_TEST (NAME H5JAM-${testname}-UNJAM COMMAND $ -i ${infile} -o ${outfile}) ADD_TEST ( NAME H5JAM-${testname}-UNJAM COMMAND "${CMAKE_COMMAND}" -- cgit v0.12 From 66ba0b4f3309188dfd8e9b5c969dcca0014b8526 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 24 Feb 2013 11:26:03 -0500 Subject: [svn-r23311] Snapshot version 1.9 release 145 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.txt b/README.txt index 12d614f..57c49b3 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.145 currently under development +HDF5 version 1.9.146 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index af2d35e..fcbb04e 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -467,7 +467,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 135 +LT_VERS_REVISION = 136 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index ae521c0..178f435 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 135 +LT_VERS_REVISION = 136 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 18545b2..e253056 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.145. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.146. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.145' -PACKAGE_STRING='HDF5 1.9.145' +PACKAGE_VERSION='1.9.146' +PACKAGE_STRING='HDF5 1.9.146' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1484,7 +1484,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.145 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.146 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1554,7 +1554,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.145:";; + short | recursive ) echo "Configuration of HDF5 1.9.146:";; esac cat <<\_ACEOF @@ -1750,7 +1750,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.145 +HDF5 configure 1.9.146 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2844,7 +2844,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.145, which was +It was created by HDF5 $as_me 1.9.146, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3676,7 +3676,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.145' + VERSION='1.9.146' cat >>confdefs.h <<_ACEOF @@ -31748,7 +31748,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.145, which was +This file was extended by HDF5 $as_me 1.9.146, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31814,7 +31814,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.145 +HDF5 config.status 1.9.146 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -34587,7 +34587,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.145 +HDF5 config.lt 1.9.146 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. diff --git a/configure.ac b/configure.ac index b67e0e1..16d3fff 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.145], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.146], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index d1096f0..67727b5 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -518,7 +518,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 135 +LT_VERS_REVISION = 136 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 86cf954..fc42e73 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -458,7 +458,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 135 +LT_VERS_REVISION = 136 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index c782ce0..32e858e 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -474,7 +474,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 135 +LT_VERS_REVISION = 136 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 9da314a..36ce3e0 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -457,7 +457,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 135 +LT_VERS_REVISION = 136 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index ab3dfb3..8ceb04d 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.145 currently under development +HDF5 version 1.9.146 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 079fb96..e0376dc 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 145 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 146 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.145" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.146" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index c16e482..328a5c5 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -522,7 +522,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 135 +LT_VERS_REVISION = 136 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 8064464..5098e7f 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.145" +#define H5_PACKAGE_STRING "HDF5 1.9.146" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.145" +#define H5_PACKAGE_VERSION "1.9.146" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.145" +#define H5_VERSION "1.9.146" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From 0fc1c9c5197d9d762ef6753f299d6ad7221f72a8 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 25 Feb 2013 09:48:42 -0500 Subject: [svn-r23313] Description: Bring changes from Coverity branch to the trunk: r20612: Changed string functions to versions with string length to fix coverity issues 922, 942 and 943. r20614: Use HDsnprintf. --gh r20675: Fix for coverity #1714 due to the fix for #810. Use HDfree() instead of H5MM_xfree(). r20678: Repaired coverity issue #598 -- failure to check return value from a call to fstat(), or to tidy up in the event of failure. r20679: Use HDstrncpy. --gh r20681: Use HDstrncat and HDstrncpy. --gh Tested on: Mac OSX/64 10.8.2 (amazon) w/Debug, etc. (too minor to require h5committest) --- bin/checkposix | 2 +- src/H5FDstdio.c | 23 ++++++++++++++++++----- src/H5HFdbg.c | 18 +++++++++--------- src/H5Lexternal.c | 47 +++++++++++++++++++++++++++-------------------- src/H5Ocopy.c | 2 +- src/H5Oname.c | 12 ++++++------ src/H5T.c | 4 ++-- src/H5private.h | 55 ++++++++++++++++++++++++++++--------------------------- src/H5system.c | 12 ++++++------ 9 files changed, 98 insertions(+), 77 deletions(-) diff --git a/bin/checkposix b/bin/checkposix index 3912e9f..b295d7d 100755 --- a/bin/checkposix +++ b/bin/checkposix @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl -w +#!/usr/bin/perl -w require 5.003; # diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 4e484c2..8f4f7f0 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -415,23 +415,36 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, /* Get the file descriptor (needed for truncate and some Windows information) */ file->fd = fileno(file->fp); - if(file->fd < 0) + if(file->fd < 0) { + free(file); + fclose(f); H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTOPENFILE, "unable to get file descriptor", NULL); + } /* end if */ #ifdef H5_HAVE_WIN32_API file->hFile = (HANDLE)_get_osfhandle(file->fd); - if(INVALID_HANDLE_VALUE == file->hFile) + if(INVALID_HANDLE_VALUE == file->hFile) { + free(file); + fclose(f); H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTOPENFILE, "unable to get Windows file handle", NULL); + } /* end if */ - if(!GetFileInformationByHandle((HANDLE)file->hFile, &fileinfo)) - H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTOPENFILE, "unable to get Windows file desinformationcriptor", NULL); + if(!GetFileInformationByHandle((HANDLE)file->hFile, &fileinfo)) { + free(file); + fclose(f); + H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTOPENFILE, "unable to get Windows file descriptor information", NULL); + } /* end if */ file->nFileIndexHigh = fileinfo.nFileIndexHigh; file->nFileIndexLow = fileinfo.nFileIndexLow; file->dwVolumeSerialNumber = fileinfo.dwVolumeSerialNumber; #else /* H5_HAVE_WIN32_API */ - fstat(file->fd, &sb); + if(fstat(file->fd, &sb) < 0) { + free(file); + fclose(f); + H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADFILE, "unable to fstat file", NULL) + } /* end if */ file->device = sb.st_dev; #ifdef H5_VMS file->inode[0] = sb.st_ino[0]; diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 76c7b96..5d68fd1 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -187,7 +187,7 @@ H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwi void H5HF_hdr_print(const H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t dump_internal, FILE *stream, int indent, int fwidth) { - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -381,7 +381,7 @@ H5HF_dblock_debug_cb(H5FS_section_info_t *_sect, void *_udata) size_t start, end; /* Start & end of the overlapping area */ size_t len; /* Length of the overlapping area */ size_t overlap; /* Track any overlaps */ - unsigned u; /* Local index variable */ + size_t u; /* Local index variable */ /* Calculate the starting & ending */ if(sect_start < dblock_start) @@ -396,7 +396,7 @@ H5HF_dblock_debug_cb(H5FS_section_info_t *_sect, void *_udata) /* Calculate the length */ len = end - start; - sprintf(temp_str, "Section #%u:", (unsigned)udata->sect_count); + HDsnprintf(temp_str, sizeof(temp_str), "Section #%u:", (unsigned)udata->sect_count); HDfprintf(udata->stream, "%*s%-*s %8Zu, %8Zu\n", udata->indent + 3, "", MAX(0, udata->fwidth - 9), temp_str, start, len); @@ -530,7 +530,7 @@ H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, HDfprintf(stream, "%*s%-*s %.2f%%\n", indent, "", fwidth, "Percent of available space for data used:", - (100.0 * (double)((dblock->size - blk_prefix_size) - amount_free) / (double)(dblock->size - blk_prefix_size))); + ((double)100.0f * (double)((dblock->size - blk_prefix_size) - amount_free) / (double)(dblock->size - blk_prefix_size))); /* * Print the data in a VMS-style octal dump. @@ -569,7 +569,7 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, char temp_str[64]; /* Temporary string, for formatting */ size_t u, v; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -614,13 +614,13 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, else HDfprintf(stream, "%*sDirect Block Entries: (address)\n", indent, ""); for(u = 0; u < hdr->man_dtable.max_direct_rows && u < iblock->nrows; u++) { - sprintf(temp_str, "Row #%u: (block size: %lu)", (unsigned)u, (unsigned long)hdr->man_dtable.row_block_size[u]); + HDsnprintf(temp_str, sizeof(temp_str), "Row #%u: (block size: %lu)", (unsigned)u, (unsigned long)hdr->man_dtable.row_block_size[u]); HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), temp_str); for(v = 0; v < hdr->man_dtable.cparam.width; v++) { size_t off = (u * hdr->man_dtable.cparam.width) + v; - sprintf(temp_str, "Col #%u:", (unsigned)v); + HDsnprintf(temp_str, sizeof(temp_str), "Col #%u:", (unsigned)v); if(hdr->filter_len > 0) HDfprintf(stream, "%*s%-*s %9a/%6Zu/%x\n", indent + 6, "", MAX(0, fwidth - 6), temp_str, @@ -642,13 +642,13 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, H5V_log2_of2(hdr->man_dtable.cparam.width); for(u = hdr->man_dtable.max_direct_rows; u < iblock->nrows; u++) { num_indirect_rows = (H5V_log2_gen(hdr->man_dtable.row_block_size[u]) - first_row_bits) + 1; - sprintf(temp_str, "Row #%u: (# of rows: %u)", (unsigned)u, num_indirect_rows); + HDsnprintf(temp_str, sizeof(temp_str), "Row #%u: (# of rows: %u)", (unsigned)u, num_indirect_rows); HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), temp_str); for(v = 0; v < hdr->man_dtable.cparam.width; v++) { size_t off = (u * hdr->man_dtable.cparam.width) + v; - sprintf(temp_str, "Col #%u:", (unsigned)v); + HDsnprintf(temp_str, sizeof(temp_str), "Col #%u:", (unsigned)v); HDfprintf(stream, "%*s%-*s %9a\n", indent + 6, "", MAX(0, fwidth - 6), temp_str, iblock->ents[off].addr); diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index 62e7a5e..a1245ba 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -102,7 +102,7 @@ H5L_getenv_prefix_name(char **env_prefix/*in,out*/) FUNC_ENTER_NOAPI_NOINIT_NOERR - strret = HDstrchr(*env_prefix, COLON_SEPC); + strret = HDstrchr(*env_prefix, H5_COLON_SEPC); if (strret == NULL) { retptr = *env_prefix; *env_prefix = strret; @@ -144,14 +144,9 @@ H5L_build_name(char *prefix, char *file_name, char **full_name/*out*/) if(NULL == (*full_name = (char *)H5MM_malloc(prefix_len + fname_len + 2))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer") - /* Copy the prefix into the buffer */ - HDstrcpy(*full_name, prefix); - - if (!CHECK_DELIMITER(prefix[prefix_len-1])) - HDstrcat(*full_name, DIR_SEPS); - - /* Add the external link's filename to the prefix supplied */ - HDstrcat(*full_name, file_name); + /* Compose the full file name */ + HDsnprintf(*full_name, (prefix_len + fname_len + 2), "%s%s%s", prefix, + (H5_CHECK_DELIMITER(prefix[prefix_len - 1]) ? "" : H5_DIR_SEPS), file_name); done: FUNC_LEAVE_NOAPI(ret_value) @@ -319,24 +314,32 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* target file_name is an absolute pathname: see RM for detailed description */ - if(CHECK_ABSOLUTE(file_name) || CHECK_ABS_PATH(file_name)) { + if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) { /* Try opening file */ if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, H5AC_dxpl_id))) { - char *ptr = NULL; + char *ptr; H5E_clear_stack(NULL); /* get last component of file_name */ - GET_LAST_DELIMITER(file_name, ptr) + H5_GET_LAST_DELIMITER(file_name, ptr) HDassert(ptr); - HDstrcpy(temp_file_name, ++ptr); + + /* Increment past delimiter */ + ptr++; + + /* Copy into the temp. file name */ + HDstrncpy(temp_file_name, ptr, HDstrlen(ptr) + 1); } /* end if */ } /* end if */ - else if(CHECK_ABS_DRIVE(file_name)) { + else if(H5_CHECK_ABS_DRIVE(file_name)) { + /* Try opening file */ if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, H5AC_dxpl_id))) { + H5E_clear_stack(NULL); + /* strip ":" */ - HDstrcpy(temp_file_name, &file_name[2]); + HDstrncpy(temp_file_name, &file_name[2], (HDstrlen(file_name) - 2) + 1); } /* end if */ } /* end if */ @@ -414,7 +417,7 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, HGOTO_ERROR(H5E_LINK, H5E_CANTALLOC, FAIL, "can't duplicate resolved file name string") /* get last component of file_name */ - GET_LAST_DELIMITER(actual_file_name, ptr) + H5_GET_LAST_DELIMITER(actual_file_name, ptr) if(!ptr) HGOTO_ERROR(H5E_LINK, H5E_CANTOPENFILE, FAIL, "unable to open external file, external link file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) @@ -543,6 +546,8 @@ H5Lcreate_external(const char *file_name, const char *obj_name, char *norm_obj_name = NULL; /* Pointer to normalized current name */ void *ext_link_buf = NULL; /* Buffer to contain external link */ size_t buf_size; /* Size of buffer to hold external link */ + size_t file_name_len; /* Length of file name string */ + size_t norm_obj_name_len; /* Length of normalized object name string */ uint8_t *p; /* Pointer into external link buffer */ herr_t ret_value = SUCCEED; /* Return value */ @@ -565,16 +570,18 @@ H5Lcreate_external(const char *file_name, const char *obj_name, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "can't normalize object name") /* Combine the filename and link name into a single buffer to give to the UD link */ - buf_size = 1 + (HDstrlen(file_name) + 1) + (HDstrlen(norm_obj_name) + 1); + file_name_len = HDstrlen(file_name) + 1; + norm_obj_name_len = HDstrlen(norm_obj_name) + 1; + buf_size = 1 + file_name_len + norm_obj_name_len; if(NULL == (ext_link_buf = H5MM_malloc(buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate udata buffer") /* Encode the external link information */ p = (uint8_t *)ext_link_buf; *p++ = (H5L_EXT_VERSION << 4) | H5L_EXT_FLAGS_ALL; /* External link version & flags */ - HDstrcpy((char *)p, file_name); /* Name of file containing external link's object */ - p += HDstrlen(file_name) + 1; - HDstrcpy((char *)p, norm_obj_name); /* External link's object */ + HDstrncpy((char *)p, file_name, file_name_len); /* Name of file containing external link's object */ + p += file_name_len; + HDstrncpy((char *)p, norm_obj_name, norm_obj_name_len); /* External link's object */ /* Create an external link */ if(H5L_create_ud(&link_loc, link_name, ext_link_buf, buf_size, H5L_TYPE_EXTERNAL, lcpl_id, lapl_id, H5AC_dxpl_id) < 0) diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index f643842..dc79e47 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -1245,7 +1245,7 @@ H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id, H5O_loc_t *dst_oloc, new_oloc.addr = dst_oloc->addr; /* Pick a default name for the new object */ - sprintf(tmp_obj_name, "~obj_pointed_by_%llu", (unsigned long long)dst_oloc->addr); + HDsnprintf(tmp_obj_name, sizeof(tmp_obj_name), "~obj_pointed_by_%llu", (unsigned long long)dst_oloc->addr); /* Create a link to the newly copied object */ /* Note: since H5O_copy_header_map actually copied the target object, it diff --git a/src/H5Oname.c b/src/H5Oname.c index fb44000..c1cb8c8 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -97,10 +97,10 @@ H5O_name_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, HDassert(p); /* decode */ - if(NULL == (mesg = (H5O_name_t *)H5MM_calloc(sizeof(H5O_name_t))) || - NULL == (mesg->s = (char *)H5MM_malloc(HDstrlen((const char *)p) + 1))) + if(NULL == (mesg = (H5O_name_t *)H5MM_calloc(sizeof(H5O_name_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + if(NULL == (mesg->s = (char *)H5MM_strdup((const char *)p))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - HDstrcpy(mesg->s, (const char *)p); /* Set return value */ ret_value = mesg; @@ -138,9 +138,9 @@ H5O_name_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, cons FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(p); - assert(mesg && mesg->s); + HDassert(f); + HDassert(p); + HDassert(mesg && mesg->s); /* encode */ HDstrcpy((char*)p, mesg->s); diff --git a/src/H5T.c b/src/H5T.c index 5801c3f..65460ed 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -4389,7 +4389,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, H5T_g.apaths = 128; if(NULL == (H5T_g.path[0] = H5FL_CALLOC(H5T_path_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for no-op conversion path") - HDstrcpy(H5T_g.path[0]->name, "no-op"); + HDsnprintf(H5T_g.path[0]->name, sizeof(H5T_g.path[0]->name), "no-op"); H5T_g.path[0]->func = H5T__conv_noop; H5T_g.path[0]->cdata.command = H5T_CONV_INIT; if(H5T__conv_noop(FAIL, FAIL, &(H5T_g.path[0]->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { @@ -4457,7 +4457,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, path->name[H5T_NAMELEN - 1] = '\0'; } /* end if */ else - HDstrcpy(path->name, "NONAME"); + HDsnprintf(path->name, sizeof(path->name), "NONAME"); if(NULL == (path->src = H5T_copy(src, H5T_COPY_ALL))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy datatype for conversion path") if(NULL == (path->dst = H5T_copy(dst, H5T_COPY_ALL))) diff --git a/src/H5private.h b/src/H5private.h index bff4e59..44dd01b 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1473,19 +1473,20 @@ extern char *strdup(const char *s); #if defined(H5_HAVE_WINDOW_PATH) /* directory delimiter for Windows: slash and backslash are acceptable on Windows */ -#define DIR_SLASH_SEPC '/' -#define DIR_SEPC '\\' -#define DIR_SEPS "\\" -#define CHECK_DELIMITER(SS) ((SS == DIR_SEPC)||(SS == DIR_SLASH_SEPC)) -#define CHECK_ABSOLUTE(NAME) ((isalpha(NAME[0])) && (NAME[1] == ':') && (CHECK_DELIMITER(NAME[2]))) -#define CHECK_ABS_DRIVE(NAME) ((isalpha(NAME[0])) && (NAME[1] == ':')) -#define CHECK_ABS_PATH(NAME) (CHECK_DELIMITER(NAME[0])) - -#define GET_LAST_DELIMITER(NAME, ptr) { \ +#define H5_DIR_SLASH_SEPC '/' +#define H5_DIR_SEPC '\\' +#define H5_DIR_SEPS "\\" +#define H5_CHECK_DELIMITER(SS) ((SS == H5_DIR_SEPC) || (SS == H5_DIR_SLASH_SEPC)) +#define H5_CHECK_ABSOLUTE(NAME) ((HDisalpha(NAME[0])) && (NAME[1] == ':') && (H5_CHECK_DELIMITER(NAME[2]))) +#define H5_CHECK_ABS_DRIVE(NAME) ((HDisalpha(NAME[0])) && (NAME[1] == ':')) +#define H5_CHECK_ABS_PATH(NAME) (H5_CHECK_DELIMITER(NAME[0])) + +#define H5_GET_LAST_DELIMITER(NAME, ptr) { \ char *slash, *backslash; \ - slash = strrchr(NAME, DIR_SLASH_SEPC); \ - backslash = strrchr(NAME, DIR_SEPC); \ - if (backslash > slash) \ + \ + slash = HDstrrchr(NAME, H5_DIR_SLASH_SEPC); \ + backslash = HDstrrchr(NAME, H5_DIR_SEPC); \ + if(backslash > slash) \ (ptr = backslash); \ else \ (ptr = slash); \ @@ -1495,27 +1496,27 @@ extern char *strdup(const char *s); /* OpenVMS pathname: $:[path] * i.g. SYS$SYSUSERS:[LU.HDF5.SRC]H5system.c */ -#define DIR_SEPC ']' -#define DIR_SEPS "]" -#define CHECK_DELIMITER(SS) (SS == DIR_SEPC) -#define CHECK_ABSOLUTE(NAME) (strrchr(NAME, ':') && strrchr(NAME, '[')) -#define CHECK_ABS_DRIVE(NAME) (0) -#define CHECK_ABS_PATH(NAME) (0) -#define GET_LAST_DELIMITER(NAME, ptr) ptr = strrchr(NAME, DIR_SEPC); +#define H5_DIR_SEPC ']' +#define H5_DIR_SEPS "]" +#define H5_CHECK_DELIMITER(SS) (SS == H5_DIR_SEPC) +#define H5_CHECK_ABSOLUTE(NAME) (HDstrrchr(NAME, ':') && HDstrrchr(NAME, '[')) +#define H5_CHECK_ABS_DRIVE(NAME) (0) +#define H5_CHECK_ABS_PATH(NAME) (0) +#define H5_GET_LAST_DELIMITER(NAME, ptr) ptr = HDstrrchr(NAME, H5_DIR_SEPC); #else -#define DIR_SEPC '/' -#define DIR_SEPS "/" -#define CHECK_DELIMITER(SS) (SS == DIR_SEPC) -#define CHECK_ABSOLUTE(NAME) (CHECK_DELIMITER(*NAME)) -#define CHECK_ABS_DRIVE(NAME) (0) -#define CHECK_ABS_PATH(NAME) (0) -#define GET_LAST_DELIMITER(NAME, ptr) ptr = strrchr(NAME, DIR_SEPC); +#define H5_DIR_SEPC '/' +#define H5_DIR_SEPS "/" +#define H5_CHECK_DELIMITER(SS) (SS == H5_DIR_SEPC) +#define H5_CHECK_ABSOLUTE(NAME) (H5_CHECK_DELIMITER(*NAME)) +#define H5_CHECK_ABS_DRIVE(NAME) (0) +#define H5_CHECK_ABS_PATH(NAME) (0) +#define H5_GET_LAST_DELIMITER(NAME, ptr) ptr = HDstrrchr(NAME, H5_DIR_SEPC); #endif -#define COLON_SEPC ':' +#define H5_COLON_SEPC ':' /* Use FUNC to safely handle variations of C99 __func__ keyword handling */ diff --git a/src/H5system.c b/src/H5system.c index 83cecba..3ffe411 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -707,7 +707,7 @@ H5_build_extpath(const char *name, char **extpath/*out*/) * OpenVMS: $:[path] * i.g. SYS$SYSUSERS:[LU.HDF5.SRC]H5system.c */ - if(CHECK_ABSOLUTE(name)) { + if(H5_CHECK_ABSOLUTE(name)) { if(NULL == (full_path = (char *)H5MM_strdup(name))) HGOTO_ERROR(H5E_INTERNAL, H5E_NOSPACE, FAIL, "memory allocation failed") } /* end if */ @@ -726,7 +726,7 @@ H5_build_extpath(const char *name, char **extpath/*out*/) * Unix: does not apply * OpenVMS: does not apply */ - if(CHECK_ABS_DRIVE(name)) { + if(H5_CHECK_ABS_DRIVE(name)) { drive = name[0] - 'A' + 1; retcwd = HDgetdcwd(drive, cwdpath, MAX_PATH_LEN); HDstrcpy(new_name, &name[2]); @@ -737,7 +737,7 @@ H5_build_extpath(const char *name, char **extpath/*out*/) * Unix: does not apply * OpenVMS: does not apply */ - else if(CHECK_ABS_PATH(name) && (0 != (drive = HDgetdrive()))) { + else if(H5_CHECK_ABS_PATH(name) && (0 != (drive = HDgetdrive()))) { sprintf(cwdpath, "%c:%c", (drive+'A'-1), name[0]); retcwd = cwdpath; HDstrcpy(new_name, &name[1]); @@ -773,8 +773,8 @@ H5_build_extpath(const char *name, char **extpath/*out*/) else HDstrncat(full_path, new_name, HDstrlen(new_name)); #else - if(!CHECK_DELIMITER(cwdpath[cwdlen - 1])) - HDstrncat(full_path, DIR_SEPS, HDstrlen(DIR_SEPS)); + if(!H5_CHECK_DELIMITER(cwdpath[cwdlen - 1])) + HDstrncat(full_path, H5_DIR_SEPS, HDstrlen(H5_DIR_SEPS)); HDstrncat(full_path, new_name, HDstrlen(new_name)); #endif } /* end if */ @@ -784,7 +784,7 @@ H5_build_extpath(const char *name, char **extpath/*out*/) if(full_path) { char *ptr = NULL; - GET_LAST_DELIMITER(full_path, ptr) + H5_GET_LAST_DELIMITER(full_path, ptr) HDassert(ptr); *++ptr = '\0'; *extpath = full_path; -- cgit v0.12 From 54574a282d6935755759ad3b237425c2eb0ebf35 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 25 Feb 2013 11:41:09 -0500 Subject: [svn-r23314] Correct typo in DEPENDS --- tools/misc/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index 3106a3a..e778d2f 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -246,7 +246,7 @@ IF (BUILD_TESTING) # test the output files repartitioned above. ADD_TEST (NAME H5REPART-h5repart_test COMMAND $) - SET_TESTS_PROPERTIES (H5REPART-h5repart_test PROPERTIES DEPENDS H5REPART-clearall-objects H5REPART-h5repart_20KH5REPART-h5repart_5K H5REPART-h5repart_sec2) + SET_TESTS_PROPERTIES (H5REPART-h5repart_test PROPERTIES DEPENDS H5REPART-clearall-objects DEPENDS H5REPART-h5repart_20K DEPENDS H5REPART-h5repart_5K DEPENDS H5REPART-h5repart_sec2) SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5repart_test -- cgit v0.12 From fbf49aeddfab4d95f80d39c87498280921cfc0f1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 25 Feb 2013 11:59:17 -0500 Subject: [svn-r23317] Fix indentation --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ef4e1c7..60655ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -563,9 +563,9 @@ IF (HDF5_ENABLE_Z_LIB_SUPPORT) IF (NOT H5_ZLIB_HEADER) IF (NOT ZLIB_USE_EXTERNAL) FIND_PACKAGE (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}) - IF (NOT ZLIB_FOUND) - FIND_PACKAGE (ZLIB) # Legacy find - ENDIF (NOT ZLIB_FOUND) + IF (NOT ZLIB_FOUND) + FIND_PACKAGE (ZLIB) # Legacy find + ENDIF (NOT ZLIB_FOUND) ENDIF (NOT ZLIB_USE_EXTERNAL) IF (ZLIB_FOUND) SET (H5_HAVE_FILTER_DEFLATE 1) -- cgit v0.12 From 00eea738d6e6ff9ad237e6a3b652baac3c6d6845 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 27 Feb 2013 12:32:56 -0500 Subject: [svn-r23320] Close resources, found from valgrind testing Tested: local linux --- test/tsohm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/tsohm.c b/test/tsohm.c index fddb552..a8d46f1 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -1280,6 +1280,9 @@ static void size2_verify_plist1(hid_t plist) ret = memcmp(&fill1, &fill1_correct, sizeof(fill1_correct)); VERIFY(ret, 0, memcmp); + + ret = H5Tclose(dtype1_id); + CHECK_I(ret, "H5Tclose"); } /*------------------------------------------------------------------------- @@ -1348,6 +1351,9 @@ static void size2_verify_plist2(hid_t plist) ret = HDmemcmp(&fill2, &fill2_correct, (size_t)DTYPE2_SIZE); VERIFY(ret, 0, memcmp); + + ret = H5Tclose(dtype2_id); + CHECK_I(ret, "H5Tclose"); } #ifdef NOT_NOW -- cgit v0.12 From 77dedb3c64efeb1636696f6ab19163f66986aac4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 1 Mar 2013 15:09:40 -0500 Subject: [svn-r23322] HDFFV-8322: Close resources, found from valgrind testing Tested: local linux --- test/CMakeLists.txt | 3 +++ test/tfile.c | 11 ++++++++++- test/th5o.c | 4 ++++ test/th5s.c | 11 +++++------ test/tsohm.c | 8 ++++++++ 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index aa92371..b830bc4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -225,6 +225,9 @@ ADD_TEST ( ) ADD_TEST (NAME testhdf5 COMMAND $) SET_TESTS_PROPERTIES(testhdf5 PROPERTIES DEPENDS h5test-clear-testhdf5-objects) +IF (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES(testhdf5 PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) +ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ############################################################################## ############################################################################## diff --git a/test/tfile.c b/test/tfile.c index 8ee0b64..e669bd0 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -526,6 +526,9 @@ test_file_open(void) /* Close dataset from first open */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); + + ret = H5Pclose(fapl_id); + CHECK(ret, FAIL, "H5Pclose"); } /* test_file_open() */ /**************************************************************** @@ -1060,6 +1063,9 @@ test_get_file_id(void) VERIFY(fid2, FAIL, "H5Iget_file_id"); /* Close objects */ + ret = H5Pclose(plist); + CHECK(ret, FAIL, "H5Pclose"); + ret = H5Tclose(datatype_id); CHECK(ret, FAIL, "H5Tclose"); @@ -2855,7 +2861,7 @@ test_filespace_sects(void) test_free_sections(fapl_stdio, filename); /* close fapl and remove the file */ - h5_cleanup(FILENAME, fapl_split); + h5_cleanup(FILENAME, fapl_stdio); /* CORE */ MESSAGE(5, ("Testing File free space information for a core file\n")); @@ -3223,6 +3229,9 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create, ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); + + ret = H5Pclose(fapl); + CHECK(ret, FAIL, "H5Pclose"); } /* end test_libver_bounds_real() */ /**************************************************************** diff --git a/test/th5o.c b/test/th5o.c index c46751e..a470f4c 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -111,6 +111,8 @@ test_h5o_open(void) CHECK(dspace, FAIL, "H5Dget_space"); /* Close the IDs */ + ret = H5Sclose(dspace); + CHECK(ret, FAIL, "H5Sclose"); ret = H5Gclose(grp); CHECK(ret, FAIL, "H5Gclose"); ret = H5Tclose(dtype); @@ -324,6 +326,8 @@ test_h5o_open_by_addr(void) CHECK(dspace, FAIL, "H5Dget_space"); /* Close the IDs */ + ret = H5Sclose(dspace); + CHECK(ret, FAIL, "H5Sclose"); ret = H5Gclose(grp); CHECK(ret, FAIL, "H5Gclose"); ret = H5Tclose(dtype); diff --git a/test/th5s.c b/test/th5s.c index a026545..ebbaa37 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -182,14 +182,13 @@ test_h5s_basic(void) fid1 = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT); CHECK_I(fid1, "H5Fopen"); if (fid1 >= 0){ - dset1 = H5Dopen2(fid1, "dset", H5P_DEFAULT); - VERIFY(dset1, FAIL, "H5Dopen2"); - ret = H5Fclose(fid1); - CHECK_I(ret, "H5Fclose"); + dset1 = H5Dopen2(fid1, "dset", H5P_DEFAULT); + VERIFY(dset1, FAIL, "H5Dopen2"); + ret = H5Fclose(fid1); + CHECK_I(ret, "H5Fclose"); } else - printf("***cannot open the pre-created H5S_MAX_RANK test file (%s)\n", - testfile); + printf("***cannot open the pre-created H5S_MAX_RANK test file (%s)\n", testfile); } /* Verify that incorrect dimensions don't work */ diff --git a/test/tsohm.c b/test/tsohm.c index a8d46f1..eb5f7c5 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -3144,6 +3144,8 @@ static void test_sohm_extlink_helper(hid_t src_fcpl_id, hid_t dst_fcpl_id) /* Close the dataset and both files to make sure everything gets flushed * out of memory */ + ret = H5Sclose(space_id); + CHECK_I(ret, "H5Sclose"); ret = H5Dclose(dset_id); CHECK_I(ret, "H5Dclose"); ret = H5Fclose(src_file_id); @@ -3201,6 +3203,9 @@ test_sohm_extlink(void) test_sohm_extlink_helper(fcpl_id, H5P_DEFAULT); test_sohm_extlink_helper(H5P_DEFAULT, fcpl_id); test_sohm_extlink_helper(fcpl_id, fcpl_id); + + ret = H5Pclose(fcpl_id); + CHECK_I(ret, "H5Pclose"); } @@ -3788,6 +3793,9 @@ test_sohm_extend_dset(void) CHECK_I(ret, "test_sohm_extend_dset_helper"); ret = test_sohm_extend_dset_helper(fcpl_id, TRUE); CHECK_I(ret, "test_sohm_extend_dset_helper"); + + ret = H5Pclose(fcpl_id); + CHECK_I(ret, "H5Pclose"); } -- cgit v0.12 From 1cffcb401afa5ec6f7a6135bf107b190fa75ccdf Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 3 Mar 2013 11:20:00 -0500 Subject: [svn-r23323] Snapshot version 1.9 release 146 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.txt b/README.txt index 57c49b3..ae0c0a2 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.146 currently under development +HDF5 version 1.9.147 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index fcbb04e..ec9cb01 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -467,7 +467,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 136 +LT_VERS_REVISION = 137 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 178f435..1ed0a58 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 136 +LT_VERS_REVISION = 137 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index e253056..a724b2d 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.146. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.147. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.146' -PACKAGE_STRING='HDF5 1.9.146' +PACKAGE_VERSION='1.9.147' +PACKAGE_STRING='HDF5 1.9.147' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1484,7 +1484,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.146 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.147 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1554,7 +1554,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.146:";; + short | recursive ) echo "Configuration of HDF5 1.9.147:";; esac cat <<\_ACEOF @@ -1750,7 +1750,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.146 +HDF5 configure 1.9.147 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2844,7 +2844,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.146, which was +It was created by HDF5 $as_me 1.9.147, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3676,7 +3676,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.146' + VERSION='1.9.147' cat >>confdefs.h <<_ACEOF @@ -31748,7 +31748,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.146, which was +This file was extended by HDF5 $as_me 1.9.147, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31814,7 +31814,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.146 +HDF5 config.status 1.9.147 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -34587,7 +34587,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.146 +HDF5 config.lt 1.9.147 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. diff --git a/configure.ac b/configure.ac index 16d3fff..67067b5 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.146], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.147], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 67727b5..c779133 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -518,7 +518,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 136 +LT_VERS_REVISION = 137 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index fc42e73..ec69320 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -458,7 +458,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 136 +LT_VERS_REVISION = 137 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 32e858e..9dd16c3 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -474,7 +474,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 136 +LT_VERS_REVISION = 137 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 36ce3e0..811b96f 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -457,7 +457,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 136 +LT_VERS_REVISION = 137 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 8ceb04d..a1ff0d1 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.146 currently under development +HDF5 version 1.9.147 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index e0376dc..086277c 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 146 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 147 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.146" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.147" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 328a5c5..80284be 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -522,7 +522,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 136 +LT_VERS_REVISION = 137 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 5098e7f..48b4a20 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.146" +#define H5_PACKAGE_STRING "HDF5 1.9.147" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.146" +#define H5_PACKAGE_VERSION "1.9.147" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.146" +#define H5_VERSION "1.9.147" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From ebb18c51862f36cfad5da44a5fb42d18f9a44856 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Tue, 5 Mar 2013 00:06:59 -0500 Subject: [svn-r23325] Description ------------ Fix for: HDFFV-8149: h5pset_external_f API - the offset is declared integer which can cause problem if use 64-bit integer Added new type off_t, modified source files and added a new test. Tested (jam, intel, gnu) --- fortran/src/H5Pf.c | 38 +- fortran/src/H5Pff.f90 | 21 +- fortran/src/H5f90proto.h | 4 +- fortran/src/H5match_types.c | 13 + fortran/test/fortranlib_test_F03.f90 | 5 +- fortran/test/tH5P.f90 | 842 ++++++++++++++++++----------------- fortran/test/tH5P_F03.f90 | 141 ++++++ 7 files changed, 616 insertions(+), 448 deletions(-) diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index 6fc8487..dba2aa4 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -1937,28 +1937,29 @@ DONE: /****if* H5Pf/h5pset_external_c * NAME - * h5pset_external_c + * h5pset_external_c * PURPOSE - * Call H5Pset_external to add an external file to the - * list of external files. + * Call H5Pset_external to add an external file to the + * list of external files. * INPUTS - * prp_id - property list identifier - * name - Name of an external file - * namelen - length of name - * offset - Offset, in bytes, from the beginning of the file - * to the location in the file where the data starts. - * bytes - Number of bytes reserved in the file for the data. + * prp_id - property list identifier + * name - Name of an external file + * namelen - length of name + * offset - Offset, in bytes, from the beginning of the file + * to the location in the file where the data starts. + * bytes - Number of bytes reserved in the file for the data. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Wednesday, February 23, 2000 + * Wednesday, February 23, 2000 * HISTORY - * + * Changed type of 'offset' from int_f to off_t_f -- MSB January 9, 2012 + * * SOURCE */ int_f -nh5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, int_f* offset, hsize_t_f*bytes) +nh5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, off_t_f* offset, hsize_t_f*bytes) /******/ { int ret_value = -1; @@ -2029,14 +2030,14 @@ nh5pget_external_count_c (hid_t_f *prp_id, int_f* count) /****if* H5Pf/h5pget_external_c * NAME - * h5pget_external_c + * h5pget_external_c * PURPOSE - * Call H5Pget_external to get nformation about an external file. + * Call H5Pget_external to get nformation about an external file. * INPUTS * prp_id - property list identifier * name_size - length of name * idx - External file index. - *OUTPUT + * OUTPUT * name - Name of an external file * offset - Offset, in bytes, from the beginning of the file * to the location in the file where the data starts. @@ -2047,11 +2048,12 @@ nh5pget_external_count_c (hid_t_f *prp_id, int_f* count) * Xiangyang Su * Wednesday, February 23, 2000 * HISTORY + * Changed type of 'offset' from integer to off_t -- MSB January 9, 2012 * * SOURCE */ int_f -nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, int_f* offset, hsize_t_f*bytes) +nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, off_t_f* offset, hsize_t_f*bytes) /******/ { int ret_value = -1; @@ -2079,7 +2081,7 @@ nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, if (status < 0) goto DONE; - *offset = (int_f)c_offset; + *offset = (off_t_f)c_offset; *bytes = (hsize_t_f)size; /* Note: if the size of the fortran buffer is larger then the returned string * from the function then we need to give HD5packFstring the fortran buffer size so diff --git a/fortran/src/H5Pff.f90 b/fortran/src/H5Pff.f90 index 203460a..a3c9a60 100644 --- a/fortran/src/H5Pff.f90 +++ b/fortran/src/H5Pff.f90 @@ -2329,14 +2329,16 @@ CONTAINS ! HISTORY ! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 +! port). March 14, 2001 +! +! Changed type of 'offset' from integer to off_t -- MSB January 9, 2012 ! ! Fortran90 Interface: - SUBROUTINE h5pset_external_f(prp_id, name, offset,bytes, hdferr) + SUBROUTINE h5pset_external_f(prp_id, name, offset, bytes, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier CHARACTER(LEN=*), INTENT(IN) :: name ! Name of an external file - INTEGER, INTENT(IN) :: offset ! Offset, in bytes, from the beginning + INTEGER(OFF_T), INTENT(IN) :: offset ! Offset, in bytes, from the beginning ! of the file to the location in the file ! where the data starts. INTEGER(HSIZE_T), INTENT(IN) :: bytes ! Number of bytes reserved in the @@ -2347,9 +2349,6 @@ CONTAINS INTEGER :: namelen -! INTEGER, EXTERNAL :: h5pset_external_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5pset_external_c(prp_id, name,namelen, offset, bytes) USE H5GLOBAL @@ -2360,7 +2359,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: prp_id CHARACTER(LEN=*), INTENT(IN) :: name INTEGER :: namelen - INTEGER, INTENT(IN) :: offset + INTEGER(OFF_T), INTENT(IN) :: offset INTEGER(HSIZE_T), INTENT(IN) :: bytes END FUNCTION h5pset_external_c END INTERFACE @@ -2453,7 +2452,9 @@ CONTAINS ! HISTORY ! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 +! port). March 14, 2001 +! +! Changed type of 'offset' from integer to off_t -- MSB January 9, 2012 ! ! Fortran90 Interface: SUBROUTINE h5pget_external_f(prp_id, idx, name_size, name, offset,bytes, hdferr) @@ -2462,7 +2463,7 @@ CONTAINS INTEGER, INTENT(IN) :: idx ! External file index. INTEGER(SIZE_T), INTENT(IN) :: name_size ! Maximum length of name array CHARACTER(LEN=*), INTENT(OUT) :: name ! Name of an external file - INTEGER, INTENT(OUT) :: offset ! Offset, in bytes, from the beginning + INTEGER(OFF_T), INTENT(OUT) :: offset ! Offset, in bytes, from the beginning ! of the file to the location in the file ! where the data starts. INTEGER(HSIZE_T), INTENT(OUT) :: bytes ! Number of bytes reserved in the @@ -2485,7 +2486,7 @@ CONTAINS INTEGER, INTENT(IN) :: idx INTEGER(SIZE_T), INTENT(IN) :: name_size CHARACTER(LEN=*), INTENT(OUT) :: name - INTEGER, INTENT(OUT) :: offset + INTEGER(OFF_T), INTENT(OUT) :: offset INTEGER(HSIZE_T), INTENT(OUT) :: bytes END FUNCTION h5pget_external_c END INTERFACE diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 53b6874..4b02b6c 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -1065,9 +1065,9 @@ H5_FCDLL int_f nh5pmodify_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags H5_FCDLL int_f nh5pget_nfilters_c (hid_t_f *prp_id, int_f* nfilters); H5_FCDLL int_f nh5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name, int_f* filter_id); H5_FCDLL int_f nh5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name); -H5_FCDLL int_f nh5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, int_f* offset, hsize_t_f*bytes); +H5_FCDLL int_f nh5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, off_t_f* offset, hsize_t_f*bytes); H5_FCDLL int_f nh5pget_external_count_c (hid_t_f *prp_id, int_f* count); -H5_FCDLL int_f nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, int_f* offset, hsize_t_f*bytes); +H5_FCDLL int_f nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, off_t_f* offset, hsize_t_f*bytes); H5_FCDLL int_f nh5pget_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* right); H5_FCDLL int_f nh5pset_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* right); H5_FCDLL int_f nh5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info); diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c index 4c83d21..eb30775 100644 --- a/fortran/src/H5match_types.c +++ b/fortran/src/H5match_types.c @@ -321,6 +321,19 @@ int main(void) return -1; #endif + /* off_t */ +#if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_OFF_T >= 8 + writeToFiles("OFF_T", "off_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_4_KIND && H5_SIZEOF_OFF_T >= 4 + writeToFiles("OFF_T", "off_t_f", 4, H5_FORTRAN_HAS_INTEGER_4_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_2_KIND && H5_SIZEOF_OFF_T >= 2 + writeToFiles("OFF_T", "off_t_f", 2, H5_FORTRAN_HAS_INTEGER_2_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_1_KIND && H5_SIZEOF_OFF_T >= 1 + writeToFiles("OFF_T", "off_t_f", 1, H5_FORTRAN_HAS_INTEGER_1_KIND); +#else + /* Error: couldn't find a size for off_t */ + return -1; +#endif /* size_t */ #if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_SIZE_T >= 8 diff --git a/fortran/test/fortranlib_test_F03.f90 b/fortran/test/fortranlib_test_F03.f90 index 111d35e..1d9615f 100644 --- a/fortran/test/fortranlib_test_F03.f90 +++ b/fortran/test/fortranlib_test_F03.f90 @@ -145,7 +145,10 @@ PROGRAM fortranlibtest_F03 CALL test_nbit(ret_total_error) CALL write_test_status(ret_total_error, ' Testing nbit filter', total_error) - + ret_total_error = 0 + CALL external_test_offset(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Testing external dataset with offset', total_error) + ! write(*,*) ! write(*,*) '=========================================' ! write(*,*) 'Testing GROUP interface ' diff --git a/fortran/test/tH5P.f90 b/fortran/test/tH5P.f90 index 3faaac2..4c78334 100644 --- a/fortran/test/tH5P.f90 +++ b/fortran/test/tH5P.f90 @@ -27,385 +27,376 @@ ! !***** - SUBROUTINE external_test(cleanup, total_error) +SUBROUTINE external_test(cleanup, total_error) ! This subroutine tests following functionalities: ! h5pset_external_f, h5pget_external_count_f, ! h5pget_external_f - USE HDF5 ! This module contains all necessary modules - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(OUT) :: total_error - - CHARACTER(LEN=8), PARAMETER :: filename = "external" - CHARACTER(LEN=80) :: fix_filename - INTEGER(HID_T) :: file_id - INTEGER(HID_T) :: plist_id - INTEGER(HID_T) :: space_id - INTEGER(HID_T) :: dataset_id - INTEGER(HSIZE_T), DIMENSION(1) :: cur_size !data space current size - INTEGER(HSIZE_T), DIMENSION(1) :: max_size !data space maximum size - CHARACTER(LEN=256) :: name !external file name - INTEGER :: file_offset !external file offset - INTEGER(HSIZE_T) :: file_size !sizeof external file segment - INTEGER :: error !error code - INTEGER(SIZE_T) :: int_size !size of integer - INTEGER(HSIZE_T) :: file_bytes !Number of bytes reserved - !in the file for the data - INTEGER :: RANK = 1 !dataset rank - INTEGER :: count !number of external files for the - !specified dataset - INTEGER(SIZE_T) :: namesize - INTEGER(HSIZE_T) :: size, buf_size - INTEGER :: idx - - buf_size = 4*1024*1024 - - ! - !Create file "external.h5" using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - stop - endif - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f",error,total_error) - - - CALL h5pcreate_f(H5P_DATASET_XFER_F, plist_id, error) - CALL check("h5pcreate_f", error, total_error) - CALL h5pset_buffer_f(plist_id, buf_size, error) - CALL check("h5pset_buffer_f", error, total_error) - CALL h5pget_buffer_f(plist_id, size, error) - CALL check("h5pget_buffer_f", error, total_error) - if (size .ne.buf_size) then - total_error = total_error + 1 - write(*,*) "h5pget_buffer_f returned wrong size, error" - endif - CALL h5pclose_f(plist_id, error) - CALL check("h5pclose_f", error, total_error) - - CALL h5pcreate_f(H5P_DATASET_CREATE_F, plist_id, error) - CALL check("h5pcreate_f",error,total_error) - cur_size(1) =100 - max_size(1) = 100; - call h5tget_size_f(H5T_NATIVE_INTEGER, int_size, error) - CALL check("h5tget_size_f",error,total_error) - file_size = int_size * max_size(1); - CALL h5pset_external_f(plist_id, "ext1.data", 0, file_size, error) - CALL check("h5pset_external_f",error,total_error) - CALL h5screate_simple_f(RANK, cur_size, space_id, error, max_size) - CALL check("h5screate_simple_f", error, total_error) - CALL h5dcreate_f(file_id, "dset1", H5T_NATIVE_INTEGER, space_id, & - dataset_id, error, plist_id) - CALL check("h5dcreate_f", error, total_error) - - CALL h5dclose_f(dataset_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5pclose_f(plist_id, error) - CALL check("h5pclose_f", error, total_error) - CALL h5sclose_f(space_id, error) - CALL check("h5sclose_f", error, total_error) - CALL h5fclose_f(file_id, error) - - CALL h5fopen_f(fix_filename, H5F_ACC_RDWR_F, file_id, error) - CALL h5dopen_f(file_id, "dset1", dataset_id, error) - CALL check("h5dopen_f",error,total_error) - - ! Read dataset creation information - CALL h5dget_create_plist_f(dataset_id, plist_id, error) - CALL check("h5dget_create_plist_f",error,total_error) - CALL h5pget_external_count_f(plist_id, count, error) - CALL check("h5pget_external_count_f",error,total_error) - if(count .ne. 1 ) then - write (*,*) "got external_count is not correct" - total_error = total_error + 1 - end if - namesize = 10 - idx = 0 - CALL h5pget_external_f(plist_id, idx, namesize, name, file_offset, & - file_bytes, error) - CALL check("h5pget_external_f",error,total_error) - if(file_offset .ne. 0 ) then - write (*,*) "got external file offset is not correct" - total_error = total_error + 1 - end if - if(file_bytes .ne. file_size ) then - write (*,*) "got external file size is not correct" - total_error = total_error + 1 - end if - - CALL h5dclose_f(dataset_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5pclose_f(plist_id, error) - CALL check("h5pclose_f", error, total_error) - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - - - if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) + USE HDF5 ! This module contains all necessary modules + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(OUT) :: total_error + + CHARACTER(LEN=8), PARAMETER :: filename = "external" + CHARACTER(LEN=80) :: fix_filename + INTEGER(HID_T) :: file_id + INTEGER(HID_T) :: plist_id + INTEGER(HID_T) :: space_id + INTEGER(HID_T) :: dataset_id + INTEGER(HSIZE_T), DIMENSION(1) :: cur_size !data space current size + INTEGER(HSIZE_T), DIMENSION(1) :: max_size !data space maximum size + CHARACTER(LEN=256) :: name !external file name + INTEGER(OFF_T) :: file_offset !external file offset + INTEGER(HSIZE_T) :: file_size !sizeof external file segment + INTEGER :: error !error code + INTEGER(SIZE_T) :: int_size !size of integer + INTEGER(HSIZE_T) :: file_bytes !Number of bytes reserved + !in the file for the data + INTEGER :: RANK = 1 !dataset rank + INTEGER :: count !number of external files for the + !specified dataset + INTEGER(SIZE_T) :: namesize + INTEGER(HSIZE_T) :: size, buf_size + INTEGER :: idx + + buf_size = 4*1024*1024 + + ! + !Create file "external.h5" using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + IF (error .NE. 0) THEN + STOP "Cannot modify filename" + ENDIF + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f",error,total_error) + + CALL h5pcreate_f(H5P_DATASET_XFER_F, plist_id, error) + CALL check("h5pcreate_f", error, total_error) + CALL h5pset_buffer_f(plist_id, buf_size, error) + CALL check("h5pset_buffer_f", error, total_error) + CALL h5pget_buffer_f(plist_id, size, error) + CALL check("h5pget_buffer_f", error, total_error) + IF (size .NE.buf_size) THEN + total_error = total_error + 1 + WRITE(*,*) "h5pget_buffer_f returned wrong size, error" + ENDIF + CALL h5pclose_f(plist_id, error) + CALL check("h5pclose_f", error, total_error) + + CALL h5pcreate_f(H5P_DATASET_CREATE_F, plist_id, error) + CALL check("h5pcreate_f",error,total_error) + cur_size(1) =100 + max_size(1) = 100 + CALL h5tget_size_f(H5T_NATIVE_INTEGER, int_size, error) + CALL check("h5tget_size_f",error,total_error) + file_size = int_size * max_size(1) + CALL h5pset_external_f(plist_id, "ext1.data", INT(0,off_t), file_size, error) + CALL check("h5pset_external_f",error,total_error) + CALL h5screate_simple_f(RANK, cur_size, space_id, error, max_size) + CALL check("h5screate_simple_f", error, total_error) + CALL h5dcreate_f(file_id, "dset1", H5T_NATIVE_INTEGER, space_id, & + dataset_id, error, plist_id) + CALL check("h5dcreate_f", error, total_error) + + CALL h5dclose_f(dataset_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5pclose_f(plist_id, error) + CALL check("h5pclose_f", error, total_error) + CALL h5sclose_f(space_id, error) + CALL check("h5sclose_f", error, total_error) + CALL h5fclose_f(file_id, error) + + CALL h5fopen_f(fix_filename, H5F_ACC_RDWR_F, file_id, error) + CALL h5dopen_f(file_id, "dset1", dataset_id, error) + CALL check("h5dopen_f",error,total_error) + + ! Read dataset creation information + CALL h5dget_create_plist_f(dataset_id, plist_id, error) + CALL check("h5dget_create_plist_f",error,total_error) + CALL h5pget_external_count_f(plist_id, count, error) + CALL check("h5pget_external_count_f",error,total_error) + IF(count .NE. 1 ) THEN + WRITE (*,*) "got external_count is not correct" + total_error = total_error + 1 + END IF + namesize = 10 + idx = 0 + CALL h5pget_external_f(plist_id, idx, namesize, name, file_offset, & + file_bytes, error) + CALL check("h5pget_external_f",error,total_error) + IF(file_offset .NE. 0 ) THEN + WRITE (*,*) "got external file offset is not correct" + total_error = total_error + 1 + END IF + IF(file_bytes .NE. file_size ) THEN + WRITE (*,*) "got external file size is not correct" + total_error = total_error + 1 + END IF + + CALL h5dclose_f(dataset_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5pclose_f(plist_id, error) + CALL check("h5pclose_f", error, total_error) + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + + IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + RETURN +END SUBROUTINE external_test + +SUBROUTINE multi_file_test(cleanup, total_error) + USE HDF5 ! This module contains all necessary modules + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(OUT) :: total_error + + CHARACTER(LEN=9), PARAMETER :: filename = "multidset" ! File name + CHARACTER(LEN=80) :: fix_filename + CHARACTER(LEN=4), PARAMETER :: dsetname = "dset" ! Dataset name + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: dset_id ! Dataset identifier + INTEGER(HID_T) :: dspace_id ! Dataspace identifier + INTEGER(HID_T) :: dtype_id ! Datatype identifier + INTEGER(HID_T) :: fapl, fapl_1 ! File access property list identifier + INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_map, memb_map_out + INTEGER(HID_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_fapl, memb_fapl_out + CHARACTER(LEN=20), DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_name, memb_name_out + REAL, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_addr, memb_addr_out + !INTEGER(HADDR_T), DIMENSION(0:H5FD_MEM_NTYPES_F) :: memb_addr + LOGICAL :: relax = .TRUE. + LOGICAL :: relax_out = .TRUE. + + INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/4,6/) ! Dataset dimensions + INTEGER :: rank = 2 ! Dataset rank + + INTEGER, DIMENSION(4,6) :: dset_data, data_out ! Data buffers + INTEGER :: error ! Error flag + INTEGER(HID_T) :: driver + INTEGER :: i, j !general purpose integers + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims + INTEGER :: mdc_nelmts + INTEGER(SIZE_T) :: rdcc_nelmts + INTEGER(SIZE_T) :: rdcc_nbytes + REAL :: rdcc_w0 + memb_fapl = H5P_DEFAULT_F + memb_map = H5FD_MEM_SUPER_F + memb_addr = 0. + memb_map(H5FD_MEM_SUPER_F) = H5FD_MEM_SUPER_F + memb_addr(H5FD_MEM_SUPER_F) = 0. + memb_map(H5FD_MEM_BTREE_F) = H5FD_MEM_BTREE_F + memb_addr(H5FD_MEM_BTREE_F) = 0.1 + memb_map(H5FD_MEM_DRAW_F) = H5FD_MEM_DRAW_F + memb_addr(H5FD_MEM_DRAW_F) = 0.5 + memb_map(H5FD_MEM_GHEAP_F) = H5FD_MEM_GHEAP_F + memb_addr(H5FD_MEM_GHEAP_F) = 0.2 + memb_map(H5FD_MEM_LHEAP_F) = H5FD_MEM_LHEAP_F + memb_addr(H5FD_MEM_LHEAP_F) = 0.3 + memb_map(H5FD_MEM_OHDR_F) = H5FD_MEM_OHDR_F + memb_addr(H5FD_MEM_OHDR_F) = 0.4 + + memb_name = ' ' + memb_name(H5FD_MEM_SUPER_F) = '%s-s.h5' + memb_name(H5FD_MEM_BTREE_F) = '%s-b.h5' + memb_name(H5FD_MEM_DRAW_F) = '%s-r.h5' + memb_name(H5FD_MEM_GHEAP_F) = '%s-g.h5' + memb_name(H5FD_MEM_LHEAP_F) = '%s-l.h5' + memb_name(H5FD_MEM_OHDR_F) = '%s-o.h5' + + ! + ! Initialize the dset_data array. + ! + DO i = 1, 4 + DO j = 1, 6 + dset_data(i,j) = (i-1)*6 + j + END DO + END DO + + ! + ! Create a new file using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + IF (error .NE. 0) THEN + WRITE(*,*) "Cannot modify filename" + STOP + ENDIF + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) + CALL check("h5pcreate_f", error, total_error) + CALL h5pset_fapl_multi_f(fapl, memb_map, memb_fapl, memb_name, memb_addr, relax, error) + CALL check("h5pset_fapl_multi_f", error, total_error) + CALL h5pget_fapl_multi_f(fapl, memb_map_out, memb_fapl_out, memb_name_out, & + memb_addr_out, relax_out, error) + CALL check("h5pget_fapl_multi_f", error, total_error) + CALL h5pget_driver_f(fapl, driver, error) + CALL check("h5pget_driver_f",error, total_error) + IF(driver .NE. H5FD_MULTI_F) THEN + WRITE(*,*) "Wrong value for driver" + ENDIF + ! + ! Let's check h5pget(set)cache_f APIs here for now + ! + CALL h5pget_cache_f(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, & + rdcc_w0, error) + CALL check("h5pget_cache_f", error, total_error) + + ! + ! Set cache to some number + ! + rdcc_nbytes = 1024*1024 + CALL h5pset_cache_f(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, & + rdcc_w0, error) + CALL check("h5pset_cache_f", error, total_error) + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error, access_prp = fapl) + CALL check("h5fcreate_f", error, total_error) + IF(error .NE. 0) THEN + WRITE(*,*) "Cannot create file using multi-file driver... Exiting...." + total_error = 1 + CALL h5pclose_f(fapl, error) RETURN - END SUBROUTINE external_test - - SUBROUTINE multi_file_test(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(OUT) :: total_error - - CHARACTER(LEN=9), PARAMETER :: filename = "multidset" ! File name - CHARACTER(LEN=80) :: fix_filename - CHARACTER(LEN=4), PARAMETER :: dsetname = "dset" ! Dataset name - - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: dset_id ! Dataset identifier - INTEGER(HID_T) :: dspace_id ! Dataspace identifier - INTEGER(HID_T) :: dtype_id ! Datatype identifier - INTEGER(HID_T) :: fapl, fapl_1 ! File access property list identifier - INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_map, memb_map_out - INTEGER(HID_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_fapl, memb_fapl_out - CHARACTER(LEN=20), DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_name, memb_name_out - REAL, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_addr, memb_addr_out - !INTEGER(HADDR_T), DIMENSION(0:H5FD_MEM_NTYPES_F) :: memb_addr - LOGICAL :: relax = .TRUE. - LOGICAL :: relax_out = .TRUE. - - INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/4,6/) ! Dataset dimensions - INTEGER :: rank = 2 ! Dataset rank - - INTEGER, DIMENSION(4,6) :: dset_data, data_out ! Data buffers - INTEGER :: error ! Error flag - INTEGER(HID_T) :: driver - INTEGER :: i, j !general purpose integers - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - INTEGER :: mdc_nelmts - INTEGER(SIZE_T) :: rdcc_nelmts - INTEGER(SIZE_T) :: rdcc_nbytes - REAL :: rdcc_w0 - memb_fapl = H5P_DEFAULT_F - memb_map = H5FD_MEM_SUPER_F - memb_addr = 0. - memb_map(H5FD_MEM_SUPER_F) = H5FD_MEM_SUPER_F - memb_addr(H5FD_MEM_SUPER_F) = 0. - memb_map(H5FD_MEM_BTREE_F) = H5FD_MEM_BTREE_F - memb_addr(H5FD_MEM_BTREE_F) = 0.1 - memb_map(H5FD_MEM_DRAW_F) = H5FD_MEM_DRAW_F - memb_addr(H5FD_MEM_DRAW_F) = 0.5 - memb_map(H5FD_MEM_GHEAP_F) = H5FD_MEM_GHEAP_F - memb_addr(H5FD_MEM_GHEAP_F) = 0.2 - memb_map(H5FD_MEM_LHEAP_F) = H5FD_MEM_LHEAP_F - memb_addr(H5FD_MEM_LHEAP_F) = 0.3 - memb_map(H5FD_MEM_OHDR_F) = H5FD_MEM_OHDR_F - memb_addr(H5FD_MEM_OHDR_F) = 0.4 - - memb_name = ' ' - memb_name(H5FD_MEM_SUPER_F) = '%s-s.h5' - memb_name(H5FD_MEM_BTREE_F) = '%s-b.h5' - memb_name(H5FD_MEM_DRAW_F) = '%s-r.h5' - memb_name(H5FD_MEM_GHEAP_F) = '%s-g.h5' - memb_name(H5FD_MEM_LHEAP_F) = '%s-l.h5' - memb_name(H5FD_MEM_OHDR_F) = '%s-o.h5' - - ! - ! Initialize the dset_data array. - ! - do i = 1, 4 - do j = 1, 6 - dset_data(i,j) = (i-1)*6 + j; - end do - end do - - ! - ! Create a new file using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - stop - endif - CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) - CALL check("h5pcreate_f", error, total_error) - CALL h5pset_fapl_multi_f(fapl, memb_map, memb_fapl, memb_name, memb_addr, relax, error) - CALL check("h5pset_fapl_multi_f", error, total_error) - CALL h5pget_fapl_multi_f(fapl, memb_map_out, memb_fapl_out, memb_name_out, & - memb_addr_out, relax_out, error) - CALL check("h5pget_fapl_multi_f", error, total_error) - CALL h5pget_driver_f(fapl, driver, error) - CALL check("h5pget_driver_f",error, total_error) - if(driver .ne. H5FD_MULTI_F) then - write(*,*) "Wrong value for driver" - endif - ! - ! Let's check h5pget(set)cache_f APIs here for now - ! - CALL h5pget_cache_f(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, & - rdcc_w0, error) - CALL check("h5pget_cache_f", error, total_error) - - - ! Set cache to some number - ! - rdcc_nbytes = 1024*1024 - CALL h5pset_cache_f(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, & - rdcc_w0, error) - CALL check("h5pset_cache_f", error, total_error) - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error, access_prp = fapl) - CALL check("h5fcreate_f", error, total_error) - if(error .ne. 0) then - write(*,*) "Cannot create file using multi-file driver... Exiting...." - total_error = 1 - call h5pclose_f(fapl, error) - return - endif - - ! - ! Create the dataspace. - ! - CALL h5screate_simple_f(rank, dims, dspace_id, error) - CALL check("h5screate_simple_f", error, total_error) - - - ! - ! Create the dataset with default properties. - ! - CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dspace_id, & - dset_id, error) - CALL check("h5dcreate_f", error, total_error) - - ! - ! Write the dataset. - ! - data_dims(1) = 4 - data_dims(2) = 6 - CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, dset_data, data_dims, error) - CALL check("h5dwrite_f", error, total_error) - - - ! - ! End access to the dataset and release resources used by it. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - - ! - ! Terminate access to the data space. - ! - CALL h5sclose_f(dspace_id, error) - CALL check("h5sclose_f", error, total_error) - - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - CALL h5pclose_f(fapl, error) - CALL check("h5pclose_f", error, total_error) - ! - ! Open the existing file. - ! - CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) - CALL check("h5pcreate_f", error, total_error) - CALL h5pset_fapl_multi_f(fapl, relax, error) - CALL check("h5pset_fapl_multi_f", error, total_error) - CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error, access_prp = fapl) - CALL check("h5fopen_f", error, total_error) - ! - CALL h5fget_access_plist_f(file_id, fapl_1, error) - CALL check("h5fget_access_plist_f", error, total_error) - !It doesn't work on Windows. - !CALL h5pget_fapl_multi_f(fapl_1, memb_map_out, memb_fapl_out, memb_name_out, & - ! memb_addr_out, relax_out, error) - ! write(*,*) memb_map_out - ! write(*,*) memb_fapl_out - ! write(*,*) memb_name_out - ! write(*,*) memb_addr_out - ! CALL check("h5pget_fapl_multi_f", error, total_error) - - ! - ! Open the existing dataset. - ! - CALL h5dopen_f(file_id, dsetname, dset_id, error) - CALL check("h5dopen_f", error, total_error) - - ! - ! Get the dataset type. - ! - CALL h5dget_type_f(dset_id, dtype_id, error) - CALL check("h5dget_type_f", error, total_error) - - ! - ! Get the data space. - ! - CALL h5dget_space_f(dset_id, dspace_id, error) - CALL check("h5dget_space_f", error, total_error) - - ! - ! Read the dataset. - ! - CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error) - CALL check("h5dread_f", error, total_error) - - ! - !Compare the data. - ! - do i = 1, 4 - do j = 1, 6 - IF (data_out(i,j) .NE. dset_data(i, j)) THEN - write(*, *) "dataset test error occured" - write(*,*) "data read is not the same as the data writen" - END IF - end do - end do - - ! - ! End access to the dataset and release resources used by it. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - - ! - ! Terminate access to the data space. - ! - CALL h5sclose_f(dspace_id, error) - CALL check("h5sclose_f", error, total_error) - - ! - ! Terminate access to the data type. - ! - CALL h5tclose_f(dtype_id, error) - CALL check("h5tclose_f", error, total_error) - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - CALL h5pclose_f(fapl, error) - CALL check("h5pclose_f", error, total_error) - CALL h5pclose_f(fapl_1, error) - CALL check("h5pclose_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - IF(cleanup) CALL h5_cleanup_f(filename//'.h5-b', H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f(filename//'.h5-g', H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f(filename//'.h5-l', H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f(filename//'.h5-o', H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f(filename//'.h5-r', H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f(filename//'.h5-s', H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - RETURN - END SUBROUTINE multi_file_test + ENDIF + ! + ! Create the dataspace. + ! + CALL h5screate_simple_f(rank, dims, dspace_id, error) + CALL check("h5screate_simple_f", error, total_error) + ! + ! Create the dataset with default properties. + ! + CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dspace_id, & + dset_id, error) + CALL check("h5dcreate_f", error, total_error) + ! + ! Write the dataset. + ! + data_dims(1) = 4 + data_dims(2) = 6 + CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, dset_data, data_dims, error) + CALL check("h5dwrite_f", error, total_error) + ! + ! End access to the dataset and release resources used by it. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + ! Terminate access to the data space. + ! + CALL h5sclose_f(dspace_id, error) + CALL check("h5sclose_f", error, total_error) + + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + CALL h5pclose_f(fapl, error) + CALL check("h5pclose_f", error, total_error) + ! + ! Open the existing file. + ! + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) + CALL check("h5pcreate_f", error, total_error) + CALL h5pset_fapl_multi_f(fapl, relax, error) + CALL check("h5pset_fapl_multi_f", error, total_error) + CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error, access_prp = fapl) + CALL check("h5fopen_f", error, total_error) + ! + CALL h5fget_access_plist_f(file_id, fapl_1, error) + CALL check("h5fget_access_plist_f", error, total_error) + !It doesn't work on Windows. + !CALL h5pget_fapl_multi_f(fapl_1, memb_map_out, memb_fapl_out, memb_name_out, & + ! memb_addr_out, relax_out, error) + ! write(*,*) memb_map_out + ! write(*,*) memb_fapl_out + ! write(*,*) memb_name_out + ! write(*,*) memb_addr_out + ! CALL check("h5pget_fapl_multi_f", error, total_error) + + ! + ! Open the existing dataset. + ! + CALL h5dopen_f(file_id, dsetname, dset_id, error) + CALL check("h5dopen_f", error, total_error) + + ! + ! Get the dataset type. + ! + CALL h5dget_type_f(dset_id, dtype_id, error) + CALL check("h5dget_type_f", error, total_error) + + ! + ! Get the data space. + ! + CALL h5dget_space_f(dset_id, dspace_id, error) + CALL check("h5dget_space_f", error, total_error) + + ! + ! Read the dataset. + ! + CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error) + CALL check("h5dread_f", error, total_error) + + ! + !Compare the data. + ! + DO i = 1, 4 + DO j = 1, 6 + IF (data_out(i,j) .NE. dset_data(i, j)) THEN + WRITE(*, *) "dataset test error occured" + WRITE(*,*) "data read is not the same as the data writen" + END IF + END DO + END DO + + ! + ! End access to the dataset and release resources used by it. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + ! Terminate access to the data space. + ! + CALL h5sclose_f(dspace_id, error) + CALL check("h5sclose_f", error, total_error) + + ! + ! Terminate access to the data type. + ! + CALL h5tclose_f(dtype_id, error) + CALL check("h5tclose_f", error, total_error) + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + CALL h5pclose_f(fapl, error) + CALL check("h5pclose_f", error, total_error) + CALL h5pclose_f(fapl_1, error) + CALL check("h5pclose_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + IF(cleanup) CALL h5_cleanup_f(filename//'.h5-b', H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename//'.h5-g', H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename//'.h5-l', H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename//'.h5-o', H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename//'.h5-r', H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename//'.h5-s', H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + RETURN +END SUBROUTINE multi_file_test !------------------------------------------------------------------------- ! Function: test_chunk_cache @@ -432,24 +423,24 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup INTEGER, INTENT(OUT) :: total_error - + CHARACTER(LEN=14), PARAMETER :: filename="chunk_cache" CHARACTER(LEN=80) :: fix_filename - INTEGER(hid_t) :: fid = -1 ! /* File ID */ + INTEGER(hid_t) :: fid = -1 ! File ID INTEGER(hid_t) :: file - INTEGER(hid_t) :: fapl_local = -1 ! /* Local fapl */ - INTEGER(hid_t) :: fapl_def = -1 ! /* Default fapl */ - INTEGER(hid_t) :: dcpl = -1 !/* Dataset creation property list ID */ - INTEGER(hid_t) :: dapl1 = -1 !/* Dataset access property list ID */ - INTEGER(hid_t) :: dapl2 = -1 !/* Dataset access property list ID */ - INTEGER(hid_t) :: sid = -1 !/* Dataspace ID */ - INTEGER(hid_t) :: dsid = -1 !/* Dataset ID */ - INTEGER(hsize_t), DIMENSION(1:1) :: chunk_dim, NDIM = (/100/) !/* Dataset and chunk dimensions */ - INTEGER(size_t) :: nslots_1, nslots_2, nslots_3, nslots_4 !/* rdcc number of elements */ - INTEGER(size_t) :: nbytes_1, nbytes_2, nbytes_3, nbytes_4 !/* rdcc number of bytes */ + INTEGER(hid_t) :: fapl_local = -1 ! Local fapl + INTEGER(hid_t) :: fapl_def = -1 ! Default fapl + INTEGER(hid_t) :: dcpl = -1 ! Dataset creation property list ID + INTEGER(hid_t) :: dapl1 = -1 ! Dataset access property list ID + INTEGER(hid_t) :: dapl2 = -1 ! Dataset access property list ID + INTEGER(hid_t) :: sid = -1 ! Dataspace ID + INTEGER(hid_t) :: dsid = -1 ! Dataset ID + INTEGER(hsize_t), DIMENSION(1:1) :: chunk_dim, NDIM = (/100/) ! Dataset and chunk dimensions + INTEGER(size_t) :: nslots_1, nslots_2, nslots_3, nslots_4 ! rdcc number of elements + INTEGER(size_t) :: nbytes_1, nbytes_2, nbytes_3, nbytes_4 ! rdcc number of bytes INTEGER :: mdc_nelmts - INTEGER(size_t) ::nlinks !/* Number of link traversals */ - REAL :: w0_1, w0_2, w0_3, w0_4; !/* rdcc preemption policy */ + INTEGER(size_t) ::nlinks ! Number of link traversals + REAL :: w0_1, w0_2, w0_3, w0_4 ! rdcc preemption policy INTEGER :: error INTEGER(size_t) rdcc_nelmts INTEGER(size_t) rdcc_nbytes @@ -462,7 +453,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) STOP ENDIF - !/* Create a default fapl and dapl */ + ! Create a default fapl and dapl CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl_def, error) CALL check("H5Pcreate_f", error, total_error) CALL H5Pcreate_f(H5P_DATASET_ACCESS_F, dapl1, error) @@ -481,7 +472,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL VERIFYlogical("H5Pget_chunk_cache_f", .TRUE., .FALSE., total_error) ENDIF - ! /* Set a lapl property on dapl1 (to verify inheritance) */ + ! Set a lapl property on dapl1 (to verify inheritance) CALL H5Pset_nlinks_f(dapl1, 134_size_t , error) CALL check("H5Pset_nlinks_f", error, total_error) CALL H5Pget_nlinks_f(dapl1, nlinks, error) @@ -494,7 +485,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) ! Turn off the chunk cache, so all the chunks are immediately written to disk CALL H5Pget_cache_f(fapl_local, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0, error) CALL check("H5Pget_cache_f", error, total_error) - rdcc_nbytes = 0; + rdcc_nbytes = 0 CALL H5Pset_cache_f(fapl_local, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0, error) CALL check("H5Pset_cache_f", error, total_error) @@ -506,29 +497,29 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL H5Pset_cache_f(fapl_local, 0, nslots_2, nbytes_2, w0_2, error) CALL check("H5Pset_cache_f", error, total_error) - !/* Create file */ + ! Create file CALL H5Fcreate_f(fix_filename, H5F_ACC_TRUNC_F, fid, error, H5P_DEFAULT_F, fapl_local) CALL check("H5Fcreate_f", error, total_error) - !/* Create dataset creation property list */ + ! Create dataset creation property list CALL H5Pcreate_f(H5P_DATASET_CREATE_F, dcpl, error) CALL check("H5Pcreate_f", error, total_error) - !/* Set chunking */ - chunk_dim(1) = 10; + ! Set chunking + chunk_dim(1) = 10 CALL H5Pset_chunk_f(dcpl, 1, chunk_dim, error) CALL check("H5Pset_chunk_f", error, total_error) - !/* Create 1-D dataspace */ + ! Create 1-D dataspace ndim(1) = 100 CALL H5Screate_simple_f(1, ndim, sid, error) CALL check("H5Pcreate_f", error, total_error) - ! /* Create dataset with default dapl */ + ! Create dataset with default dapl CALL H5Dcreate_f(fid, "dset", H5T_NATIVE_INTEGER, sid, dsid, error, dcpl, H5P_DEFAULT_F, dapl1) CALL check("H5Pcreate_f", error, total_error) - ! /* Retrieve dapl from dataset, verify cache values are the same as on fapl_local */ + ! Retrieve dapl from dataset, verify cache values are the same as on fapl_local CALL H5Dget_access_plist_f(dsid, dapl2, error) CALL check("H5Dget_access_plist_f", error, total_error) CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) @@ -538,7 +529,8 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) IF(w0_2.NE.w0_4)THEN CALL VERIFYlogical("H5Pget_chunk_cache_f", .TRUE., .FALSE., total_error) ENDIF - CALL H5Pclose_f(dapl2,error); CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(dapl2,error) + CALL check("H5Pclose_f", error, total_error) ! Set new values on dapl1. nbytes will be set to default, so the file ! property will override this setting @@ -550,7 +542,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL H5Pset_chunk_cache_f(dapl1, nslots_3, nbytes_3, w0_3, error) CALL check("H5Pset_chunk_cache_f", error, total_error) - ! Close dataset, reopen with dapl1. Note the use of a dapl with H5Oopen */ + ! Close dataset, reopen with dapl1. Note the use of a dapl with H5Oopen CALL H5Dclose_f(dsid, error) CALL H5Oopen_f(fid, "dset", dsid, error, dapl1) @@ -569,10 +561,12 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) IF(w0_3.NE.w0_4)THEN CALL VERIFYlogical("H5Pget_chunk_cache_f4", .TRUE., .FALSE., total_error) ENDIF - CALL H5Pclose_f(dapl2,error); CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(dapl2,error) + CALL check("H5Pclose_f", error, total_error) ! Close dataset, reopen with H5P_DEFAULT as dapl - CALL H5Dclose_f(dsid, error); CALL check("H5Dclose_f", error, total_error) + CALL H5Dclose_f(dsid, error) + CALL check("H5Dclose_f", error, total_error) CALL H5Oopen_f(fid, "dset", dsid, error) CALL check("H5Oopen_f", error, total_error) @@ -587,10 +581,12 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) IF(w0_2.NE.w0_4)THEN CALL VERIFYlogical("H5Pget_chunk_cache_f", .TRUE., .FALSE., total_error) ENDIF - CALL H5Pclose_f(dapl2,error); CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(dapl2,error) + CALL check("H5Pclose_f", error, total_error) ! Similary, test use of H5Dcreate2 with H5P_DEFAULT - CALL H5Dclose_f(dsid, error); CALL check("H5Dclose_f", error, total_error) + CALL H5Dclose_f(dsid, error) + CALL check("H5Dclose_f", error, total_error) CALL H5Dcreate_f(fid, "dset2", H5T_NATIVE_INTEGER, sid, dsid, error, dcpl, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("H5Pcreate_f", error, total_error) @@ -615,8 +611,10 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) ! Close and reopen file with new fapl_local - CALL H5Dclose_f(dsid, error); CALL check("H5Dclose_f", error, total_error) - CALL H5Fclose_f(fid,error); CALL check("h5fclose_f", error, total_error) + CALL H5Dclose_f(dsid, error) + CALL check("H5Dclose_f", error, total_error) + CALL H5Fclose_f(fid,error) + CALL check("h5fclose_f", error, total_error) CALL H5Fopen_f (fix_filename, H5F_ACC_RDWR_F, fid, error, fapl_local) CALL check("h5fopen_f", error, total_error) @@ -628,7 +626,8 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL h5dopen_f (fid, "dset", dsid, error, dapl2) CALL check("h5dopen_f", error, total_error) - CALL H5Pclose_f(dapl2,error); CALL check("H5Pclose_f", error, total_error) ! Close dapl2, to avoid id leak + CALL H5Pclose_f(dapl2,error) + CALL check("H5Pclose_f", error, total_error) ! Close dapl2, to avoid id leak CALL H5Dget_access_plist_f(dsid, dapl2, error) CALL check("H5Dget_access_plist_f", error, total_error) @@ -647,11 +646,13 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL H5Pset_chunk_cache_f(dapl2, nslots_2, nbytes_2, w0_2, error) CALL check("H5Pset_chunk_cache_f", error, total_error) - CALL H5Dclose_f(dsid, error); CALL check("H5Dclose_f", error, total_error) + CALL H5Dclose_f(dsid, error) + CALL check("H5Dclose_f", error, total_error) CALL h5dopen_f (fid, "dset", dsid, error, dapl2) CALL check("h5dopen_f", error, total_error) - CALL H5Pclose_f(dapl2,error); CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(dapl2,error) + CALL check("H5Pclose_f", error, total_error) CALL H5Dget_access_plist_f(dsid, dapl2, error) CALL check("H5Dget_access_plist_f", error, total_error) @@ -665,17 +666,24 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) ! Close - CALL H5Dclose_f(dsid, error); CALL check("H5Dclose_f", error, total_error) - CALL H5Sclose_f(sid,error); CALL check("H5Sclose_f", error, total_error) - CALL H5Pclose_f(fapl_local,error); CALL check("H5Pclose_f", error, total_error) - CALL H5Pclose_f(fapl_def,error); CALL check("H5Pclose_f", error, total_error) - CALL H5Pclose_f(dapl1,error); CALL check("H5Pclose_f", error, total_error) - CALL H5Pclose_f(dapl2,error); CALL check("H5Pclose_f", error, total_error) - CALL H5Pclose_f(dcpl,error); CALL check("H5Pclose_f", error, total_error) - CALL H5Fclose_f(fid,error); CALL check("H5Fclose_f", error, total_error) + CALL H5Dclose_f(dsid, error) + CALL check("H5Dclose_f", error, total_error) + CALL H5Sclose_f(sid,error) + CALL check("H5Sclose_f", error, total_error) + CALL H5Pclose_f(fapl_local,error) + CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(fapl_def,error) + CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(dapl1,error) + CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(dapl2,error) + CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(dcpl,error) + CALL check("H5Pclose_f", error, total_error) + CALL H5Fclose_f(fid,error) + CALL check("H5Fclose_f", error, total_error) IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) CALL check("h5_cleanup_f", error, total_error) END SUBROUTINE test_chunk_cache - diff --git a/fortran/test/tH5P_F03.f90 b/fortran/test/tH5P_F03.f90 index aec8a26..02ca9dc 100644 --- a/fortran/test/tH5P_F03.f90 +++ b/fortran/test/tH5P_F03.f90 @@ -362,3 +362,144 @@ SUBROUTINE test_genprop_class_callback(total_error) CALL check("h5pclose_class_f", error, total_error) END SUBROUTINE test_genprop_class_callback + +!------------------------------------------------------------------------- +! Function: external_test_offset +! +! Purpose: Tests APIs: +! h5pset_external_f (with offsets not equal to zero), h5pget_external_f +! +! Return: Success: 0 +! Failure: -1 +! +! FORTRAN Programmer: M. Scot Breitenfeld +! January 10, 2012 +!------------------------------------------------------------------------- +! +SUBROUTINE external_test_offset(cleanup,total_error) + + USE ISO_C_BINDING + USE HDF5 ! This module contains all necessary modules + + IMPLICIT NONE + INTEGER, INTENT(OUT) :: total_error + LOGICAL, INTENT(IN) :: cleanup + + INTEGER(hid_t) :: fapl=-1 ! file access property list + INTEGER(hid_t) :: file=-1 ! file to write to + INTEGER(hid_t) :: dcpl=-1 ! dataset creation properties + INTEGER(hid_t) :: space=-1 ! data space + INTEGER(hid_t) :: dset=-1 ! dataset + INTEGER(hid_t) :: grp=-1 ! group to emit diagnostics + INTEGER(size_t) :: i, j ! miscellaneous counters + CHARACTER(LEN=180) :: filename ! file names + INTEGER, DIMENSION(1:25) :: part ! raw data buffers + INTEGER, DIMENSION(1:100), TARGET :: whole ! raw data buffers + INTEGER(hsize_t), DIMENSION(1:1) :: cur_size ! current data space size + INTEGER(hid_t) :: hs_space ! hyperslab data space + INTEGER(hsize_t), DIMENSION(1:1) :: hs_start = (/30/) ! hyperslab starting offset + INTEGER(hsize_t), DIMENSION(1:1) :: hs_count = (/25/) ! hyperslab size + CHARACTER(LEN=1) :: ichr1 ! character conversion holder + INTEGER :: error ! error status + TYPE(C_PTR) :: f_ptr ! fortran pointer + + CHARACTER(LEN=1,KIND=C_CHAR), DIMENSION(1:30) :: temparray + + temparray(1:30)(1:1) = '0' ! 1 byte character + + ! Write the data to external files directly + DO i = 1, 4 + DO j = 1, 25 + part(j) = (i-1)*25+(j-1) + ENDDO + WRITE(ichr1,'(I1.1)') i + filename = "extern_"//ichr1//"a.raw" + OPEN(10, FILE=filename, ACCESS='STREAM', form='UNFORMATTED') + + WRITE(10) temparray(1:(i-1)*10) + WRITE(10) part + CLOSE(10) + ENDDO + ! + ! Create the file and an initial group. + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) + CALL h5fcreate_f('extren_raw.h5', H5F_ACC_TRUNC_F, file, error, access_prp=fapl) + CALL check("h5fcreate_f",error,total_error) + + CALL h5gcreate_f(file, "emit-diagnostics", grp, error) + CALL check("h5gcreate_f",error, total_error) + + ! Create the dataset + CALL h5pcreate_f(H5P_DATASET_CREATE_F, dcpl, error) + CALL check("h5pcreate_f", error, total_error) + CALL h5pset_external_f(dcpl, "extern_1a.raw", INT(0,off_t), INT(SIZEOF(part), hsize_t), error) + CALL check("h5pset_external_f",error,total_error) + CALL h5pset_external_f(dcpl, "extern_2a.raw", INT(10,off_t), INT(SIZEOF(part), hsize_t), error) + CALL check("h5pset_external_f",error,total_error) + CALL h5pset_external_f(dcpl, "extern_3a.raw", INT(20,off_t), INT(SIZEOF(part), hsize_t), error) + CALL check("h5pset_external_f",error,total_error) + CALL h5pset_external_f(dcpl, "extern_4a.raw", INT(30,off_t), INT(SIZEOF(part), hsize_t), error) + CALL check("h5pset_external_f",error,total_error) + + cur_size(1) = 100 + CALL h5screate_simple_f(1, cur_size, space, error) + CALL check("h5screate_simple_f", error, total_error) + CALL h5dcreate_f(file, "dset1", H5T_NATIVE_INTEGER, space, dset,error,dcpl_id=dcpl) + CALL check("h5dcreate_f", error, total_error) + + ! + ! Read the entire dataset and compare with the original + whole(:) = 0 + f_ptr = C_LOC(whole(1)) + CALL h5dread_f(dset, H5T_NATIVE_INTEGER, f_ptr, error, mem_space_id=space, file_space_id=space) + CALL check("h5dread_f", error, total_error) + + DO i = 1, 100 + IF(whole(i) .NE. i-1)THEN + WRITE(*,*) "Incorrect value(s) read." + total_error = total_error + 1 + EXIT + ENDIF + ENDDO + ! + ! Read the middle of the dataset + CALL h5scopy_f(space, hs_space, error) + CALL check("h5scopy_f", error, total_error) + CALL h5sselect_hyperslab_f(hs_space, H5S_SELECT_SET_F, hs_start, hs_count, error) + CALL check("h5sselect_hyperslab_f", error, total_error) + + whole(:) = 0 + f_ptr = C_LOC(whole(1)) + CALL h5dread_f(dset, H5T_NATIVE_INTEGER, f_ptr, error, mem_space_id=hs_space, file_space_id=hs_space) + CALL check("h5dread_f", error, total_error) + + CALL h5sclose_f(hs_space, error) + CALL check("h5sclose_f", error, total_error) + DO i = hs_start(1)+1, hs_start(1)+hs_count(1) + IF(whole(i) .NE. i-1)THEN + WRITE(*,*) "Incorrect value(s) read." + total_error = total_error + 1 + EXIT + ENDIF + ENDDO + + CALL h5dclose_f(dset, error) + CALL check("h5dclose_f", error, total_error) + CALL h5pclose_f(dcpl, error) + CALL check("h5pclose_f", error, total_error) + CALL h5sclose_f(space, error) + CALL check("h5sclose_f", error, total_error) + CALL h5fclose_f(file, error) + CALL check("h5fclose_f", error, total_error) + + ! cleanup + DO i = 1, 4 + WRITE(ichr1,'(I1.1)') i + filename = "extern_"//ichr1//"a.raw" + CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + ENDDO + IF(cleanup) CALL h5_cleanup_f("extren_raw.h5", H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + +END SUBROUTINE external_test_offset -- cgit v0.12 From 2195fe47db5cd5f8e298ec455c4e34cfdd301b9b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 5 Mar 2013 15:16:51 -0500 Subject: [svn-r23326] Refactor testhdf5 for memcheck testing. Test longest running options using only. --- test/CMakeLists.txt | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b830bc4..d0fcef9 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -223,10 +223,23 @@ ADD_TEST ( tsohm_dst.h5 tsohm_src.h5 ) -ADD_TEST (NAME testhdf5 COMMAND $) -SET_TESTS_PROPERTIES(testhdf5 PROPERTIES DEPENDS h5test-clear-testhdf5-objects) + IF (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES(testhdf5 PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) + ADD_TEST (NAME testhdf5-base COMMAND $ -x heap file select) + SET_TESTS_PROPERTIES(testhdf5-base PROPERTIES DEPENDS h5test-clear-testhdf5-objects) + SET_TESTS_PROPERTIES(testhdf5-base PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) + ADD_TEST (NAME testhdf5-heap COMMAND $ -o heap) + SET_TESTS_PROPERTIES(testhdf5-heap PROPERTIES DEPENDS h5test-clear-testhdf5-objects) + SET_TESTS_PROPERTIES(testhdf5-heap PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) + ADD_TEST (NAME testhdf5-file COMMAND $ -o file) + SET_TESTS_PROPERTIES(testhdf5-file PROPERTIES DEPENDS h5test-clear-testhdf5-objects) + SET_TESTS_PROPERTIES(testhdf5-file PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) + ADD_TEST (NAME testhdf5-select COMMAND $ -o select) + SET_TESTS_PROPERTIES(testhdf5-select PROPERTIES DEPENDS h5test-clear-testhdf5-objects) + SET_TESTS_PROPERTIES(testhdf5-select PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) +ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME testhdf5 COMMAND $) + SET_TESTS_PROPERTIES(testhdf5 PROPERTIES DEPENDS h5test-clear-testhdf5-objects) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ############################################################################## -- cgit v0.12 From 5b959f0bf95b0a50933e57cee0c1e86a318f6d39 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Tue, 5 Mar 2013 17:35:23 -0500 Subject: [svn-r23327] Added the reference of the requirement of POSIX Compliance. --- release_docs/INSTALL_parallel | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/release_docs/INSTALL_parallel b/release_docs/INSTALL_parallel index b2e1eec..eacaf68 100644 --- a/release_docs/INSTALL_parallel +++ b/release_docs/INSTALL_parallel @@ -17,12 +17,14 @@ of running the parallel test suites. 1.1. Requirements ----------------- -PHDF5 requires an MPI compiler with MPI-IO support and a parallel file system. -If you don't know yet, you should first consult with your system support staff -of information how to compile an MPI program, how to run an MPI application, -and how to access the parallel file system. There are sample MPI-IO C and -Fortran programs in the appendix section of "Sample programs". You can use -them to run simple tests of your MPI compilers and the parallel file system. +PHDF5 requires an MPI compiler with MPI-IO support and a POSIX compliant +(Ref. 1) parallel file system. If you don't know yet, you should first consult +with your system support staff of information how to compile an MPI program, +how to run an MPI application, and how to access the parallel file system. +There are sample MPI-IO C and Fortran programs in the appendix section of +"Sample programs". You can use them to run simple tests of your MPI compilers +and the parallel file system. Also, the t_posix_compliant test in testpar +verifies if the file system is POSIX compliant. 1.2. Further Help @@ -274,6 +276,20 @@ if the tests should use directory /PFS/user/me, do shell initial files like .profile, .cshrc, etc.) +Reference +--------- +1. POSIX Compliant. A good explanation is by Donald Lewin, + After a write() to a regular file has successfully returned, any + successful read() from each byte position on the file that was modified + by that write() will return the date that was written by the write(). A + subsequent write() to the same byte will overwrite the file data. If a + read() of a file data can be proven by any means [e.g., MPI_Barrier()] + to occur after a write() of that data, it must reflect that write(), + even if the calls are made by a different process. + Lewin, D. (1994). "POSIX Programmer's Guide (pg. 513-4)". O'Reilly + & Associates. + + Appendix A. Sample programs --------------------------- Here are sample MPI-IO C and Fortran programs. You may use them to run simple -- cgit v0.12 From 110d933a5720f4d9ad84cee8eac0ada7e8ffc956 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 6 Mar 2013 01:13:45 -0500 Subject: [svn-r23329] Bug fix: HDFFV-8305 Some systems, like Mac, strings inspect library files and older versions of strings maybe know newer library format, resulting in errors. Make it read the file as stdin, avoiding this problem. Tested: h5committest. all passed. --- test/testlibinfo.sh.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/testlibinfo.sh.in b/test/testlibinfo.sh.in index fba1794..f268b13 100644 --- a/test/testlibinfo.sh.in +++ b/test/testlibinfo.sh.in @@ -53,7 +53,10 @@ SKIP() { # Function definitions CHECK_LIBINFO(){ LINEMSG $1 - if strings $1 | grep "SUMMARY OF THE HDF5 CONFIGURATION" > /dev/null; then + # Some systems, like Mac, strings inspect library files and older versions + # of strings maybe know newer library format, resulting in errors. + # Make it read the file as stdin, avoiding this problem. + if strings < $1 | grep "SUMMARY OF THE HDF5 CONFIGURATION" > /dev/null; then echo " PASSED" else echo " FAILED" -- cgit v0.12 From dbd93b2c552a58353ec5af7fb4067e1f1e1b17dd Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 6 Mar 2013 12:26:48 -0500 Subject: [svn-r23332] HDFFV-8322: for valgrind testing, split-up testhdf5 tests by excluding and running long running tests separately. Tested: local linux --- test/CMakeLists.txt | 2 +- test/testframe.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d0fcef9..6af1e94 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -225,7 +225,7 @@ ADD_TEST ( ) IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME testhdf5-base COMMAND $ -x heap file select) + ADD_TEST (NAME testhdf5-base COMMAND $ -x heap -x file -x select) SET_TESTS_PROPERTIES(testhdf5-base PROPERTIES DEPENDS h5test-clear-testhdf5-objects) SET_TESTS_PROPERTIES(testhdf5-base PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) ADD_TEST (NAME testhdf5-heap COMMAND $ -o heap) diff --git a/test/testframe.c b/test/testframe.c index 5835b73..8ab7a5b 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -155,8 +155,8 @@ void TestUsage(void) print_func("Usage: %s [-v[erbose] (l[ow]|m[edium]|h[igh]|0-9)] %s\n", TestProgName, (TestPrivateUsage ? "" : "")); - print_func(" [-[e]x[clude] name+] \n"); - print_func(" [-o[nly] name+] \n"); + print_func(" [-[e]x[clude] name]+ \n"); + print_func(" [-o[nly] name]+ \n"); print_func(" [-b[egin] name] \n"); print_func(" [-s[ummary]] \n"); print_func(" [-c[leanoff]] \n"); -- cgit v0.12 From f667d55efe0cd0afc9a7071d64e3ac306623b00a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 6 Mar 2013 13:40:47 -0500 Subject: [svn-r23333] Update CMake documentation, remove obsolete info for windows. --- release_docs/CMake.txt | 435 ++++++++++++++++++++++++-- release_docs/INSTALL_Windows.txt | 3 - release_docs/USING_CMake.txt | 72 ++++- release_docs/USING_Windows.txt | 643 +-------------------------------------- 4 files changed, 483 insertions(+), 670 deletions(-) diff --git a/release_docs/CMake.txt b/release_docs/CMake.txt index 029d16d..81dfb61 100644 --- a/release_docs/CMake.txt +++ b/release_docs/CMake.txt @@ -10,7 +10,7 @@ Notes: This short instruction is written for users who want to quickly build www.cmake.org. CMake uses the command line, however the visual CMake tool is - recommended for the configuration step. The steps are similiar for + recommended for the configuration step. The steps are similar for all the operating systems supported by CMake. NOTES: @@ -25,14 +25,14 @@ Notes: This short instruction is written for users who want to quickly build Please send us any comments on how CMake support can be improved on any system. Visit the KitWare site for more information about CMake. - 3. If you are building HDF5 on Windows, do NOT use or execute any - files from the windows folder. - - 4. Build and test results can be submitted to our CDash server at: + 3. Build and test results can be submitted to our CDash server at: cdash.hdfgroup.uiuc.edu. Please read the HDF and CDash document at: www.hdfgroup.org/CDash/HowToSubmit. + 4. See the appendix at the bottom of this file for examples of using + a ctest script for building and testing. + ======================================================================== Preconditions @@ -44,8 +44,7 @@ Notes: This short instruction is written for users who want to quickly build 2. If you plan to use Zlib or Szip; A. Download the packages and install them in a central location. For example on Windows, create a folder extlibs - and install the packages there. Windows users should also read Section V - in INSTALL_Windows.txt. + and install the packages there. B. Use source packages from a SVN server by adding the following CMake options: HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="SVN" @@ -81,8 +80,9 @@ Notes: This short instruction is written for users who want to quickly build available in your Start menu. For Linux, UNIX, and Mac users the executable is named "cmake-gui" and can be found where CMake was installed. - Specify the source and build directories. It is recommemded that you - choose a build directory different then the source directory + Specify the source and build directories. + ***** It is recommemded that you choose a build directory ****** + ***** different then the source directory ****** (for example on Windows, if the source is at c:\MyHDFstuff\hdf5, then use c:\MyHDFstuff\hdf5\build or c:\MyHDFstuff\build\hdf5). @@ -119,24 +119,46 @@ Notes: This short instruction is written for users who want to quickly build * :BOOL=[ON | OFF] is: - # This is the CMakeCache file. - ######################## - # EXTERNAL cache entries - ######################## - SET (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE) - SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) - SET (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE) - SET (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) - SET (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) - SET (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE) - SET (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE) - SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) - SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) - SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) - SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) - SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) - SET (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) - SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) + # This is the CMakeCache file. + ######################## + # EXTERNAL cache entries + ######################## + SET (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE) + SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) + SET (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) + SET (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE) + SET (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) + SET (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) + SET (HDF5_ENABLE_F2003 OFF CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE) + SET (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE) + SET (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE) + SET (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE) + SET (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) + SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) + SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) + SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) + SET (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE) + SET (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE) + SET (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE) + SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) + SET (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE) + SET (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE) + SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) + SET (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE) + SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) + SET (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) + SET (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) + SET (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE) + SET (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) + SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) + SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) + SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building" FORCE) + SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE) + SET (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk" CACHE STRING "Use SZip from HDF repository" FORCE) + SET (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) + SET (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) + SET (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) + SET (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) 2. Configure the cache settings @@ -323,6 +345,365 @@ IF (HDF5_ENABLE_SZIP_SUPPORT) ************************************************************************ + APPENDIX + +Below are examples of the ctest scripts used by The HDF Group. +See the script, cmakehdf5, in the bin folder for a smaller and limited +function shell script version of the following general scripts. +The example is for a linux machine, but the same scripts can be used on +a windows machine by adjusting the CTEST_CMAKE_GENERATOR option in the +product specific script. + +************************************************************************ + +CTestScript.cmake: common ctest script used to build, test and package +======================================================================== + +cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR) +######################################################## +# This dashboard is maintained by The HDF Group +# For any comments please contact cdashhelp@hdfgroup.org +# +######################################################## +# ----------------------------------------------------------- +# -- Get environment +# ----------------------------------------------------------- +if(NOT SITE_OS_NAME) + ## machine name not provided - attempt to discover with uname + ## -- set hostname + ## -------------------------- + find_program(HOSTNAME_CMD NAMES hostname) + exec_program(${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME) + set(CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}") + find_program(UNAME NAMES uname) + macro(getuname name flag) + exec_program("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}") + endmacro(getuname) + + getuname(osname -s) + getuname(osrel -r) + getuname(cpu -m) + message("Dashboard script uname output: ${osname}-${osrel}-${cpu}\n") + + set(CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}") + if(USE_AUTOTOOLS) + set(CTEST_BUILD_NAME "AT-${CTEST_BUILD_NAME}") + endif(USE_AUTOTOOLS) + if(SITE_BUILDNAME_SUFFIX) + set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}") + endif(SITE_BUILDNAME_SUFFIX) + set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS}") +else(NOT SITE_OS_NAME) + ## machine name provided + ## -------------------------- + if(CMAKE_HOST_UNIX) + set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_OS_BITS}-${SITE_COMPILER_NAME}-${SITE_COMPILER_VERSION}") + else(CMAKE_HOST_UNIX) + set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}") + endif(CMAKE_HOST_UNIX) + if(SITE_BUILDNAME_SUFFIX) + set(CTEST_BUILD_NAME ${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}) + endif() + set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") +endif(NOT SITE_OS_NAME) + +#----------------------------------------------------------------------------- +# MAC machines need special option +#----------------------------------------------------------------------------- +if(APPLE) + # Compiler choice + execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + SET(ENV{CC} "${XCODE_CC}") + SET(ENV{CXX} "${XCODE_CXX}") + # Shared fortran is not supported, build static + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") +endif(APPLE) + +#----------------------------------------------------------------------------- +## cygwin does not handle the find_package() call +## -------------------------- +if(NOT SITE_CYGWIN}) + find_package (Subversion) + set(CTEST_UPDATE_COMMAND "${Subversion_SVN_EXECUTABLE}") +else(NOT SITE_CYGWIN}) + set(CTEST_UPDATE_COMMAND "/usr/bin/svn") +endif(NOT SITE_CYGWIN}) + +#----------------------------------------------------------------------------- +set(NEED_REPOSITORY_CHECKOUT 0) +set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") +if (CTEST_USE_TAR_SOURCE) + ## Uncompress source if tar file provided + ## -------------------------- + if(WIN32) + set(CTEST_7Z_COMMAND "C:/Program Files/7-Zip/7z.exe") + message("extracting... [${CTEST_7Z_COMMAND} x ${CTEST_USE_TAR_SOURCE}.zip]") + execute_process(COMMAND ${CTEST_7Z_COMMAND} x ${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) + else(WIN32) + message("extracting... [${CTEST_CMAKE_COMMAND} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") + execute_process(COMMAND tar -xvf ${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) + endif(WIN32) + + if(NOT rv EQUAL 0) + message("extracting... [error-(${rv}) clean up]") + file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") + message(FATAL_ERROR "error: extract of ${CTEST_USE_TAR_SOURCE} failed") + endif(NOT rv EQUAL 0) + + file(RENAME ${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY}) + set(LOCAL_SKIP_UPDATE "TRUE") +else (CTEST_USE_TAR_SOURCE) + ## use subversion to get source + ## -------------------------- + if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") + set (NEED_REPOSITORY_CHECKOUT 1) + endif (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") + + if (${NEED_REPOSITORY_CHECKOUT}) + set (CTEST_CHECKOUT_COMMAND + "${CTEST_UPDATE_COMMAND} co ${REPOSITORY_URL} \"${CTEST_SOURCE_DIRECTORY}\" -r HEAD") + else (${NEED_REPOSITORY_CHECKOUT}) + set (CTEST_CHECKOUT_COMMAND "${CTEST_UPDATE_COMMAND} update") + endif (${NEED_REPOSITORY_CHECKOUT}) +endif (CTEST_USE_TAR_SOURCE) + +#----------------------------------------------------------------------------- +## Clear the build directory +## -------------------------- +set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) +file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") +#include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake) +ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) + +# Use multiple CPU cores to build +include(ProcessorCount) +ProcessorCount(N) +if(NOT N EQUAL 0) + if(NOT WIN32) + set(CTEST_BUILD_FLAGS -j${N}) + endif(NOT WIN32) + set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) +endif() + +#----------------------------------------------------------------------------- +# Send the main script as a note. +if(USE_AUTOTOOLS) + ## autotools builds need to use make and does not use the cacheinit.cmake file + ## -- make command + ## ----------------- + find_program(MAKE NAMES make) + + list(APPEND CTEST_NOTES_FILES + "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" + "${CMAKE_CURRENT_LIST_FILE}" + ) +else(USE_AUTOTOOLS) + list(APPEND CTEST_NOTES_FILES + "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" + "${CMAKE_CURRENT_LIST_FILE}" + "${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake" + ) +endif(USE_AUTOTOOLS) + +#----------------------------------------------------------------------------- +# Check for required variables. +# -------------------------- +foreach(req + CTEST_CMAKE_GENERATOR + CTEST_SITE + CTEST_BUILD_NAME + ) + if(NOT DEFINED ${req}) + message(FATAL_ERROR "The containing script must set ${req}") + endif(NOT DEFINED ${req}) +endforeach(req) + +#----------------------------------------------------------------------------- +# Initialize the CTEST commands +#------------------------------ +if(USE_AUTOTOOLS) + set(CTEST_CONFIGURE_COMMAND "${CTEST_SOURCE_DIRECTORY}/configure ${ADD_BUILD_OPTIONS}") + set(CTEST_BUILD_COMMAND "${MAKE} ${CTEST_BUILD_FLAGS}") + ## -- CTest Config + #configure_file($ENV{HOME}/CTestConfiguration/CTestConfig.cmake ${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake) + configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) + ## -- CTest Testfile +# configure_file(${CTEST_SCRIPT_DIRECTORY}/CTestTestfile.cmake ${CTEST_BINARY_DIRECTORY}/CTestTestfile.cmake) + file(WRITE ${CTEST_BINARY_DIRECTORY}/CTestTestfile.cmake "ADD_TEST(makecheck \"${MAKE}\" \"${CTEST_BUILD_FLAGS}\" \"-i\" \"check\")") +else(USE_AUTOTOOLS) + if(LOCAL_MEMCHECK_TEST) + find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind) + set (CTEST_CONFIGURE_COMMAND + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" + ) + else(LOCAL_MEMCHECK_TEST) + find_program(CTEST_COVERAGE_COMMAND NAMES gcov) + set (CTEST_CONFIGURE_COMMAND + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" + ) + endif(LOCAL_MEMCHECK_TEST) +endif(USE_AUTOTOOLS) + +#----------------------------------------------------------------------------- +## -- set output to english +set($ENV{LC_MESSAGES} "en_EN") + +# Print summary information. +foreach(v + CTEST_SITE + CTEST_BUILD_NAME + CTEST_SOURCE_DIRECTORY + CTEST_BINARY_DIRECTORY + CTEST_CMAKE_GENERATOR + CTEST_BUILD_CONFIGURATION + CTEST_GIT_COMMAND + CTEST_CHECKOUT_COMMAND + CTEST_CONFIGURE_COMMAND + CTEST_SCRIPT_DIRECTORY + CTEST_USE_LAUNCHERS + ) + set(vars "${vars} ${v}=[${${v}}]\n") +endforeach(v) +message("Dashboard script configuration:\n${vars}\n") + +#----------------------------------------------------------------------------- +if(${MODEL} STREQUAL "Continuous") + ## Continuous mode is used for commit test processing + ## -------------------------- + while (${CTEST_ELAPSED_TIME} LESS 36000) + set(START_TIME ${CTEST_ELAPSED_TIME}) + CTEST_START (Continuous) + CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res) + set (CTEST_CHECKOUT_COMMAND) # checkout on first iteration only + message("Dashboard updated files: ${res}\n") + if(res GREATER 0) + CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}") + CTEST_READ_CUSTOM_FILES ("${CTEST_BINARY_DIRECTORY}") + CTEST_SUBMIT (PARTS Update Configure Notes) + CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) + CTEST_SUBMIT (PARTS Build) + CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) + CTEST_SUBMIT (PARTS Test) + + execute_process (COMMAND cpack -C ${CTEST_BUILD_CONFIGURATION} + WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} + RESULT_VARIABLE cpackResult + OUTPUT_VARIABLE cpackLog + ERROR_VARIABLE cpackLog.err + ) + file (WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") + endif(${res} GREATER 0) + + CTEST_SLEEP(${START_TIME} 300 ${CTEST_ELAPSED_TIME}) + endwhile (${CTEST_ELAPSED_TIME} LESS 36000) +#----------------------------------------------------------------------------- +else(${MODEL} STREQUAL "Continuous") +#----------------------------------------------------------------------------- + ## NORMAL process + ## -- LOCAL_SKIP_UPDATE skips updating the source folder from svn + ## -- LOCAL_NO_SUBMIT skips reporting to CDash server + ## -- LOCAL_SKIP_TEST skips the test process (only builds) + ## -- LOCAL_MEMCHECK_TEST executes the Valgrind testing + ## -- LOCAL_COVERAGE_TEST executes code coverage process + ## -------------------------- + CTEST_START (${MODEL} TRACK ${MODEL}) + if(NOT LOCAL_SKIP_UPDATE) + CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}") + endif(NOT LOCAL_SKIP_UPDATE) + CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}") + CTEST_READ_CUSTOM_FILES ("${CTEST_BINARY_DIRECTORY}") + if(NOT LOCAL_NO_SUBMIT) + CTEST_SUBMIT (PARTS Update Configure Notes) + endif(NOT LOCAL_NO_SUBMIT) + CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) + if(NOT LOCAL_NO_SUBMIT) + CTEST_SUBMIT (PARTS Build) + endif(NOT LOCAL_NO_SUBMIT) + if(NOT LOCAL_SKIP_TEST) + if(NOT LOCAL_MEMCHECK_TEST) + CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) + if(NOT LOCAL_NO_SUBMIT) + CTEST_SUBMIT (PARTS Test) + endif(NOT LOCAL_NO_SUBMIT) + else(NOT LOCAL_MEMCHECK_TEST) + CTEST_MEMCHECK (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) + if(NOT LOCAL_NO_SUBMIT) + CTEST_SUBMIT (PARTS MemCheck) + endif(NOT LOCAL_NO_SUBMIT) + endif(NOT LOCAL_MEMCHECK_TEST) + if(LOCAL_COVERAGE_TEST) + CTEST_COVERAGE (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) + if(NOT LOCAL_NO_SUBMIT) + CTEST_SUBMIT (PARTS Coverage) + endif(NOT LOCAL_NO_SUBMIT) + endif(LOCAL_COVERAGE_TEST) + endif(NOT LOCAL_SKIP_TEST) + if(NOT LOCAL_MEMCHECK_TEST) + ##----------------------------------------------- + ## Package the product + ##----------------------------------------------- + execute_process(COMMAND cpack -C ${CTEST_BUILD_CONFIGURATION} -V + WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} + RESULT_VARIABLE cpackResult + OUTPUT_VARIABLE cpackLog + ERROR_VARIABLE cpackLog.err + ) + file(WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") + endif(NOT LOCAL_MEMCHECK_TEST) +endif(${MODEL} STREQUAL "Continuous") +#----------------------------------------------------------------------------- + +message("DONE:CTestScript") +************************************************************************ + +************************************************************************ +Product specific script, HDF518Static.cmake, that uses the +CTestScript.cmake file (see above). Usage: +"ctest -S HDF518Static.cmake,hdf518 -C Release -O hdf518static.log" +where hdf518 is the source folder relative to the location of these scripts +======================================================================== + +cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR) + +# CTEST_SCRIPT_ARG is the source folder passed on the command line +set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG}) +set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/buildstatic) +set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) +set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") +set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") +set(CTEST_BUILD_CONFIGURATION "Release") +set(MODEL "Experimental") + +# build generator name, see cmake generator list +set(CTEST_CMAKE_GENERATOR "Unix Makefiles") + +# machine description, can be removed on linux +set(CTEST_SITE "machine.domain") +set(SITE_OS_NAME "os name") +set(SITE_OS_VERSION "os version") +set(SITE_OS_BITS "os size") +set(SITE_COMPILER_NAME "compiler name") +set(SITE_COMPILER_VERSION "compiler version") + +# extra CDash build name description +set(SITE_BUILDNAME_SUFFIX "STATIC") + +# needed for source updates, change as required +set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8") + +# options to add/change from the cacheinit.cmake in the config/cmake folder +set(ADD_BUILD_OPTIONS "-DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/hdf5.1.8_static") +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_ANSI_CFLAGS:STRING=-fPIC -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=\"SVN\"") + +# include common script file +include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) + +message("DONE") + +************************************************************************ Need further assistance, send email to help@hdfgroup.org diff --git a/release_docs/INSTALL_Windows.txt b/release_docs/INSTALL_Windows.txt index 967675f..4344ea4 100644 --- a/release_docs/INSTALL_Windows.txt +++ b/release_docs/INSTALL_Windows.txt @@ -9,8 +9,5 @@ We now recommend that users build, test and install HDF5 using CMake. Instructions for building and testing HDF5 using CMake can be found in the CMake.txt file found in this folder. -The old solutions and projects found in the windows\ folder will be -maintained for legacy users until HDF5 1.10. - The old INSTALL_Windows documentation can be found in the obsolete_windows_docs\ folder located with this document. diff --git a/release_docs/USING_CMake.txt b/release_docs/USING_CMake.txt index e4e05ed..0e980ea 100644 --- a/release_docs/USING_CMake.txt +++ b/release_docs/USING_CMake.txt @@ -31,6 +31,10 @@ Notes: This short instruction is written for users who want to quickly build Please read the HDF and CDash document at: www.hdfgroup.org/CDash/HowToSubmit. + 4. See the appendix at the bottom of this file for an example of using + a ctest script for building and testing. See CMake.txt for more + information. + ======================================================================== Preconditions @@ -180,10 +184,28 @@ Notes: This short instruction is written for users who want to quickly build ======================================================================== + Using Visual Studio 2010 with HDF5 Libraries built with Visual Studio 2010 +======================================================================== + + 9. Set up path for external libraries and headers + + The path settings will need to be in project property sheets per project. + Go to "Project" and select "Properties", find "Configuration Properties", + and then "VC++ Directories". + + 9.1 If you are building on 64-bit Windows, find the "Platform" dropdown + and select "x64". + + 9.2 Add the header path to the "Include Directories" setting. + + 9.3 Add the library path to the "Library Directories" setting. + + +======================================================================== Minimum C Project Files for CMake ======================================================================== - 9. Create a CMakeLists.txt file at the source root. + 10. Create a CMakeLists.txt file at the source root. .......................................................................... cmake_minimum_required (VERSION 2.8.10) PROJECT (HDF5MyApp C CXX) @@ -196,7 +218,55 @@ ADD_EXECUTABLE (hdf_example ${PROJECT_SOURCE_DIR}/hdf_example.c) TARGET_LINK_LIBRARIES (hdf_example ${LINK_LIBS}) .......................................................................... + +************************************************************************ + APPENDIX + +Below ia an example of the ctest script used by The HDF Group. See the +Appendix in the CMake.txt file for the CTestScript.cmake file used by this +script. + ************************************************************************ +Product specific script, HDF518Example.cmake, that uses the +CTestScript.cmake file (see Appendix in the CMake.txt). Usage: +"ctest -S HDF518Example.cmake,hdf518Examples -C Release -O hdf518EX.log" +where hdf518Examples is the source folder relative to the location of these scripts +======================================================================== + +cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR) + +set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG}) +set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) +set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) +set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") +set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") +set(CTEST_BUILD_CONFIGURATION "Release") +set(MODEL "Experimental") + +# build generator name, see cmake generator list +set(CTEST_CMAKE_GENERATOR "Unix Makefiles") + +# machine description, can be removed on linux +set(CTEST_SITE "machine.domain") +set(SITE_OS_NAME "os name") +set(SITE_OS_VERSION "os version") +set(SITE_OS_BITS "os size") +set(SITE_COMPILER_NAME "compiler name") +set(SITE_COMPILER_VERSION "compiler version") + + +# needed for source updates, change as required +set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5-examples/trunk/1_8") + +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/hdf5Examples-1.8") + +# location of the installed hdf5 (cmake configuration folder) +set(ENV{HDF5_DIR} "/usr/share/cmake/hdf5") + +include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) + +message("DONE") + Need further assistance, send email to help@hdfgroup.org diff --git a/release_docs/USING_Windows.txt b/release_docs/USING_Windows.txt index 9afbeb1..97ac4ad 100644 --- a/release_docs/USING_Windows.txt +++ b/release_docs/USING_Windows.txt @@ -4,626 +4,10 @@ * (Full Version) * *********************************************************************** -The following instructions assume that the HDF5 binary code package from -HDF website (http://hdfgroup.org) is used. +We now recommend that users build, test and install HDF5 using CMake. -Warnings: -Please read CAREFULLY about the following preconditions and notes first. - -Contents: - - Section : Preconditions and Notes - Section I : What do we provide? - Section II : How to build examples (optional) - Section III : How to build an application using the HDF5 library or DLL - Section IV : How to build HDF5 for 64-bit Windows - Section V : How to build HDF5 applications using Visual Studio 2010 - Section VI : Misc. - - -======================================================================== - Preconditions and Notes -======================================================================== - -Preconditions: - - 1. Installed Microsoft Visual Studio. This document is written for Visual - Studio 2008. Express Editions may work with the project files - but not from the command line. We do not support the Express Editions. - - 2. (Optional) Installed Intel Compiler 10.1 or 11.1 if you want to use HDF5 - Fortran libraries. - - 3. Install Winzip or 7-zip for extracting source tarball. - - Note: 1. 7zip is an open-source alternative to WinZip. Some of the - advanced functionality is disabled in WinZip unless you buy the - software. With 7zip, most of this functionality is included for - free. - - 5. Set up a directory structure to unpack the library. For example: - - c:\ (any drive) - MyHDFstuff\ (any folder name) - - 6. Download the hdf5-1.8.x binary code package and use 7zip or WinZip to - extract the HDF5 package into c:\MyHDFstuff. This creates a directory - called 'hdf5-1.8.x' under MyHDFstuff which contains several files and - directories. Rename "hdf5-1.8.x" to "hdf5". - - 7. HDF5 provide options to do in-memory compression within HDF5 library. - Currently, two external compression libraries Zlib and Szip can be used - with HDF5. - - 7.1 HDF5 uses Zlib version 1.2.5 for compression and Zlib is - distributed with HDF5 library in 1.8.x release. - - 7.2 HDF5 uses Szip version 2.1 for compression and Szip compression - software is provided with HDF5 products in 1.8.x release. - - Please note that Szip is not a totally open-source free software. - For licensing issue of Szip, please check "Licensing terms" at - http://hdfgroup.org/doc_resource/SZIP/index.html. - - Szip compression feature inside HDF5 is enabled by default. - - 8. Define the following environment variables: - - HDF5_EXT_ZLIB - HDF5_EXT_SZIP - - In this section, Zlib and Szip compression packages are assumed to be - used. Please read Section V as well as this section if you do not want - to use compression feature inside HDF5. - - To define these environment variables: - - Click "Start", click "Control Panel", and then double-click "System". - On the "Advanced" tab, click "Environment Variables". - - If you are logged on as administrator to the local computer AND want to - let all other users use these two environment variables, click "New" - under "System Variables" box; otherwise, click "New" under "User - Variables" box. - - In the New Variable window, set "Variable name" as HDF5_EXT_ZLIB and - "Variable value" as zlib.lib, then click OK. - - Similarly, you can set: - - HDF5_EXT_SZIP environment variable as szip.lib - - Notes: - - a. You will have to close and reopen running programs for the new - environment variable settings to take effect. - - b. c:\zlib\zlib.dll and c:\szip\dll\szip.dll should be copied - into a location that the application can find. - - 9. Set up path for libraries and headers - - Invoke Microsoft Visual Studio and go to "Tools" and select "Options", - find "Projects", and then "VC++ Directories". - - 9.1 If you are building on 64-bit Windows, find the "Platform" dropdown - and select "x64". - - 9.2 Find the box "Show directories for", choose "Include files", if you - can not find your HDF5 header path (for example, - c:\MyHDFstuff\include) from the directory list, add the - header path (c:\MyHDFstuff\include) to the included - directories. - - 9.3 Find the box "Show directories for", choose "Library files". If you - cannot find your HDF5 library path (for example, - c:\MyHDFstuff\dll for dynamic-shared and c:\MyHDFstuff\lib for static) - from the directory list, add the library - path (c:\MyHDFstuff\dll or c:\MyHDFstuff\lib) to the library directories. - - 9.4 If building Fortran applications, you will also need to setup the path - for the Intel Fortran compiler. Please see Section VI. - - NOTE: - If you are using VS2010, the path settings will need to be in project - property sheets per project. Go to "Project" and select "Properties", find - "Configuration Properties", and then "VC++ Directories". - - 9.1 If you are building on 64-bit Windows, find the "Platform" dropdown - and select "x64". - 9.2 Add the header path to the "Include Directories" setting. - 9.3 Add the library path to the "Library Directories" setting. - -Notes: - - 1. HDF4-related tools are not built and released with HDF5 library packages - any more. To obtain HDF4 related tools, please check - http://hdfgroup.org/h4toh5/ and ftp://ftp.hdfgroup.org/HDF5/h4toh5 - - 2. For Fortran users, Intel Fortran Compiler 10.1 is currently supported - -- please see Section VI. Intel Compiler 11.1 can be used but the project files - must be upgraded within the Visual Studio IDE. - - 3. The szip and zlib dlls must be in the PATH for using the tools (including static). - - -======================================================================== - Section I: What do we provide? -======================================================================== - - 1. Provide - - HDF5 static library: - release version - - HDF5 Dynamic Link Library(DLL): - release version as well as export libraries for DLL - - HDF5 High-Level Library (Optional): - HDF5 C++ Library - HDF5 HL-Fortran Library - - HDF5 tools: - HDF5 tools - - HDF5 tool library: - release version - - HDF5 tool export library for DLL: - release version - - 2. Examples (Included in the binary distribution as a zip file) - - Unpack the examples, hdf5-examples.zip, into your "hdf5" folder - (c:\MyHDFstuff\hdf5). - The resulting structure under this folder should be: - c++ - c++/examples - examples - fortran - fortran/examples - hl - hl/c++ - hl/c++/examples - hl/examples - hl/fortran - hl/fortran/examples - windows - windows/c++ - windows/c++/examples - windows/examples - windows/fortran - windows/fortran/examples - windows/hl - windows/hl/examples - windows/hl/fortran - windows/hl/fortran/examples - hdf5build_examples.bat - InstallExamples.bat - - HDF5 examples: - Simple HDF5 C/C++/Fortran and High level C/Fortran examples - -======================================================================== - Section II: How To Build Examples (Optional) -======================================================================== - -Simple examples have been provided for users to test HDF5 C/C++/Fortran and -High level C/Fortran library and tools. - -Note: - 1) To build HDF5 C++ examples, HDF5 C++ library must have been installed in - Step I. - - 2) To build HDF5 Fortran or HL Fortran examples, please see Section VI, - Step 3. - - 3) To build HDF5 High Level C examples, HDF5 High level library must have - been installed in step I. - - 4) By default, the HDF5 binary distribution only includes the release - versions of HDF5 C/C++ libraries and DLLs. - -To build and test HDF5 C examples: ----------------------------------- - 1. Invoke Microsoft Visual Studio, go to "File" and select the "Open - Solution" option. - - Then open the solution - c:\MyHDFstuff\hdf5examples\windows\examples\allexamples\allexamples.sln. - - 2. Select "Build", and "Configuration Manager". - - To build release versions of C examples. - - In "Active Solution Configuration", select "Release". Select "Close". - Select "Build" -> "Build Solution" or "Rebuild Solution" to build - release version of project "allexamples". - - When the release build is done, there should be the following - subdirectories in c:\MyHDFstuff\hdf5examples\examples\ - - attributetest - attributetestdll - chunkread - chunkreaddll - compoundtest - compoundtestdll - extendwritetest - extendwritetestdll - grouptest - grouptestdll - readtest - readtestdll - selectest - selectestdll - writetest - writetestdll - - 3. Invoke a command prompt window and run the batch file InstallExamples.bat - which resides in the top level directory (c:\MyHDFstuff\hdf5examples). This file - creates new directories, examplesREL, examplesRELDLL in the - c:\MyHDFstuff\hdf5examples\examples directory and places - all the executables in it. - - 4. We provide a batch file named testExamples.bat and an expected examples - tests output file named testExamples_exp_output.txt in - c:\MyHDFstuff\hdf5\examples directory for you to test HDF5 C examples. - - testExamples.bat batch file has options: - - testExamples release -- for release version - - testExamples release dll -- for release DLL version - - Invoke a command prompt and run testExamples.bat with appropriate options. - You should get "All HDF5 C examples tests passed." when the C examples are - built successfully. Otherwise, the difference between the expected - outputs and actual outputs will be given. - -To build and test HDF5 C++ examples: ------------------------------------- - - 1. Invoke Microsoft Visual Studio, go to "File" and select the "Open - Solution" option. - - Then open the solution - c:\MyHDFstuff\hdf5examples\windows\examples\allexamples\allcppexamples.sln. - - 2. Select "Build", and "Configuration Manager". - - To build release versions of C examples. - - In "Active Solution Configuration", select "Release". Select "Close". - Select "Build" -> "Build Solution" or "Rebuild Solution" to build - release version of project "allcppexamples". - - When the release build is done, there should be the following - subdirectories in c:\MyHDFstuff\hdf5examples\c++\examples\ - - chunks - chunksdll - compound - compounddll - create - createdll - extend_ds - extend_dsll - h5group - h5groupdll - readdata - readdatadll - writedata - writedatadll - - 3. Invoke a command prompt window and run the batch file - InstallcppExamples.bat which resides in the top level directory - (c:\MyHDFstuff\hdf5examples). This file creates new directories, - cppexamplesREL, cppexamplesRELDLL in the - c:\MyHDFstuff\hdf5examples\c++\examples directory and places all - the executables in it. - - 4. We provide a batch file named testcppExamples.bat in - c:\MyHDFstuff\hdf5examples\c++\examples directory for you to test HDF5 C++ - examples. - - testcppExamples.bat batch file has options: - - testcppExamples release -- for release version - - testcppExamples release dll -- for release DLL version - - Invoke a command prompt and run testcppExamples.bat with appropriate - options. You should get "All HDF5 C++ examples tests passed." when the - C++ examples are built successfully. Otherwise, the difference between - the expected outputs and actual outputs will be given. - - -To build and test HDF5 High Level C examples: ---------------------------------------------- - - 1. Invoke Microsoft Visual Studio, go to "File" and select the "Open - Solution" option. - - Then open the solution - c:\MyHDFstuff\hdf5examples\windows\hl\examples\allhlcexamples\allhlcexamples.sln - - 2. Select "Build", and "Configuration Manager". - - To build release versions of C examples. - - In "Active Solution Configuration", select "Release". Select "Close". - Select "Build" -> "Build Solution" or "Rebuild Solution" to build - release version of project "allhlcexamples". - - When the release build is done, binaries will be built in the - following subdirectories of c:\MyHDFstuff\hdf5\examples\ - - ex_image[1-2](dll) - ex_lite1(dll) - ex_table[01-12](dll) - ex_ds1(dll) - ptExample[FL+VL](dll) - - 3. Invoke a command prompt and run the batch file Install_hlcexamples.bat - which resides in the top level directory (c:\MyHDFstuff\hdf5examples). This file - creates new directories, HLCexamplesRELEASE, HLCexamplesRELEASEDLL in the - c:\MyHDFstuff\hdf5examples\hl\examples directory and places all the executables in - it. - - 4. We provide a batch file named test_hl_cexamples.bat in - c:\MyHDFstuff\hdf5examples\hl\examples directory for you to test HDF5 high level C - examples. - - test_hl_cexamples.bat batch file has options: - - Options purpose - - test_hl_cexamples release -- for release version - - test_hl_cexamples release dll -- for release DLL version - - Invoke a command prompt window and run test_hl_cexamples with - appropriate options. - - Invoke a command prompt and run testExamples.bat with appropriate options. - You should get "All of the HL C Examples Passed!" when the HL C examples - are built successfully. Otherwise, the difference between the expected - outputs and actual outputs will be given. - - -======================================================================== - Section III: Building an application using the HDF5 library or DLL -======================================================================== - -Waring: The instructions below will only describe how to build an application - using the release version of the HDF5 library or DLL. To use the debug - version of the HDF5 library or DLL, you need to substitute the release - version of the HDF5 library or DLL with the debug version. - - -To build an application that uses the HDF5 static library the following -locations will need to be specified for locating header files and linking with -the HDF static library, for example: - -c:\MyHDFstuff\hdf5\hdf5lib\release\include -c:\MyHDFstuff\hdf5\hdf5lib\release\lib - -We assume that you will use Zlib and Szip compression with HDF5 library. - -1. Specifying Include Directories - -To specify the include directories in the settings for your Visual Studio -project, you may choose one of the following two methods. - - Method One: Project-wide Settings - - 1. Open your project in Microsoft Visual Studio and make sure it is the - active project. - - 2. Go to the Project menu and chose the "Properties" option. - - 3. Choose the build configuration you would like to modify in the drop - down menu labeled "Configuration:" - - 4. Choose the "C/C++" tab, and select "General". - - 5. In a text-area labeled with "Additional Include Directories:", add - HDF5, Zlib, and Szip header files directories. For example: - - c:\MyHDFstuff\hdf5\hdf5lib\release\include - c:\zlib\include - c:\szip\include - - Then click OK. - - 6. (Optional) To use HDF5 Fortran static library, the location of - Fortran module files should be specified by following Project-> - Settings->Fortran->Preprocessor, and in the text-area labeled - "Additional Include Directories", add HDF5 Fortran module files - directories. For example: - - c:\MyHDFstuff\hdf5\hdf5lib\release\include - - Method Two: Visual Studio Settings - - 1. In Visual STudio, go to Tools->Options->Projects-> - VC++ Directories. Under "Show Directories For", select "Include files" - - 2. Insert the correct HDF5, Zlib, Szip paths for headers(include). For - example, - - c:\MyHDFstuff\hdf5\hdf5lib\release\include - c:\zlib\include - c:\szip\include - - -2. Specifying Library Directories - -To specify the library directories in the settings for your Visual Studio -project, you may choose one of the following two methods. - - Method One: Project-wide Settings - - 1. Open your project in Microsoft Visual Studio and make sure it is the - active project. - - 2. Go to the Project menu and chose the "Properties" option. - - 3. Choose the build configuration you would like to modify in the drop - down menu labeled "Configuration:" - - 4. Choose the "Linker" tab, and select "General". - - 5. In a text-area labeled with "Additional Library Directories:", add - HDF5, Zlib, and Szip library files directories. For example: - - c:\MyHDFstuff\hdf5\hdf5lib\release\lib - c:\zlib\dll - c:\szip\dll - - Note: To link with HDF5 DLLs rathern that static libraries, simply - specify the "dll" directory rather than "lib", and link with the - corresponding DLL link library below. - - Then click OK. - - - Method Two: Visual Studio Settings - - 1. In Visual STudio, go to Tools->Options->Projects-> - VC++ Directories. Under "Show Directories For", select "Library files" - - 2. Insert the correct HDF5, Zlib, Szip paths for link libraries. For - example, - - c:\MyHDFstuff\hdf5\hdf5lib\release\lib - c:\zlib\dll - c:\szip\dll - - Note: To link with HDF5 DLLs rathern that static libraries, simply - specify the "dll" directory rather than "lib", and link with the - corresponding DLL link library below. - - -3. Specifying Libraries to Link - - To link the HDF5 static library with your application: - - 1. In Visual Studio, go to the Project menu and choose "Properties". - - 2. Find the "Link" option and "Input" category. In the "Additional - Dependencies" field, insert "zlib.lib, libszip.lib, hdf5.lib". - - 3. (Optional) Also insert "hdf5_cpp.lib" if you want to use HDF5 C++ - static library. - - 4. (Optional) Also insert "hdf5_fortran.lib" if you want to use HDF5 - Fortran static library. - - 5. (Optional) Also insert "hdf5_hl.lib" if you want to use HDF5 high - level static library. - - 6. (Optional) Also insert "hdf5_hl_cpp.lib" if you want to use HDF5 High - Level C++ static library. - - 7. (Optional) Also insert "hdf5_hl_fortran.lib" if you want to use HDF5 - High Level Fortran static library. - - - To link the HDF5 DLL library with your application: - - 1. Follow the steps for linking the HDF5 static library as shown above, - except now link the export library that is created with the DLL. - - The export library is called hdf5dll.lib for HDF5 C libray, - hdf5_cppdll.lib for HDF5 C++ library, and hdf5_fortrandll.lib - for HDF5 Fortran library. - - 2. In the Project Properties dialog, go to the C/C++ > Preprocessor - subsection. In the "Preprocessor Definitions" box, add "_HDF5USEDLL_" - to the list. - - 3. (Optional) Also add HDF5CPP_USEDLL to use HDF5 C++ DLL. - - 4. (Optional) Also add _HDF5USEHLDLL_ to use HDF5 high level DLL. - - 5. (Optional) Also add HDF5USE_HLCPPDLL use HDF5 high level C++ DLL. - - 6. (Optional) Follow Project->Settings->Fortran->Category->General-> - Predefined Preprocess or Symbols, and add "HDF5F90_WINDOWS" to use HDF5 - Fortran DLL. - - 7. Place the DLLs in a location that Windows will be able to locate. The - searched path and order for DLL's is - - a) The directory where the executable module for the current - process is located. - b) The current directory. - c} The Windows system directory. The GetSystemDirectory function - retrieves the path of this directory. - d) The Windows directory. The GetWindowsDirectory function - retrieves the path of this directory. - e) The directories listed in the PATH environment variable. - - -======================================================================== - Section IV: How to build HDF5 for 64-bit Windows -======================================================================== - -HDF5 is available for 64-bit Windows in Visual Studio 2008. - -Prerequisites: - - 1. A 64-bit Windows machine. - - 2. Microsoft Visual Studio 2008 installed with x64 Extensions. - - -Building: - - Building 64-bit Windows binaries is very similar to the process for 32-bit. - Therefore, you may follow the instructions in Section II with the following - modifications. - - 1. The x64 platform must be selected in the build configuration for - debug and release versions. Before building, go to "Build", - "Configuration Manager". In the "Active solution platform" box, - select "x64", and press "Close". - - 2. 64-bit HDF5 applications must be built with 64-bit external libraries. - You must add the include and - library paths for x64 configurations as you have in the - "Prerequisites" section. This is also true for Intel Fortran if - Fortran libraries are to be built. - -======================================================================== - Section V: How to build HDF5 applications using Visual Studio 2010 -======================================================================== -Building with Visual Studio 2010 is very similar to building with Visual Studio -2008, with some minor changes. Therefore, follow the build instructions above, -with the following considerations: - - 1. Visual Studio 2010 uses a new format for project files, but Visual Studio - 2008 project files can be converted. The HDF5 project files - will need to be converted on first use. To do so: - - 1.1. Open the HDF5 Visual Studio 2008 solution file as in Section II - (all.sln) - - NOTE. Intel Fortran 11.1 currently does not integrate with Visual Studio 2010. - - 1.2. You will be prompted with an automatic conversion wizard. Click - through, accepting the default values. You may choose to create - backups of the project files, although it isn't necessary. - - 1.3. When it is finished, it should state that all projects were - converted successfully with no errors. Warnings can be ignored. - - 2. Once the project files have been converted you will need to create project - property sheets for the library and include paths. Then build and test normally. - Note that the converted project files aren't backwards compatible with - previous versions of Visual Studio. +Instructions for building and testing HDF5 applications using CMake can be found in +the USING_CMake.txt file found in this folder. ======================================================================== @@ -635,26 +19,7 @@ with the following considerations: Here are some helpful notes if you are not familiar with using the Visual C++ Development Environment. - 1.1 Project name and location issues: - - It is recommended that you use the given directory structure for building - HDF5 Examples. However, it is possible to create your own structure. If you must - install all.sln and all.vcproj in another directory, relative to hdf5 - directory, you will be asked to locate the sub-project files, when you open - the project all.sln. - - If you want to rename "all" (the entire project), you will need to modify - two files all.sln and all.vcproj as text (contrary to the explicit warnings - in the files). - - - 1.2 Settings... details: - - If you create your own project, the necessary settings can be read - from the all.vcproj file (as text), or from the Project Settings in the - Visual Studio project settings dialog. - - 1.3 FAQ + 1.1 FAQ Many other common questions and hints are located online and being updated in the HDF5 FAQ. For Windows-specific questions, please see: -- cgit v0.12 From dd0a7fa13bbf70160ca881ccc4f8d380d19a5606 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Thu, 7 Mar 2013 14:58:45 -0500 Subject: [svn-r23336] Discovered some typo in the last added comment. Rewrote the comment. Tested: no need since only comments are changed. --- test/testlibinfo.sh.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/testlibinfo.sh.in b/test/testlibinfo.sh.in index f268b13..b7aa6c4 100644 --- a/test/testlibinfo.sh.in +++ b/test/testlibinfo.sh.in @@ -53,9 +53,9 @@ SKIP() { # Function definitions CHECK_LIBINFO(){ LINEMSG $1 - # Some systems, like Mac, strings inspect library files and older versions - # of strings maybe know newer library format, resulting in errors. - # Make it read the file as stdin, avoiding this problem. + # Some systems, like Mac, the strings command inspects library files. Older + # versions of strings may not know newer library format, resulting in + # command errors. Make it read the file as stdin to avoid the problem. if strings < $1 | grep "SUMMARY OF THE HDF5 CONFIGURATION" > /dev/null; then echo " PASSED" else -- cgit v0.12 From 1e057e17d2941900fa9459f23eb3e80cef866e40 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Thu, 7 Mar 2013 15:58:41 -0500 Subject: [svn-r23338] Updated with HDFFV-8305 fix. --- release_docs/RELEASE.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index a1ff0d1..6b42b6d 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1073,8 +1073,17 @@ Bug Fixes since HDF5-1.8.0 release Testing ------- + - In some Mac system, testlibinfo.sh failed with this error: + Check file ../src/.libs/libhdf5.7.dylib + strings: object: ../src/.libs/libhdf5.7.dylib malformed object \ + (unknown load command 15) + The strings command of Mac inspects library files and older + versions of strings may not know newer library format, resulting + in errors. Fixed by sending the library file as stdin to the strings + coommand to avoid this problem. (AKC - 2013/03/08 HDFFV-8305) + - Fixed a typo in the ERROR macro in test/testhdf5.h. It segmentation - faulted when used before. (AKC - 2013/02/12 HDFFV-8267) + faulted when used before. (AKC - 2013/02/12 HDFFV-8267) Supported Platforms -- cgit v0.12 From c896a5b7eb6ee05206eff1e2432f5eade1a7365a Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 10 Mar 2013 04:34:50 -0500 Subject: [svn-r23341] Snapshot version 1.9 release 147 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.txt b/README.txt index ae0c0a2..b3a5451 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.147 currently under development +HDF5 version 1.9.148 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index ec9cb01..b025f0b 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -467,7 +467,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 137 +LT_VERS_REVISION = 138 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 1ed0a58..37b5b68 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 137 +LT_VERS_REVISION = 138 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index a724b2d..2c25701 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.147. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.148. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.147' -PACKAGE_STRING='HDF5 1.9.147' +PACKAGE_VERSION='1.9.148' +PACKAGE_STRING='HDF5 1.9.148' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1484,7 +1484,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.147 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.148 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1554,7 +1554,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.147:";; + short | recursive ) echo "Configuration of HDF5 1.9.148:";; esac cat <<\_ACEOF @@ -1750,7 +1750,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.147 +HDF5 configure 1.9.148 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2844,7 +2844,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.147, which was +It was created by HDF5 $as_me 1.9.148, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3676,7 +3676,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.147' + VERSION='1.9.148' cat >>confdefs.h <<_ACEOF @@ -31748,7 +31748,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.147, which was +This file was extended by HDF5 $as_me 1.9.148, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31814,7 +31814,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.147 +HDF5 config.status 1.9.148 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -34587,7 +34587,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.147 +HDF5 config.lt 1.9.148 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. diff --git a/configure.ac b/configure.ac index 67067b5..c51f05e 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.147], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.148], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index c779133..c41653f 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -518,7 +518,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 137 +LT_VERS_REVISION = 138 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index ec69320..89aee46 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -458,7 +458,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 137 +LT_VERS_REVISION = 138 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 9dd16c3..fc734df 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -474,7 +474,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 137 +LT_VERS_REVISION = 138 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 811b96f..bd46a70 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -457,7 +457,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 137 +LT_VERS_REVISION = 138 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 6b42b6d..1f4016c 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.147 currently under development +HDF5 version 1.9.148 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 086277c..f66508d 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 147 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 148 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.147" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.148" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 80284be..c08649e 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -522,7 +522,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 137 +LT_VERS_REVISION = 138 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 48b4a20..57f358d 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.147" +#define H5_PACKAGE_STRING "HDF5 1.9.148" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.147" +#define H5_PACKAGE_VERSION "1.9.148" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.147" +#define H5_VERSION "1.9.148" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From 3a4c43cbd4a58a527c802cc36651ac252f84ed90 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 15 Mar 2013 10:26:14 -0500 Subject: [svn-r23353] Correct target name --- tools/lib/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index f0d0d01..ac86e8a 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -38,15 +38,15 @@ SET (H5_TOOLS_LIB_HDRS ADD_LIBRARY (${HDF5_TOOLS_LIB_TARGET} ${LIB_TYPE} ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS}) TARGET_LINK_LIBRARIES (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_GLOBAL_VARIABLE( HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") +SET_GLOBAL_VARIABLE(HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") H5_SET_LIB_OPTIONS ( ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} ${LIB_TYPE} HDF5_TOOLS_LIB_NAME_RELEASE HDF5_TOOLS_LIB_NAME_DEBUG ) -#SET_TARGET_PROPERTIES (hdf5_tools PROPERTIES COMPILE_DEFINITIONS H5DIFF_DEBUG) -SET_TARGET_PROPERTIES (hdf5_tools PROPERTIES FOLDER libraries/tools) +#SET_TARGET_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} PROPERTIES COMPILE_DEFINITIONS H5DIFF_DEBUG) +SET_TARGET_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools) ############################################################################## ############################################################################## -- cgit v0.12 From dadea7dc7425d27bf48c75d9e40086c073e27b00 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 15 Mar 2013 10:26:55 -0500 Subject: [svn-r23354] Close prop list var --- test/tfile.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/tfile.c b/test/tfile.c index e669bd0..ac2ef82 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -3084,7 +3084,7 @@ test_filespace_compatible(void) VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); /* Get the file's file creation property list */ - /* Retrieve the file space handling stretegy and threshold */ + /* Retrieve the file space handling strategy and threshold */ fcpl = H5Fget_create_plist(fid); CHECK(fcpl, FAIL, "H5Fget_create_plist"); ret = H5Pget_file_space(fcpl, &strategy, &threshold); @@ -3117,9 +3117,13 @@ test_filespace_compatible(void) ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT); CHECK(ret, FAIL, "H5Ldelete"); - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); + /* Close the plist */ + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Pclose"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); /* Re-Open the file */ fid = H5Fopen(FILE5, H5F_ACC_RDONLY, H5P_DEFAULT); -- cgit v0.12 From e188e7797bcf9d10f7f301f9664e4f0c41f36937 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 17 Mar 2013 03:28:21 -0500 Subject: [svn-r23361] Snapshot version 1.9 release 148 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.txt b/README.txt index b3a5451..96c1121 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.148 currently under development +HDF5 version 1.9.149 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index b025f0b..37e5d1b 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -467,7 +467,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 138 +LT_VERS_REVISION = 139 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 37b5b68..8df77f3 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 138 +LT_VERS_REVISION = 139 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 2c25701..a31c67a 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.148. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.149. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.148' -PACKAGE_STRING='HDF5 1.9.148' +PACKAGE_VERSION='1.9.149' +PACKAGE_STRING='HDF5 1.9.149' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1484,7 +1484,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.148 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.149 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1554,7 +1554,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.148:";; + short | recursive ) echo "Configuration of HDF5 1.9.149:";; esac cat <<\_ACEOF @@ -1750,7 +1750,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.148 +HDF5 configure 1.9.149 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2844,7 +2844,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.148, which was +It was created by HDF5 $as_me 1.9.149, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3676,7 +3676,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.148' + VERSION='1.9.149' cat >>confdefs.h <<_ACEOF @@ -31748,7 +31748,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.148, which was +This file was extended by HDF5 $as_me 1.9.149, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31814,7 +31814,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.148 +HDF5 config.status 1.9.149 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -34587,7 +34587,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.148 +HDF5 config.lt 1.9.149 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. diff --git a/configure.ac b/configure.ac index c51f05e..38b342a 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.148], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.149], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index c41653f..7379980 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -518,7 +518,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 138 +LT_VERS_REVISION = 139 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 89aee46..b360bf3 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -458,7 +458,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 138 +LT_VERS_REVISION = 139 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index fc734df..fb54a54 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -474,7 +474,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 138 +LT_VERS_REVISION = 139 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index bd46a70..37d5af8 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -457,7 +457,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 138 +LT_VERS_REVISION = 139 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 1f4016c..4414eb1 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.148 currently under development +HDF5 version 1.9.149 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index f66508d..deb4587 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 148 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 149 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.148" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.149" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index c08649e..febb111 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -522,7 +522,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 138 +LT_VERS_REVISION = 139 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 57f358d..f4c0eab 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.148" +#define H5_PACKAGE_STRING "HDF5 1.9.149" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.148" +#define H5_PACKAGE_VERSION "1.9.149" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.148" +#define H5_VERSION "1.9.149" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From 76a8599736e22ede7506e550fcfe9c3443ff0a3d Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 18 Mar 2013 14:50:32 -0500 Subject: [svn-r23366] Removed the H5Pset_dxpl_multi and H5Pget_dxpl_multi functions from the library. The intended functionality for them was never fully implemented and they are fundamentally broken. The functions were removed from the C and C++ interfaces. They were not exported in the Fortran interface. Tested on: jam(c++/fortran/hl) I tested using check-vfd to ensure the multi VFD still works properly. There is no reason to test this on other machines or on parallel. --- c++/src/H5DxferProp.cpp | 37 ------------- src/H5FDmulti.c | 144 ------------------------------------------------ src/H5FDmulti.h | 3 - 3 files changed, 184 deletions(-) diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index 0785735..bc3e0af 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -266,43 +266,6 @@ void DSetMemXferPropList::getVlenMemManager( H5MM_allocate_t& alloc_func, void** } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setMulti -///\brief Sets the data transfer property list for the multi-file driver. -///\param memb_dxpl - OUT: Array of data access property lists -///\exception H5::PropListIException -///\par Description -/// This function can only be used after the member map has -/// been set with FileAccPropList::setMulti (not done - BMR.) -// Programmer: Binh-Minh Ribler - April, 2004 -//-------------------------------------------------------------------------- -void DSetMemXferPropList::setMulti(const hid_t *memb_dxpl) -{ - herr_t ret_value = H5Pset_dxpl_multi(id, memb_dxpl); - if (ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::setMulti", - "H5Pset_dxpl_multi failed"); - } -} - -//-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getMulti -///\brief Returns multi-file data transfer property list information. -///\param memb_dxpl - OUT: Array of data access property lists -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 -//-------------------------------------------------------------------------- -void DSetMemXferPropList::getMulti(hid_t *memb_dxpl) -{ - herr_t ret_value = H5Pget_dxpl_multi(id, memb_dxpl); - if (ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::getMulti", - "H5Pget_dxpl_multi failed"); - } -} - -//-------------------------------------------------------------------------- // Function: DSetMemXferPropList::setSmallDataBlockSize ///\brief Sets the size of a contiguous block reserved for small data. ///\param size - IN: Maximum size, in bytes, of the small data block. diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 5bdfbbe..9d6e065 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -726,150 +726,6 @@ H5FD_multi_dxpl_cls_cb(const char *name, size_t size, void *_dx) return 0; } /* end H5FD_multi_dxpl_cls_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5Pset_dxpl_multi - * - * Purpose: Set the data transfer property list DXPL_ID to use the multi - * driver with the specified data transfer properties for each - * memory usage type MEMB_DXPL[] (after the usage map is - * applied). - * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Robb Matzke - * Tuesday, August 10, 1999 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -herr_t -H5Pset_dxpl_multi(hid_t dxpl_id, const hid_t *memb_dxpl) -{ - H5FD_multi_dxpl_t dx; - H5FD_mem_t mt; - htri_t prop_exists; /* Whether the multi VFD DXPL property already exists */ - static const char *func = "H5FDset_dxpl_multi"; /* Function Name for error reporting */ - - /*NO TRACE*/ - - /* Clear the error stack */ - H5Eclear2(H5E_DEFAULT); - - /* Check arguments */ - if(TRUE != H5Pisa_class(dxpl_id, H5P_DATASET_XFER)) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1) - if(!memb_dxpl) - H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "invalid pointer", -1) - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { - if(memb_dxpl[mt] != H5P_DEFAULT && TRUE != H5Pisa_class(memb_dxpl[mt], H5P_DATASET_XFER)) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1) - } /* end for */ - - /* Check for existence of multi VFD DXPL property in DXPL */ - if((prop_exists = H5Pexist(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME)) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't check for multi VFD property", -1) - - /* Copy the DXPLs to internal property, converting "generic" default - * property lists into default dataset transfer property lists */ - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { - if(memb_dxpl[mt] == H5P_DEFAULT) - dx.memb_dxpl[mt] = H5P_DATASET_XFER_DEFAULT; - else { - if((dx.memb_dxpl[mt] = H5Pcopy(memb_dxpl[mt])) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTCOPY, "can't copy dataset transfer property list", -1) - } /* end else */ - } /* end for */ - - /* Clear previous property, if it exists */ - if(prop_exists) { - H5FD_multi_dxpl_t old_dx; - - /* Get the old DXPL value */ - if(H5Pget(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, &old_dx) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't get previous property value", -1) - - ALL_MEMBERS(mt) { - if(old_dx.memb_dxpl[mt] >= 0) - if(H5Pclose(old_dx.memb_dxpl[mt]) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTCLOSEOBJ, "can't close property list", -1) - } END_MEMBERS; - - /* Set the new value */ - if(H5Pset(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, &dx) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't get previous property value", -1) - } /* end if */ - else { - /* Insert multi VFD DXPL property into property list */ - if(H5Pinsert2(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, H5FD_MULTI_DXPL_PROP_SIZE, &dx, NULL, NULL, NULL, H5FD_multi_dxpl_copy_cb, H5FD_multi_dxpl_cmp_cb, H5FD_multi_dxpl_cls_cb) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTINSERT, "can't insert multi VFD DXPL property", -1) - } /* end else */ - - return 0; -} /* end H5Pset_dxpl_multi() */ - - -/*------------------------------------------------------------------------- - * Function: H5Pget_dxpl_multi - * - * Purpose: Returns information which was set with H5Pset_dxpl_multi() - * above. - * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Robb Matzke - * Tuesday, August 10, 1999 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -herr_t -H5Pget_dxpl_multi(hid_t dxpl_id, hid_t *memb_dxpl/*out*/) -{ - H5FD_multi_dxpl_t dx; - H5FD_mem_t mt; - htri_t prop_exists; /* Whether the multi VFD DXPL property already exists */ - static const char *func = "H5FDget_dxpl_multi"; /* Function Name for error reporting */ - - /*NO TRACE*/ - - /* Clear the error stack */ - H5Eclear2(H5E_DEFAULT); - - /* Argument checking */ - if(TRUE != H5Pisa_class(dxpl_id, H5P_DATASET_XFER)) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1) - - if(memb_dxpl) { - /* Check for existence of multi VFD DXPL property in DXPL */ - if((prop_exists = H5Pexist(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME)) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't check for multi VFD property", -1) - if(!prop_exists) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "multi VFD DXPL property not set", -1) - - /* Get the DXPL value */ - if(H5Pget(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, &dx) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't get property value", -1) - - /* Deep copy the multi VFD DXPL value */ - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { - if(dx.memb_dxpl[mt] >= 0) - memb_dxpl[mt] = H5Pcopy(dx.memb_dxpl[mt]); - else - memb_dxpl[mt] = dx.memb_dxpl[mt]; /*default or bad ID */ - } /* end for */ - } /* end if */ - - return 0; -} /* end H5Pget_dxpl_multi() */ - /*------------------------------------------------------------------------- * Function: H5FD_multi_sb_size diff --git a/src/H5FDmulti.h b/src/H5FDmulti.h index da16b0c..e819e74 100644 --- a/src/H5FDmulti.h +++ b/src/H5FDmulti.h @@ -34,9 +34,6 @@ H5_DLL herr_t H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, H5_DLL herr_t H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/, hid_t *memb_fapl/*out*/, char **memb_name/*out*/, haddr_t *memb_addr/*out*/, hbool_t *relax/*out*/); -H5_DLL herr_t H5Pset_dxpl_multi(hid_t dxpl_id, const hid_t *memb_dxpl); -H5_DLL herr_t H5Pget_dxpl_multi(hid_t dxpl_id, hid_t *memb_dxpl/*out*/); - H5_DLL herr_t H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, const char *raw_ext, hid_t raw_plist_id); -- cgit v0.12 From 626fb1b02fee15e1954583f7ec06b3e09eb7bffc Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 18 Mar 2013 23:14:59 -0500 Subject: [svn-r23379] HDFFV-8297 h5fc does not recognize files ending in .f95, .f03, and .f08 as source files added missing extensions. Tested: jam (gnu) --- fortran/src/h5fc.in | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in index 2d7b5b4..c55b496 100644 --- a/fortran/src/h5fc.in +++ b/fortran/src/h5fc.in @@ -233,8 +233,13 @@ for arg in $@ ; do *) allargs="$allargs $arg" if [ -s "$arg" ] ; then ext=`expr "$arg" : '.*\(\..*\)'` - if [ "$ext" = ".f" -o "$ext" = ".F" -o "$ext" = ".f90" -o \ - "$ext" = ".for" -o "$ext" = ".FOR" -o "$ext" = ".F90" ] ; then + if [ "$ext" = ".f" -o "$ext" = ".F" -o \ + "$ext" = ".for" -o "$ext" = ".FOR" -o \ + "$ext" = ".ftn" -o "$ext" = ".FTN" -o \ + "$ext" = ".f90" -o "$ext" = ".F90" -o \ + "$ext" = ".f95" -o "$ext" = ".F95" -o \ + "$ext" = ".f03" -o "$ext" = ".F03" -o \ + "$ext" = ".f08" -o "$ext" = ".F08" ] ; then do_compile="yes" compile_args="$compile_args $arg" fname=`basename $arg $ext` -- cgit v0.12 From 8ad18f496ad665faffc4f2fd0eae8140b53ab760 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 19 Mar 2013 15:51:14 -0500 Subject: [svn-r23388] HDDFV-8322: Free allocations in parse_command_line function. Tested: local linux --- tools/misc/h5mkgrp.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/misc/h5mkgrp.c b/tools/misc/h5mkgrp.c index b4ac6f6..b9fb588 100644 --- a/tools/misc/h5mkgrp.c +++ b/tools/misc/h5mkgrp.c @@ -46,6 +46,7 @@ typedef struct { size_t ngroups; /* Number of groups to create */ char **groups; /* Pointer to array of group names */ } param_t; +param_t params; /* Command line parameter settings */ /*------------------------------------------------------------------------- @@ -62,6 +63,15 @@ typedef struct { static void leave(int ret) { + int curr_group; + + if (params.fname) + HDfree (params.fname); + if (params.ngroups) { + for(curr_group = 0; curr_group < params.ngroups; curr_group++) + HDfree (params.groups[curr_group]); + HDfree (params.groups); + } h5tools_close(); HDexit(ret); } /* end leave() */ @@ -206,7 +216,6 @@ for(curr_group = 0; curr_group < params->ngroups; curr_group++) int main(int argc, const char *argv[]) { - param_t params; /* Command line parameter settings */ hid_t fid; /* HDF5 file ID */ hid_t fapl_id; /* File access property list ID */ hid_t lcpl_id; /* Link creation property list ID */ @@ -322,6 +331,6 @@ main(int argc, const char *argv[]) /* Shut down h5tools lib */ h5tools_close(); - return EXIT_SUCCESS; + leave(EXIT_SUCCESS); } /* end main() */ -- cgit v0.12 From 59dd5665a5887efa8e91e0339719e4bd0c2be2a6 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 19 Mar 2013 22:44:28 -0500 Subject: [svn-r23395] Description: Bring Coverity changes from branch to trunk: r20682: fixed coverity: 76, 77, 635, 636, 1164, 1165, 1166, 1121, 1122, 1117, 1343 Tested on: Mac OSX/64 10.8.3 (amazon) w/C++ & FORTRAN (too minor to require h5committest) --- tools/h5copy/h5copy.c | 39 +-- tools/h5ls/h5ls.c | 247 ++++++++++------- tools/lib/h5diff.c | 34 +-- tools/lib/h5diff.h | 205 -------------- tools/lib/h5diff_array.c | 689 +++++++++++++++++++++++++++++----------------- tools/lib/h5diff_attr.c | 14 +- tools/lib/h5tools_utils.h | 2 +- 7 files changed, 619 insertions(+), 611 deletions(-) diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c index 574ba94..b2ad9d0 100644 --- a/tools/h5copy/h5copy.c +++ b/tools/h5copy/h5copy.c @@ -199,23 +199,21 @@ static int parse_flag(const char* str_flag, unsigned *flag) int main (int argc, const char *argv[]) { - hid_t fid_src=-1; - hid_t fid_dst=-1; - char *fname_src=NULL; - char *fname_dst=NULL; - char *oname_src=NULL; - char *oname_dst=NULL; - unsigned flag=0; - unsigned verbose=0; - unsigned parents=0; + hid_t fid_src = -1; + hid_t fid_dst = -1; + char *fname_src = NULL; + char *fname_dst = NULL; + char *oname_src = NULL; + char *oname_dst = NULL; + char *str_flag = NULL; + unsigned flag = 0; + unsigned verbose = 0; + unsigned parents = 0; hid_t ocpl_id = (-1); /* Object copy property list */ hid_t lcpl_id = (-1); /* Link creation property list */ - char str_flag[20]; int opt; int li_ret; h5tool_link_info_t linkinfo; - int i, len; - char *str_ptr=NULL; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); @@ -249,7 +247,7 @@ main (int argc, const char *argv[]) usage(); leave(EXIT_FAILURE); } - HDstrcpy(str_flag,opt_arg); + str_flag = HDstrdup(opt_arg); break; case 'h': @@ -377,8 +375,10 @@ main (int argc, const char *argv[]) { printf("Copying file <%s> and object <%s> to file <%s> and object <%s>\n", fname_src, oname_src, fname_dst, oname_dst); - if (flag) + if (flag) { + HDassert(str_flag); printf("Using %s flag\n", str_flag); + } } @@ -417,14 +417,19 @@ main (int argc, const char *argv[]) } /* end if */ else /* error, if parent groups doesn't already exist in destination file */ { + size_t i, len; + len = HDstrlen(oname_dst); + /* check if all the parents groups exist. skip root group */ for (i = 1; i < len; i++) { if ('/'==oname_dst[i]) { - str_ptr = (char*)HDcalloc((size_t)i+1, sizeof(char)); - HDstrncpy (str_ptr, oname_dst, (size_t)i); + char *str_ptr; + + str_ptr = (char *)HDcalloc(i + 1, sizeof(char)); + HDstrncpy(str_ptr, oname_dst, i); str_ptr[i]='\0'; if (H5Lexists(fid_dst, str_ptr, H5P_DEFAULT) <= 0) { @@ -513,6 +518,8 @@ error: HDfree(oname_dst); if (oname_src) HDfree(oname_src); + if (str_flag) + HDfree(str_flag); h5tools_close(); diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 7135e4e..832d91f 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -115,8 +115,8 @@ typedef struct { hid_t gid; /* Group ID */ hbool_t symlink_target; /* Whether this is the target of an symbolic link */ symlink_trav_t *symlink_list; /* List of visited symbolic links */ - int base_len; /* Length of base path name, if not root */ - int name_start; /* # of leading characters to strip off path names on output */ + size_t base_len; /* Length of base path name, if not root */ + size_t name_start; /* # of leading characters to strip off path names on output */ }iter_t; /* Command-line switches */ @@ -154,7 +154,6 @@ static struct dispatch_t { dispatch_g[TYPE].list2 = (LIST2); \ } -static void display_type(hid_t type, int ind); static void print_type(h5tools_str_t *buffer, hid_t type, int ind); static herr_t visit_obj(hid_t file, const char *oname, iter_t *iter); @@ -342,7 +341,7 @@ print_obj_name(h5tools_str_t *buffer, const iter_t *iter, const char *oname, int n; if(show_file_name_g) - sprintf(fullname, "%s/%s", iter->fname, oname + iter->name_start); + HDsnprintf(fullname, sizeof(fullname), "%s/%s", iter->fname, oname + iter->name_start); else name = oname + iter->name_start; @@ -553,14 +552,14 @@ print_precision(h5tools_str_t *buffer, hid_t type, int ind) /* If the precision is less than the total size then show the precision * and offset on the following line. Also display the padding * information. */ - if (8*H5Tget_size(type)!=(prec=H5Tget_precision(type))) { + if(8 * H5Tget_size(type) != (prec = H5Tget_precision(type))) { h5tools_str_append(buffer, "\n%*s(%lu bit%s of precision beginning at bit %lu)", - ind, "", (unsigned long)prec, 1==prec?"":"s", + ind, "", (unsigned long)prec, 1 == prec ? "" : "s", (unsigned long)H5Tget_offset(type)); H5Tget_pad(type, &plsb, &pmsb); - if (H5Tget_offset(type)>0) { - switch (plsb) { + if(H5Tget_offset(type) > 0) { + switch(plsb) { case H5T_PAD_ZERO: plsb_s = "zero"; break; @@ -575,12 +574,11 @@ print_precision(h5tools_str_t *buffer, hid_t type, int ind) plsb_s = "unknown"; break; default: - ; break; } } - if (H5Tget_offset(type)+prec<8*H5Tget_size(type)) { - switch (pmsb) { + if((unsigned)H5Tget_offset(type) + prec < 8 * H5Tget_size(type)) { + switch(pmsb) { case H5T_PAD_ZERO: pmsb_s = "zero"; break; @@ -595,23 +593,22 @@ print_precision(h5tools_str_t *buffer, hid_t type, int ind) pmsb_s = "unknown"; break; default: - ; break; } } if (plsb_s || pmsb_s) { h5tools_str_append(buffer, "\n%*s(", ind, ""); if (plsb_s) { - nbits = H5Tget_offset(type); + nbits = (unsigned)H5Tget_offset(type); h5tools_str_append(buffer, "%lu %s bit%s at bit 0", - (unsigned long)nbits, plsb_s, 1==nbits?"":"s"); + (unsigned long)nbits, plsb_s, 1 == nbits ? "" : "s"); } if (plsb_s && pmsb_s) h5tools_str_append(buffer, ", "); if (pmsb_s) { - nbits = 8*H5Tget_size(type)-(H5Tget_offset(type)+prec); + nbits = (8 * H5Tget_size(type)) - ((unsigned)H5Tget_offset(type) + prec); h5tools_str_append(buffer, "%lu %s bit%s at bit %lu", - (unsigned long)nbits, pmsb_s, 1==nbits?"":"s", - (unsigned long)(8*H5Tget_size(type)-nbits)); + (unsigned long)nbits, pmsb_s, 1 == nbits ? "" : "s", + (unsigned long)(8 * H5Tget_size(type) - nbits)); } h5tools_str_append(buffer, ")"); } @@ -829,14 +826,18 @@ print_cmpd_type(h5tools_str_t *buffer, hid_t type, int ind) char *name=NULL; /* member name */ size_t size; /* total size of type in bytes */ hid_t subtype; /* member data type */ - unsigned nmembs; /* number of members */ + int nmembs; /* number of members */ int n; /* miscellaneous counters */ unsigned i; /* miscellaneous counters */ - if (H5T_COMPOUND!=H5Tget_class(type)) return FALSE; + if(H5T_COMPOUND != H5Tget_class(type)) + return FALSE; + nmembs = H5Tget_nmembers(type); + if(nmembs <= 0) + return FALSE; + h5tools_str_append(buffer, "struct {"); - nmembs=H5Tget_nmembers(type); - for (i=0; i0); + if(nmembs < 0) + return FALSE; + super = H5Tget_super(type); h5tools_str_append(buffer, "enum "); - print_type(buffer, super, ind+4); + print_type(buffer, super, ind + 4); h5tools_str_append(buffer, " {"); - /* Determine what data type to use for the native values. To simplify - * things we entertain three possibilities: - * 1. long long -- the largest native signed integer - * 2. unsigned long long -- the largest native unsigned integer - * 3. raw format */ - if (H5Tget_size(type)<=sizeof(long long)) { - dst_size = sizeof(long long); - if (H5T_SGN_NONE==H5Tget_sign(type)) { - native = H5T_NATIVE_ULLONG; - } else { - native = H5T_NATIVE_LLONG; + if(nmembs > 0) { + char **name; /* member names */ + unsigned char *value; /* value array */ + hid_t native = -1; /* native integer data type */ + size_t dst_size; /* destination value type size */ + unsigned i; /* miscellaneous counters */ + + /* Determine what data type to use for the native values. To simplify + * things we entertain three possibilities: + * 1. long long -- the largest native signed integer + * 2. unsigned long long -- the largest native unsigned integer + * 3. raw format */ + if(H5Tget_size(type) <= sizeof(long long)) { + dst_size = sizeof(long long); + if(H5T_SGN_NONE == H5Tget_sign(type)) + native = H5T_NATIVE_ULLONG; + else + native = H5T_NATIVE_LLONG; + } /* end if */ + else + dst_size = H5Tget_size(type); + + /* Get the names and raw values of all members */ + name = (char **)HDcalloc((size_t)nmembs, sizeof(char *)); + value = (unsigned char *)HDcalloc((size_t)nmembs, MAX(H5Tget_size(type), dst_size)); + for(i = 0; i < (unsigned)nmembs; i++) { + name[i] = H5Tget_member_name(type, i); + H5Tget_member_value(type, i, value + i * H5Tget_size(type)); } - } else { - dst_size = H5Tget_size(type); - } - - /* Get the names and raw values of all members */ - name = HDcalloc(nmembs, sizeof(char*)); - value = (unsigned char *)HDcalloc(nmembs, MAX(H5Tget_size(type), dst_size)); - for (i=0; i0) H5Tconvert(super, native, nmembs, value, NULL, H5P_DEFAULT); + /* Convert values to native data type */ + if(native > 0) + if(H5Tconvert(super, native, (size_t)nmembs, value, NULL, H5P_DEFAULT) < 0) { + /* Release resources */ + for(i = 0; i < (unsigned)nmembs; i++) + HDfree(name[i]); + HDfree(name); + HDfree(value); - /* Sort members by increasing value */ - /*not implemented yet*/ - - /* Print members */ - for (i=0; i", ind+4, ""); + + h5tools_str_append(buffer, "\n%*s}", ind, ""); - /* Release resources */ - for (i=0; i", ind+4, ""); - h5tools_str_append(buffer, "\n%*s}", ind, ""); return TRUE; } @@ -1189,10 +1210,11 @@ print_array_type(h5tools_str_t *buffer, hid_t type, int ind) int ndims, i; hsize_t *dims=NULL; - if (H5T_ARRAY!=H5Tget_class(type)) return FALSE; + if (H5T_ARRAY!=H5Tget_class(type)) + return FALSE; ndims = H5Tget_array_ndims(type); if (ndims) { - dims = (hsize_t *)HDmalloc(ndims*sizeof(dims[0])); + dims = (hsize_t *)HDmalloc((unsigned)ndims * sizeof(dims[0])); H5Tget_array_dims2(type, dims); /* Print dimensions */ @@ -1202,9 +1224,8 @@ print_array_type(h5tools_str_t *buffer, hid_t type, int ind) HDfree(dims); } - else { + else h5tools_str_append(buffer, " [SCALAR]\n", rawoutstream); - } /* Print parent type */ @@ -1390,7 +1411,7 @@ dump_dataset_values(hid_t dset) outputformat.line_per_line = 1; } else { - outputformat.line_ncols = width_g; + outputformat.line_ncols = (unsigned)width_g; } if (label_g) outputformat.cmpd_name = "%s="; outputformat.line_pre = " %s "; @@ -1412,9 +1433,9 @@ dump_dataset_values(hid_t dset) } outputformat.arr_linebreak = 0; /* Floating point types should display full precision */ - sprintf(fmt_float, "%%1.%dg", FLT_DIG); + HDsnprintf(fmt_float, sizeof(fmt_float), "%%1.%dg", FLT_DIG); outputformat.fmt_float = fmt_float; - sprintf(fmt_double, "%%1.%dg", DBL_DIG); + HDsnprintf(fmt_double, sizeof(fmt_double), "%%1.%dg", DBL_DIG); outputformat.fmt_double = fmt_double; if (hexdump_g) { @@ -1428,8 +1449,7 @@ dump_dataset_values(hid_t dset) outputformat.ascii = TRUE; outputformat.elmt_suf1 = ""; outputformat.elmt_suf2 = ""; - strcpy(string_prefix, outputformat.line_pre); - strcat(string_prefix, "\""); + HDsnprintf(string_prefix, sizeof(string_prefix), "%s\"", outputformat.line_pre); outputformat.line_pre = string_prefix; outputformat.line_suf = "\""; } @@ -1487,7 +1507,6 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, size_t need; int ndims; int i; - int n; void *buf; H5S_class_t space_type; hsize_t curr_pos = 0; /* total data element position */ @@ -1502,7 +1521,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, h5tools_str_reset(&buffer); h5tools_str_append(&buffer, " Attribute: "); - n = print_string(&buffer, attr_name, TRUE); + print_string(&buffer, attr_name, TRUE); if((attr = H5Aopen(obj, attr_name, H5P_DEFAULT))) { space = H5Aget_space(attr); @@ -1535,6 +1554,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); break; + case H5S_NO_CLASS: default: /* Unknown dataspace type */ h5tools_str_append(&buffer, " unknown\n"); @@ -1570,7 +1590,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, outputformat.str_repeat = 8; } - outputformat.line_ncols = width_g; + outputformat.line_ncols = (unsigned)width_g; if(label_g) outputformat.cmpd_name = "%s="; if(string_g && 1==H5Tget_size(type) && @@ -1777,7 +1797,7 @@ dataset_list2(hid_t dset, const char UNUSED *name) } /* Print total raw storage size */ - total = H5Sget_simple_extent_npoints(space) * H5Tget_size(type); + total = (hsize_t)H5Sget_simple_extent_npoints(space) * H5Tget_size(type); used = H5Dget_storage_size(dset); tclass = H5Tget_class(type); h5tools_str_append(&buffer, " %-10s ", "Storage:"); @@ -1795,13 +1815,24 @@ dataset_list2(hid_t dset, const char UNUSED *name) } break; + case H5T_NO_CLASS: + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_COMPOUND: + case H5T_ENUM: + case H5T_ARRAY: + case H5T_NCLASSES: default: h5tools_str_append(&buffer, HSIZE_T_FORMAT" logical byte%s, "HSIZE_T_FORMAT" allocated byte%s", total, 1==total?"":"s", used, 1==used?"":"s"); if (used>0) { - utilization = (total*100.0)/used; + utilization = ((double)total * (double)100.0f) / (double)used; h5tools_str_append(&buffer, ", %1.2f%% utilization", utilization); } } @@ -1811,7 +1842,8 @@ dataset_list2(hid_t dset, const char UNUSED *name) /* Print information about external strorage */ if((nf = H5Pget_external_count(dcpl)) > 0) { for(i = 0, max_len = 0; i < nf; i++) { - H5Pget_external(dcpl, (unsigned)i, sizeof(f_name), f_name, NULL, NULL); + if(H5Pget_external(dcpl, (unsigned)i, sizeof(f_name), f_name, NULL, NULL) < 0) + continue; n = print_string(NULL, f_name, TRUE); max_len = MAX(max_len, n); } /* end for */ @@ -1857,7 +1889,7 @@ dataset_list2(hid_t dset, const char UNUSED *name) filt_id = H5Pget_filter2(dcpl, (unsigned)i, &filt_flags, &cd_nelmts, cd_values, sizeof(f_name), f_name, NULL); f_name[sizeof(f_name) - 1] = '\0'; - sprintf(s, "Filter-%d:", i); + HDsnprintf(s, sizeof(s), "Filter-%d:", i); h5tools_str_append(&buffer, " %-10s %s-%u %s {", s, (f_name[0] ? f_name : "method"), (unsigned)filt_id, @@ -2054,7 +2086,7 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void if (cmt_bufsize > 0) { comment = (char *)HDmalloc((size_t)cmt_bufsize + 1); /* new_size including null terminator */ if(comment) { - cmt_bufsize = H5Oget_comment(obj, comment, cmt_bufsize); + cmt_bufsize = H5Oget_comment(obj, comment, (size_t)cmt_bufsize); if(cmt_bufsize > 0) { comment[cmt_bufsize] = 0; h5tools_str_reset(&buffer); @@ -2267,6 +2299,9 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) } break; + case H5L_TYPE_ERROR: + case H5L_TYPE_HARD: + case H5L_TYPE_MAX: default: h5tools_str_append(&buffer, "UD Link {cannot follow UD links}\n"); h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); @@ -2457,7 +2492,7 @@ get_width(void) static hbool_t is_valid_args(void) { - herr_t ret = TRUE; + hbool_t ret = TRUE; if(recursive_g && grp_literal_g) { diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 2b4fa29..1752155 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -241,7 +241,6 @@ static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options struct exclude_path_list * exclude_path_ptr; int ret_cmp; int ret = 0; - int len_grp; /* check if exclude path option is given */ if (!options->exclude_path) @@ -260,6 +259,8 @@ static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options HDstrlen(exclude_path_ptr->obj_path)); if (ret_cmp == 0) /* found matching members */ { + size_t len_grp; + /* check if given path belong to an excluding group, if so * exclude it as well. * This verifies if “/grp1/dset1” is only under “/grp1”, but @@ -338,7 +339,6 @@ static void free_exclude_path_list(diff_opt_t *options) *------------------------------------------------------------------------*/ static void build_match_list (const char *objname1, trav_info_t *info1, const char *objname2, trav_info_t *info2, trav_table_t ** table_out, diff_opt_t *options) { - unsigned i; size_t curr1 = 0; size_t curr2 = 0; unsigned infile[2]; @@ -346,8 +346,8 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch char * path2_lp; h5trav_type_t type1_l; h5trav_type_t type2_l; - int path1_offset = 0; - int path2_offset = 0; + size_t path1_offset = 0; + size_t path2_offset = 0; int cmp; trav_table_t *table; size_t idx; @@ -616,8 +616,8 @@ hsize_t h5diff(const char *fname1, int i; int l_ret1 = -1; int l_ret2 = -1; - const char * obj1fullname = NULL; - const char * obj2fullname = NULL; + char * obj1fullname = NULL; + char * obj2fullname = NULL; int both_objs_grp = 0; /* init to group type */ h5trav_type_t obj1type = H5TRAV_TYPE_GROUP; @@ -701,26 +701,26 @@ hsize_t h5diff(const char *fname1, /* make the given object1 fullpath, start with "/" */ if (HDstrncmp(objname1, "/", 1)) { - HDstrcpy((char *)obj1fullname, "/"); - HDstrcat((char *)obj1fullname, objname1); + HDstrcpy(obj1fullname, "/"); + HDstrcat(obj1fullname, objname1); } else - HDstrcpy((char *)obj1fullname, objname1); + HDstrcpy(obj1fullname, objname1); /* make the given object2 fullpath, start with "/" */ if (HDstrncmp(objname2, "/", 1)) { - HDstrcpy((char *)obj2fullname, "/"); - HDstrcat((char *)obj2fullname, objname2); + HDstrcpy(obj2fullname, "/"); + HDstrcat(obj2fullname, objname2); } else - HDstrcpy((char *)obj2fullname, objname2); + HDstrcpy(obj2fullname, objname2); /*---------------------------------------------------------- * check if obj1 is root, group, single object or symlink */ h5difftrace("h5diff check if obj1 is root, group, single object or symlink\n"); - if(!HDstrcmp((char *)obj1fullname, "/")) + if(!HDstrcmp(obj1fullname, "/")) { obj1type = H5TRAV_TYPE_GROUP; } @@ -840,10 +840,10 @@ hsize_t h5diff(const char *fname1, h5difftrace("h5diff no object specified\n"); /* set root group */ obj1fullname = (char*)HDcalloc(2, sizeof(char)); - HDstrcat((char *)obj1fullname, "/"); + HDstrcat(obj1fullname, "/"); obj1type = H5TRAV_TYPE_GROUP; obj2fullname = (char*)HDcalloc(2, sizeof(char)); - HDstrcat((char *)obj2fullname, "/"); + HDstrcat(obj2fullname, "/"); obj2type = H5TRAV_TYPE_GROUP; } @@ -1078,9 +1078,9 @@ out: /* free buffers */ if (obj1fullname) - HDfree((char *)obj1fullname); + HDfree(obj1fullname); if (obj2fullname) - HDfree((char *)obj2fullname); + HDfree(obj2fullname); /* free link info buffer */ if (trg_linfo1.trg_path) diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 2530805..9e1c8bb 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -196,210 +196,5 @@ int print_objname(diff_opt_t *options, hsize_t nfound); void do_print_objname (const char *OBJ, const char *path1, const char *path2, diff_opt_t * opts); void do_print_attrname (const char *attr, const char *path1, const char *path2); - -/*------------------------------------------------------------------------- - * XCAO, 11/10/2010 - * added to improve performance for compound datasets - */ -typedef struct mcomp_t -{ - int n; /* number of members */ - hid_t *ids; /* member type id */ - unsigned char *flags; - size_t *offsets; - struct mcomp_t **m; /* members */ -}mcomp_t; - -hsize_t diff_datum(void *_mem1, - void *_mem2, - hid_t m_type, - hsize_t i, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - hid_t container1_id, - hid_t container2_id, /*where the reference came from*/ - int *ph, /*print header */ - mcomp_t *members); /*compound members */ - - - -hsize_t diff_float(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -hsize_t diff_double(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -#if H5_SIZEOF_LONG_DOUBLE !=0 - -hsize_t diff_ldouble(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -#endif - -hsize_t diff_schar(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -hsize_t diff_uchar(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -hsize_t diff_short(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -hsize_t diff_ushort(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -hsize_t diff_int(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -hsize_t diff_uint(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -hsize_t diff_long(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -hsize_t diff_ulong(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -hsize_t diff_llong(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - -hsize_t diff_ullong(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - #endif /* H5DIFF_H__ */ diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 1e7f88b..878f459 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -36,7 +36,6 @@ #endif #define I_FORMAT "%-15d %-15d %-15d\n" -#define C_FORMAT "%-16c %-17c\n" #define S_FORMAT "%-16s %-17s\n" #define UI_FORMAT "%-15u %-15u %-15u\n" #define LI_FORMAT "%-15ld %-15ld %-15ld\n" @@ -101,43 +100,44 @@ *------------------------------------------------------------------------- */ -static int not_comparable; +static hbool_t not_comparable; -#define PER(A,B) { per=-1; \ - not_comparable=0; \ - both_zero=0; \ - if (A==0 && B==0) \ - both_zero=1; \ - if (A!=0) \ - per = (double)ABS( ( double)(B-A) / (double)A ); \ +#define PER(A,B) { \ + per = -1; \ + not_comparable = FALSE; \ + both_zero = FALSE; \ + if(FP_ZERO == fpclassify(A) && FP_ZERO == fpclassify(B)) \ + both_zero = TRUE; \ + if(FP_ZERO != fpclassify(A)) \ + per = (double)ABS((double)(B - A) / (double)A); \ else \ - not_comparable=1; \ + not_comparable = TRUE; \ } -#define PER_UNSIGN(TYPE,A,B) { per=-1; \ - not_comparable=0; \ - both_zero=0; \ - if (A==0 && B==0) \ - both_zero=1; \ - if (A!=0) \ - per = ABS((double)((TYPE)(B-A)) / (double)A) ; \ +#define PER_UNSIGN(TYPE,A,B) { \ + per = -1; \ + not_comparable = FALSE; \ + both_zero = FALSE; \ + if(A == 0 && B == 0) \ + both_zero = TRUE; \ + if(A != 0) \ + per = ABS((double)((TYPE)(B - A)) / (double)A) ; \ else \ - not_comparable=1; \ + not_comparable = TRUE; \ } -#define BOTH_ZERO(A,B) { both_zero=0; \ - if (A==0 && B==0) \ - both_zero=1; \ -} +# define PDIFF(a,b) ( (b>a) ? (b-a) : (a-b)) -#define IS_ZERO(A) { is_zero=0; \ - if (A==0) \ - is_zero=1; \ -} +typedef struct mcomp_t +{ + unsigned n; /* number of members */ + hid_t *ids; /* member type id */ + size_t *offsets; + struct mcomp_t **m; /* members */ +}mcomp_t; -# define PDIFF(a,b) ( (b>a) ? (b-a) : (a-b)) /*------------------------------------------------------------------------- * local prototypes @@ -146,7 +146,7 @@ static int not_comparable; static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id,hid_t region1_id, hid_t region2_id, diff_opt_t *options); static hbool_t all_zero(const void *_mem, size_t size); static int ull2float(unsigned long long ull_value, float *f_value); -static hsize_t character_compare(unsigned char *mem1,unsigned char *mem2,hsize_t i,unsigned u,int rank,hsize_t *dims,hsize_t *acc,hsize_t *pos,diff_opt_t *options,const char *obj1,const char *obj2,int *ph); +static hsize_t character_compare(char *mem1,char *mem2,hsize_t i,unsigned u,int rank,hsize_t *dims,hsize_t *acc,hsize_t *pos,diff_opt_t *options,const char *obj1,const char *obj2,int *ph); static hsize_t character_compare_opt(unsigned char *mem1,unsigned char *mem2,hsize_t i,int rank,hsize_t *dims,hsize_t *acc,hsize_t *pos,diff_opt_t *options,const char *obj1,const char *obj2,int *ph); static hbool_t equal_float(float value, float expected, diff_opt_t *options); static hbool_t equal_double(double value, double expected, diff_opt_t *options); @@ -157,6 +157,179 @@ static int print_data(diff_opt_t *options); static void print_pos(int *ph,int pp,hsize_t curr_pos,hsize_t *acc,hsize_t *pos,int rank,hsize_t *dims,const char *obj1,const char *obj2 ); static void print_char_pos(int *ph,int pp,hsize_t curr_pos,unsigned u,hsize_t *acc,hsize_t *pos,int rank,hsize_t *dims,const char *obj1,const char *obj2 ); static void h5diff_print_char(char ch); +static hsize_t diff_datum(void *_mem1, + void *_mem2, + hid_t m_type, + hsize_t i, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + hid_t container1_id, + hid_t container2_id, /*where the reference came from*/ + int *ph, /*print header */ + mcomp_t *members); /*compound members */ +static hsize_t diff_float(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); +static hsize_t diff_double(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); +#if H5_SIZEOF_LONG_DOUBLE !=0 +static hsize_t diff_ldouble(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); +#endif +static hsize_t diff_schar(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); +static hsize_t diff_uchar(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); +static hsize_t diff_short(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); +static hsize_t diff_ushort(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); +static hsize_t diff_int(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); +static hsize_t diff_uint(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); +static hsize_t diff_long(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); +static hsize_t diff_ulong(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); +static hsize_t diff_llong(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); +static hsize_t diff_ullong(unsigned char *mem1, + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); /*------------------------------------------------------------------------- @@ -180,7 +353,7 @@ typedef enum dtype_t } dtype_t; #endif -static int my_isnan(dtype_t type, void *val); +static hbool_t my_isnan(dtype_t type, void *val); /*------------------------------------------------------------------------- * XCAO, 11/10/2010 @@ -260,6 +433,9 @@ hsize_t diff_array( void *_mem1, switch (type_class) { + case H5T_NO_CLASS: + case H5T_TIME: + case H5T_NCLASSES: default: HDassert(0); break; @@ -387,21 +563,21 @@ hsize_t diff_array( void *_mem1, * Dereference the object and compare the type (basic object type). *------------------------------------------------------------------------- */ -hsize_t diff_datum(void *_mem1, - void *_mem2, - hid_t m_type, - hsize_t i, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - hid_t container1_id, - hid_t container2_id, /*where the reference came from*/ - int *ph, /*print header */ - mcomp_t *members) /*compound members */ +static hsize_t diff_datum(void *_mem1, + void *_mem2, + hid_t m_type, + hsize_t i, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + hid_t container1_id, + hid_t container2_id, /*where the reference came from*/ + int *ph, /*print header */ + mcomp_t *members) /*compound members */ { unsigned char *mem1 = (unsigned char*)_mem1; unsigned char *mem2 = (unsigned char*)_mem2; @@ -411,19 +587,19 @@ hsize_t diff_datum(void *_mem1, H5T_sign_t type_sign; H5T_class_t type_class; size_t offset; - int nmembs; - int j; + unsigned nmembs; + unsigned j; hsize_t nelmts; size_t size=0; - int iszero1; - int iszero2; + hbool_t iszero1; + hbool_t iszero2; hid_t obj1_id; hid_t obj2_id; hsize_t nfound=0; /* differences found */ int ret=0; /* check return error */ float f1, f2; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_datum start\n"); type_size = H5Tget_size( m_type ); @@ -442,10 +618,10 @@ hsize_t diff_datum(void *_mem1, switch (H5Tget_class(m_type)) { - default: - HDassert(0); - break; + case H5T_NO_CLASS: case H5T_TIME: + case H5T_NCLASSES: + default: HDassert(0); break; @@ -464,8 +640,8 @@ hsize_t diff_datum(void *_mem1, memb_type = members->ids[j]; nfound+=diff_datum( - mem1+offset, - mem2+offset, + mem1 + offset, + mem2 + offset, memb_type, i, rank, @@ -508,10 +684,10 @@ hsize_t diff_datum(void *_mem1, else { /* Get pointer to first string */ - s1 = mem1; + s1 = (char *)mem1; size1 = H5Tget_size(m_type); /* Get pointer to second string */ - s2 = mem2; + s2 = (char *)mem2; size2 = H5Tget_size(m_type); } @@ -634,11 +810,11 @@ hsize_t diff_datum(void *_mem1, */ err1 = H5Tenum_nameof(m_type, mem1, enum_name1, sizeof enum_name1); if(err1 < 0) - strcpy(enum_name1, "**INVALID VALUE**"); + HDsnprintf(enum_name1, sizeof(enum_name1), "**INVALID VALUE**"); err2 = H5Tenum_nameof(m_type, mem2, enum_name2, sizeof enum_name2); if(err2 < 0) - strcpy(enum_name2, "**INVALID VALUE**"); + HDsnprintf(enum_name2, sizeof(enum_name2), "**INVALID VALUE**"); if(err1 < 0 || err2 < 0) { @@ -702,7 +878,8 @@ hsize_t diff_datum(void *_mem1, { hsize_t adims[H5S_MAX_RANK]; - hsize_t ndims; + int ndims; + /* get the array's base datatype for each element */ memb_type = H5Tget_super(m_type); size = H5Tget_size(memb_type); @@ -711,7 +888,7 @@ hsize_t diff_datum(void *_mem1, HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK); /* calculate the number of array elements */ - for (u = 0, nelmts = 1; u len; - for (j = 0; j < (int)nelmts; j++) - nfound+=diff_datum( - ((char *)(((hvl_t *)mem1)->p)) + j * size, - ((char *)(((hvl_t *)mem2)->p)) + j * size, /* offset */ - memb_type, - i, /* index position */ - rank, - dims, - acc, - pos, - options, - obj1, - obj2, - container1_id, - container2_id, - ph, members); + for (j = 0; j < nelmts; j++) + nfound += diff_datum( + ((char *)(((hvl_t *)mem1)->p)) + j * size, + ((char *)(((hvl_t *)mem2)->p)) + j * size, /* offset */ + memb_type, + i, /* index position */ + rank, + dims, + acc, + pos, + options, + obj1, + obj2, + container1_id, + container2_id, + ph, members); H5Tclose(memb_type); @@ -1421,7 +1598,7 @@ hsize_t diff_datum(void *_mem1, { print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); + parallel_print(UI_FORMAT_P_NOTCOMP,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); } nfound++; } @@ -1434,7 +1611,7 @@ hsize_t diff_datum(void *_mem1, { print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint),per); + parallel_print(UI_FORMAT_P,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint),per); } nfound++; } @@ -1450,7 +1627,7 @@ hsize_t diff_datum(void *_mem1, { print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); + parallel_print(UI_FORMAT_P_NOTCOMP,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); } nfound++; } @@ -1463,7 +1640,7 @@ hsize_t diff_datum(void *_mem1, { print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint),per); + parallel_print(UI_FORMAT_P,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint),per); } nfound++; } @@ -1904,8 +2081,8 @@ hsize_t diff_datum(void *_mem1, { float temp1_float; float temp2_float; - int isnan1=0; - int isnan2=0; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; HDassert(type_size==sizeof(float)); @@ -1933,29 +2110,29 @@ hsize_t diff_datum(void *_mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { - if (ABS(temp1_float-temp2_float) > options->delta) + if (ABS(temp1_float-temp2_float) > (float)options->delta) { if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT,(double)temp1_float,(double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; } } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; @@ -1979,7 +2156,7 @@ hsize_t diff_datum(void *_mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_float,temp2_float); @@ -1990,35 +2167,35 @@ hsize_t diff_datum(void *_mem1, { print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; } else - if ( per > options->percent && ABS(temp1_float-temp2_float) > options->delta ) + if ( per > options->percent && (double)ABS(temp1_float-temp2_float) > options->delta ) { if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_float,temp2_float, - ABS(temp1_float-temp2_float), - ABS(1-temp2_float/temp1_float)); + parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float), + (double)ABS(1 - temp2_float / temp1_float)); } nfound++; } } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; @@ -2044,7 +2221,7 @@ hsize_t diff_datum(void *_mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_float,temp2_float); @@ -2055,8 +2232,8 @@ hsize_t diff_datum(void *_mem1, { print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_float,temp2_float, - ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float)); } nfound++; } @@ -2069,22 +2246,22 @@ hsize_t diff_datum(void *_mem1, { print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_float,temp2_float, - ABS(temp1_float-temp2_float), - ABS(1-temp2_float/temp1_float)); + parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float), + (double)ABS(1 - temp2_float / temp1_float)); } nfound++; } } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; @@ -2102,7 +2279,7 @@ hsize_t diff_datum(void *_mem1, { print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; } @@ -2117,8 +2294,8 @@ hsize_t diff_datum(void *_mem1, { double temp1_double; double temp2_double; - int isnan1=0; - int isnan2=0; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; HDassert(type_size==sizeof(double)); @@ -2144,7 +2321,7 @@ hsize_t diff_datum(void *_mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { if (ABS(temp1_double-temp2_double) > options->delta) @@ -2160,7 +2337,7 @@ hsize_t diff_datum(void *_mem1, } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -2191,7 +2368,7 @@ hsize_t diff_datum(void *_mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_double,temp2_double); @@ -2225,7 +2402,7 @@ hsize_t diff_datum(void *_mem1, } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -2256,7 +2433,7 @@ hsize_t diff_datum(void *_mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_double,temp2_double); @@ -2291,7 +2468,7 @@ hsize_t diff_datum(void *_mem1, } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -2331,8 +2508,8 @@ hsize_t diff_datum(void *_mem1, { long double temp1_double; long double temp2_double; - int isnan1=0; - int isnan2=0; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; HDassert(type_size==sizeof(long double)); @@ -2360,7 +2537,7 @@ hsize_t diff_datum(void *_mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { if (ABS(temp1_double-temp2_double) > options->delta) @@ -2375,7 +2552,7 @@ hsize_t diff_datum(void *_mem1, } } /* NaN */ /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -2405,7 +2582,7 @@ hsize_t diff_datum(void *_mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_double,temp2_double); @@ -2439,7 +2616,7 @@ hsize_t diff_datum(void *_mem1, } /* NaN */ /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -2469,7 +2646,7 @@ hsize_t diff_datum(void *_mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_double,temp2_double); @@ -2504,7 +2681,7 @@ hsize_t diff_datum(void *_mem1, } /* NaN */ /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -2671,14 +2848,15 @@ hsize_t diff_region(hid_t obj1_id, *------------------------------------------------------------------------- */ if(nblocks1 > 0) { - alloc_size = nblocks1 * ndims1 * 2 * sizeof(ptdata1[0]); + HDassert(ndims1 > 0); + alloc_size = (hsize_t)nblocks1 * (unsigned)ndims1 * 2 * sizeof(ptdata1[0]); HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - ptdata1 = HDmalloc((size_t)alloc_size); + ptdata1 = (hsize_t *)HDmalloc((size_t)alloc_size); H5_CHECK_OVERFLOW(nblocks1, hssize_t, hsize_t); H5Sget_select_hyper_blocklist(region1_id, (hsize_t)0, (hsize_t)nblocks1, ptdata1); - ptdata2 = HDmalloc((size_t)alloc_size); + ptdata2 = (hsize_t *)HDmalloc((size_t)alloc_size); H5_CHECK_OVERFLOW(nblocks2, hssize_t, hsize_t); H5Sget_select_hyper_blocklist(region2_id, (hsize_t)0, (hsize_t)nblocks2, ptdata2); @@ -2726,14 +2904,14 @@ hsize_t diff_region(hid_t obj1_id, *------------------------------------------------------------------------- */ if(npoints1 > 0) { - alloc_size = npoints1 * ndims1 * sizeof(ptdata1[0]); + alloc_size = (hsize_t)npoints1 * (unsigned)ndims1 * sizeof(ptdata1[0]); HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - ptdata1 = HDmalloc((size_t)alloc_size); + ptdata1 = (hsize_t *)HDmalloc((size_t)alloc_size); H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t); H5Sget_select_elem_pointlist(region1_id, (hsize_t)0, (hsize_t)npoints1, ptdata1); - ptdata2 = HDmalloc((size_t)alloc_size); + ptdata2 = (hsize_t *)HDmalloc((size_t)alloc_size); H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t); H5Sget_select_elem_pointlist(region2_id, (hsize_t)0, (hsize_t)npoints2, ptdata2); @@ -2790,8 +2968,8 @@ hsize_t diff_region(hid_t obj1_id, HDfree(ptdata2); } - nfound_b = nfound_b/ndims1; - nfound_p = nfound_p/ndims1; + nfound_b = nfound_b / (unsigned)ndims1; + nfound_p = nfound_p / (unsigned)ndims1; return (nfound_p + nfound_b); } @@ -2807,8 +2985,8 @@ hsize_t diff_region(hid_t obj1_id, */ static -hsize_t character_compare(unsigned char *mem1, - unsigned char *mem2, +hsize_t character_compare(char *mem1, + char *mem2, hsize_t i, unsigned u, int rank, @@ -2821,8 +2999,8 @@ hsize_t character_compare(unsigned char *mem1, int *ph) { hsize_t nfound=0; /* differences found */ - unsigned char temp1_uchar; - unsigned char temp2_uchar; + char temp1_uchar; + char temp2_uchar; HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); @@ -2857,7 +3035,7 @@ hsize_t character_compare(unsigned char *mem1, *------------------------------------------------------------------------- */ -hsize_t character_compare_opt(unsigned char *mem1, +static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, hsize_t i, int rank, @@ -2873,7 +3051,7 @@ hsize_t character_compare_opt(unsigned char *mem1, unsigned char temp1_uchar; unsigned char temp2_uchar; double per; - int both_zero; + hbool_t both_zero; HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); @@ -2950,7 +3128,7 @@ hsize_t character_compare_opt(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_float(unsigned char *mem1, +static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -2969,9 +3147,9 @@ hsize_t diff_float(unsigned char *mem1, float temp2_float; hsize_t i; double per; - int both_zero; - int isnan1=0; - int isnan2=0; + hbool_t both_zero; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; h5difftrace("diff_float start\n"); @@ -2998,27 +3176,27 @@ hsize_t diff_float(unsigned char *mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { - if (ABS(temp1_float-temp2_float) > options->delta) + if ((double)ABS(temp1_float-temp2_float) > options->delta) { if ( print_data(options) ) { print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; } } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; @@ -3051,7 +3229,7 @@ hsize_t diff_float(unsigned char *mem1, isnan2 = my_isnan(FLT_FLOAT,&temp2_float); } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( (!isnan1 && !isnan2)) { PER(temp1_float,temp2_float); @@ -3062,8 +3240,8 @@ hsize_t diff_float(unsigned char *mem1, { print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_float,temp2_float, - ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float)); } nfound++; } @@ -3076,21 +3254,21 @@ hsize_t diff_float(unsigned char *mem1, { print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_float,temp2_float, - ABS(temp1_float-temp2_float), - ABS(1-temp2_float/temp1_float)); + parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float), + (double)ABS(1 - temp2_float / temp1_float)); } nfound++; } } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; @@ -3125,7 +3303,7 @@ hsize_t diff_float(unsigned char *mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_float,temp2_float); @@ -3136,36 +3314,36 @@ hsize_t diff_float(unsigned char *mem1, { print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_float,temp2_float, - ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float)); } nfound++; } else - if ( per > options->percent && ABS(temp1_float-temp2_float) > options->delta ) + if ( per > options->percent && (double)ABS(temp1_float - temp2_float) > options->delta ) { if ( print_data(options) ) { print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_float,temp2_float, - ABS(temp1_float-temp2_float), - ABS(1-temp2_float/temp1_float)); + parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float), + (double)ABS(1 - temp2_float / temp1_float)); } nfound++; } } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; @@ -3194,7 +3372,7 @@ hsize_t diff_float(unsigned char *mem1, { print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_float,temp2_float,ABS(temp1_float-temp2_float)); + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; } @@ -3226,7 +3404,7 @@ hsize_t diff_float(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_double(unsigned char *mem1, +static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -3245,9 +3423,9 @@ hsize_t diff_double(unsigned char *mem1, double temp2_double; hsize_t i; double per; - int both_zero; - int isnan1=0; - int isnan2=0; + hbool_t both_zero; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; h5difftrace("diff_double start\n"); /*------------------------------------------------------------------------- @@ -3273,7 +3451,7 @@ hsize_t diff_double(unsigned char *mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { if (ABS(temp1_double-temp2_double) > options->delta) { @@ -3287,7 +3465,7 @@ hsize_t diff_double(unsigned char *mem1, } } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -3326,7 +3504,7 @@ hsize_t diff_double(unsigned char *mem1, isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_double,temp2_double); @@ -3359,7 +3537,7 @@ hsize_t diff_double(unsigned char *mem1, } } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -3400,7 +3578,7 @@ hsize_t diff_double(unsigned char *mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_double,temp2_double); @@ -3434,7 +3612,7 @@ hsize_t diff_double(unsigned char *mem1, } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -3510,7 +3688,7 @@ hsize_t diff_double(unsigned char *mem1, */ #if H5_SIZEOF_LONG_DOUBLE !=0 -hsize_t diff_ldouble(unsigned char *mem1, +static hsize_t diff_ldouble(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -3529,9 +3707,9 @@ hsize_t diff_ldouble(unsigned char *mem1, long double temp2_double; hsize_t i; double per; - int both_zero; - int isnan1=0; - int isnan2=0; + hbool_t both_zero; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; h5difftrace("diff_ldouble start\n"); @@ -3558,7 +3736,7 @@ hsize_t diff_ldouble(unsigned char *mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { if (ABS(temp1_double-temp2_double) > options->delta) { @@ -3572,7 +3750,7 @@ hsize_t diff_ldouble(unsigned char *mem1, } } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -3611,7 +3789,7 @@ hsize_t diff_ldouble(unsigned char *mem1, isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_double,temp2_double); @@ -3644,7 +3822,7 @@ hsize_t diff_ldouble(unsigned char *mem1, } } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -3685,7 +3863,7 @@ hsize_t diff_ldouble(unsigned char *mem1, } /* both not NaN, do the comparison */ - if ( isnan1==0 && isnan2==0) + if ( !isnan1 && !isnan2) { PER(temp1_double,temp2_double); @@ -3719,7 +3897,7 @@ hsize_t diff_ldouble(unsigned char *mem1, } /* only one is NaN, assume difference */ - else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { if ( print_data(options) ) { @@ -3795,7 +3973,7 @@ hsize_t diff_ldouble(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_schar(unsigned char *mem1, +static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -3814,7 +3992,7 @@ hsize_t diff_schar(unsigned char *mem1, char temp2_char; hsize_t i; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_schar start\n"); @@ -3974,7 +4152,7 @@ hsize_t diff_schar(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_uchar(unsigned char *mem1, +static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -3993,7 +4171,7 @@ hsize_t diff_uchar(unsigned char *mem1, unsigned char temp2_uchar; hsize_t i; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_uchar start\n"); @@ -4152,7 +4330,7 @@ hsize_t diff_uchar(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_short(unsigned char *mem1, +static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -4171,7 +4349,7 @@ hsize_t diff_short(unsigned char *mem1, short temp2_short; hsize_t i; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_short start\n"); /* -d and !-p */ @@ -4332,7 +4510,7 @@ hsize_t diff_short(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_ushort(unsigned char *mem1, +static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -4351,7 +4529,7 @@ hsize_t diff_ushort(unsigned char *mem1, unsigned short temp2_ushort; hsize_t i; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_ushort start\n"); /* -d and !-p */ @@ -4513,7 +4691,7 @@ hsize_t diff_ushort(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_int(unsigned char *mem1, +static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -4532,7 +4710,7 @@ hsize_t diff_int(unsigned char *mem1, int temp2_int; hsize_t i; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_int start\n"); /* -d and !-p */ @@ -4694,7 +4872,7 @@ hsize_t diff_int(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_uint(unsigned char *mem1, +static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -4713,7 +4891,7 @@ hsize_t diff_uint(unsigned char *mem1, unsigned int temp2_uint; hsize_t i; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_uint start\n"); /* -d and !-p */ @@ -4873,7 +5051,7 @@ hsize_t diff_uint(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_long(unsigned char *mem1, +static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -4892,7 +5070,7 @@ hsize_t diff_long(unsigned char *mem1, long temp2_long; hsize_t i; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_long start\n"); /* -d and !-p */ @@ -5058,7 +5236,7 @@ hsize_t diff_long(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_ulong(unsigned char *mem1, +static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -5077,7 +5255,7 @@ hsize_t diff_ulong(unsigned char *mem1, unsigned long temp2_ulong; hsize_t i; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_ulong start\n"); @@ -5243,7 +5421,7 @@ hsize_t diff_ulong(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_llong(unsigned char *mem1, +static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -5262,7 +5440,7 @@ hsize_t diff_llong(unsigned char *mem1, long long temp2_llong; hsize_t i; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_llong start\n"); /* -d and !-p */ @@ -5418,7 +5596,7 @@ hsize_t diff_llong(unsigned char *mem1, * *------------------------------------------------------------------------- */ -hsize_t diff_ullong(unsigned char *mem1, +static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, @@ -5438,7 +5616,7 @@ hsize_t diff_ullong(unsigned char *mem1, hsize_t i; float f1, f2; double per; - int both_zero; + hbool_t both_zero; h5difftrace("diff_ullong start\n"); /* -d and !-p */ @@ -5665,8 +5843,8 @@ hbool_t equal_double(double value, double expected, diff_opt_t *options) * detect NaNs *------------------------------------------------------------------------- */ - int isnan1 = my_isnan(FLT_DOUBLE,&value); - int isnan2 = my_isnan(FLT_DOUBLE,&expected); + hbool_t isnan1 = my_isnan(FLT_DOUBLE,&value); + hbool_t isnan2 = my_isnan(FLT_DOUBLE,&expected); /*------------------------------------------------------------------------- * we consider NaN == NaN to be true @@ -5720,8 +5898,8 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio * detect NaNs *------------------------------------------------------------------------- */ - int isnan1 = my_isnan(FLT_LDOUBLE,&value); - int isnan2 = my_isnan(FLT_LDOUBLE,&expected); + hbool_t isnan1 = my_isnan(FLT_LDOUBLE,&value); + hbool_t isnan2 = my_isnan(FLT_LDOUBLE,&expected); /*------------------------------------------------------------------------- * we consider NaN == NaN to be true @@ -5779,8 +5957,8 @@ hbool_t equal_float(float value, float expected, diff_opt_t *options) * detect NaNs *------------------------------------------------------------------------- */ - int isnan1 = my_isnan(FLT_FLOAT,&value); - int isnan2 = my_isnan(FLT_FLOAT,&expected); + hbool_t isnan1 = my_isnan(FLT_FLOAT,&value); + hbool_t isnan2 = my_isnan(FLT_FLOAT,&expected); /*------------------------------------------------------------------------- * we consider NaN == NaN to be true @@ -5832,40 +6010,39 @@ hbool_t equal_float(float value, float expected, diff_opt_t *options) * *------------------------------------------------------------------------- */ -static int +static hbool_t my_isnan(dtype_t type, void *val) { - int retval = 0; + hbool_t retval = FALSE; char s[256]; h5difftrace("my_isnan start\n"); if (FLT_FLOAT==type) { float x; + HDmemcpy(&x, val, sizeof(float)); retval = (x!=x); - - - } else if (FLT_DOUBLE==type) { double x; + HDmemcpy(&x, val, sizeof(double)); retval = (x!=x); - -#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 } +#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 else if (FLT_LDOUBLE==type) { long double x; + HDmemcpy(&x, val, sizeof(long double)); retval = (x!=x); -#endif } +#endif else { - return 0; + return FALSE; } /* @@ -5877,44 +6054,39 @@ my_isnan(dtype_t type, void *val) if (FLT_FLOAT==type) { float x; - HDmemcpy(&x, val, sizeof(float)); - sprintf(s, "%g", x); - + HDmemcpy(&x, val, sizeof(float)); + HDsnprintf(s, sizeof(s), "%g", (double)x); } else if (FLT_DOUBLE==type) { double x; + HDmemcpy(&x, val, sizeof(double)); - sprintf(s, "%g", x); -#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 + HDsnprintf(s, sizeof(s), "%g", x); } +#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 else if (FLT_LDOUBLE==type) { long double x; + HDmemcpy(&x, val, sizeof(long double)); - sprintf(s, "%Lg", x); -#endif + HDsnprintf(s, sizeof(s), "%Lg", x); } +#endif else { - return 0; + return FALSE; } - if ( HDstrstr(s, "NaN") || HDstrstr(s, "NAN") || HDstrstr(s, "nan") || HDstrstr(s, "-1.#IND") /* WIN32 */ ) { - - retval = 1; + retval = TRUE; } - - - - } #ifdef H5_VMS @@ -5925,15 +6097,17 @@ my_isnan(dtype_t type, void *val) if (FLT_FLOAT==type) { float x; + HDmemcpy(&x, val, sizeof(float)); retval = (x==FLT_MAX || x==-FLT_MAX); } else if (FLT_DOUBLE==type) { double x; + HDmemcpy(&x, val, sizeof(double)); retval = (x==DBL_MAX || x==-DBL_MAX); } else { - return 0; + return FALSE; } } #endif /*H5_VMS*/ @@ -5943,9 +6117,6 @@ my_isnan(dtype_t type, void *val) } - - - /*------------------------------------------------------------------------- * * Local functions @@ -6164,8 +6335,8 @@ static void h5diff_print_char(char ch) */ static void get_member_types(hid_t tid, mcomp_t *members) { - int i; int tclass; + unsigned u; if (tid <=0 || !members) return; @@ -6179,23 +6350,24 @@ static void get_member_types(hid_t tid, mcomp_t *members) } else if (tclass == H5T_COMPOUND) { - members->n = H5Tget_nmembers( tid ); - if (members->n <=0) + int nmembs; + + nmembs = H5Tget_nmembers(tid); + if(nmembs <= 0) return; + members->n = (unsigned)nmembs; - members->ids = HDcalloc(members->n, sizeof(hid_t)); - members->flags = HDcalloc(members->n, sizeof(unsigned char)); - members->offsets = HDcalloc(members->n, sizeof(size_t)); - members->m = HDcalloc(members->n, sizeof(mcomp_t *)); + members->ids = (hid_t *)HDcalloc(members->n, sizeof(hid_t)); + members->offsets = (size_t *)HDcalloc(members->n, sizeof(size_t)); + members->m = (mcomp_t **)HDcalloc(members->n, sizeof(mcomp_t *)); - for (i=0; i< members->n; i++) + for(u = 0; u < members->n; u++) { - members->ids[i] = H5Tget_member_type( tid, i ); - members->flags[i] = H5Tis_variable_str( members->ids[i] ); - members->offsets[i] = H5Tget_member_offset( tid, i ); - members->m[i] = (mcomp_t *)HDmalloc(sizeof(mcomp_t)); - HDmemset(members->m[i], 0, sizeof(mcomp_t)); - get_member_types(members->ids[i], members->m[i]); + members->ids[u] = H5Tget_member_type( tid, u ); + members->offsets[u] = H5Tget_member_offset( tid, u ); + members->m[u] = (mcomp_t *)HDmalloc(sizeof(mcomp_t)); + HDmemset(members->m[u], 0, sizeof(mcomp_t)); + get_member_types(members->ids[u], members->m[u]); } } @@ -6211,24 +6383,23 @@ static void get_member_types(hid_t tid, mcomp_t *members) */ static void close_member_types(mcomp_t *members) { - int i; + unsigned u; if (!members || members->n<=0 || !members->ids) return; - for (i=0; in; i++) + for(u = 0; u < members->n; u++) { - if (members->m[i]) + if(members->m[u]) { - close_member_types(members->m[i]); - HDfree(members->m[i]); + close_member_types(members->m[u]); + HDfree(members->m[u]); } - H5Tclose(members->ids[i]); + H5Tclose(members->ids[u]); } - HDfree (members->m); - HDfree (members->ids); - HDfree (members->flags); - HDfree (members->offsets); + HDfree(members->m); + HDfree(members->ids); + HDfree(members->offsets); } diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 4899200..ef1d761 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -108,17 +108,17 @@ static void table_attrs_free( table_attrs_t *table ) *------------------------------------------------------------------------*/ static void table_attr_mark_exist(unsigned *exist, char *name, table_attrs_t *table) { - unsigned int new; + size_t new_val; if(table->nattrs == table->size) { table->size = MAX(1, table->size * 2); table->attrs = (match_attr_t *)HDrealloc(table->attrs, table->size * sizeof(match_attr_t)); } /* end if */ - new = table->nattrs++; - table->attrs[new].exist[0] = exist[0]; - table->attrs[new].exist[1] = exist[1]; - table->attrs[new].name = (char *)HDstrdup(name); + new_val = table->nattrs++; + table->attrs[new_val].exist[0] = exist[0]; + table->attrs[new_val].exist[1] = exist[1]; + table->attrs[new_val].name = (char *)HDstrdup(name); } /*------------------------------------------------------------------------- @@ -459,8 +459,8 @@ hsize_t diff_attr(hid_t loc1_id, goto error; /* format output string */ - sprintf(np1,"%s of <%s>",name1,path1); - sprintf(np2,"%s of <%s>",name2,path2); + HDsnprintf(np1, sizeof(np1), "%s of <%s>", name1, path1); + HDsnprintf(np2, sizeof(np1), "%s of <%s>", name2, path2); /*--------------------------------------------------------------------- * array compare diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h index 10c643d..3285278 100644 --- a/tools/lib/h5tools_utils.h +++ b/tools/lib/h5tools_utils.h @@ -159,7 +159,7 @@ typedef struct { /* obtain link info from H5tools_get_symlink_info() */ typedef struct { H5O_type_t trg_type; /* OUT: target type */ - const char *trg_path; /* OUT: target obj path. This must be freed + char *trg_path; /* OUT: target obj path. This must be freed * when used with H5tools_get_symlink_info() */ haddr_t objno; /* OUT: target object address */ unsigned long fileno; /* OUT: File number that target object is located in */ -- cgit v0.12 From e8955b876cc81e9cd7318418435d5cd861854c2a Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Wed, 20 Mar 2013 15:33:33 -0500 Subject: [svn-r23407] Purpose: HDFFV-8214 - h5repack failed converting small chunked dataset (size < 1K) to contiguous layout. Description: h5repack failed converting small chunked dataset (size < 1K) to contiguous layout. The first case was when chunk dim is bigger than the dataset dim (at leat one), h5repack failed with displaying error stacks. The other case is when chunk dim is smaller than the dataset dim, h5repack failed to change layout. Tested: jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), emu (solaris-BE),fred (mac64-LE), Windows (32-LE cmake), cmake (jam) --- release_docs/RELEASE.txt | 2 ++ tools/h5repack/CMakeLists.txt | 12 ++++++++++++ tools/h5repack/h5repack.sh.in | 12 ++++++++++++ tools/h5repack/h5repack_copy.c | 10 ---------- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4414eb1..8a54b21 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -751,6 +751,8 @@ Bug Fixes since HDF5-1.8.0 release Tools ----- + - h5repack: Fixed failure for converting a layout of small chunked dataset + (size < 1K) to contiguous layout. HDFFV-8214 (JKM 2013/03/18) - h5diff: Fixed to return correct exit code 1 when detect unique extra attribute. Prior to this fix, h5diff returned exit code 0 indicating two files are identical. HDFFV-7643 (JKM 2013/02/15) diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 156f6d8..06c6b71 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -881,6 +881,18 @@ ADD_H5_VERIFY_TEST (error3 "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 H5S_UNLIM # file input - should not fail ADD_H5_TEST (error4 "TEST" h5repack_layout3.h5 -f NONE) +#-------------------------------------------------------------------------- +# Test base: Convert CHUNK to CONTI for a chunked dataset with small dataset +# (dset size < 64K) and with unlimited max dims on a condition as follow. +# (HDFFV-8214) +#-------------------------------------------------------------------------- +# chunk dim is bigger than dataset dim. should succeed. +ADD_H5_VERIFY_TEST (ckdim_biger "TEST" 0 h5repack_layout3.h5 chunk_unlimit2 CONTI -l chunk_unlimit2:CONTI) +# chunk dim is smaller than dataset dim. should succeed. +ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 CONTI -l chunk_unlimit3:CONTI) + + + # Native option # Do not use FILE1, as the named dtype will be converted to native, and h5diff will # report a difference. diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in index dc90426..14e1d04 100644 --- a/tools/h5repack/h5repack.sh.in +++ b/tools/h5repack/h5repack.sh.in @@ -891,6 +891,18 @@ VERIFY_LAYOUT_DSET error3 h5repack_layout3.h5 chunk_unlimit3 H5S_UNLIMITED -f ch # file input - should not fail TOOLTEST error4 h5repack_layout3.h5 -f NONE +#-------------------------------------------------------------------------- +# Test base: Convert CHUNK to CONTI for a chunked dataset with small dataset +# (dset size < 64K) and with unlimited max dims on a condition as follow. +# (HDFFV-8214) +#-------------------------------------------------------------------------- + +# chunk dim is bigger than dataset dim. should succeed. +VERIFY_LAYOUT_DSET ckdim_biger h5repack_layout3.h5 chunk_unlimit2 CONTI -l chunk_unlimit2:CONTI +# chunk dim is smaller than dataset dim. should succeed. +VERIFY_LAYOUT_DSET ckdim_smaller h5repack_layout3.h5 chunk_unlimit3 CONTI -l chunk_unlimit3:CONTI + + # Native option # Do not use FILE1, as the named dtype will be converted to native, and h5diff will # report a difference. diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 02337fd..f9dd334 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -1017,16 +1017,6 @@ int do_copy_objects(hid_t fidin, /* get the storage size of the input dataset */ dsize_in=H5Dget_storage_size(dset_in); - /* check for small size datasets (less than 1k) except - * changing to COMPACT. For the reference, COMPACT is limited - * by size 64K by library. - */ - if (options->layout_g != H5D_COMPACT) - { - if ( size_dset < options->min_comp ) - apply_s=0; - } - /* apply the filter */ if (apply_s) { -- cgit v0.12 From a0ec9c282b3dbabec9d1f46e86c37336b9cd490b Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Wed, 20 Mar 2013 23:04:19 -0500 Subject: [svn-r23410] HDFFV-8264: Using F2003, build fails on Fedora with undefined reference to __h5r_MOD_h5rget_region_region_f This turned out being an issue with configure. The reporter submitted a patch which fixed the fact that we should not be setting AM_FCFLAGS (an automake variable) with FFLAGS (a user variable). I removed this, and we now only set FFLAGS if the environment variable is set, otherwise we don't. Tested: jam (gnu) --- configure.ac | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 38b342a..a57d149 100644 --- a/configure.ac +++ b/configure.ac @@ -434,9 +434,10 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ## -------------------------------------------------------------------- ## General Fortran flags - ## - AM_FCFLAGS="${AM_FCFLAGS} ${FFLAGS}" - FCFLAGS="${FCFLAGS} ${FFLAGS}" + ## Only add FFLAGS to FCFLAGS if it's set. + if test "x$FFLAGS" != "x" ; then + FCFLAGS="${FCFLAGS} ${FFLAGS}" + fi ## -------------------------------------------------------------------- ## Fortran source extention -- cgit v0.12 From e7ced517bc9fab1e13962231e53ef5c107daf88e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 21 Mar 2013 09:04:50 -0500 Subject: [svn-r23411] HDDFV-8322: Free allocations in command line parsing. Tested: local linux --- tools/h5copy/h5copy.c | 54 +++++++++++++++++---------------------------------- 1 file changed, 18 insertions(+), 36 deletions(-) diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c index b2ad9d0..3fb5701 100644 --- a/tools/h5copy/h5copy.c +++ b/tools/h5copy/h5copy.c @@ -36,6 +36,11 @@ static struct long_options l_opts[] = { { "version", no_arg, 'V' }, { NULL, 0, '\0' } }; +char *fname_src = NULL; +char *fname_dst = NULL; +char *oname_src = NULL; +char *oname_dst = NULL; +char *str_flag = NULL; /*------------------------------------------------------------------------- * Function: leave @@ -54,6 +59,17 @@ static struct long_options l_opts[] = { static void leave(int ret) { + if (fname_src) + HDfree(fname_src); + if (fname_dst) + HDfree(fname_dst); + if (oname_dst) + HDfree(oname_dst); + if (oname_src) + HDfree(oname_src); + if (str_flag) + HDfree(str_flag); + h5tools_close(); HDexit(ret); } @@ -201,11 +217,6 @@ main (int argc, const char *argv[]) { hid_t fid_src = -1; hid_t fid_dst = -1; - char *fname_src = NULL; - char *fname_dst = NULL; - char *oname_src = NULL; - char *oname_dst = NULL; - char *str_flag = NULL; unsigned flag = 0; unsigned verbose = 0; unsigned parents = 0; @@ -339,8 +350,6 @@ main (int argc, const char *argv[]) if (fid_src==-1) { error_msg("Could not open input file <%s>...Exiting\n", fname_src); - if (fname_src) - HDfree(fname_src); leave(EXIT_FAILURE); } @@ -360,10 +369,6 @@ main (int argc, const char *argv[]) if (fid_dst==-1) { error_msg("Could not open output file <%s>...Exiting\n", fname_dst); - if (fname_src) - HDfree(fname_src); - if (fname_dst) - HDfree(fname_dst); leave(EXIT_FAILURE); } @@ -484,18 +489,7 @@ main (int argc, const char *argv[]) if (H5Fclose(fid_dst)<0) goto error; - if (fname_src) - HDfree(fname_src); - if (fname_dst) - HDfree(fname_dst); - if (oname_dst) - HDfree(oname_dst); - if (oname_src) - HDfree(oname_src); - - h5tools_close(); - - return EXIT_SUCCESS; + leave(EXIT_SUCCESS); error: printf("Error in copy...Exiting\n"); @@ -510,19 +504,7 @@ error: H5Fclose(fid_src); H5Fclose(fid_dst); } H5E_END_TRY; - if (fname_src) - HDfree(fname_src); - if (fname_dst) - HDfree(fname_dst); - if (oname_dst) - HDfree(oname_dst); - if (oname_src) - HDfree(oname_src); - if (str_flag) - HDfree(str_flag); - - h5tools_close(); - return EXIT_FAILURE; + leave(EXIT_FAILURE); } -- cgit v0.12 From 0596de6267e6917057df2ebe2f7e524a1a9e6773 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 21 Mar 2013 09:19:09 -0500 Subject: [svn-r23412] Add test depends on clear test. Occasional failures. --- hl/test/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 39a3811..c5b6f6e 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -31,6 +31,9 @@ MACRO (HL_ADD_TEST hl_name files) SET_TARGET_PROPERTIES (hl_${hl_name} PROPERTIES FOLDER test/hl) ADD_TEST (NAME hl_${hl_name} COMMAND $) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (hl_${hl_name} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") # -------------------------------------------------------------------- #-- Copy the necessary files. @@ -75,6 +78,10 @@ ADD_TEST ( test_packet_table.h5 test_table.h5 ) +IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (hl_test-clear-objects PROPERTIES DEPENDS ${last_test}) +ENDIF (NOT "${last_test}" STREQUAL "") +SET (last_test "hl_test-clear-objects") HL_ADD_TEST (test_ds "dsdata.txt;dslat.txt;dslon.txt;test_ds_be.h5;test_ds_le.h5") HL_ADD_TEST (test_dset_opt "") -- cgit v0.12 From 535456397c2886ecaffddbd6471f6f2e50125c1d Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 21 Mar 2013 13:19:53 -0500 Subject: [svn-r23415] Description: Avoid using fpclassify() for detecting zero/non-zero values. Tested on: Mac OSX/64 10.8.3 (amazon) w/debug --- tools/lib/h5diff_array.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 878f459..528fc40 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -106,9 +106,9 @@ static hbool_t not_comparable; per = -1; \ not_comparable = FALSE; \ both_zero = FALSE; \ - if(FP_ZERO == fpclassify(A) && FP_ZERO == fpclassify(B)) \ + if(0 == (A) && 0 == (B)) \ both_zero = TRUE; \ - if(FP_ZERO != fpclassify(A)) \ + if(0 != (A)) \ per = (double)ABS((double)(B - A) / (double)A); \ else \ not_comparable = TRUE; \ -- cgit v0.12 From 030a17ca60905ef90cabaa147ee84febb064fc42 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 21 Mar 2013 14:22:19 -0500 Subject: [svn-r23417] Fixes an issue (HDFFV-8159) where uninitialized memory was being read during variable-length type conversion. All variable-length type conversion buffers are now initialized to contain 0s on allocation. Tested on: jam(w/ fortran, C++, parallel, parallel fortran) ostrich This is a very small change (basially changing malloc to calloc) and is unlikely to cause issues on other platforms. --- src/H5Tconv.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 5ecf864..b732817 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -3014,17 +3014,17 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, { H5T_vlen_alloc_info_t _vl_alloc_info; /* VL allocation info buffer */ H5T_vlen_alloc_info_t *vl_alloc_info = &_vl_alloc_info; /* VL allocation info */ - H5T_path_t *tpath; /* Type conversion path */ + H5T_path_t *tpath = NULL; /* Type conversion path */ hbool_t noop_conv = FALSE; /* Flag to indicate a noop conversion */ hbool_t write_to_file = FALSE; /* Flag to indicate writing to file */ hbool_t parent_is_vlen; /* Flag to indicate parent is vlen datatyp */ hid_t tsrc_id = -1, tdst_id = -1;/*temporary type atoms */ - H5T_t *src; /*source datatype */ - H5T_t *dst; /*destination datatype */ + H5T_t *src = NULL; /*source datatype */ + H5T_t *dst = NULL; /*destination datatype */ H5HG_t bg_hobjid, parent_hobjid; - uint8_t *s; /*source buffer */ - uint8_t *d; /*destination buffer */ - uint8_t *b; /*background buffer */ + uint8_t *s = NULL; /*source buffer */ + uint8_t *d = NULL; /*destination buffer */ + uint8_t *b = NULL; /*background buffer */ ssize_t s_stride, d_stride; /*src and dst strides */ ssize_t b_stride; /*bkg stride */ size_t safe; /*how many elements are safe to process in each pass */ @@ -3120,7 +3120,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(tpath->cdata.need_bkg || parent_is_vlen) { /* Set up initial background buffer */ tmp_buf_size = MAX(src_base_size, dst_base_size); - if(NULL == (tmp_buf = H5FL_BLK_MALLOC(vlen_seq,tmp_buf_size))) + if(NULL == (tmp_buf = H5FL_BLK_CALLOC(vlen_seq,tmp_buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") } /* end if */ @@ -3200,7 +3200,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, */ if(!seq_len && !conv_buf) { conv_buf_size = ((1 / H5T_VLEN_MIN_CONF_BUF_SIZE) + 1) * H5T_VLEN_MIN_CONF_BUF_SIZE; - if(NULL == (conv_buf = H5FL_BLK_MALLOC(vlen_seq, conv_buf_size))) + if(NULL == (conv_buf = H5FL_BLK_CALLOC(vlen_seq, conv_buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") } else if(conv_buf_size < MAX(src_size, dst_size)) { @@ -3208,6 +3208,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, conv_buf_size = ((MAX(src_size, dst_size) / H5T_VLEN_MIN_CONF_BUF_SIZE) + 1) * H5T_VLEN_MIN_CONF_BUF_SIZE; if(NULL == (conv_buf = H5FL_BLK_REALLOC(vlen_seq, conv_buf, conv_buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") + HDmemset(conv_buf, 0, conv_buf_size); } /* end if */ /* Read in VL sequence */ @@ -3223,6 +3224,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, tmp_buf_size = conv_buf_size; if(NULL == (tmp_buf = H5FL_BLK_REALLOC(vlen_seq, tmp_buf, tmp_buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") + HDmemset(tmp_buf, 0, tmp_buf_size); } /* end if */ /* If we are writing and there is a nested VL type, read @@ -3236,6 +3238,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, tmp_buf_size = (bg_seq_len * MAX(src_base_size, dst_base_size)); if(NULL == (tmp_buf = H5FL_BLK_REALLOC(vlen_seq, tmp_buf, tmp_buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") + HDmemset(tmp_buf, 0, tmp_buf_size); } /* end if */ H5F_addr_decode(dst->shared->u.vlen.f, (const uint8_t **)&tmp, &(bg_hobjid.addr)); INT32DECODE(tmp, bg_hobjid.idx); -- cgit v0.12 From c8018386da2165a16f5e2d0cb5a391dca07b4ed5 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 22 Mar 2013 12:56:05 -0500 Subject: [svn-r23427] Purpose: Fix bug HDFFV-8067 Description: + The C++ test failed with the new PGI compilers versions 12.4 and 12.5 + An exception thrown by an internal function, which was called by a constructor, was not propagating to the test program during the stack unwinding, so it couldn't be caught by the test and the program terminated. + Various trials and errors indicated that the problem is where an STD string converted to a char* being passed to the internal function, but confirmation has not been found yet. It could be a compiler bug. Solution: + Added a try/catch in the constructor around the internal function and re-throw the exception when it is caught. This is a workaround. + Unrelated minor fixes: removed unused variables and MESSAGE's; commented out tvlstr.cpp/test_read_vl_string_attribute because it may be redundant, and commented out H5Tpkg.h inclusion because TEST_ALIGNMENT is not added yet and probably not necessary in the C++ API. Platforms tested: Linux/32 2.6 (jam) with PGI compilers Linux/32 2.6 (jam) with GNU compilers Linux/64 2.6 (koala) --- c++/src/H5File.cpp | 18 ++++++++++++++++-- c++/test/dsets.cpp | 6 ------ c++/test/tattr.cpp | 2 -- c++/test/tcompound.cpp | 1 - c++/test/tfile.cpp | 12 ++++-------- c++/test/tfilter.cpp | 4 ++-- c++/test/th5s.cpp | 1 - c++/test/tlinks.cpp | 3 ++- c++/test/trefer.cpp | 2 -- c++/test/ttypes.cpp | 4 ++++ c++/test/tvlstr.cpp | 5 +++-- 11 files changed, 31 insertions(+), 27 deletions(-) diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 92c4d32..1f7b6f8 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -77,11 +77,18 @@ H5File::H5File() : H5Location(), id(0) {} /// please refer to the \b Special \b case section in the C layer /// Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5F.html#File-Create +// Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file +// could not be caught in the applications. Added try block here +// to catch then re-throw it. -BMR 2013/03/21 // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(0) { - p_get_file(name, flags, create_plist, access_plist); + try { + p_get_file(name, flags, create_plist, access_plist); + } catch (FileIException open_file) { + throw open_file; + } } //-------------------------------------------------------------------------- @@ -95,11 +102,18 @@ H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& c /// FileCreatPropList::DEFAULT ///\param access_plist - IN: File access property list. Default to /// FileCreatPropList::DEFAULT +// Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file +// could not be caught in the applications. Added try block here +// to catch then re-throw it. -BMR 2013/03/21 // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(0) { - p_get_file(name.c_str(), flags, create_plist, access_plist); + try { + p_get_file(name.c_str(), flags, create_plist, access_plist); + } catch (FileIException open_file) { + throw open_file; + } } //-------------------------------------------------------------------------- diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index e822b36..643762b 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -285,13 +285,7 @@ test_simple_io( H5File& file) static herr_t test_datasize() { - SUBTEST("DataSet::getInMemDataSize()"); - - int points[100][200]; - int check[100][200]; - int i, j, n; - try { // Open FILE1. diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index 100e725..1a15aea 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -964,7 +964,6 @@ static void test_attr_mult_read() static void test_attr_delete() { H5std_string attr_name; // Buffer for attribute names - int ii; // Output message about test being performed SUBTEST("Removing Attribute Function"); @@ -1364,7 +1363,6 @@ extern "C" void test_attr() { // Output message about test being performed - //MESSAGE("Testing Attributes\n"); MESSAGE(5, ("Testing Attributes\n")); test_attr_basic_write(); // Test basic H5A writing code diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp index fbb1219..28d8a1e 100644 --- a/c++/test/tcompound.cpp +++ b/c++/test/tcompound.cpp @@ -749,7 +749,6 @@ extern "C" void test_compound() { // Output message about test being performed - //MESSAGE("Testing Compound Data Type operations\n"); MESSAGE(5, ("Testing Compound Data Type operations\n")); test_compound_1(); // various things about compound data types diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index ba38d7a..65b8e57 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -117,16 +117,16 @@ static void test_file_create() "terminate called without an active exception Command terminated by signal 6" Commenting it out until it's fixed LK 20120626. -#ifndef H5_HAVE_FILE_VERSIONS +*/ try { H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E + // Should FAIL but didn't, so throw an invalid action exception throw InvalidActionException("H5File constructor", "Attempted to create an existing file."); } catch( FileIException E ) // catch truncating existing file {} // do nothing, FAIL expected -#endif // Close file1 delete file1; file1 = NULL; @@ -144,7 +144,6 @@ static void test_file_create() // Test create with H5F_ACC_TRUNC. This will truncate the existing file. file1 = new H5File (FILE1, H5F_ACC_TRUNC); -#ifndef H5_HAVE_FILE_VERSIONS // Try to truncate first file again. This should fail because file1 // is the same file and is currently open. try { @@ -155,19 +154,17 @@ static void test_file_create() } catch( FileIException E ) // catching truncating opened file {} // do nothing, FAIL expected -#endif + // Try with H5F_ACC_EXCL. This should fail too because the file already // exists. try { -// H5File file3 (FILE1, H5F_ACC_EXCL); // should throw E + H5File file3 (FILE1, H5F_ACC_EXCL); // should throw E // Should FAIL but didn't, so throw an invalid action exception throw InvalidActionException("H5File constructor", "H5F_ACC_EXCL attempt on an existing file."); } catch( FileIException E ) // catching H5F_ACC_EXCL on existing file {} // do nothing, FAIL expected -*/ - std::cerr << "SKIPPED for HDFFV-8067" << std::endl; // Get the file-creation template FileCreatPropList tmpl1 = file1->getCreatePlist(); @@ -627,7 +624,6 @@ void test_file() { // Output message about test being performed MESSAGE(5, ("Testing File I/O operations\n")); - //MESSAGE("Testing File I/O operations\n"); test_file_create(); // Test file creation (also creation templates) test_file_open(); // Test file opening diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp index 0dbdf00..9e60655 100644 --- a/c++/test/tfilter.cpp +++ b/c++/test/tfilter.cpp @@ -47,12 +47,14 @@ #define FILTER_CHUNK_DIM2 25 // will do this function later or use it as guideline - BMR - 2007/01/26 +#if 0 static herr_t test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, int corrupted, hsize_t *dset_size) { cerr << "do nothing right now" << endl; return(0); } +#endif /* Temporary filter IDs used for testing */ #define H5Z_FILTER_BOGUS 305 @@ -254,13 +256,11 @@ extern "C" void test_filters() { // Output message about test being performed - //MESSAGE("Testing Various Filters\n"); MESSAGE(5, ("Testing Various Filters\n")); hid_t fapl_id; fapl_id = h5_fileaccess(); // in h5test.c, returns a file access template - int nerrors=0; // keep track of number of failures occurr try { // Use the file access template id to create a file access prop. list diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp index 32c40d5..7947a9b 100644 --- a/c++/test/th5s.cpp +++ b/c++/test/th5s.cpp @@ -569,7 +569,6 @@ extern "C" void test_h5s() { // Output message about test being performed - //MESSAGE("Testing Dataspaces\n"); MESSAGE(5, ("Testing Dataspaces\n")); test_h5s_basic(); // Test basic H5S code diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index e4e691a..fca5918 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -226,6 +226,7 @@ typedef struct { hbool_t *visited; /* Pointer to array of "visited link" flags */ } link_iter_info_t; +#if 0 /* Link visit structs */ typedef struct { const char *path; /* Path to link */ @@ -374,6 +375,7 @@ typedef struct { unsigned idx; /* Index in object visit structure */ const obj_visit_t *info; /* Pointer to the object visit structure to use */ } ovisit_ud_t; +#endif static const char *FILENAME[] = { "link0", @@ -529,7 +531,6 @@ void test_links() fapl_id = h5_fileaccess(); // Output message about test being performed - //MESSAGE("Testing Various Links\n"); MESSAGE(5, ("Testing Various Links\n")); try { diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp index 4eb5b21..ce18e58 100644 --- a/c++/test/trefer.cpp +++ b/c++/test/trefer.cpp @@ -235,7 +235,6 @@ static void test_reference_obj(void) verify_val(name_size, DSET1_LEN, "Group::getObjnameByIdx(index,(std::string)buf,buf_len)", __LINE__, __FILE__); // Test getObjnameByIdx(hsize_t idx, char* name, size_t size) - char name_C[DSET1_LEN+1]; group.getObjnameByIdx(0, name, name_size+1); verify_val(name, DSET1_NAME, "Group::getObjnameByIdx(index,(char*)buf,buf_len)", __LINE__, __FILE__); verify_val(name_size, DSET1_LEN, "Group::getObjnameByIdx(index,(char*)buf,buf_len)", __LINE__, __FILE__); @@ -345,7 +344,6 @@ extern "C" void test_reference(void) { // Output message about test being performed - //MESSAGE("Testing References\n"); MESSAGE(5, ("Testing References\n")); test_reference_obj(); // Test basic object reference functionality diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index b1baa29..c10cf6d 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -52,6 +52,7 @@ * normally require alignment. When set, all native datatypes must be aligned * on a byte boundary equal to the data size. */ +#if 0 #define TEST_ALIGNMENT /* Alignment test stuff */ @@ -61,6 +62,9 @@ #endif #define SET_ALIGNMENT(TYPE,VAL) \ H5T_NATIVE_##TYPE##_ALIGN_g=MAX(H5T_NATIVE_##TYPE##_ALIGN_g, VAL) +#endif + /* #include "H5Tpkg.h" + */ const char *FILENAME[] = { "dtypes1.h5", diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index 73e54e0..89f24f2 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -129,7 +129,7 @@ void test_vlstr_free_custom(void *_mem, void *info) *------------------------------------------------------------------------- */ // String for testing datasets -static char stastring_ds_write[1]={'A'}; +// static char stastring_ds_write[1]={'A'}; // Info for a string dataset const H5std_string DSET1_NAME("String_ds"); @@ -687,6 +687,7 @@ static void test_vlstring_attribute() } } // test_vlstring_attribute() +#if 0 /*------------------------------------------------------------------------- * Function: test_read_vl_string_attribute * @@ -746,6 +747,7 @@ static void test_read_vl_string_attribute() issue_fail_msg("test_read_vl_string_attribute()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_read_vl_string_attribute +#endif // 2013: need to verify before adding to test /*------------------------------------------------------------------------- * Function: test_vlstring_array_attribute @@ -957,7 +959,6 @@ extern "C" void test_vlstrings() { // Output message about test being performed - //MESSAGE("Testing Variable-Length Strings"); MESSAGE(5, ("Testing Variable-Length Strings")); // These tests use the same file -- cgit v0.12 From 3f1c23b3151153395c6001b895532bf101bdd746 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 22 Mar 2013 14:16:38 -0500 Subject: [svn-r23428] Description: Fixed bug HDFFV-4272. Just typos in documentation. Platform tested: Jam --- c++/src/H5File.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 1f7b6f8..ede7469 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -61,7 +61,7 @@ H5File::H5File() : H5Location(), id(0) {} /// modifying default file meta-data. Default to /// FileCreatPropList::DEFAULT ///\param access_plist - IN: File access property list. Default to -/// FileCreatPropList::DEFAULT +/// FileAccPropList::DEFAULT ///\par Description /// Valid values of \a flags include: /// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists, @@ -101,7 +101,7 @@ H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& c /// modifying default file meta-data. Default to /// FileCreatPropList::DEFAULT ///\param access_plist - IN: File access property list. Default to -/// FileCreatPropList::DEFAULT +/// FileAccPropList::DEFAULT // Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file // could not be caught in the applications. Added try block here // to catch then re-throw it. -BMR 2013/03/21 @@ -201,7 +201,7 @@ bool H5File::isHdf5(const H5std_string& name ) ///\param name - IN: Name of the file ///\param flags - IN: File access flags ///\param access_plist - IN: File access property list. Default to -/// FileCreatPropList::DEFAULT +/// FileAccPropList::DEFAULT ///\par Description /// Valid values of \a flags include: /// H5F_ACC_RDWR: Open with read/write access. If the file is -- cgit v0.12 From 99b15244742caf98b5ff634f34d880fd0089d8d4 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Fri, 22 Mar 2013 16:02:07 -0500 Subject: [svn-r23431] Fix for HDFFV-8141. Changes default value for USE_SHARED_LIB in compile scripts to yes when static is disabled. Comments in scripts about the order of flag variables containing library paths was also corrected. Tested with h5committest on duck, jam, koala, and ostrich in addition to specific testing for the compile script change. --- c++/src/h5c++.in | 33 ++++++++++++++++++++++----------- fortran/src/h5fc.in | 32 ++++++++++++++++++++------------ tools/misc/h5cc.in | 34 +++++++++++++++++++++++----------- 3 files changed, 65 insertions(+), 34 deletions(-) diff --git a/c++/src/h5c++.in b/c++/src/h5c++.in index 20435eb..8928d13 100644 --- a/c++/src/h5c++.in +++ b/c++/src/h5c++.in @@ -83,11 +83,12 @@ CXXLINKERBASE="@CXX@" # CXXFLAGS, CPPFLAGS and LDFLAGS are reserved for use by the script user. # FLAGS brought from the hdf5 build are put in H5BLD_*FLAGS. -# User's CPPFLAGS and CXXFLAGS come after their H5BLD counterparts to override -# them. User's LDFLAGS come just before clibpath, user's LIBS come after -# $link_objs and before the hdf5 libraries in $link_args, followed by any -# external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS -# or LIBS carried in from the hdf5 build. +# User's CPPFLAGS and CXXFLAGS come after their H5BLD counterparts. User's +# LDFLAGS come just before clibpath, user's LIBS come after $link_objs and +# before the hdf5 libraries in $link_args, followed by any external library +# paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in +# from the hdf5 build. The order of the flags is intended to give precedence +# to the user's flags. H5BLD_CXXFLAGS="@AM_CXXFLAGS@ @CXXFLAGS@" H5BLD_CPPFLAGS="@AM_CPPFLAGS@ @CPPFLAGS@" H5BLD_LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@" @@ -100,7 +101,16 @@ CPPFLAGS="${HDF5_CPPFLAGS:-$CPPFLAGSBASE}" LDFLAGS="${HDF5_LDFLAGS:-$LDFLAGSBASE}" LIBS="${HDF5_LIBS:-$LIBSBASE}" -USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" +# If a static library is available, the default will be to use it. If the only +# available library is shared, it will be used by default. The user can +# override either default, although choosing an unavailable library will result +# in link errors. +STATIC_AVAILABLE="@enable_static@" +if test "${STATIC_AVAILABLE}" = "yes"; then + USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" +else + USE_SHARED_LIB="${HDF5_USE_SHLIB:-yes}" +fi usage() { # A wonderfully informative "usage" message. @@ -365,11 +375,12 @@ if test "x$do_link" = "xyes"; then # module. It's okay if they're included twice in the compile line. link_args="$link_args $H5BLD_LDFLAGS $H5BLD_LIBS" - # User's CPPFLAGS and CXXFLAGS come after their H5BLD counterparts to override - # them. User's LDFLAGS come just before clibpath, user's LIBS come after - # $link_objs and before the hdf5 libraries in $link_args, followed by any - # external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS - # or LIBS carried in from the hdf5 build. + # User's CPPFLAGS and CXXFLAGS come after their H5BLD counterparts. User's + # LDFLAGS come just before clibpath, user's LIBS come after $link_objs and + # before the hdf5 libraries in $link_args, followed by any external library + # paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in + # from the hdf5 build. The order of the flags is intended to give precedence + # to the user's flags. $SHOW $CXXLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CXXFLAGS $CXXFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args $shared_link diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in index c55b496..c58eab0 100644 --- a/fortran/src/h5fc.in +++ b/fortran/src/h5fc.in @@ -80,12 +80,11 @@ FLINKERBASE="@FC@" # FFLAGS and LDFLAGS are reserved for use by the script user. # FLAGS brought from the hdf5 build are put in H5BLD_*FLAGS. -# User's FFLAGS come after their H5BLD counterparts to override -# them. User's LDFLAGS come just before clibpath, user's LIBS come after -# $link_objs and before the hdf5 libraries in $link_args, followed by any -# external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS -# or LIBS carried in from the hdf5 build. - +# User's FFLAGS come after their H5BLD counterparts. User's LDFLAGS come just +# before clibpath, user's LIBS come after $link_objs and before the hdf5 +# libraries in $link_args, followed by any external library paths and libraries +# from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in from the hdf5 build. +# The order of the flags is intended to give precedence to the user's flags. H5BLD_FFLAGS="@AM_FCFLAGS@ @FCFLAGS@" F9XMODFLAG="@F9XMODFLAG@" F9XSUFFIXFLAG="@F9XSUFFIXFLAG@" @@ -98,7 +97,16 @@ FFLAGS="${HDF5_FFLAGS:-$FFLAGSBASE}" LDFLAGS="${HDF5_LDFLAGS:-$LDFLAGSBASE}" LIBS="${HDF5_LIBS:-$LIBSBASE}" -USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" +# If a static library is available, the default will be to use it. If the only +# available library is shared, it will be used by default. The user can +# override either default, although choosing an unavailable library will result +# in link errors. +STATIC_AVAILABLE="@enable_static@" +if test "${STATIC_AVAILABLE}" = "yes"; then + USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" +else + USE_SHARED_LIB="${HDF5_USE_SHLIB:-yes}" +fi usage() { # A wonderfully informative "usage" message. @@ -349,11 +357,11 @@ if test "x$do_link" = "xyes"; then # module. It's okay if they're included twice in the compile line. link_args="$link_args $H5BLD_LDFLAGS $H5BLD_LIBS" - # User's FFLAGS come after their H5BLD counterparts to override - # them. User's LDFLAGS come just before clibpath, user's LIBS come after - # $link_objs and before the hdf5 libraries in $link_args, followed by any - # external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS - # or LIBS carried in from the hdf5 build. + # User's FFLAGS come after their H5BLD counterparts. User's LDFLAGS come just + # before clibpath, user's LIBS come after $link_objs and before the hdf5 + # libraries in $link_args, followed by any external library paths and libraries + # from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in from the hdf5 build. + # The order of the flags is intended to give precedence to the user's flags. $SHOW $FLINKER $FFLAGS $H5BLD_FFLAGS $F9XSUFFIXFLAG $LDFLAGS $fmodules $link_objs $LIBS $link_args $shared_link status=$? fi diff --git a/tools/misc/h5cc.in b/tools/misc/h5cc.in index 233c80a..45143e4 100644 --- a/tools/misc/h5cc.in +++ b/tools/misc/h5cc.in @@ -85,11 +85,12 @@ CLINKERBASE="@CC@" # CFLAGS, CPPFLAGS and LDFLAGS are reserved for use by the script user. # FLAGS brought from the hdf5 build are put in H5BLD_*FLAGS. -# User's CPPFLAGS and CFLAGS come after their H5BLD counterparts to override -# them. User's LDFLAGS come just before clibpath, user's LIBS come after -# $link_objs and before the hdf5 libraries in $link_args, followed by any -# external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS -# or LIBS carried in from the hdf5 build. +# User's CPPFLAGS and CFLAGS come after their H5BLD counterparts. User's +# LDFLAGS come just before clibpath, user's LIBS come after $link_objs and +# before the hdf5 libraries in $link_args, followed by any external library +# paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in +# from the hdf5 build. The order of the flags is intended to give precedence +# to the user's flags. H5BLD_CFLAGS="@AM_CFLAGS@ @CFLAGS@" H5BLD_CPPFLAGS="@AM_CPPFLAGS@ @CPPFLAGS@" H5BLD_LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@" @@ -102,7 +103,17 @@ CPPFLAGS="${HDF5_CPPFLAGS:-$CPPFLAGSBASE}" LDFLAGS="${HDF5_LDFLAGS:-$LDFLAGSBASE}" LIBS="${HDF5_LIBS:-$LIBSBASE}" -USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" +# If a static library is available, the default will be to use it. If the only +# available library is shared, it will be used by default. The user can +# override either default, although choosing an unavailable library will result +# in link errors. +STATIC_AVAILABLE="@enable_static@" +if test "${STATIC_AVAILABLE}" = "yes"; then + USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" +else + USE_SHARED_LIB="${HDF5_USE_SHLIB:-yes}" +fi + usage() { # A wonderfully informative "usage" message. @@ -374,11 +385,12 @@ if test "x$do_link" = "xyes"; then # module. It's okay if they're included twice in the compile line. link_args="$link_args $H5BLD_LDFLAGS $H5BLD_LIBS" - # User's CPPFLAGS and CFLAGS come after their H5BLD counterparts to override - # them. User's LDFLAGS come just before clibpath, user's LIBS come after - # $link_objs and before the hdf5 libraries in $link_args, followed by any - # external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS - # or LIBS carried in from the hdf5 build. + # User's CPPFLAGS and CFLAGS come after their H5BLD counterparts. User's + # LDFLAGS come just before clibpath, user's LIBS come after $link_objs and + # before the hdf5 libraries in $link_args, followed by any external library + # paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in + # from the hdf5 build. The order of the flags is intended to give precedence + # to the user's flags. $SHOW $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CFLAGS $CFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args $shared_link status=$? fi -- cgit v0.12 From f593b6e71296c74b2da8790a062c2a6076c8ce6d Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Fri, 22 Mar 2013 16:56:15 -0500 Subject: [svn-r23433] Fix for HDFFV-7996. Compile scripts will add paths for external libraries linked to executable files that they create. Eliminates need for LD_LIBRARY_PATH for szip in locations not known to ld. Teted on platypus and emu (64bit) in addition to h5committest. --- c++/src/h5c++.in | 14 ++++++++++++++ fortran/src/h5fc.in | 14 ++++++++++++++ tools/misc/h5cc.in | 14 ++++++++++++++ 3 files changed, 42 insertions(+) diff --git a/c++/src/h5c++.in b/c++/src/h5c++.in index 8928d13..0f17cf1 100644 --- a/c++/src/h5c++.in +++ b/c++/src/h5c++.in @@ -334,6 +334,20 @@ if test "x$do_link" = "xyes"; then if test -n "$flag"; then shared_link="${flag}${libdir}" + # Any libraries in LDFLAGS or H5BLD_LDFLAGS also should have rpaths embedded + # in the executables created by h5cc (reduces need for LD_LIBRARY_PATH). + if test -n "$LDFLAGS"; then + for entry in $LDFLAGS; do + extdir=`echo $entry | sed '/^-L/ s/^-L//'` + shared_link="${shared_link} ${flag}${extdir}" + done + fi + if test -n "$H5BLD_LDFLAGS"; then + for entry in $H5BLD_LDFLAGS; do + extdir=`echo $entry | sed '/^-L/ s/^-L//'` + shared_link="${shared_link} ${flag}${extdir}" + done + fi fi if test "x$USE_SHARED_LIB" != "xyes"; then diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in index c58eab0..37f7c71 100644 --- a/fortran/src/h5fc.in +++ b/fortran/src/h5fc.in @@ -316,6 +316,20 @@ if test "x$do_link" = "xyes"; then if test -n "$flag"; then shared_link="${flag}${libdir}" + # Any libraries in LDFLAGS or H5BLD_LDFLAGS also should have rpaths embedded + # in the executables created by h5cc (reduces need for LD_LIBRARY_PATH). + if test -n "$LDFLAGS"; then + for entry in $LDFLAGS; do + extdir=`echo $entry | sed '/^-L/ s/^-L//'` + shared_link="${shared_link} ${flag}${extdir}" + done + fi + if test -n "$H5BLD_LDFLAGS"; then + for entry in $H5BLD_LDFLAGS; do + extdir=`echo $entry | sed '/^-L/ s/^-L//'` + shared_link="${shared_link} ${flag}${extdir}" + done + fi fi if test "x$USE_SHARED_LIB" != "xyes"; then diff --git a/tools/misc/h5cc.in b/tools/misc/h5cc.in index 45143e4..fe11c26 100644 --- a/tools/misc/h5cc.in +++ b/tools/misc/h5cc.in @@ -350,6 +350,20 @@ if test "x$do_link" = "xyes"; then if test -n "$flag"; then shared_link="${flag}${libdir}" + # Any libraries in LDFLAGS or H5BLD_LDFLAGS also should have rpaths embedded + # in the executables created by h5cc (reduces need for LD_LIBRARY_PATH). + if test -n "$LDFLAGS"; then + for entry in $LDFLAGS; do + extdir=`echo $entry | sed '/^-L/ s/^-L//'` + shared_link="${shared_link} ${flag}${extdir}" + done + fi + if test -n "$H5BLD_LDFLAGS"; then + for entry in $H5BLD_LDFLAGS; do + extdir=`echo $entry | sed '/^-L/ s/^-L//'` + shared_link="${shared_link} ${flag}${extdir}" + done + fi fi if test "x$USE_SHARED_LIB" != "xyes"; then -- cgit v0.12 From 5c459618453c684cd7bcd8c2b8117bb3e6ad1b27 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Fri, 22 Mar 2013 17:05:57 -0500 Subject: [svn-r23434] Improvement: DFFV-8245 Use Clang as the compiler for the Mac platform. Changed all Mac to use clang/clang++ as the default C and CXX compilers if not provided by the user. Still use gfortran as the default fortran compiler since Apple does not provide any fortran compiler. Tested: passed all three macs OS, snow leapord (fred), lion (duck) and mountain lion (wren). Also passed test using Apple gcc, Gnu gcc, Intel as the C compilers and all corresponding CXX compilers fits in. Did not run h5committest or other non-mac platform since this change affect Apple platforms only. --- config/apple | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/config/apple b/config/apple index c5c0a19..d2d4663 100644 --- a/config/apple +++ b/config/apple @@ -20,17 +20,16 @@ # # See BlankForm in this directory for details. -# The default compiler is `gcc' +# The default compiler is `clang' if test "X-" = "X-$CC"; then - CC=gcc - CC_BASENAME=gcc + CC=clang + CC_BASENAME=clang fi # Figure out compiler flags . $srcdir/config/gnu-flags # temp patch: if GCC 4.2.1 is used in Lion or Mountain Lion systems, do not # use -O option as it causes failures in test/dt_arith. -#echo host_os=$host_os case "$host_os" in darwin1[12].*) # lion & mountain lion #echo cc_vendor=$cc_vendor'-'cc_version=$cc_version @@ -48,6 +47,11 @@ esac . $srcdir/config/intel-flags if test "X-" = "X-$FC"; then case $CC_BASENAME in + clang) + # clang has no fortran compiler. Use gfortran. + FC=gfortran + FC_BASENAME=gfortran + ;; gcc*) FC=gfortran FC_BASENAME=gfortran @@ -59,8 +63,30 @@ if test "X-" = "X-$FC"; then esac fi +if test "X-" = "X-$CXX"; then + case $CC_BASENAME in + clang) + CXX=clang++ + CXX_BASENAME=clang++ + ;; + gcc) + CXX=g++ + CXX_BASENAME=g++ + ;; + icc) + CXX=icpc + CXX_BASENAME=icpc + ;; + esac +fi + # compiler version strings case $CC in + clang) + cc_version_info=`$CC $CFLAGS $H5_CFLAGS --version 2>&1 |\ + grep 'Apple' | sed 's/(.*//'` + ;; + *gcc*) cc_version_info=`$CC $CFLAGS $H5_CFLAGS --version 2>&1 | grep -v 'PathScale' |\ grep 'GCC' | sed 's/.*\((GCC) [-a-z0-9\. ]*.*\)/\1/'` @@ -97,6 +123,11 @@ esac # get c++ version info case $CXX in + clang++) + cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\ + grep 'Apple' | sed 's/(.*//'` + ;; + *g++*) cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\ grep 'GCC' | sed 's/.*\((GCC) [-a-z0-9\. ]*.*\)/\1/'` -- cgit v0.12 From 1f6cd26a93875c34d3a43921fe0d9637879b15ae Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Sat, 23 Mar 2013 12:37:49 -0500 Subject: [svn-r23438] Purpose: Fix bug HDFFV-7520 Description: Added wrappers for H5Aexists. Platforms Tested: Linux/32 2.6 (jam) Linux/64 2.6 (koala) Linux/ppc64 (ostrich) --- c++/src/H5Location.cpp | 33 ++++++++++++++++++++++ c++/src/H5Location.h | 10 +++++-- c++/test/tattr.cpp | 76 +++++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 112 insertions(+), 7 deletions(-) diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index b93cd86..be59f51 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -250,6 +250,39 @@ int H5Location::getNumAttrs() const } //-------------------------------------------------------------------------- +// Function: H5Location::attrExists +///\brief Checks whether the named attribute exists at this location. +///\param name - IN: Name of the attribute to be queried +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2013 +//-------------------------------------------------------------------------- +bool H5Location::attrExists(const char* name) const +{ + // Call C routine H5Aexists to determine whether an attribute exists + // at this location, which could be specified by a file, group, dataset, + // or named datatype. + herr_t ret_value = H5Aexists(getId(), name); + if( ret_value > 0 ) + return true; + else if(ret_value == 0) + return false; + else // Raise exception when H5Aexists returns a negative value + throw AttributeIException(inMemFunc("attrExists"), "H5Aexists failed"); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::attrExists +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +bool H5Location::attrExists(const H5std_string& name) const +{ + attrExists(name.c_str()); +} + +//-------------------------------------------------------------------------- // Function: H5Location::removeAttr ///\brief Removes the named attribute from this object. ///\param name - IN: Name of the attribute to be removed diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index d1dd892..8eae454 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -79,11 +79,15 @@ class H5_DLLCPP H5Location : public IdComponent { // misleading, so getRefObjType is used in the new function instead. // Iterate user's function over the attributes at this location. - int iterateAttrs( attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL ); + int iterateAttrs(attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL); + + // Checks whether the named attribute exists at this location. + bool attrExists(const char* name) const; + bool attrExists(const H5std_string& name) const; // Removes the named attribute from this location. - void removeAttr( const char* name ) const; - void removeAttr( const H5std_string& name ) const; + void removeAttr(const char* name) const; + void removeAttr(const H5std_string& name) const; // Renames the named attribute to a new name. void renameAttr(const char* oldname, const char* newname) const; diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index 1a15aea..7e77e85 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -252,14 +252,19 @@ static void test_attr_rename() int read_data1[ATTR1_DIM1]={0}; // Buffer for reading the attribute int i; - // Output message about test being performed - SUBTEST("Rename Attribute Function"); + // Output message about test being performed + SUBTEST("Checking for Existence and Renaming Attribute"); try { // Open file H5File fid1(FILE_BASIC, H5F_ACC_RDWR); - // Check rename of attribute belonging to a file + // Check and rename attribute belonging to a file + + // Check for existence of attribute + bool attr_exists = fid1.attrExists(FATTR1_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "Attribute should exist but does not"); // Change attribute name fid1.renameAttr(FATTR1_NAME, FATTR_TMP_NAME); @@ -280,7 +285,12 @@ static void test_attr_rename() // Open the dataset DataSet dataset = fid1.openDataSet(DSET1_NAME); - // Check rename of attribute belonging to a dataset + // Check and rename attribute belonging to a dataset + + // Check for existence of attribute + attr_exists = dataset.attrExists(ATTR1_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "Attribute should exist but does not"); // Change attribute name dataset.renameAttr(ATTR1_NAME, ATTR_TMP_NAME); @@ -303,6 +313,11 @@ static void test_attr_rename() // Close attribute attr1.close(); + // Check for existence of second attribute + attr_exists = dataset.attrExists(ATTR2_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "Attribute should exist but does not"); + // Open the second attribute Attribute attr2(dataset.openAttribute(ATTR2_NAME)); @@ -324,6 +339,11 @@ static void test_attr_rename() // Change first attribute back to the original name dataset.renameAttr(ATTR_TMP_NAME, ATTR1_NAME); + // Check for existence of attribute after renaming + attr_exists = dataset.attrExists(ATTR1_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "Attribute should exist but does not"); + PASSED(); } // end try block @@ -1354,6 +1374,53 @@ static void test_string_attr() /**************************************************************** ** +** test_attr_exists(): Test checking for attribute existence. +** (additional attrExists tests are in test_attr_rename()) +** +****************************************************************/ +static void test_attr_exists() +{ + // Output message about test being performed + SUBTEST("Check Attribute Existence"); + + try { + // Open file. + H5File fid1(FILE_BASIC, H5F_ACC_RDWR); + + // Open the root group. + Group root = fid1.openGroup("/"); + + // Check for existence of attribute + bool attr_exists = fid1.attrExists(ATTR1_FL_STR_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "fid1, ATTR1_FL_STR_NAMEAttribute should exist but does not"); + + // Check for existence of attribute + attr_exists = fid1.attrExists(FATTR1_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "fid1,FATTR2_NAMEAttribute should exist but does not"); + + // Open a group. + Group group = fid1.openGroup(GROUP1_NAME); + + // Check for existence of attribute + attr_exists = group.attrExists(ATTR2_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "group, ATTR2_NAMEAttribute should exist but does not"); + + PASSED(); + } // end try block + + catch (InvalidActionException E) { + issue_fail_msg("test_attr_exists()", __LINE__, __FILE__, E.getCDetailMsg()); + } + catch (Exception E) { + issue_fail_msg("test_attr_exists()", __LINE__, __FILE__, E.getCDetailMsg()); + } +} // test_attr_exists() + +/**************************************************************** +** ** test_attr(): Main attribute testing routine. ** ****************************************************************/ @@ -1382,6 +1449,7 @@ void test_attr() test_attr_dtype_shared(); // Test using shared datatypes in attributes test_string_attr(); // Test read/write string attribute + test_attr_exists(); // Test H5Location::attrExists } // test_attr() -- cgit v0.12 From 6e1122dda4e446f6e9ad9ce4a9c2da8d40e441e3 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Mon, 25 Mar 2013 00:28:47 -0500 Subject: [svn-r23441] HDFFV-8245: bug fix. Snow Leopard (darwin 10.X) does not have clang++. Reversed it to use gcc/g++ as the default C and CXX compilers for Darwin 10.X systems. Tested: duck (darwin 11), wren (darwin 12) and fred (darwin 10). --- config/apple | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/config/apple b/config/apple index d2d4663..ac93ea5 100644 --- a/config/apple +++ b/config/apple @@ -20,10 +20,19 @@ # # See BlankForm in this directory for details. -# The default compiler is `clang' +# The default compiler is `clang'. +# No support for OS older than darwin 10.X. if test "X-" = "X-$CC"; then - CC=clang - CC_BASENAME=clang + case "$host_os" in + darwin10.*) # Snow Leopard. Use gcc/g++ because clang++ is not available. + CC=gcc + CC_BASENAME=gcc + ;; + *) + CC=clang + CC_BASENAME=clang + ;; + esac fi # Figure out compiler flags -- cgit v0.12