summaryrefslogtreecommitdiffstats
path: root/tools/h5stat
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/h5stat
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/h5stat')
-rw-r--r--tools/h5stat/h5stat.c8
-rw-r--r--tools/h5stat/testh5stat.sh.in17
2 files changed, 21 insertions, 4 deletions
diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c
index a5d7eef..e9fa0fa 100644
--- a/tools/h5stat/h5stat.c
+++ b/tools/h5stat/h5stat.c
@@ -823,7 +823,7 @@ freespace_stats(hid_t fid, iter_t *iter)
} /* end for */
if(sect_info)
- free(sect_info);
+ HDfree(sect_info);
return 0;
} /* end freespace_stats() */
@@ -1756,9 +1756,9 @@ main(int argc, const char *argv[])
iter.free_hdr = finfo.free.meta_size;
} /* end else */
- iter.num_small_groups = (unsigned long *)calloc((size_t)sgroups_threshold, sizeof(unsigned long));
- iter.num_small_attrs = (unsigned long *)calloc((size_t)(sattrs_threshold+1), sizeof(unsigned long));
- iter.small_dset_dims = (unsigned long *)calloc((size_t)sdsets_threshold, sizeof(unsigned long));
+ iter.num_small_groups = (unsigned long *)HDcalloc((size_t)sgroups_threshold, sizeof(unsigned long));
+ iter.num_small_attrs = (unsigned long *)HDcalloc((size_t)(sattrs_threshold+1), sizeof(unsigned long));
+ iter.small_dset_dims = (unsigned long *)HDcalloc((size_t)sdsets_threshold, sizeof(unsigned long));
if(iter.num_small_groups == NULL || iter.num_small_attrs == NULL || iter.small_dset_dims == NULL) {
error_msg("Unable to allocate memory for tracking small groups/datasets/attributes\n");
diff --git a/tools/h5stat/testh5stat.sh.in b/tools/h5stat/testh5stat.sh.in
index 91b9c3d..85cc1d4 100644
--- a/tools/h5stat/testh5stat.sh.in
+++ b/tools/h5stat/testh5stat.sh.in
@@ -37,6 +37,7 @@ EXIT_FAILURE=1
STAT=h5stat # The tool name
STAT_BIN=`pwd`/$STAT # The path of the tool binary
+RM='rm -rf'
CMP='cmp -s'
DIFF='diff -c'
CP='cp'
@@ -149,6 +150,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".
#
@@ -298,6 +312,9 @@ TOOLTEST h5stat_numattrs3.ddl -A --numattrs=25 h5stat_threshold.h5
TOOLTEST h5stat_numattrs4.ddl -A -a 100 h5stat_newgrat.h5
#
+# Clean up temporary files/directories
+CLEAN_TESTFILES_AND_TESTDIR
+
if test $nerrors -eq 0 ; then
echo "All $TESTNAME tests passed."
exit $EXIT_SUCCESS