diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2013-11-19 23:00:19 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2013-11-19 23:00:19 (GMT) |
commit | 9dfe3e854f023fb2351cdd014c1954297e9fd921 (patch) | |
tree | fbe8d544de76a35a7b46b2733ebdae20f8007b33 /tools/h5copy | |
parent | 612faec1aceceb595c77da52b092b7683581e776 (diff) | |
download | hdf5-9dfe3e854f023fb2351cdd014c1954297e9fd921.zip hdf5-9dfe3e854f023fb2351cdd014c1954297e9fd921.tar.gz hdf5-9dfe3e854f023fb2351cdd014c1954297e9fd921.tar.bz2 |
[svn-r24457] Bring revisions #24333 - #24432 from trunk to revise_chunks.
h5committested.
Diffstat (limited to 'tools/h5copy')
-rw-r--r-- | tools/h5copy/h5copygentest.c | 12 | ||||
-rw-r--r-- | tools/h5copy/testh5copy.sh.in | 17 |
2 files changed, 23 insertions, 6 deletions
diff --git a/tools/h5copy/h5copygentest.c b/tools/h5copy/h5copygentest.c index 8fc7144..e696b1b 100644 --- a/tools/h5copy/h5copygentest.c +++ b/tools/h5copy/h5copygentest.c @@ -240,10 +240,10 @@ static void gent_named_vl(hid_t loc_id) /* allocate and initialize VL dataset to write */ buf[0].len = 1; - buf[0].p = malloc( 1 * sizeof(int)); + buf[0].p = HDmalloc( 1 * sizeof(int)); ((int *)buf[0].p)[0]=1; buf[1].len = 2; - buf[1].p = malloc( 2 * sizeof(int)); + buf[1].p = HDmalloc( 2 * sizeof(int)); ((int *)buf[1].p)[0]=2; ((int *)buf[1].p)[1]=3; @@ -286,16 +286,16 @@ static void gent_nested_vl(hid_t loc_id) /* allocate and initialize VL dataset to write */ buf[0].len = 1; - buf[0].p = malloc( 1 * sizeof(hvl_t)); + buf[0].p = HDmalloc( 1 * sizeof(hvl_t)); tvl = (hvl_t *)buf[0].p; - tvl->p = malloc( 1 * sizeof(int) ); + tvl->p = HDmalloc( 1 * sizeof(int) ); tvl->len = 1; ((int *)tvl->p)[0]=1; buf[1].len = 1; - buf[1].p = malloc( 1 * sizeof(hvl_t)); + buf[1].p = HDmalloc( 1 * sizeof(hvl_t)); tvl = (hvl_t *)buf[1].p; - tvl->p = malloc( 2 * sizeof(int) ); + tvl->p = HDmalloc( 2 * sizeof(int) ); tvl->len = 2; ((int *)tvl->p)[0]=2; ((int *)tvl->p)[1]=3; diff --git a/tools/h5copy/testh5copy.sh.in b/tools/h5copy/testh5copy.sh.in index bec3bfc..77c64c4 100644 --- a/tools/h5copy/testh5copy.sh.in +++ b/tools/h5copy/testh5copy.sh.in @@ -67,6 +67,8 @@ H5DIFF_BIN=`pwd`/../h5diff/$H5DIFF # The path of the h5diff tool binary H5LS=h5ls # The h5ls tool name H5LS_ARGS=-Svr # Arguments to the h5ls tool H5LS_BIN=`pwd`/../h5ls/$H5LS # The path of the h5ls tool binary + +RM='rm -rf' CMP='cmp -s' DIFF='diff -c' CP='cp' @@ -121,6 +123,19 @@ COPY_TESTFILES_TO_TESTDIR() done } +CLEAN_TESTFILES_AND_TESTDIR() +{ + # skip rm 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 + $RM $TESTDIR + fi +} + # Print a "SKIP" message SKIP() { @@ -578,6 +593,8 @@ COPY_REFERENCES COPY_EXT_LINKS TEST_MISC +# Clean up temporary files/directories +CLEAN_TESTFILES_AND_TESTDIR if test $nerrors -eq 0 ; then echo "All $TESTNAME tests passed." |