summaryrefslogtreecommitdiffstats
path: root/tools/misc
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2013-11-19 23:00:19 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2013-11-19 23:00:19 (GMT)
commit9dfe3e854f023fb2351cdd014c1954297e9fd921 (patch)
treefbe8d544de76a35a7b46b2733ebdae20f8007b33 /tools/misc
parent612faec1aceceb595c77da52b092b7683581e776 (diff)
downloadhdf5-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/misc')
-rw-r--r--tools/misc/h5repart.c4
-rw-r--r--tools/misc/talign.c10
-rw-r--r--tools/misc/testh5mkgrp.sh.in16
3 files changed, 23 insertions, 7 deletions
diff --git a/tools/misc/h5repart.c b/tools/misc/h5repart.c
index 07f6bfd..ffd52e8 100644
--- a/tools/misc/h5repart.c
+++ b/tools/misc/h5repart.c
@@ -290,7 +290,7 @@ main (int argc, char *argv[])
if (argno<argc) usage (prog_name);
/* Now the real work, split the file */
- buf = malloc (blk_size);
+ buf = HDmalloc (blk_size);
while (src_offset<src_size) {
/* Read a block. The amount to read is the minimum of:
@@ -498,6 +498,6 @@ main (int argc, char *argv[])
}
/* Free resources and return */
- free (buf);
+ HDfree (buf);
return EXIT_SUCCESS;
}
diff --git a/tools/misc/talign.c b/tools/misc/talign.c
index 017eb55..66318bf 100644
--- a/tools/misc/talign.c
+++ b/tools/misc/talign.c
@@ -126,7 +126,7 @@ int main(void)
H5Dclose(set);
/* Now open the set, and read it back in */
- data = (char *)malloc(H5Tget_size(fix));
+ data = (char *)HDmalloc(H5Tget_size(fix));
if(!data) {
perror("malloc() failed");
@@ -152,7 +152,7 @@ out:
mname ? mname : "(null)", (int)H5Tget_member_offset(fix,0),
string5, (char *)(data + H5Tget_member_offset(fix, 0)));
if(mname)
- free(mname);
+ HDfree(mname);
fptr = (float *)(data + H5Tget_member_offset(fix, 1));
mname = H5Tget_member_name(fix, 1);
@@ -163,7 +163,7 @@ out:
(double)fok[0], (double)fptr[0],
(double)fok[1], (double)fptr[1]);
if(mname)
- free(mname);
+ HDfree(mname);
fptr = (float *)(data + H5Tget_member_offset(fix, 2));
mname = H5Tget_member_name(fix, 2);
@@ -173,7 +173,7 @@ out:
(double)fnok[0], (double)fptr[0],
(double)fnok[1], (double)fptr[1]);
if(mname)
- free(mname);
+ HDfree(mname);
fptr = (float *)(data + H5Tget_member_offset(fix, 1));
printf("\n"
@@ -192,7 +192,7 @@ out:
}
if(data)
- free(data);
+ HDfree(data);
H5Sclose(spc);
H5Tclose(cmp);
H5Tclose(cmp1);
diff --git a/tools/misc/testh5mkgrp.sh.in b/tools/misc/testh5mkgrp.sh.in
index 5ec1a28..85205a8 100644
--- a/tools/misc/testh5mkgrp.sh.in
+++ b/tools/misc/testh5mkgrp.sh.in
@@ -31,6 +31,7 @@ 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
+RM='rm -rf'
CMP='cmp'
DIFF='diff -c'
CP='cp'
@@ -111,6 +112,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 line-line message left justified in a field of 70 characters
# beginning with the word "Testing".
TESTING()
@@ -299,6 +313,8 @@ 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
+# Clean up temporary files/directories
+CLEAN_TESTFILES_AND_TESTDIR
if test $nerrors -eq 0 ; then
echo "All $TESTNAME tests passed."