diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2012-03-05 19:33:30 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2012-03-05 19:33:30 (GMT) |
commit | 386b3e971b91580fad6c97cbdf95219097945ddf (patch) | |
tree | 3a1c7efe4865291a2f829dcc1ed968fddec54fa9 /tools/h5dump | |
parent | 058f9c205676a487d8fb37ff3874176eee7807d3 (diff) | |
download | hdf5-386b3e971b91580fad6c97cbdf95219097945ddf.zip hdf5-386b3e971b91580fad6c97cbdf95219097945ddf.tar.gz hdf5-386b3e971b91580fad6c97cbdf95219097945ddf.tar.bz2 |
[svn-r22027] HDFFV-7839: Dangling link should not display error
If a link is specified on the command with the -d option, call the handle_links function on error from the H5Dopen command.
Updated test file results with error stack when link not found.
Tested: local linux and jam
Diffstat (limited to 'tools/h5dump')
-rw-r--r-- | tools/h5dump/CMakeLists.txt | 6 | ||||
-rw-r--r-- | tools/h5dump/h5dump_ddl.c | 8 | ||||
-rw-r--r-- | tools/h5dump/testh5dump.sh.in | 6 |
3 files changed, 9 insertions, 11 deletions
diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index f77d6a5..b6f98d6 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -928,7 +928,7 @@ IF (BUILD_TESTING) # test for displaying simple space datasets ADD_H5_TEST (tdset-1 0 --enable-error-stack tdset.h5) # test for displaying selected datasets - ADD_H5_TEST (tdset-2 1 -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5) + ADD_H5_MASK_TEST (tdset-2 1 --enable-error-stack -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5) # test for displaying attributes ADD_H5_TEST (tattr-1 0 --enable-error-stack tattr.h5) @@ -947,6 +947,8 @@ IF (BUILD_TESTING) # test for displaying the selected link ADD_H5_TEST (tslink-2 0 --enable-error-stack -l slink2 tslink.h5) ADD_H5_TEST (tudlink-2 0 --enable-error-stack -l udlink2 tudlink.h5) + # test for displaying dangling soft links + ADD_H5_MASK_TEST (tslink-D 0 --enable-error-stack -d /slink1 tslink.h5) # tests for hard links ADD_H5_TEST (thlink-1 0 --enable-error-stack thlink.h5) @@ -1045,7 +1047,7 @@ IF (BUILD_TESTING) ADD_H5_TEST (file_space 0 --enable-error-stack -B file_space.h5) # test -p with a non existing dataset - ADD_H5_TEST (tperror 1 -p -d bogus tfcontents1.h5) + ADD_H5_MASK_TEST (tperror 1 --enable-error-stack -p -d bogus tfcontents1.h5) # test for file contents ADD_H5_TEST (tcontents 0 --enable-error-stack -n tfcontents1.h5) diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c index d00b9e8..be56c9b 100644 --- a/tools/h5dump/h5dump_ddl.c +++ b/tools/h5dump/h5dump_ddl.c @@ -1474,13 +1474,7 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis if((dsetid = H5Dopen2(fid, dset, H5P_DEFAULT)) < 0) { if (pe) { - HDfprintf(rawoutstream, "\n"); - begin_obj(h5tools_dump_header_format->datasetbegin, real_name, h5tools_dump_header_format->datasetblockbegin); - HDfprintf(rawoutstream, "\n"); - indentation(COL); - error_msg("unable to open dataset \"%s\"\n", real_name); - end_obj(h5tools_dump_header_format->datasetend, h5tools_dump_header_format->datasetblockend); - h5tools_setstatus(EXIT_FAILURE); + handle_links(fid, dset, data, pe, display_name); } return; } /* end if */ diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 57168e0..4b18574 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -712,7 +712,7 @@ TOOLTEST tgroup-2.ddl --group=/g2 --group / -g /y tgroup.h5 # test for displaying simple space datasets TOOLTEST tdset-1.ddl --enable-error-stack tdset.h5 # test for displaying selected datasets -TOOLTEST tdset-2.ddl -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5 +TOOLTEST3 tdset-2.ddl --enable-error-stack -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5 # test for displaying attributes TOOLTEST tattr-1.ddl --enable-error-stack tattr.h5 @@ -731,6 +731,8 @@ TOOLTEST tudlink-1.ddl --enable-error-stack tudlink.h5 # test for displaying the selected link TOOLTEST tslink-2.ddl --enable-error-stack -l slink2 tslink.h5 TOOLTEST tudlink-2.ddl --enable-error-stack -l udlink2 tudlink.h5 +# test for displaying dangling soft links +TOOLTEST3 tslink-D.ddl --enable-error-stack -d /slink1 tslink.h5 # tests for hard links TOOLTEST thlink-1.ddl --enable-error-stack thlink.h5 @@ -830,7 +832,7 @@ TOOLTEST tboot2.ddl --enable-error-stack -B tfcontents2.h5 TOOLTEST file_space.ddl --enable-error-stack -B file_space.h5 # test -p with a non existing dataset -TOOLTEST tperror.ddl -p -d bogus tfcontents1.h5 +TOOLTEST3 tperror.ddl --enable-error-stack -p -d bogus tfcontents1.h5 # test for file contents TOOLTEST tcontents.ddl --enable-error-stack -n tfcontents1.h5 |