summaryrefslogtreecommitdiffstats
path: root/tools/h5dump
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2012-07-09 19:41:17 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2012-07-09 19:41:17 (GMT)
commit17eca872f13fb7e880438dca76f40d371293bc8a (patch)
tree40cc2f0e22be7ebc357ebb2e696e44e7a2f406ae /tools/h5dump
parent637df34074604c314cd55a3b0cad733e35255ceb (diff)
downloadhdf5-17eca872f13fb7e880438dca76f40d371293bc8a.zip
hdf5-17eca872f13fb7e880438dca76f40d371293bc8a.tar.gz
hdf5-17eca872f13fb7e880438dca76f40d371293bc8a.tar.bz2
[svn-r22531] HDFFV-5942: sort options with contents option
Added static local variables in h5trav to hold the index_by and index_order values. Defaults are set. H5dump only use of the trav_print function, added two parameters and passed in the sort_by and sort_order variables. Tested: local linux
Diffstat (limited to 'tools/h5dump')
-rw-r--r--tools/h5dump/CMakeLists.txt2
-rw-r--r--tools/h5dump/h5dump_ddl.c2
-rw-r--r--tools/h5dump/testh5dump.sh.in2
3 files changed, 5 insertions, 1 deletions
diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt
index 3bc481d..d89db0d 100644
--- a/tools/h5dump/CMakeLists.txt
+++ b/tools/h5dump/CMakeLists.txt
@@ -1096,6 +1096,8 @@ IF (BUILD_TESTING)
# test for file contents
ADD_H5_TEST (tcontents 0 --enable-error-stack -n tfcontents1.h5)
+ ADD_H5_TEST (tordercontents1 0 --enable-error-stack -n --sort_by=name --sort_order=ascending tfcontents1.h5)
+ ADD_H5_TEST (tordercontents2 0 --enable-error-stack -n --sort_by=name --sort_order=descending tfcontents1.h5)
# tests for storage layout
# compact
diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c
index 22d2a2b..c0a9884 100644
--- a/tools/h5dump/h5dump_ddl.c
+++ b/tools/h5dump/h5dump_ddl.c
@@ -1294,7 +1294,7 @@ dump_fcontents(hid_t fid)
}
/* print objects in the files */
- h5trav_print(fid);
+ h5trav_print(fid, sort_by, sort_order);
HDfprintf(rawoutstream, " %s\n",END);
}
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in
index 3bd0dfd..8c7d754 100644
--- a/tools/h5dump/testh5dump.sh.in
+++ b/tools/h5dump/testh5dump.sh.in
@@ -720,6 +720,8 @@ TOOLTEST3 tperror.ddl --enable-error-stack -p -d bogus tfcontents1.h5
# test for file contents
TOOLTEST tcontents.ddl --enable-error-stack -n tfcontents1.h5
+TOOLTEST tordercontents1.ddl --enable-error-stack -n --sort_by=name --sort_order=ascending tfcontents1.h5
+TOOLTEST tordercontents2.ddl --enable-error-stack -n --sort_by=name --sort_order=descending tfcontents1.h5
# tests for storage layout
# compact