From 612faec1aceceb595c77da52b092b7683581e776 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Fri, 15 Nov 2013 12:58:00 -0500 Subject: [svn-r24454] Checkin for bug fix SWMR-11: used message file to coordinate test runs for h5watch. The changes were initially done as part of the file locking implementation. In addition, fixes for the following: A) Bug fix when enable-production in test/tfile.c-- --test_swmr_write(): use latest format in creating the test files B) Bug fixes to sync up with revise_chksum_retry branch: 1) test/accum.c--fix to use new_argv/new_envp for execve() and clean out compilation warnings 2) hl/src/H5HLprivate2.h--put the defines in alphabetical order 3) hl/tools/h5watch/h5watch.c--h5watch test exit code error due to error stack 4) hl/tools/h5watch/extend_dset.c--clean up some compilation warnings Tested on jam, ostrich, koala, platypus, emu, aix. --- hl/src/H5HLprivate2.h | 42 ++-- hl/tools/h5watch/Makefile.am | 8 +- hl/tools/h5watch/Makefile.in | 9 +- hl/tools/h5watch/extend_dset.c | 123 ++++++++-- hl/tools/h5watch/h5watch.c | 45 ++-- hl/tools/h5watch/h5watchgentest.c | 40 ++-- hl/tools/h5watch/testh5watch.sh.in | 370 ++++++++++++++++-------------- hl/tools/testfiles/w-ext-cmpd-esc-f1.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd-esc-f2.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd-esc-f3.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd-esc-ff1.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd-esc-ff2.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd-esc-ff3.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd-esc.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd-f1.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd-f2.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd-f3.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd-ff1.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd-ff2.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd-ff3.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd-label.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd-two-f1.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd-two-f2.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd-two-f3.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd-two-ff1.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd-two-ff2.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd-two-ff3.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd-two.ddl | 4 +- hl/tools/testfiles/w-ext-cmpd.ddl | 4 +- hl/tools/testfiles/w-ext-early.ddl | 4 +- hl/tools/testfiles/w-ext-late.ddl | 4 +- hl/tools/testfiles/w-ext-one-d.ddl | 4 +- hl/tools/testfiles/w-ext-one-simple.ddl | 4 +- hl/tools/testfiles/w-ext-one.ddl | 4 +- hl/tools/testfiles/w-ext-two-d.ddl | 4 +- hl/tools/testfiles/w-ext-two-width.ddl | 4 +- hl/tools/testfiles/w-ext-two.ddl | 4 +- test/accum.c | 133 +++++------ test/tfile.c | 31 ++- 39 files changed, 539 insertions(+), 382 deletions(-) diff --git a/hl/src/H5HLprivate2.h b/hl/src/H5HLprivate2.h index 5646d6c..556c86f 100644 --- a/hl/src/H5HLprivate2.h +++ b/hl/src/H5HLprivate2.h @@ -60,12 +60,15 @@ #ifndef TRUE # define TRUE 1 #endif +#ifndef HDassert + #define HDassert(X) assert(X) +#endif /* HDassert */ #ifndef HDcalloc #define HDcalloc(N,Z) calloc(N,Z) #endif /* HDcalloc */ -#ifndef HDrealloc - #define HDrealloc(M,Z) realloc(M,Z) -#endif /* HDrealloc */ +#ifndef HDfflush + #define HDfflush(F) fflush(F) +#endif /* HDfflush */ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #ifndef HDfree #define HDfree(M) free(M) @@ -76,33 +79,30 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #ifndef HDmemset #define HDmemset(X,C,Z) memset(X,C,Z) #endif /* HDmemset */ -#ifndef HDassert - #define HDassert(X) assert(X) -#endif /* HDassert */ -#ifndef HDstrlen - #define HDstrlen(S) strlen(S) -#endif /* HDstrlen */ +#ifndef HDrealloc + #define HDrealloc(M,Z) realloc(M,Z) +#endif /* HDrealloc */ +#ifndef HDsleep + #define HDsleep(N) sleep(N) +#endif /* HDsleep */ #ifndef HDstrcat #define HDstrcat(X,Y) strcat(X,Y) #endif /* HDstrcat */ +#ifndef HDstrcmp + #define HDstrcmp(X,Y) strcmp(X,Y) +#endif /* HDstrcmp */ +#ifndef HDstrlen + #define HDstrlen(S) strlen(S) +#endif /* HDstrlen */ #ifndef HDstrrchr #define HDstrrchr(S,C) strrchr(S,C) #endif /* HDstrrchr */ -#ifndef HDstrtol - #define HDstrtol(S,R,N) strtol(S,R,N) -#endif /* HDstrtol */ #ifndef HDstrtod #define HDstrtod(S,R) strtod(S,R) #endif /* HDstrtod */ -#ifndef HDsleep - #define HDsleep(N) sleep(N) -#endif /* HDsleep */ -#ifndef HDfflush - #define HDfflush(F) fflush(F) -#endif /* HDfflush */ -#ifndef HDstrcmp - #define HDstrcmp(X,Y) strcmp(X,Y) -#endif /* HDstrcmp */ +#ifndef HDstrtol + #define HDstrtol(S,R,N) strtol(S,R,N) +#endif /* HDstrtol */ /* * And now for a couple non-Posix functions... Watch out for systems that * define these in terms of macros. diff --git a/hl/tools/h5watch/Makefile.am b/hl/tools/h5watch/Makefile.am index 16dfe23..2f4b163 100644 --- a/hl/tools/h5watch/Makefile.am +++ b/hl/tools/h5watch/Makefile.am @@ -24,9 +24,7 @@ include $(top_srcdir)/config/commence.am INCLUDES=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib -I$(top_srcdir)/hl/src # These are our main targets, the tools -#TEST_PROG=h5watchgentest TEST_SCRIPT=testh5watch.sh -#check_PROGRAMS=h5watchgentest check_SCRIPTS=$(TEST_SCRIPT) SCRIPT_DEPEND=h5watch$(EXEEXT) @@ -38,16 +36,14 @@ h5watch_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) h5watch_SOURCES=h5watch.c -#gen_onetwo_test_SOURCES=gen_onetwo_test.c h5watchgentest_SOURCES=h5watchgentest.c extend_dset_SOURCES=extend_dset.c -#extend_one_SOURCES=extend_one.c -#extend_two_SOURCES=extend_two.c # Programs all depend on the hdf5 library, the tools library, and the HL # library. LDADD=$(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5) - +# +CHECK_CLEANFILES+=*.h5 DISTCLEANFILES=testh5watch.sh include $(top_srcdir)/config/conclude.am diff --git a/hl/tools/h5watch/Makefile.in b/hl/tools/h5watch/Makefile.in index 1725cd0..0e2400b 100644 --- a/hl/tools/h5watch/Makefile.in +++ b/hl/tools/h5watch/Makefile.in @@ -433,27 +433,22 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. # *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 # Include src and tools/lib directories INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/tools/lib -I$(top_srcdir)/hl/src # These are our main targets, the tools -#TEST_PROG=h5watchgentest TEST_SCRIPT = testh5watch.sh -#check_PROGRAMS=h5watchgentest check_SCRIPTS = $(TEST_SCRIPT) SCRIPT_DEPEND = h5watch$(EXEEXT) # Add h5watch specific linker flags here h5watch_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) h5watch_SOURCES = h5watch.c - -#gen_onetwo_test_SOURCES=gen_onetwo_test.c h5watchgentest_SOURCES = h5watchgentest.c extend_dset_SOURCES = extend_dset.c -#extend_one_SOURCES=extend_one.c -#extend_two_SOURCES=extend_two.c # Programs all depend on the hdf5 library, the tools library, and the HL # library. diff --git a/hl/tools/h5watch/extend_dset.c b/hl/tools/h5watch/extend_dset.c index 61cc09f..79b06a0 100644 --- a/hl/tools/h5watch/extend_dset.c +++ b/hl/tools/h5watch/extend_dset.c @@ -4,6 +4,7 @@ #include #include #include +#include /* * Extending datasets in WATCH.h5 generated by h5watchgentest.c @@ -13,10 +14,16 @@ #define DSET_CMPD "DSET_CMPD" #define DSET_CMPD_ESC "DSET_CMPD_ESC" #define DSET_CMPD_TWO "DSET_CMPD_TWO" - #define DSET_ALLOC_LATE "DSET_ALLOC_LATE" #define DSET_ALLOC_EARLY "DSET_ALLOC_EARLY" +/* The message sent by this process (extend_dset) to the test script to start "h5watch" */ +#define WRITER_MESSAGE "writer_message" +/* The message received from the test script to start extending dataset */ +#define READER_MESSAGE "reader_message" +/* Message timeout in seconds */ +#define MESSAGE_TIMEOUT 300 + /* Size of data buffer */ #define TEST_BUF_SIZE 100 @@ -41,6 +48,9 @@ int two_tests[TWO_NTESTS][2] = { {2, 2}, {2, -11}, {2, 0}, static int extend_dset_two(const char *file, char *dname); static int extend_dset_one(const char *file, char *dname); +void send_message(const char *file); +static int wait_message(const char *file); + /* Data structures for datasets with compound data type */ typedef struct sub22_t { @@ -68,6 +78,54 @@ typedef struct set_t { } set_t; /* + * To send a message by creating the file. + */ +void +send_message(const char *file) +{ + FILE *id; + + id = fopen(file, "w+"); + fclose(id); +} /* send_message() */ + +/* + * + * Repeatedly check for the message file. + * It will stop when the file exists or exceeds the timeout limit. + */ +static int +wait_message(const char *file) +{ + FILE *id; /* File pointer */ + time_t t0, t1; /* Time info */ + + /* Start timer */ + time(&t0); + + /* Wait for message from test script to start work */ + while((id = fopen(file, "r")) == NULL) { + /* Get current time */ + time(&t1); + /* + * Determine time difference-- + * if waiting too long for the message, then it is + * unlikely the message will get sent, then fail rather + * than loop forever. + */ + if(difftime(t1, t0) > MESSAGE_TIMEOUT) + goto done; + } + + fclose(id); + unlink(file); + return(SUCCEED); + +done: + return(FAIL); +} /* wait_message() */ + +/* *********************************************************************** * * Extending a two-dimensional dataset: @@ -94,7 +152,8 @@ typedef struct set_t { static int extend_dset_two(const char *file, char *dname) { - hid_t fid; /* file id */ + hid_t fid = -1; /* file id */ + hid_t fapl = -1; /* file access property list id */ hid_t did; /* dataset id */ hid_t sid; /* dataspace id */ hid_t dtid; /* dataset's datatype id */ @@ -107,13 +166,24 @@ extend_dset_two(const char *file, char *dname) int ibuf[TEST_BUF_SIZE]; /* buffer for storing retrieved elements (integer) */ set_t cbuf[TEST_BUF_SIZE]; /* buffer for storing retrieved elemnets (compound) */ - /* Open the file and dataset */ - if((fid = H5Fopen(file, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) + /* Create a copy of file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + return -1; + + /* Set to use the latest library format */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + return -1; + + /* Open the file and dataset with SWMR write */ + if((fid = H5Fopen(file, H5F_ACC_RDWR|H5F_ACC_SWMR_WRITE, fapl)) < 0) goto done; if((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) goto done; + /* Send message to the test script to start "h5watch" */ + send_message(WRITER_MESSAGE); + if((sid = H5Dget_space(did)) < 0) goto done; @@ -128,6 +198,10 @@ extend_dset_two(const char *file, char *dname) if((dtid = H5Tget_native_type(H5Dget_type(did), H5T_DIR_DEFAULT)) < 0) goto done; + /* Wait for message from the test script to start extending dataset */ + if(wait_message(READER_MESSAGE) < 0) + goto done; + /* Loop through different variations of extending the dataset */ for(i = 0; i < TWO_NTESTS; i++) { @@ -139,8 +213,8 @@ extend_dset_two(const char *file, char *dname) goto done; /* Set up the new extended dimension sizes */ - ext_dims[0] = cur_dims[0] + two_tests[i][0]; - ext_dims[1] = cur_dims[1] + two_tests[i][1]; + ext_dims[0] = cur_dims[0] + (hsize_t)two_tests[i][0]; + ext_dims[1] = cur_dims[1] + (hsize_t)two_tests[i][1]; /* Extend the dataset */ if(H5Dset_extent(did, ext_dims) < 0) @@ -148,7 +222,7 @@ extend_dset_two(const char *file, char *dname) num_elmts = 1; for(j = 0; j < (unsigned)ndims; j++) - num_elmts *= ext_dims[j]; + num_elmts *= (unsigned)ext_dims[j]; /* Compound type */ if(!HDstrcmp(dname, DSET_CMPD_TWO)) { @@ -172,7 +246,7 @@ extend_dset_two(const char *file, char *dname) } else { /* Integer type */ HDmemset(ibuf, 0, sizeof(ibuf)); for(j = 0; j < num_elmts; j++) - ibuf[j] = i + 1; + ibuf[j] = (int)(i + 1); /* Write to the dataset */ if(H5Dwrite(did, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0) @@ -187,6 +261,7 @@ extend_dset_two(const char *file, char *dname) /* Closing */ if(H5Tclose(dtid) < 0) goto done; if(H5Dclose(did) < 0) goto done; + if(H5Pclose(fapl) < 0) goto done; if(H5Fclose(fid) < 0) goto done; return(SUCCEED); @@ -195,6 +270,7 @@ done: H5E_BEGIN_TRY H5Tclose(dtid); H5Dclose(did); + H5Pclose(fapl); H5Fclose(fid); H5E_END_TRY @@ -221,7 +297,8 @@ done: static int extend_dset_one(const char *file, char *dname) { - hid_t fid; /* file id */ + hid_t fid = -1; /* file id */ + hid_t fapl = -1; /* file access property list id */ hid_t did; /* dataset id */ hid_t dtid; /* dataset's datatype id */ hid_t sid; /* dataspace id */ @@ -235,10 +312,20 @@ extend_dset_one(const char *file, char *dname) hsize_t count[1]; /* dimension sizes of appended data */ size_t dtype_size; /* size of the dataset's datatype */ - /* Open the file and dataset */ - if((fid = H5Fopen(file, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) + /* Create a copy of file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + return -1; + /* Set to use the latest library format */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + return -1; + + /* Open the file and dataset with SWMR write */ + if((fid = H5Fopen(file, H5F_ACC_RDWR|H5F_ACC_SWMR_WRITE, fapl)) < 0) goto done; + /* Send message to the test script to start "h5watch" */ + send_message(WRITER_MESSAGE); + if((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) goto done; @@ -250,6 +337,9 @@ extend_dset_one(const char *file, char *dname) if((dtid = H5Tget_native_type(H5Dget_type(did), H5T_DIR_DEFAULT)) < 0) goto done; + /* Wait for message from the test script to start extending dataset */ + wait_message(READER_MESSAGE); + /* Loop through different variations of extending the dataset */ for(i = 0; i < ONE_NTESTS; i++) { @@ -261,7 +351,7 @@ extend_dset_one(const char *file, char *dname) goto done; /* Set up the new extended dimension sizes */ - ext_dims[0] = cur_dims[0] + one_tests[i]; + ext_dims[0] = cur_dims[0] + (hsize_t)one_tests[i]; /* Extend the dataset */ if(H5Dset_extent(did, ext_dims) < 0) @@ -272,7 +362,7 @@ extend_dset_one(const char *file, char *dname) /* Select the extended region */ offset[0] = cur_dims[0]; - count[0] = one_tests[i]; + count[0] = (hsize_t)one_tests[i]; if((sid = H5Dget_space(did)) < 0) goto done; if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0) @@ -305,7 +395,7 @@ extend_dset_one(const char *file, char *dname) goto done; } else { /* Integer type */ for(j = 0; j < (unsigned)one_tests[i]; j++) - ibuf[j] = j; + ibuf[j] = (int)j; /* Write to the extended region of the dataset */ if(H5Dwrite(did, dtid, mid, sid, H5P_DEFAULT, ibuf) < 0) @@ -325,6 +415,7 @@ extend_dset_one(const char *file, char *dname) /* Closing */ if(H5Tclose(dtid) < 0) goto done; if(H5Dclose(did) < 0) goto done; + if(H5Pclose(fapl) < 0) goto done; if(H5Fclose(fid) < 0) goto done; return(SUCCEED); @@ -335,6 +426,7 @@ done: H5Sclose(mid); H5Tclose(dtid); H5Dclose(did); + H5Pclose(fapl); H5Fclose(fid); H5E_END_TRY @@ -358,7 +450,8 @@ main(int argc, const char *argv[]) dname = strdup(argv[2]); if(!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { - if(extend_dset_one(fname, dname) < 0) goto done; + if(extend_dset_one(fname, dname) < 0) + goto done; } else if(!HDstrcmp(dname, DSET_ONE) || !HDstrcmp(dname, DSET_ALLOC_LATE) || !HDstrcmp(dname, DSET_ALLOC_EARLY)) { diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c index 2324300..d2a117d 100644 --- a/hl/tools/h5watch/h5watch.c +++ b/hl/tools/h5watch/h5watch.c @@ -21,9 +21,6 @@ #include "h5tools.h" #include "h5tools_dump.h" -#include "h5tools_utils.h" -#include "h5tools_ref.h" -#include "h5trav.h" #include "H5LDprivate.h" /* @@ -190,7 +187,7 @@ doprint(hid_t did, hsize_t *start, hsize_t *block, int rank) info.line_per_line = 1; } else - info.line_ncols = g_display_width; + info.line_ncols = (unsigned)g_display_width; info.line_multi_new = 1; @@ -367,7 +364,7 @@ monitor_dataset(hid_t fid, char *dsetname) if(i != ndims) { /* Printing changes in dimension sizes */ for(u = 0; u < ndims; u++) { - HDfprintf(stdout, "dimension %u: %Hu->%Hu", u, prev_dims[u], cur_dims[u]); + HDfprintf(stdout, "dimension %u: %Hu->%Hu", (unsigned)u, prev_dims[u], cur_dims[u]); if(cur_dims[u] > prev_dims[u]) HDfprintf(stdout, " (increases)\n"); else if(cur_dims[u] < prev_dims[u]) @@ -404,7 +401,7 @@ monitor_dataset(hid_t fid, char *dsetname) } /* Save the current dimension sizes */ - HDmemcpy(prev_dims, cur_dims, ndims * sizeof(hsize_t)); + HDmemcpy(prev_dims, cur_dims, (size_t)ndims * sizeof(hsize_t)); /* Sleep before next monitor */ HDsleep(g_polling_interval); @@ -434,8 +431,8 @@ done: static herr_t process_cmpd_fields(hid_t fid, char *dsetname) { - hid_t did; /* dataset id */ - hid_t dtid, tid; /* dataset's data type id */ + hid_t did=-1; /* dataset id */ + hid_t dtid=-1, tid=-1; /* dataset's data type id */ size_t len; /* number of comma-separated fields in "g_list_of_fields" */ herr_t ret_value = SUCCEED; /* Return value */ @@ -516,9 +513,9 @@ done: static herr_t check_dataset(hid_t fid, char *dsetname) { - hid_t did; /* Dataset id */ - hid_t dcp; /* Dataset creation property */ - hid_t sid; /* Dataset's dataspace id */ + hid_t did=-1; /* Dataset id */ + hid_t dcp=-1; /* Dataset creation property */ + hid_t sid=-1; /* Dataset's dataspace id */ int ndims; /* # of dimensions in the dataspace */ unsigned u; /* Local index variable */ hsize_t cur_dims[H5S_MAX_RANK]; /* size of dataspace dimensions */ @@ -583,6 +580,8 @@ check_dataset(hid_t fid, char *dsetname) } done: + H5Eset_auto2(H5E_DEFAULT, func, edata); + /* Closing */ H5E_BEGIN_TRY H5Sclose(sid); @@ -590,8 +589,6 @@ done: H5Dclose(did); H5E_END_TRY - H5Eset_auto2(H5E_DEFAULT, func, edata); - return(ret_value); } /* check_dataset() */ @@ -712,7 +709,7 @@ parse_command_line(int argc, const char *argv[]) break; case 'w': /* --width=N */ - g_display_width = HDstrtol(opt_arg, NULL, 0); + g_display_width = (int)HDstrtol(opt_arg, NULL, 0); if(g_display_width < 0) { usage(h5tools_getprogname()); leave(EXIT_FAILURE); @@ -804,6 +801,7 @@ main(int argc, const char *argv[]) H5E_auto2_t func; char *x; hid_t fid = -1; + hid_t fapl = -1; /* Set up tool name and exit status */ h5tools_setprogname(PROGRAMNAME); @@ -846,9 +844,17 @@ main(int argc, const char *argv[]) h5tools_setstatus(EXIT_FAILURE); } + /* Create a copy of file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + return -1; + + /* Set to use the latest library format */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + return -1; + do { while(fname && *fname) { - fid = h5tools_fopen(fname, H5F_ACC_SWMR_READ, H5P_DEFAULT, NULL, drivername, sizeof drivername); + fid = h5tools_fopen(fname, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl, NULL, drivername, sizeof drivername); if(fid >= 0) { HDfprintf(stdout, "Opened \"%s\" with %s driver.\n", fname, drivername); @@ -869,7 +875,8 @@ main(int argc, const char *argv[]) if(fid < 0) { error_msg("unable to open file \"%s\"\n", fname); - HDfree(fname); + if(fname) HDfree(fname); + if(fapl >= 0) H5Pclose(fapl); leave(EXIT_FAILURE); } @@ -910,6 +917,12 @@ main(int argc, const char *argv[]) } if(g_dup_fields) HDfree(g_dup_fields); + /* Close the file access property list */ + if(fapl >= 0 && H5Pclose(fapl) < 0) { + error_msg("unable to close file access property list\n"); + h5tools_setstatus(EXIT_FAILURE); + } + /* Close the file */ if(H5Fclose(fid) < 0) { error_msg("unable to close file\n"); diff --git a/hl/tools/h5watch/h5watchgentest.c b/hl/tools/h5watch/h5watchgentest.c index 152af25..df157b4 100644 --- a/hl/tools/h5watch/h5watchgentest.c +++ b/hl/tools/h5watch/h5watchgentest.c @@ -99,9 +99,9 @@ typedef struct set_t { static int generate_dset(hid_t fid, const char *dname, int ndims, hsize_t *dims, hsize_t *maxdims, hid_t dtid, void *data) { - hid_t dcpl; /* Dataset creation property */ - hid_t did; /* Dataset id */ - hid_t sid; /* Dataspace id */ + hid_t dcpl=-1; /* Dataset creation property */ + hid_t did=-1; /* Dataset id */ + hid_t sid=-1; /* Dataspace id */ int i; /* Local index variable */ hsize_t chunk_dims[H5S_MAX_RANK]; /* Dimension sizes for chunks */ @@ -157,23 +157,31 @@ done: int main(void) { - hid_t fid; /* File id */ - hsize_t cur_dims[1]; /* Dimension sizes */ - hsize_t max_dims[1]; /* Maximum dimension sizes */ - hsize_t cur2_dims[2]; /* Current dimension sizes */ - hsize_t max2_dims[2]; /* Maximum dimension sizes */ - hid_t set_tid, esc_set_tid; /* Compound type id */ - hid_t sub22_tid; /* Compound type id */ - hid_t sub2_tid, esc_sub2_tid; /* Compound type id */ - hid_t sub4_tid, esc_sub4_tid; /* Compound type id */ + hid_t fid=-1; /* File id */ + hid_t fapl=-1; /* File access property list id */ + hsize_t cur_dims[1]; /* Dimension sizes */ + hsize_t max_dims[1]; /* Maximum dimension sizes */ + hsize_t cur2_dims[2]; /* Current dimension sizes */ + hsize_t max2_dims[2]; /* Maximum dimension sizes */ + hid_t set_tid=-1, esc_set_tid=-1; /* Compound type id */ + hid_t sub22_tid=-1; /* Compound type id */ + hid_t sub2_tid=-1, esc_sub2_tid=-1; /* Compound type id */ + hid_t sub4_tid=-1, esc_sub4_tid=-1; /* Compound type id */ int one_data[ONE_DIMS0]; /* Buffer for data */ int two_data[TWO_DIMS0*TWO_DIMS1]; /* Buffer for data */ set_t one_cbuf[ONE_DIMS0]; /* Buffer for data with compound type */ set_t two_cbuf[TWO_DIMS0*TWO_DIMS1]; /* Buffer for data with compound type */ - int i; /* Local index variable */ + int i; /* Local index variable */ - /* Create a file */ - if((fid = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + /* Create a copy of file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + return -1; + /* Set to use the latest library format */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + return -1; + + /* Create a file with the latest format */ + if((fid = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto done; /* Initialization for one-dimensional dataset */ @@ -324,6 +332,7 @@ main(void) if(H5Tclose(esc_sub2_tid) < 0) goto done; if(H5Tclose(esc_sub4_tid) < 0) goto done; if(H5Tclose(esc_set_tid) < 0) goto done; + if(H5Pclose(fapl) < 0) goto done; if(H5Fclose(fid) < 0) goto done; exit(EXIT_SUCCESS); @@ -337,6 +346,7 @@ done: H5Tclose(esc_sub2_tid); H5Tclose(esc_sub4_tid); H5Tclose(esc_set_tid); + H5Pclose(fapl); H5Fclose(fid); H5E_END_TRY diff --git a/hl/tools/h5watch/testh5watch.sh.in b/hl/tools/h5watch/testh5watch.sh.in index 8451151..377dd89 100644 --- a/hl/tools/h5watch/testh5watch.sh.in +++ b/hl/tools/h5watch/testh5watch.sh.in @@ -17,7 +17,7 @@ # H5WATCH=h5watch # The tool name H5WATCH_BIN=`pwd`/$H5WATCH # The path of H5WATCH -EXTEND_DSET=extend_dset # Helper to extend the dataset when watching +EXTEND_DSET=extend_dset # Routine to extend the dataset when watching EXTEND_BIN=`pwd`/$EXTEND_DSET # The path of EXTEND_DSET # EXIT_SUCCESS=0 @@ -25,13 +25,16 @@ EXIT_FAILURE=1 # GEN_TEST=h5watchgentest # Generate HDF5 file with various datasets GEN_TEST_BIN=`pwd`/$GEN_TEST # Path of the binary GEN_TEST +WATCHFILE=`pwd`/WATCH.h5 # The HDF5 file generated to test h5watch +TESTFILE=TEST.h5 # The temporary file (a copy of WATCH.h5) used by tests +# +# These 3 defines should be the same as the defines in ./extend_dset.c +WRITER_MESSAGE=writer_message # The message file created by the "extend" process +READER_MESSAGE=reader_message # The message file created by the "watch" process +MESSAGE_TIMEOUT=300 # Message timeout length in secs # - -CP='cp' CMP='cmp -s' DIFF='diff -c' -KILL='kill' -SLEEP='sleep' NLINES=20 # Max. lines of output to display if test fails # # Mac OS: just to make sure echo "backslash backslash" behaves properly @@ -40,7 +43,7 @@ if test `uname -s` = 'Darwin'; then else ECHO='echo' fi - +# # Global variables nerrors=0 verbose=yes @@ -122,111 +125,101 @@ TOOLTEST() { rm -f $actual $actual_err fi } - # -# TEST_WATCH(): TEST_WATCH $1 $2 $3 $4 $5 ... -# -# Arguments: -# $1 -- number of objects to watch and to extend -# $2 -- the specified file to watch and to extend -# (filename varies with $1 suffix) -# $3 -- the specified dataset to watch and to extend -# $4 -- the options to h5watch (can be NULL) -# $5 -- expected output from watching the object -# ($3, $4, $5) can be repeated for $1 times # -# This is done to reduce the sleeping time for testing +# +# TEST_WATCH(): +# +# Arguments: +# $1 -- the specified dataset to watch and to extend +# $2 -- the options to h5watch (can be NULL) +# $3 -- expected output from watching the object # TEST_WATCH() { - plist="" # plist: the list of h5watch process IDs - dlist="" # dlist: the list of dataset names to watch/extend - outlist="" # outlist: the list of expected output files with suffix ".ddl" stripped - xlist="" # xlist: the list of exit codes from extending the dataset - NUM=$1 # number of objects to watch/extend - shift - NFNAME="`basename $1 .h5`" #the file to watch and to extend stripped of suffix ".h5" - shift - ctr=1 #counter for tracking the # of objects to test - while [ $ctr -le $NUM ] ; #loop till end of all objects to test - do - actual="../testfiles/`basename $3 .ddl`.out" #the actual output - outlist="$outlist`basename $3 .ddl` " #store to the list of output names - dlist="$dlist$1 " #store to the list of datasets - # - $CP "$NFNAME.h5" "$NFNAME$ctr.h5" #copy the file to a temporary file - # - if test -z "$2"; then #compile options & object to h5watch - OBJ="$NFNAME$ctr.h5/$1" #no options, just object - else - OBJ="$2 $NFNAME$ctr.h5/$1" #option and object - fi - # - # Run h5watch and put in background, output to a file - # - TESTING $H5WATCH $OBJ - $ECHO "" - $ECHO "#############################" > $actual - $ECHO " output for '$H5WATCH $OBJ'" >>$actual - $ECHO "#############################" >>$actual - $RUNSERIAL $H5WATCH_BIN $2 "$NFNAME$ctr.h5/$1" >> $actual & - WATCH_PID=$! #get h5watch process ID - plist="$plist$! " #store to the list of process IDs - shift; shift; shift - ctr=`expr $ctr + 1` - done; + cp $WATCHFILE $TESTFILE # Copy the file being watched/extended to a temporary file + actual="../testfiles/`basename $3 .ddl`.out" # The actual output + expect="$srcdir/../testfiles/$3" # The expected output # - # Extend the list of datasets corresponding to the list of files - n=1; - for d in $dlist; do - $EXTEND_BIN "$NFNAME$n.h5" $d - xlist="$xlist$? " #store to the list of exit codes from extending the dataset - n=`expr $n + 1` - done; - # - # Sleep to make sure output is flushed out before stopping h5watch - $ECHO "Sleeping for 4 seconds..." - $SLEEP 4 + # Set up options and object to h5watch + if test -z "$2"; then + OBJ="$TESTFILE/$1" # Empty options, just object to h5watch + else + OBJ="$2 $TESTFILE/$1" # Options + object to h5watch + fi + rm -f $WRITER_MESSAGE # Remove the file just to be sure + rm -f $READER_MESSAGE # Remove the file just to be sure # - # Kill the list of h5watch processes - $ECHO "Killing h5watch processes..." - for p in $plist; do #kill the list of h5watch processes - $KILL $p - done + $EXTEND_BIN $TESTFILE $1 & # Extend the dataset; put in background + extend_pid=$! # Get "extend" process ID # - # Check the list of return codes from extending the dataset - # Compare the list of actual output from h5watch with the corresponding expected output - n=1 - for x in $xlist; do - outname=`$ECHO $outlist|cut -d' ' -f$n` - actual="../testfiles/$outname.out" - expect="$srcdir/../testfiles/$outname.ddl" - if [ $x -ne 0 ]; then - $ECHO "*FAILED*" - nerrors="`expr $nerrors + 1`" - if [ yes = "$verbose" ]; then - $ECHO "test returned with exit code $exitcode" - $ECHO "test output: (up to $NLINES lines)" - - head -$NLINES $actual - $ECHO "***end of test output***" - $ECHO "" - fi - elif $CMP $expect $actual; then - $ECHO " PASSED" - else - $ECHO "*FAILED*" - $ECHO " Expected result differs from actual result" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' - fi - # - # Cleaning - rm -f "$NFNAME$n.h5" - if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual - fi - n="`expr $n + 1`" + # Wait for message from "extend_dset" process to start h5watch-- + # To wait for the writer message file or till the maximum # of seconds is reached + # This performs similar function as the routine h5_wait_message() in test/h5test.c + mexist=0 # Indicate whether the message file is found + t0=`date +%s` # Get current time in seconds + difft=0 # Initialize the time difference + while [ $difft -lt $MESSAGE_TIMEOUT ] ; # Loop till message times out + do + t1=`date +%s` # Get current time in seconds + difft=`expr $t1 - $t0` # Calculate the time difference + if [ -e $WRITER_MESSAGE ]; then # If message file is found: + mexist=1 # indicate the message file is found + rm $WRITER_MESSAGE # remove the message file + break # get out of the while loop + fi done; + # + # If message file from "extend" process is found-- + # start h5watch + # send message to "extend" process to start work + # wait for "extend" process to complete, then kill h5watch + # determine test result + # If message file from "extend" process is not found-- + # there is some problem; the test fails + # + if test $mexist -eq 0; then + $ECHO "*FAILED*" + $ECHO "Problem with extend_dset...this test failed." + else + # + # Run h5watch; put in background; collect output to a file + TESTING $H5WATCH $OBJ + head -n 3 $expect > $actual # copy the first 3 lines from $expect (just the command line) + $RUNSERIAL $H5WATCH_BIN $2 "$TESTFILE/$1" >> $actual & + watch_pid=$! # Get h5watch process ID + cp /dev/null $READER_MESSAGE # Send message to "extend" process to start work + wait $extend_pid # Wait for "extend" process to complete + extend_exit=$? # Collect "extend" process' exit code + sleep 1 # Sleep to make sure output is flushed + kill $watch_pid # Kill h5watch + # + if [ $extend_exit -ne 0 ]; then # Error returned from "extend" process + $ECHO "*FAILED*" + nerrors="`expr $nerrors + 1`" + if [ yes = "$verbose" ]; then + $ECHO "extend test returned with exit code $extend_exit" + $ECHO "test output: (up to $NLINES lines)" + head -$NLINES $actual + $ECHO "***end of test output***" + $ECHO "" + fi + elif $CMP $expect $actual; then # Compare actual output with expected output + $ECHO " PASSED" + else + $ECHO "*FAILED*" # Actual and expected outputs are different + $ECHO " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + if test yes = "$verbose"; then + $DIFF $expect $actual |sed 's/^/ /' + fi + fi + # + # Cleaning + rm -f $TESTFILE + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual + fi + fi } ############################################################################## @@ -290,76 +283,117 @@ TOOLTEST w-err-cmpd3.ddl 1 --fields=field1,field2, WATCH.h5/DSET_CMPD TOOLTEST w-err-cmpd4.ddl 1 --fields=field1,field2.b.k WATCH.h5/DSET_CMPD TOOLTEST w-err-cmpd5.ddl 1 --fields=field1 --fields=field2.b.k WATCH.h5/DSET_CMPD # -# -################################################################################################# -# # -# Tests on extending datasets-- # -# DSET_ONE, DSET_CMPD, DSET_CMPD_ESC # -# DSET_ALLOC_EARLY, DSET_ALLOC_LATE # -# DSET_TWO, DSET_CMPD_TWO # -# # -################################################################################################# -# -# Generate file with various types of datasets -$GEN_TEST_BIN -# -# Watching and extending: WATCH1.h5/DSET_ONE, WATCH2.h5/DSET_ALLOC_EARLY, WATCH3.h5/DSET_ALLOC_LATE WATCH4.h5/DSET_CMPD -# : WATCH5.h5/DSET_TWO, WATCH6.h5/DSET_CMPD_TWO, WATCH7.h5/DDSET_CMPD_ESC -TEST_WATCH 7 WATCH.h5 DSET_ONE '' w-ext-one.ddl DSET_ALLOC_EARLY '' w-ext-early.ddl DSET_ALLOC_LATE '' w-ext-late.ddl DSET_CMPD '' w-ext-cmpd.ddl DSET_TWO '' w-ext-two.ddl DSET_CMPD_TWO '' w-ext-cmpd-two.ddl DSET_CMPD_ESC '' w-ext-cmpd-esc.ddl -# -############################ -# Tests on --fields option # -############################ -# -# Watching and extending: -# WATCH1.h5/DSET_CMPD with --fields=field1,field2 -# WATCH2.h5/DSET_CMP_TWO with --fields=field1,field2 -# WATCH3.h5/DSET_CMPD_ESC with --fields=field\,1,field2\. -# WATCH4.h5/DSET_CMPD with --fields=field1 --fields=field2 -# WATCH5.h5/DSET_CMPD_ESC with --fields=field\,1 --fields=field2\. -# WATCH6.h5/DSET_CMPD_TWO with --fields=field1 --fields=field2 -# -TEST_WATCH 6 WATCH.h5 DSET_CMPD --fields=field1,field2 w-ext-cmpd-f1.ddl DSET_CMPD_TWO --fields=field1,field2 w-ext-cmpd-two-f1.ddl DSET_CMPD_ESC '--fields=field\,1,field2\.' w-ext-cmpd-esc-f1.ddl DSET_CMPD '--fields=field1 --fields=field2' w-ext-cmpd-ff1.ddl DSET_CMPD_ESC '--fields=field\,1 --fields=field2\.' w-ext-cmpd-esc-ff1.ddl DSET_CMPD_TWO '--fields=field1 --fields=field2' w-ext-cmpd-two-ff1.ddl +echo "DONE WITH 1st SET OF TESTS" # # # -# Watching and extending: -# WATCH1.h5/DSET_CMPD with --fields=field2.b,field4 -# WATCH2.h5/DSET_CMPD_ESC with --fields=field2\..\,b,field4\ -# WATCH3.h5/DSET_CMPD_TWO with --fields=field2.b,field4 -# WATCH4.h5/DSET_CMPD with --fields=field2.b --fields=field4 -# WATCH5.h5/DSET_CMPD_ESC with --fields=field2\..\,b --fields=field4\, -# WATCH6.h5/DSET_CMPD_TWO with --fields=field2.b --fields=field4 -TEST_WATCH 6 WATCH.h5 DSET_CMPD --fields=field2.b,field4 w-ext-cmpd-f2.ddl DSET_CMPD_ESC '--fields=field2\..\,b,field4\,' w-ext-cmpd-esc-f2.ddl DSET_CMPD_TWO --fields=field2.b,field4 w-ext-cmpd-two-f2.ddl DSET_CMPD '--fields=field2.b --fields=field4' w-ext-cmpd-ff2.ddl DSET_CMPD_ESC '--fields=field2\..\,b --fields=field4\,' w-ext-cmpd-esc-ff2.ddl DSET_CMPD_TWO '--fields=field2.b --fields=field4' w-ext-cmpd-two-ff2.ddl +################################# +# Tests without options # +################################# # +# Generate file WATCH.h5 with various types of datasets, +$GEN_TEST_BIN # -# -# Watching and extending: -# WATCH1.h5/DSET_CMPD with --fields=field2.b.a,field2.c -# WATCH2.h5/DSET_CMPD_ESC with --fields=field2\..\,b.a,field2\..\\K -# WATCH3.h5/DSET_CMPD_TWO with --fields=field2.b.a,field2.c -# WATCH4.h5/DSET_CMPD with --fields=field2.b.a --fields=field2.c -# WATCH5.h5/DSET_CMPD_ESC with --fields=field2\..\,b.a --fields=field2\..\\K -# WATCH6.h5/DSET_CMPD_TWO with --fields=field2.b.a --fields=field2.c -TEST_WATCH 6 WATCH.h5 DSET_CMPD --fields=field2.b.a,field2.c w-ext-cmpd-f3.ddl DSET_CMPD_ESC '--fields=field2\..\,b.a,field2\..\\K' w-ext-cmpd-esc-f3.ddl DSET_CMPD_TWO --fields=field2.b.a,field2.c w-ext-cmpd-two-f3.ddl DSET_CMPD '--fields=field2.b.a --fields=field2.c' w-ext-cmpd-ff3.ddl DSET_CMPD_ESC '--fields=field2\..\,b.a --fields=field2\..\\K' w-ext-cmpd-esc-ff3.ddl DSET_CMPD_TWO '--fields=field2.b.a --fields=field2.c' w-ext-cmpd-two-ff3.ddl -# -# -# -######################################################### -# # -# Tests on options: # -# --dim # -# --width, --label, --simple, --help # -# # -######################################################### -# -# Watching and extending: -# WATCH1.h5/DSET_ONE with -d option -# WATCH2.h5/DSET_TWO with --dim option -# WATCH3.h5/DSET_TWO with --width=60 option -# WATCH4.h5/DSET_CMPD with --label option -# WATCH5.h5/DSET_ONE with --simple option -TEST_WATCH 5 WATCH.h5 DSET_ONE --dim w-ext-one-d.ddl DSET_TWO --dim w-ext-two-d.ddl DSET_TWO --width=30 w-ext-two-width.ddl DSET_CMPD --label w-ext-cmpd-label.ddl DSET_ONE --simple w-ext-one-simple.ddl +# Watching and extending: (TEST.h5 is a copy of WATCH.h5) +# TEST.h5/DSET_ONE +# TEST.h5/DSET_ALLOC_EARLY +# TEST.h5/DSET_ALLOC_LATE +# TEST.h5/DSET_CMPD +# TEST.h5/DSET_TWO +# TEST.h5/DSET_CMPD_TWO +# TEST.h5/DSET_CMPD_ESC +# +TEST_WATCH DSET_ONE '' w-ext-one.ddl +TEST_WATCH DSET_ALLOC_EARLY '' w-ext-early.ddl +TEST_WATCH DSET_ALLOC_LATE '' w-ext-late.ddl +TEST_WATCH DSET_CMPD '' w-ext-cmpd.ddl +TEST_WATCH DSET_TWO '' w-ext-two.ddl +TEST_WATCH DSET_CMPD_TWO '' w-ext-cmpd-two.ddl +TEST_WATCH DSET_CMPD_ESC '' w-ext-cmpd-esc.ddl +# +echo "DONE WITH 2nd SET OF TESTS" +# +# +# +################################# +# Tests on --fields option # +################################# +# +# Watching and extending: (TEST.h5 is a copy of WATCH.h5) +# TEST.h5/DSET_CMPD with --fields=field1,field2 +# TEST.h5/DSET_CMP_TWO with --fields=field1,field2 +# TEST.h5/DSET_CMPD_ESC with --fields=field\,1,field2\. +# TEST.h5/DSET_CMPD with --fields=field1 --fields=field2 +# TEST.h5/DSET_CMPD_ESC with --fields=field\,1 --fields=field2\. +# TEST.h5/DSET_CMPD_TWO with --fields=field1 --fields=field2 +# +TEST_WATCH DSET_CMPD --fields=field1,field2 w-ext-cmpd-f1.ddl +TEST_WATCH DSET_CMPD_TWO --fields=field1,field2 w-ext-cmpd-two-f1.ddl +TEST_WATCH DSET_CMPD_ESC '--fields=field\,1,field2\.' w-ext-cmpd-esc-f1.ddl +TEST_WATCH DSET_CMPD '--fields=field1 --fields=field2' w-ext-cmpd-ff1.ddl +TEST_WATCH DSET_CMPD_ESC '--fields=field\,1 --fields=field2\.' w-ext-cmpd-esc-ff1.ddl +TEST_WATCH DSET_CMPD_TWO '--fields=field1 --fields=field2' w-ext-cmpd-two-ff1.ddl +# +echo "DONE WITH 3rd SET OF TESTS" +# +# +# +# Watching and extending: (TEST.h5 is a copy of WATCH.h5) +# TEST.h5/DSET_CMPD with --fields=field2.b,field4 +# TEST.h5/DSET_CMPD_ESC with --fields=field2\..\,b,field4\ +# TEST.h5/DSET_CMPD_TWO with --fields=field2.b,field4 +# TEST.h5/DSET_CMPD with --fields=field2.b --fields=field4 +# TEST.h5/DSET_CMPD_ESC with --fields=field2\..\,b --fields=field4\, +# TEST.h5/DSET_CMPD_TWO with --fields=field2.b --fields=field4 +# +TEST_WATCH DSET_CMPD --fields=field2.b,field4 w-ext-cmpd-f2.ddl +TEST_WATCH DSET_CMPD_ESC '--fields=field2\..\,b,field4\,' w-ext-cmpd-esc-f2.ddl +TEST_WATCH DSET_CMPD_TWO --fields=field2.b,field4 w-ext-cmpd-two-f2.ddl +TEST_WATCH DSET_CMPD '--fields=field2.b --fields=field4' w-ext-cmpd-ff2.ddl +TEST_WATCH DSET_CMPD_ESC '--fields=field2\..\,b --fields=field4\,' w-ext-cmpd-esc-ff2.ddl +TEST_WATCH DSET_CMPD_TWO '--fields=field2.b --fields=field4' w-ext-cmpd-two-ff2.ddl +# +echo "DONE WITH 4th SET OF TESTS" +# +# +# +# Watching and extending: (TEST.h5 is a copy of WATCH.h5) +# TEST.h5/DSET_CMPD with --fields=field2.b.a,field2.c +# TEST.h5/DSET_CMPD_ESC with --fields=field2\..\,b.a,field2\..\\K +# TEST.h5/DSET_CMPD_TWO with --fields=field2.b.a,field2.c +# TEST.h5/DSET_CMPD with --fields=field2.b.a --fields=field2.c +# TEST.h5/DSET_CMPD_ESC with --fields=field2\..\,b.a --fields=field2\..\\K +# TEST.h5/DSET_CMPD_TWO with --fields=field2.b.a --fields=field2.c +TEST_WATCH DSET_CMPD --fields=field2.b.a,field2.c w-ext-cmpd-f3.ddl +TEST_WATCH DSET_CMPD_ESC '--fields=field2\..\,b.a,field2\..\\K' w-ext-cmpd-esc-f3.ddl +TEST_WATCH DSET_CMPD_TWO --fields=field2.b.a,field2.c w-ext-cmpd-two-f3.ddl +TEST_WATCH DSET_CMPD '--fields=field2.b.a --fields=field2.c' w-ext-cmpd-ff3.ddl +TEST_WATCH DSET_CMPD_ESC '--fields=field2\..\,b.a --fields=field2\..\\K' w-ext-cmpd-esc-ff3.ddl +TEST_WATCH DSET_CMPD_TWO '--fields=field2.b.a --fields=field2.c' w-ext-cmpd-two-ff3.ddl +# +echo "DONE WITH 5th SET OF TESTS" +# +# +# +################################################# +# Tests on options: # +# --dim # +# --width, --label, --simple, --help # +################################################# +# +# Watching and extending: (TEST.h5 is a copy of WATCH.h5) +# TEST.h5/DSET_ONE with -d option +# TEST.h5/DSET_TWO with --dim option +# TEST.h5/DSET_TWO with --width=60 option +# TEST.h5/DSET_CMPD with --label option +# TEST.h5/DSET_ONE with --simple option +TEST_WATCH DSET_ONE --dim w-ext-one-d.ddl +TEST_WATCH DSET_TWO --dim w-ext-two-d.ddl +TEST_WATCH DSET_TWO --width=30 w-ext-two-width.ddl +TEST_WATCH DSET_CMPD --label w-ext-cmpd-label.ddl +TEST_WATCH DSET_ONE --simple w-ext-one-simple.ddl +# +echo "DONE WITH 6th SET OF TESTS" # # # diff --git a/hl/tools/testfiles/w-ext-cmpd-esc-f1.ddl b/hl/tools/testfiles/w-ext-cmpd-esc-f1.ddl index 215552b..6e1d2b5 100644 --- a/hl/tools/testfiles/w-ext-cmpd-esc-f1.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-esc-f1.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --fields=field\,1,field2\. WATCH3.h5/DSET_CMPD_ESC' + output for 'h5watch --fields=field\,1,field2\. TEST.h5/DSET_CMPD_ESC' ############################# -Opened "WATCH3.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_ESC... dimension 0: 10->13 (increases) Data: diff --git a/hl/tools/testfiles/w-ext-cmpd-esc-f2.ddl b/hl/tools/testfiles/w-ext-cmpd-esc-f2.ddl index 19e2dc8..cde31f2 100644 --- a/hl/tools/testfiles/w-ext-cmpd-esc-f2.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-esc-f2.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --fields=field2\..\,b,field4\, WATCH2.h5/DSET_CMPD_ESC' + output for 'h5watch --fields=field2\..\,b,field4\, TEST.h5/DSET_CMPD_ESC' ############################# -Opened "WATCH2.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_ESC... dimension 0: 10->13 (increases) Data: diff --git a/hl/tools/testfiles/w-ext-cmpd-esc-f3.ddl b/hl/tools/testfiles/w-ext-cmpd-esc-f3.ddl index 58d86b6..7623f3f 100644 --- a/hl/tools/testfiles/w-ext-cmpd-esc-f3.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-esc-f3.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --fields=field2\..\,b.a,field2\..\\K WATCH2.h5/DSET_CMPD_ESC' + output for 'h5watch --fields=field2\..\,b.a,field2\..\\K TEST.h5/DSET_CMPD_ESC' ############################# -Opened "WATCH2.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_ESC... dimension 0: 10->13 (increases) Data: diff --git a/hl/tools/testfiles/w-ext-cmpd-esc-ff1.ddl b/hl/tools/testfiles/w-ext-cmpd-esc-ff1.ddl index f0fbc00..e37e010 100644 --- a/hl/tools/testfiles/w-ext-cmpd-esc-ff1.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-esc-ff1.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --fields=field\,1 --fields=field2\. WATCH5.h5/DSET_CMPD_ESC' + output for 'h5watch --fields=field\,1 --fields=field2\. TEST.h5/DSET_CMPD_ESC' ############################# -Opened "WATCH5.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_ESC... dimension 0: 10->13 (increases) Data: diff --git a/hl/tools/testfiles/w-ext-cmpd-esc-ff2.ddl b/hl/tools/testfiles/w-ext-cmpd-esc-ff2.ddl index 460c2ae..db331f0 100644 --- a/hl/tools/testfiles/w-ext-cmpd-esc-ff2.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-esc-ff2.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --fields=field2\..\,b --fields=field4\, WATCH5.h5/DSET_CMPD_ESC' + output for 'h5watch --fields=field2\..\,b --fields=field4\, TEST.h5/DSET_CMPD_ESC' ############################# -Opened "WATCH5.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_ESC... dimension 0: 10->13 (increases) Data: diff --git a/hl/tools/testfiles/w-ext-cmpd-esc-ff3.ddl b/hl/tools/testfiles/w-ext-cmpd-esc-ff3.ddl index 7c0afbf..5b6c5e6 100644 --- a/hl/tools/testfiles/w-ext-cmpd-esc-ff3.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-esc-ff3.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --fields=field2\..\,b.a --fields=field2\..\\K WATCH5.h5/DSET_CMPD_ESC' + output for 'h5watch --fields=field2\..\,b.a --fields=field2\..\\K TEST.h5/DSET_CMPD_ESC' ############################# -Opened "WATCH5.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_ESC... dimension 0: 10->13 (increases) Data: diff --git a/hl/tools/testfiles/w-ext-cmpd-esc.ddl b/hl/tools/testfiles/w-ext-cmpd-esc.ddl index 8fd18d0..66eb48c 100644 --- a/hl/tools/testfiles/w-ext-cmpd-esc.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-esc.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch WATCH7.h5/DSET_CMPD_ESC' + output for 'h5watch TEST.h5/DSET_CMPD_ESC' ############################# -Opened "WATCH7.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_ESC... dimension 0: 10->13 (increases) Data: diff --git a/hl/tools/testfiles/w-ext-cmpd-f1.ddl b/hl/tools/testfiles/w-ext-cmpd-f1.ddl index 4882a0c..a722f68 100644 --- a/hl/tools/testfiles/w-ext-cmpd-f1.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-f1.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --fields=field1,field2 WATCH1.h5/DSET_CMPD' + output for 'h5watch --fields=field1,field2 TEST.h5/DSET_CMPD' ############################# -Opened "WATCH1.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD... dimension 0: 10->13 (increases) Data: diff --git a/hl/tools/testfiles/w-ext-cmpd-f2.ddl b/hl/tools/testfiles/w-ext-cmpd-f2.ddl index 178ce22..b6561c5 100644 --- a/hl/tools/testfiles/w-ext-cmpd-f2.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-f2.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --fields=field2.b,field4 WATCH1.h5/DSET_CMPD' + output for 'h5watch --fields=field2.b,field4 TEST.h5/DSET_CMPD' ############################# -Opened "WATCH1.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD... dimension 0: 10->13 (increases) Data: diff --git a/hl/tools/testfiles/w-ext-cmpd-f3.ddl b/hl/tools/testfiles/w-ext-cmpd-f3.ddl index a3b34be..a94b365 100644 --- a/hl/tools/testfiles/w-ext-cmpd-f3.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-f3.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --fields=field2.b.a,field2.c WATCH1.h5/DSET_CMPD' + output for 'h5watch --fields=field2.b.a,field2.c TEST.h5/DSET_CMPD' ############################# -Opened "WATCH1.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD... dimension 0: 10->13 (increases) Data: diff --git a/hl/tools/testfiles/w-ext-cmpd-ff1.ddl b/hl/tools/testfiles/w-ext-cmpd-ff1.ddl index 8ff1eee..dcefb7a 100644 --- a/hl/tools/testfiles/w-ext-cmpd-ff1.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-ff1.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --fields=field1 --fields=field2 WATCH4.h5/DSET_CMPD' + output for 'h5watch --fields=field1 --fields=field2 TEST.h5/DSET_CMPD' ############################# -Opened "WATCH4.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD... dimension 0: 10->13 (increases) Data: diff --git a/hl/tools/testfiles/w-ext-cmpd-ff2.ddl b/hl/tools/testfiles/w-ext-cmpd-ff2.ddl index ceda0ae..ecb8fcb 100644 --- a/hl/tools/testfiles/w-ext-cmpd-ff2.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-ff2.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --fields=field2.b --fields=field4 WATCH4.h5/DSET_CMPD' + output for 'h5watch --fields=field2.b --fields=field4 TEST.h5/DSET_CMPD' ############################# -Opened "WATCH4.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD... dimension 0: 10->13 (increases) Data: diff --git a/hl/tools/testfiles/w-ext-cmpd-ff3.ddl b/hl/tools/testfiles/w-ext-cmpd-ff3.ddl index f93f679..c3d22f5 100644 --- a/hl/tools/testfiles/w-ext-cmpd-ff3.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-ff3.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --fields=field2.b.a --fields=field2.c WATCH4.h5/DSET_CMPD' + output for 'h5watch --fields=field2.b.a --fields=field2.c TEST.h5/DSET_CMPD' ############################# -Opened "WATCH4.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD... dimension 0: 10->13 (increases) Data: diff --git a/hl/tools/testfiles/w-ext-cmpd-label.ddl b/hl/tools/testfiles/w-ext-cmpd-label.ddl index 72add5b..63ac47e 100644 --- a/hl/tools/testfiles/w-ext-cmpd-label.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-label.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --label WATCH4.h5/DSET_CMPD' + output for 'h5watch --label TEST.h5/DSET_CMPD' ############################# -Opened "WATCH4.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD... dimension 0: 10->13 (increases) Data: diff --git a/hl/tools/testfiles/w-ext-cmpd-two-f1.ddl b/hl/tools/testfiles/w-ext-cmpd-two-f1.ddl index ed1f9ca..a49f9f1 100644 --- a/hl/tools/testfiles/w-ext-cmpd-two-f1.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-two-f1.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --fields=field1,field2 WATCH2.h5/DSET_CMPD_TWO' + output for 'h5watch --fields=field1,field2 TEST.h5/DSET_CMPD_TWO' ############################# -Opened "WATCH2.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_TWO... dimension 0: 4->6 (increases) dimension 1: 10->12 (increases) diff --git a/hl/tools/testfiles/w-ext-cmpd-two-f2.ddl b/hl/tools/testfiles/w-ext-cmpd-two-f2.ddl index 6ae1e29..4404b71 100644 --- a/hl/tools/testfiles/w-ext-cmpd-two-f2.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-two-f2.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --fields=field2.b,field4 WATCH3.h5/DSET_CMPD_TWO' + output for 'h5watch --fields=field2.b,field4 TEST.h5/DSET_CMPD_TWO' ############################# -Opened "WATCH3.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_TWO... dimension 0: 4->6 (increases) dimension 1: 10->12 (increases) diff --git a/hl/tools/testfiles/w-ext-cmpd-two-f3.ddl b/hl/tools/testfiles/w-ext-cmpd-two-f3.ddl index 1dc772b..a0ab9ac 100644 --- a/hl/tools/testfiles/w-ext-cmpd-two-f3.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-two-f3.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --fields=field2.b.a,field2.c WATCH3.h5/DSET_CMPD_TWO' + output for 'h5watch --fields=field2.b.a,field2.c TEST.h5/DSET_CMPD_TWO' ############################# -Opened "WATCH3.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_TWO... dimension 0: 4->6 (increases) dimension 1: 10->12 (increases) diff --git a/hl/tools/testfiles/w-ext-cmpd-two-ff1.ddl b/hl/tools/testfiles/w-ext-cmpd-two-ff1.ddl index 519894b..81d91a7 100644 --- a/hl/tools/testfiles/w-ext-cmpd-two-ff1.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-two-ff1.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --fields=field1 --fields=field2 WATCH6.h5/DSET_CMPD_TWO' + output for 'h5watch --fields=field1 --fields=field2 TEST.h5/DSET_CMPD_TWO' ############################# -Opened "WATCH6.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_TWO... dimension 0: 4->6 (increases) dimension 1: 10->12 (increases) diff --git a/hl/tools/testfiles/w-ext-cmpd-two-ff2.ddl b/hl/tools/testfiles/w-ext-cmpd-two-ff2.ddl index c0f30d6..e32a818 100644 --- a/hl/tools/testfiles/w-ext-cmpd-two-ff2.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-two-ff2.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --fields=field2.b --fields=field4 WATCH6.h5/DSET_CMPD_TWO' + output for 'h5watch --fields=field2.b --fields=field4 TEST.h5/DSET_CMPD_TWO' ############################# -Opened "WATCH6.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_TWO... dimension 0: 4->6 (increases) dimension 1: 10->12 (increases) diff --git a/hl/tools/testfiles/w-ext-cmpd-two-ff3.ddl b/hl/tools/testfiles/w-ext-cmpd-two-ff3.ddl index 74bd5be..86c255d 100644 --- a/hl/tools/testfiles/w-ext-cmpd-two-ff3.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-two-ff3.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --fields=field2.b.a --fields=field2.c WATCH6.h5/DSET_CMPD_TWO' + output for 'h5watch --fields=field2.b.a --fields=field2.c TEST.h5/DSET_CMPD_TWO' ############################# -Opened "WATCH6.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_TWO... dimension 0: 4->6 (increases) dimension 1: 10->12 (increases) diff --git a/hl/tools/testfiles/w-ext-cmpd-two.ddl b/hl/tools/testfiles/w-ext-cmpd-two.ddl index 9476c68..90775e3 100644 --- a/hl/tools/testfiles/w-ext-cmpd-two.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-two.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch WATCH6.h5/DSET_CMPD_TWO' + output for 'h5watch TEST.h5/DSET_CMPD_TWO' ############################# -Opened "WATCH6.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_TWO... dimension 0: 4->6 (increases) dimension 1: 10->12 (increases) diff --git a/hl/tools/testfiles/w-ext-cmpd.ddl b/hl/tools/testfiles/w-ext-cmpd.ddl index e9b8deb..5512d17 100644 --- a/hl/tools/testfiles/w-ext-cmpd.ddl +++ b/hl/tools/testfiles/w-ext-cmpd.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch WATCH4.h5/DSET_CMPD' + output for 'h5watch TEST.h5/DSET_CMPD' ############################# -Opened "WATCH4.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD... dimension 0: 10->13 (increases) Data: diff --git a/hl/tools/testfiles/w-ext-early.ddl b/hl/tools/testfiles/w-ext-early.ddl index 5af042e..a822540 100644 --- a/hl/tools/testfiles/w-ext-early.ddl +++ b/hl/tools/testfiles/w-ext-early.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch WATCH2.h5/DSET_ALLOC_EARLY' + output for 'h5watch TEST.h5/DSET_ALLOC_EARLY' ############################# -Opened "WATCH2.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_ALLOC_EARLY... dimension 0: 10->13 (increases) Data: diff --git a/hl/tools/testfiles/w-ext-late.ddl b/hl/tools/testfiles/w-ext-late.ddl index b733d6e..724562f 100644 --- a/hl/tools/testfiles/w-ext-late.ddl +++ b/hl/tools/testfiles/w-ext-late.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch WATCH3.h5/DSET_ALLOC_LATE' + output for 'h5watch TEST.h5/DSET_ALLOC_LATE' ############################# -Opened "WATCH3.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_ALLOC_LATE... dimension 0: 10->13 (increases) Data: diff --git a/hl/tools/testfiles/w-ext-one-d.ddl b/hl/tools/testfiles/w-ext-one-d.ddl index 64c8977..55d55ca 100644 --- a/hl/tools/testfiles/w-ext-one-d.ddl +++ b/hl/tools/testfiles/w-ext-one-d.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --dim WATCH1.h5/DSET_ONE' + output for 'h5watch --dim TEST.h5/DSET_ONE' ############################# -Opened "WATCH1.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_ONE... dimension 0: 10->13 (increases) dimension 0: 13->12 (decreases) diff --git a/hl/tools/testfiles/w-ext-one-simple.ddl b/hl/tools/testfiles/w-ext-one-simple.ddl index dc14e6a..f657748 100644 --- a/hl/tools/testfiles/w-ext-one-simple.ddl +++ b/hl/tools/testfiles/w-ext-one-simple.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --simple WATCH5.h5/DSET_ONE' + output for 'h5watch --simple TEST.h5/DSET_ONE' ############################# -Opened "WATCH5.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_ONE... dimension 0: 10->13 (increases) Data: diff --git a/hl/tools/testfiles/w-ext-one.ddl b/hl/tools/testfiles/w-ext-one.ddl index c091054..b46392e 100644 --- a/hl/tools/testfiles/w-ext-one.ddl +++ b/hl/tools/testfiles/w-ext-one.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch WATCH1.h5/DSET_ONE' + output for 'h5watch TEST.h5/DSET_ONE' ############################# -Opened "WATCH1.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_ONE... dimension 0: 10->13 (increases) Data: diff --git a/hl/tools/testfiles/w-ext-two-d.ddl b/hl/tools/testfiles/w-ext-two-d.ddl index 926c786..dda09e6 100644 --- a/hl/tools/testfiles/w-ext-two-d.ddl +++ b/hl/tools/testfiles/w-ext-two-d.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --dim WATCH2.h5/DSET_TWO' + output for 'h5watch --dim TEST.h5/DSET_TWO' ############################# -Opened "WATCH2.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_TWO... dimension 0: 4->6 (increases) dimension 1: 10->12 (increases) diff --git a/hl/tools/testfiles/w-ext-two-width.ddl b/hl/tools/testfiles/w-ext-two-width.ddl index 1dcd4f3..47e9221 100644 --- a/hl/tools/testfiles/w-ext-two-width.ddl +++ b/hl/tools/testfiles/w-ext-two-width.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch --width=30 WATCH3.h5/DSET_TWO' + output for 'h5watch --width=30 TEST.h5/DSET_TWO' ############################# -Opened "WATCH3.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_TWO... dimension 0: 4->6 (increases) dimension 1: 10->12 (increases) diff --git a/hl/tools/testfiles/w-ext-two.ddl b/hl/tools/testfiles/w-ext-two.ddl index 83d018c..a98d333 100644 --- a/hl/tools/testfiles/w-ext-two.ddl +++ b/hl/tools/testfiles/w-ext-two.ddl @@ -1,7 +1,7 @@ ############################# - output for 'h5watch WATCH5.h5/DSET_TWO' + output for 'h5watch TEST.h5/DSET_TWO' ############################# -Opened "WATCH5.h5" with sec2 driver. +Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_TWO... dimension 0: 4->6 (increases) dimension 1: 10->12 (increases) diff --git a/test/accum.c b/test/accum.c index 6c89765..1a218c6 100644 --- a/test/accum.c +++ b/test/accum.c @@ -168,7 +168,7 @@ test_write_read(void) /* Allocate buffers */ write_buf = (int *)HDmalloc(1024 * sizeof(int)); HDassert(write_buf); - read_buf = (int *)HDcalloc(1024, sizeof(int)); + read_buf = (int *)HDcalloc((size_t)1024, sizeof(int)); HDassert(read_buf); /* Fill buffer with data, zero out read buffer */ @@ -179,7 +179,7 @@ test_write_read(void) /* Write 1KB at Address 0 */ if(accum_write(0, 1024, write_buf) < 0) FAIL_STACK_ERROR; if(accum_read(0, 1024, read_buf) < 0) FAIL_STACK_ERROR; - if(HDmemcmp(write_buf, read_buf, 1024) != 0) TEST_ERROR; + if(HDmemcmp(write_buf, read_buf, (size_t)1024) != 0) TEST_ERROR; if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -224,7 +224,7 @@ test_write_read_nonacc_front(void) /* Allocate buffers */ write_buf = (int *)HDmalloc(2048 * sizeof(int)); HDassert(write_buf); - read_buf = (int *)HDcalloc(2048, sizeof(int)); + read_buf = (int *)HDcalloc((size_t)2048, sizeof(int)); HDassert(read_buf); /* Fill buffer with data, zero out read buffer */ @@ -238,7 +238,7 @@ test_write_read_nonacc_front(void) if(accum_reset() < 0) FAIL_STACK_ERROR; if(accum_write(1024, 1024, write_buf) < 0) FAIL_STACK_ERROR; if(accum_read(0, 1024, read_buf) < 0) FAIL_STACK_ERROR; - if(HDmemcmp(write_buf, read_buf, 1024) != 0) TEST_ERROR; + if(HDmemcmp(write_buf, read_buf, (size_t)1024) != 0) TEST_ERROR; if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -283,7 +283,7 @@ test_write_read_nonacc_end(void) /* Allocate buffers */ write_buf = (int *)HDmalloc(2048 * sizeof(int)); HDassert(write_buf); - read_buf = (int *)HDcalloc(2048, sizeof(int)); + read_buf = (int *)HDcalloc((size_t)2048, sizeof(int)); HDassert(read_buf); /* Fill buffer with data, zero out read buffer */ @@ -297,7 +297,7 @@ test_write_read_nonacc_end(void) if(accum_reset() < 0) FAIL_STACK_ERROR; if(accum_write(0, 1024, write_buf) < 0) FAIL_STACK_ERROR; if(accum_read(1024, 1024, read_buf) < 0) FAIL_STACK_ERROR; - if(HDmemcmp(write_buf, read_buf, 1024) != 0) TEST_ERROR; + if(HDmemcmp(write_buf, read_buf, (size_t)1024) != 0) TEST_ERROR; if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -529,7 +529,7 @@ test_accum_overlap(void) /* Allocate buffers */ wbuf = (int32_t *)HDmalloc(4096 * sizeof(int32_t)); HDassert(wbuf); - rbuf = (int32_t *)HDcalloc(4096, sizeof(int32_t)); + rbuf = (int32_t *)HDcalloc((size_t)4096, sizeof(int32_t)); HDassert(rbuf); /* Case 1: No metadata in accumulator */ @@ -701,7 +701,7 @@ test_accum_overlap_clean(void) /* Allocate buffers */ wbuf = (int32_t *)HDmalloc(4096 * sizeof(int32_t)); HDassert(wbuf); - rbuf = (int32_t *)HDcalloc(4096, sizeof(int32_t)); + rbuf = (int32_t *)HDcalloc((size_t)4096, sizeof(int32_t)); HDassert(rbuf); /* Case 1: No metadata in accumulator */ @@ -880,7 +880,7 @@ test_accum_non_overlap_size(void) /* Allocate buffers */ wbuf = (int *)HDmalloc(4096 * sizeof(int32_t)); HDassert(wbuf); - rbuf = (int *)HDcalloc(4096, sizeof(int32_t)); + rbuf = (int *)HDcalloc((size_t)4096, sizeof(int32_t)); HDassert(rbuf); /* Case 1: No metadata in accumulator */ @@ -947,7 +947,7 @@ test_accum_overlap_size(void) /* Allocate buffers */ wbuf = (int32_t *)HDmalloc(4096 * sizeof(int32_t)); HDassert(wbuf); - rbuf = (int32_t *)HDcalloc(4096, sizeof(int32_t)); + rbuf = (int32_t *)HDcalloc((size_t)4096, sizeof(int32_t)); HDassert(rbuf); /* Case 1: No metadata in accumulator */ @@ -1054,11 +1054,11 @@ test_accum_adjust(void) /* Read back and verify first write */ if(accum_read((1024 * 1024), (1024 * 1024) - 1, rbuf) < 0) FAIL_STACK_ERROR; - if(HDmemcmp(wbuf, rbuf, (1024 * 1024) - 1) != 0) TEST_ERROR; + if(HDmemcmp(wbuf, rbuf, (size_t)((1024 * 1024) - 1)) != 0) TEST_ERROR; /* Read back and verify second write */ if(accum_read((1024 * 1024) - 1024, 1024, rbuf) < 0) FAIL_STACK_ERROR; - if(HDmemcmp(wbuf, rbuf, 1024) != 0) TEST_ERROR; + if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR; /* Reset accumulator for next case */ if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -1084,10 +1084,10 @@ test_accum_adjust(void) /* Read back and verify both pieces of data */ if(accum_read(1048576, 1048575, rbuf) < 0) FAIL_STACK_ERROR; - if(HDmemcmp(wbuf, rbuf, 1048576) != 0) TEST_ERROR; + if(HDmemcmp(wbuf, rbuf, (size_t)1048576) != 0) TEST_ERROR; if(accum_read(5, 1048571, rbuf) < 0) FAIL_STACK_ERROR; - if(HDmemcmp(wbuf, rbuf, 1048571) != 0) TEST_ERROR; + if(HDmemcmp(wbuf, rbuf, (size_t)1048571) != 0) TEST_ERROR; /* Reset accumulator for next case */ if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -1122,7 +1122,7 @@ test_accum_adjust(void) /* Read in the piece we wrote to disk above, and then verify that the data is as expected */ if(accum_read((1024 * 1024) - 1, 1024, rbuf) < 0) FAIL_STACK_ERROR; - if(HDmemcmp(wbuf, rbuf, 1024) != 0) TEST_ERROR; + if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR; /* Reset accumulator for next case */ if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -1162,7 +1162,7 @@ test_accum_adjust(void) /* Read in the piece we wrote to disk above, and then verify that the data is as expected */ if(accum_read(1048571, 349523, rbuf) < 0) FAIL_STACK_ERROR; - if(HDmemcmp(wbuf, rbuf, 349523) != 0) TEST_ERROR; + if(HDmemcmp(wbuf, rbuf, (size_t)349523) != 0) TEST_ERROR; /* Reset accumulator for next case */ if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -1199,7 +1199,7 @@ test_accum_adjust(void) /* Read in the piece we wrote to disk above, and then verify that the data is as expected */ if(accum_read((1024 * 1024) - 5, 10, rbuf) < 0) FAIL_STACK_ERROR; - if(HDmemcmp(wbuf, rbuf, 10) != 0) TEST_ERROR; + if(HDmemcmp(wbuf, rbuf, (size_t)10) != 0) TEST_ERROR; /* Reset accumulator for next case */ if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -1231,7 +1231,7 @@ test_accum_adjust(void) /* Read in the piece we wrote to disk above, and then verify that the data is as expected */ if(accum_read(1048571, 349523, rbuf) < 0) FAIL_STACK_ERROR; - if(HDmemcmp(wbuf, rbuf, 349523) != 0) TEST_ERROR; + if(HDmemcmp(wbuf, rbuf, (size_t)349523) != 0) TEST_ERROR; if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -1314,7 +1314,7 @@ test_read_after(void) /* Read in the piece we wrote to disk above, and then verify that the data is as expected */ if(accum_read(512, 512, rbuf) < 0) FAIL_STACK_ERROR; - if(HDmemcmp(wbuf, rbuf, 128) != 0) TEST_ERROR; + if(HDmemcmp(wbuf, rbuf, (size_t)128) != 0) TEST_ERROR; if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -1356,13 +1356,13 @@ test_big(void) unsigned u; /* Local index variable */ /* Allocate space for the write & read buffers */ - wbuf = (uint8_t *)HDmalloc(BIG_BUF_SIZE); + wbuf = (uint8_t *)HDmalloc((size_t)BIG_BUF_SIZE); HDassert(wbuf); - wbuf2 = (uint8_t *)HDmalloc(BIG_BUF_SIZE); + wbuf2 = (uint8_t *)HDmalloc((size_t)BIG_BUF_SIZE); HDassert(wbuf2); - rbuf = (uint8_t *)HDcalloc(BIG_BUF_SIZE + 1536, 1); + rbuf = (uint8_t *)HDcalloc((size_t)(BIG_BUF_SIZE + 1536), (size_t)1); HDassert(rbuf); - zbuf = (uint8_t *)HDcalloc(BIG_BUF_SIZE + 1536, 1); + zbuf = (uint8_t *)HDcalloc((size_t)(BIG_BUF_SIZE + 1536), (size_t)1); HDassert(zbuf); /* Initialize write buffers */ @@ -1380,12 +1380,12 @@ test_big(void) if(accum_read(0, BIG_BUF_SIZE, rbuf) < 0) FAIL_STACK_ERROR; /* Verify data read */ - if(HDmemcmp(wbuf, rbuf, BIG_BUF_SIZE) != 0) TEST_ERROR; + if(HDmemcmp(wbuf, rbuf, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR; /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR; - HDmemset(rbuf, 0, BIG_BUF_SIZE); + HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE); if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -1397,14 +1397,14 @@ test_big(void) if(accum_read(0, BIG_BUF_SIZE, rbuf) < 0) FAIL_STACK_ERROR; /* Verify data read */ - if(HDmemcmp(zbuf, rbuf, 1024) != 0) TEST_ERROR; - if(HDmemcmp(wbuf, rbuf + 1024, 1024) != 0) TEST_ERROR; - if(HDmemcmp(zbuf, rbuf + 2048, (BIG_BUF_SIZE - 2048)) != 0) TEST_ERROR; + if(HDmemcmp(zbuf, rbuf, (size_t)1024) != 0) TEST_ERROR; + if(HDmemcmp(wbuf, rbuf + 1024, (size_t)1024) != 0) TEST_ERROR; + if(HDmemcmp(zbuf, rbuf + 2048, (size_t)(BIG_BUF_SIZE - 2048)) != 0) TEST_ERROR; /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(1024, 1024, zbuf) < 0) FAIL_STACK_ERROR; - HDmemset(rbuf, 0, BIG_BUF_SIZE); + HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE); if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -1416,13 +1416,13 @@ test_big(void) if(accum_read(0, BIG_BUF_SIZE, rbuf) < 0) FAIL_STACK_ERROR; /* Verify data read */ - if(HDmemcmp(zbuf, rbuf, (BIG_BUF_SIZE - 512)) != 0) TEST_ERROR; - if(HDmemcmp(wbuf, rbuf + (BIG_BUF_SIZE - 512), 512) != 0) TEST_ERROR; + if(HDmemcmp(zbuf, rbuf, (size_t)(BIG_BUF_SIZE - 512)) != 0) TEST_ERROR; + if(HDmemcmp(wbuf, rbuf + (BIG_BUF_SIZE - 512), (size_t)512) != 0) TEST_ERROR; /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(BIG_BUF_SIZE - 512, 1024, zbuf) < 0) FAIL_STACK_ERROR; - HDmemset(rbuf, 0, BIG_BUF_SIZE); + HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE); if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -1434,13 +1434,13 @@ test_big(void) if(accum_read(512, BIG_BUF_SIZE, rbuf) < 0) FAIL_STACK_ERROR; /* Verify data read */ - if(HDmemcmp(wbuf + 512, rbuf, 512) != 0) TEST_ERROR; - if(HDmemcmp(zbuf, rbuf + 512, (BIG_BUF_SIZE - 512)) != 0) TEST_ERROR; + if(HDmemcmp(wbuf + 512, rbuf, (size_t)512) != 0) TEST_ERROR; + if(HDmemcmp(zbuf, rbuf + 512, (size_t)(BIG_BUF_SIZE - 512)) != 0) TEST_ERROR; /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, 1024, zbuf) < 0) FAIL_STACK_ERROR; - HDmemset(rbuf, 0, BIG_BUF_SIZE); + HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE); if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -1457,12 +1457,12 @@ test_big(void) if(accum_read(0, BIG_BUF_SIZE, rbuf) < 0) FAIL_STACK_ERROR; /* Verify data read */ - if(HDmemcmp(wbuf2, rbuf, BIG_BUF_SIZE) != 0) TEST_ERROR; + if(HDmemcmp(wbuf2, rbuf, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR; /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR; - HDmemset(rbuf, 0, BIG_BUF_SIZE); + HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE); if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -1479,13 +1479,13 @@ test_big(void) if(accum_read(0, BIG_BUF_SIZE + 512, rbuf) < 0) FAIL_STACK_ERROR; /* Verify data read */ - if(HDmemcmp(wbuf2, rbuf, BIG_BUF_SIZE) != 0) TEST_ERROR; - if(HDmemcmp(wbuf + 512, rbuf + BIG_BUF_SIZE, 512) != 0) TEST_ERROR; + if(HDmemcmp(wbuf2, rbuf, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR; + if(HDmemcmp(wbuf + 512, rbuf + BIG_BUF_SIZE, (size_t)512) != 0) TEST_ERROR; /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, BIG_BUF_SIZE + 512, zbuf) < 0) FAIL_STACK_ERROR; - HDmemset(rbuf, 0, BIG_BUF_SIZE + 512); + HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 512)); if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -1506,14 +1506,14 @@ test_big(void) if(accum_read(0, BIG_BUF_SIZE + 1024, rbuf) < 0) FAIL_STACK_ERROR; /* Verify data read */ - if(HDmemcmp(wbuf2, rbuf, BIG_BUF_SIZE) != 0) TEST_ERROR; - if(HDmemcmp(zbuf, rbuf + BIG_BUF_SIZE, 512) != 0) TEST_ERROR; - if(HDmemcmp(wbuf, rbuf + BIG_BUF_SIZE + 512, 512) != 0) TEST_ERROR; + if(HDmemcmp(wbuf2, rbuf, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR; + if(HDmemcmp(zbuf, rbuf + BIG_BUF_SIZE, (size_t)512) != 0) TEST_ERROR; + if(HDmemcmp(wbuf, rbuf + BIG_BUF_SIZE + 512, (size_t)512) != 0) TEST_ERROR; /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, BIG_BUF_SIZE + 1536, zbuf) < 0) FAIL_STACK_ERROR; - HDmemset(rbuf, 0, BIG_BUF_SIZE + 1024); + HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 1024)); if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -1535,13 +1535,13 @@ test_big(void) if(accum_read(0, BIG_BUF_SIZE + 1536, rbuf) < 0) FAIL_STACK_ERROR; /* Verify data read */ - if(HDmemcmp(zbuf, rbuf, 1536) != 0) TEST_ERROR; - if(HDmemcmp(wbuf2, rbuf + 1536, BIG_BUF_SIZE) != 0) TEST_ERROR; + if(HDmemcmp(zbuf, rbuf, (size_t)1536) != 0) TEST_ERROR; + if(HDmemcmp(wbuf2, rbuf + 1536, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR; /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(1536, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR; - HDmemset(rbuf, 0, BIG_BUF_SIZE + 1536); + HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 1536)); if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -1562,13 +1562,13 @@ test_big(void) if(accum_read(0, BIG_BUF_SIZE + 512, rbuf) < 0) FAIL_STACK_ERROR; /* Verify data read */ - if(HDmemcmp(zbuf, rbuf, 512) != 0) TEST_ERROR; - if(HDmemcmp(wbuf2, rbuf + 512, BIG_BUF_SIZE) != 0) TEST_ERROR; + if(HDmemcmp(zbuf, rbuf, (size_t)512) != 0) TEST_ERROR; + if(HDmemcmp(wbuf2, rbuf + 512, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR; /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(512, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR; - HDmemset(rbuf, 0, BIG_BUF_SIZE + 512); + HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 512)); if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -1589,14 +1589,14 @@ test_big(void) if(accum_read(0, BIG_BUF_SIZE + 1536, rbuf) < 0) FAIL_STACK_ERROR; /* Verify data read */ - if(HDmemcmp(wbuf, rbuf, 1024) != 0) TEST_ERROR; - if(HDmemcmp(zbuf, rbuf + 1024, 512) != 0) TEST_ERROR; - if(HDmemcmp(wbuf2, rbuf + 1536, BIG_BUF_SIZE) != 0) TEST_ERROR; + if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR; + if(HDmemcmp(zbuf, rbuf + 1024, (size_t)512) != 0) TEST_ERROR; + if(HDmemcmp(wbuf2, rbuf + 1536, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR; /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, BIG_BUF_SIZE + 1536, zbuf) < 0) FAIL_STACK_ERROR; - HDmemset(rbuf, 0, BIG_BUF_SIZE + 1536); + HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 1536)); if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -1617,8 +1617,8 @@ test_big(void) if(accum_read(0, BIG_BUF_SIZE + 512, rbuf) < 0) FAIL_STACK_ERROR; /* Verify data read */ - if(HDmemcmp(wbuf, rbuf, 512) != 0) TEST_ERROR; - if(HDmemcmp(wbuf2, rbuf + 512, BIG_BUF_SIZE) != 0) TEST_ERROR; + if(HDmemcmp(wbuf, rbuf, (size_t)512) != 0) TEST_ERROR; + if(HDmemcmp(wbuf2, rbuf + 512, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR; if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -1670,9 +1670,9 @@ test_random_write(void) unsigned u; /* Local index variable */ /* Allocate space for the write & read buffers */ - wbuf = (uint8_t *)malloc(RANDOM_BUF_SIZE); + wbuf = (uint8_t *)malloc((size_t)RANDOM_BUF_SIZE); HDassert(wbuf); - rbuf = (uint8_t *)calloc(RANDOM_BUF_SIZE, 1); + rbuf = (uint8_t *)calloc((size_t)RANDOM_BUF_SIZE, (size_t)1); HDassert(rbuf); /* Initialize write buffer */ @@ -1756,7 +1756,7 @@ HDfprintf(stderr, "Random # seed was: %u\n", seed); if(accum_read(RANDOM_BASE_OFF, RANDOM_BUF_SIZE, rbuf) < 0) FAIL_STACK_ERROR; /* Verify data read back in */ - if(HDmemcmp(wbuf, rbuf, RANDOM_BUF_SIZE) != 0) TEST_ERROR; + if(HDmemcmp(wbuf, rbuf, (size_t)RANDOM_BUF_SIZE) != 0) TEST_ERROR; if(accum_reset() < 0) FAIL_STACK_ERROR; @@ -1810,6 +1810,8 @@ test_swmr_write_big(void) unsigned u; /* Local index variable */ pid_t pid; /* Process ID */ int status; /* Status returned from child process */ + char *new_argv[] = {NULL}; + char *new_envp[] = {NULL}; TESTING("SWMR write of large metadata"); @@ -1845,9 +1847,9 @@ test_swmr_write_big(void) FAIL_STACK_ERROR; /* Allocate space for the write & read buffers */ - if((wbuf2 = (uint8_t *)HDmalloc(BIG_BUF_SIZE)) == NULL) + if((wbuf2 = (uint8_t *)HDmalloc((size_t)BIG_BUF_SIZE)) == NULL) FAIL_STACK_ERROR; - if((rbuf = (uint8_t *)HDmalloc(BIG_BUF_SIZE)) == NULL) + if((rbuf = (uint8_t *)HDmalloc((size_t)BIG_BUF_SIZE)) == NULL) FAIL_STACK_ERROR; /* Initialize wbuf with "0, 1, 2...1024"*/ @@ -1861,7 +1863,7 @@ test_swmr_write_big(void) if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, H5P_DATASET_XFER_DEFAULT, rbuf) < 0) FAIL_STACK_ERROR; /* Verify the data read is correct */ - if(HDmemcmp(wbuf, rbuf, 1024) != 0) TEST_ERROR; + if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR; /* Flush the data to disk */ if(H5F_accum_reset(rf, H5P_DATASET_XFER_DEFAULT, TRUE) < 0) FAIL_STACK_ERROR; @@ -1881,7 +1883,7 @@ test_swmr_write_big(void) if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, H5P_DATASET_XFER_DEFAULT, rbuf) < 0) FAIL_STACK_ERROR; /* Verify the data read is correct */ - if(HDmemcmp(wbuf, rbuf, 1024) != 0) TEST_ERROR; + if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR; /* The data stays in the accumulator */ /* Write a large piece of metadata [2048, BIG_BUF_SIZE] with wbuf2 */ @@ -1891,7 +1893,7 @@ test_swmr_write_big(void) if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)2048, (size_t)BIG_BUF_SIZE, H5P_DATASET_XFER_DEFAULT, rbuf) < 0) FAIL_STACK_ERROR; /* Verify the data read is correct */ - if(HDmemcmp(wbuf2, rbuf, BIG_BUF_SIZE) != 0) TEST_ERROR; + if(HDmemcmp(wbuf2, rbuf, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR; /* Fork child process to verify that the data at [1024, 2014] does get written to disk */ if((pid = HDfork()) < 0) { @@ -1899,7 +1901,8 @@ test_swmr_write_big(void) FAIL_STACK_ERROR; } else if(0 == pid) { /* Child process */ /* Run the reader */ - status = HDexecve(SWMR_READER, NULL, NULL); + status = HDexecve(SWMR_READER, new_argv, new_envp); + printf("errno from execve = %s\n", strerror(errno)); FAIL_STACK_ERROR; } diff --git a/test/tfile.c b/test/tfile.c index 26a94cb..7ea50c6 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -3475,15 +3475,23 @@ static void test_swmr_write(void) { hid_t fid, fid2; /* File IDs */ + hid_t fapl; /* File access property list id */ unsigned intent; /* File access flags */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing H5F_ACC_SWMR_WRITE access flag\n")); + /* Create a copy of the file access property list */ + fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(fapl, FAIL, "H5Pcreate"); + + /* Set to use the latest library format */ + ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); + CHECK(ret, FAIL, "H5Pset_libver_bounds"); /* Create file, without SWMR_WRITE flag */ - fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); CHECK(fid, FAIL, "H5Fcreate"); /* Get the intent & check that the SWMR_WRITE flag is not set */ @@ -3493,7 +3501,7 @@ test_swmr_write(void) /* Try to reopen file w/SWMR_WRITE flag */ H5E_BEGIN_TRY { - fid2 = H5Fopen(FILE1, (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE), H5P_DEFAULT); + fid2 = H5Fopen(FILE1, (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE), fapl); } H5E_END_TRY; VERIFY(fid2, FAIL, "H5Fopen"); @@ -3503,7 +3511,7 @@ test_swmr_write(void) /* Create file, with SWMR_WRITE flag */ - fid = H5Fcreate(FILE1, (H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE), H5P_DEFAULT, H5P_DEFAULT); + fid = H5Fcreate(FILE1, (H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE), H5P_DEFAULT, fapl); CHECK(fid, FAIL, "H5Fcreate"); /* Get the intent & check that the SWMR_WRITE flag is set */ @@ -3513,12 +3521,12 @@ test_swmr_write(void) /* Try to reopen file w/o SWMR_WRITE flag */ H5E_BEGIN_TRY { - fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT); + fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl); } H5E_END_TRY; VERIFY(fid2, FAIL, "H5Fopen"); /* Reopen file, with read-write and SWMR_WRITE access */ - fid2 = H5Fopen(FILE1, (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE), H5P_DEFAULT); + fid2 = H5Fopen(FILE1, (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE), fapl); CHECK(fid2, FAIL, "H5Fopen"); /* Get the intent & check that the SWMR_WRITE flag is set */ @@ -3537,13 +3545,13 @@ test_swmr_write(void) /* Try to reopen file read-only w/SWMR_WRITE flag */ H5E_BEGIN_TRY { - fid = H5Fopen(FILE1, (H5F_ACC_RDONLY | H5F_ACC_SWMR_WRITE), H5P_DEFAULT); + fid = H5Fopen(FILE1, (H5F_ACC_RDONLY | H5F_ACC_SWMR_WRITE), fapl); } H5E_END_TRY; VERIFY(fid, FAIL, "H5Fopen"); /* Reopen file, with read-write and SWMR_WRITE access */ - fid = H5Fopen(FILE1, (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE), H5P_DEFAULT); + fid = H5Fopen(FILE1, (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE), fapl); CHECK(fid, FAIL, "H5Fopen"); /* Get the intent & check that the SWMR_WRITE flag is set */ @@ -3553,12 +3561,12 @@ test_swmr_write(void) /* Try to reopen file w/o SWMR_WRITE flag */ H5E_BEGIN_TRY { - fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT); + fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl); } H5E_END_TRY; VERIFY(fid2, FAIL, "H5Fopen"); /* Reopen file, with read-write and SWMR_WRITE access */ - fid2 = H5Fopen(FILE1, (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE), H5P_DEFAULT); + fid2 = H5Fopen(FILE1, (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE), fapl); CHECK(fid2, FAIL, "H5Fopen"); /* Get the intent & check that the SWMR_WRITE flag is set */ @@ -3573,6 +3581,11 @@ test_swmr_write(void) /* Close file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); + + /* Close the property list */ + ret = H5Pclose(fapl); + CHECK(ret, FAIL, "H5Pclose"); + } /* end test_swmr_write() */ /**************************************************************** -- cgit v0.12