mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-31 17:10:47 +08:00
[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
This commit is contained in:
parent
058f9c2056
commit
386b3e971b
@ -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)
|
||||
|
@ -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 */
|
||||
|
@ -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
|
||||
|
@ -7,7 +7,37 @@ DATASET "/dset2" {
|
||||
DATATYPE H5T_IEEE_F64BE
|
||||
DATASPACE SIMPLE { ( 30, 20 ) / ( 30, 20 ) }
|
||||
}
|
||||
DATASET "dset3" {
|
||||
}
|
||||
}
|
||||
h5dump error: unable to open dataset "dset3"
|
||||
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
|
||||
#000: (file name) line (number) in H5Dopen2(): not found
|
||||
major: Dataset
|
||||
minor: Object not found
|
||||
#001: (file name) line (number) in H5G_loc_find(): can't find object
|
||||
major: Symbol table
|
||||
minor: Object not found
|
||||
#002: (file name) line (number) in H5G_traverse(): internal path traversal failed
|
||||
major: Symbol table
|
||||
minor: Object not found
|
||||
#003: (file name) line (number) in H5G_traverse_real(): traversal operator failed
|
||||
major: Symbol table
|
||||
minor: Callback failed
|
||||
#004: (file name) line (number) in H5G_loc_find_cb(): object 'dset3' doesn't exist
|
||||
major: Symbol table
|
||||
minor: Object not found
|
||||
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
|
||||
#000: (file name) line (number) in H5Lget_info(): unable to get link info
|
||||
major: Symbol table
|
||||
minor: Object not found
|
||||
#001: (file name) line (number) in H5L_get_info(): name doesn't exist
|
||||
major: Symbol table
|
||||
minor: Object already exists
|
||||
#002: (file name) line (number) in H5G_traverse(): internal path traversal failed
|
||||
major: Symbol table
|
||||
minor: Object not found
|
||||
#003: (file name) line (number) in H5G_traverse_real(): traversal operator failed
|
||||
major: Symbol table
|
||||
minor: Callback failed
|
||||
#004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist
|
||||
major: Symbol table
|
||||
minor: Object not found
|
||||
h5dump error: unable to get link info from "dset3"
|
||||
|
@ -1,5 +1,35 @@
|
||||
HDF5 "tfcontents1.h5" {
|
||||
DATASET "bogus" {
|
||||
}
|
||||
}
|
||||
h5dump error: unable to open dataset "bogus"
|
||||
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
|
||||
#000: (file name) line (number) in H5Dopen2(): not found
|
||||
major: Dataset
|
||||
minor: Object not found
|
||||
#001: (file name) line (number) in H5G_loc_find(): can't find object
|
||||
major: Symbol table
|
||||
minor: Object not found
|
||||
#002: (file name) line (number) in H5G_traverse(): internal path traversal failed
|
||||
major: Symbol table
|
||||
minor: Object not found
|
||||
#003: (file name) line (number) in H5G_traverse_real(): traversal operator failed
|
||||
major: Symbol table
|
||||
minor: Callback failed
|
||||
#004: (file name) line (number) in H5G_loc_find_cb(): object 'bogus' doesn't exist
|
||||
major: Symbol table
|
||||
minor: Object not found
|
||||
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
|
||||
#000: (file name) line (number) in H5Lget_info(): unable to get link info
|
||||
major: Symbol table
|
||||
minor: Object not found
|
||||
#001: (file name) line (number) in H5L_get_info(): name doesn't exist
|
||||
major: Symbol table
|
||||
minor: Object already exists
|
||||
#002: (file name) line (number) in H5G_traverse(): internal path traversal failed
|
||||
major: Symbol table
|
||||
minor: Object not found
|
||||
#003: (file name) line (number) in H5G_traverse_real(): traversal operator failed
|
||||
major: Symbol table
|
||||
minor: Callback failed
|
||||
#004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist
|
||||
major: Symbol table
|
||||
minor: Object not found
|
||||
h5dump error: unable to get link info from "bogus"
|
||||
|
30
tools/testfiles/tslink-D.ddl
Normal file
30
tools/testfiles/tslink-D.ddl
Normal file
@ -0,0 +1,30 @@
|
||||
HDF5 "tslink.h5" {
|
||||
SOFTLINK "/slink1" {
|
||||
LINKTARGET "somevalue"
|
||||
}
|
||||
}
|
||||
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
|
||||
#000: (file name) line (number) in H5Dopen2(): not found
|
||||
major: Dataset
|
||||
minor: Object not found
|
||||
#001: (file name) line (number) in H5G_loc_find(): can't find object
|
||||
major: Symbol table
|
||||
minor: Object not found
|
||||
#002: (file name) line (number) in H5G_traverse(): internal path traversal failed
|
||||
major: Symbol table
|
||||
minor: Object not found
|
||||
#003: (file name) line (number) in H5G_traverse_real(): special link traversal failed
|
||||
major: Links
|
||||
minor: Link traversal failure
|
||||
#004: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed
|
||||
major: Links
|
||||
minor: Link traversal failure
|
||||
#005: (file name) line (number) in H5G_traverse_slink(): unable to follow symbolic link
|
||||
major: Symbol table
|
||||
minor: Object not found
|
||||
#006: (file name) line (number) in H5G_traverse_real(): traversal operator failed
|
||||
major: Symbol table
|
||||
minor: Callback failed
|
||||
#007: (file name) line (number) in H5G_traverse_slink_cb(): component not found
|
||||
major: Symbol table
|
||||
minor: Object not found
|
Loading…
x
Reference in New Issue
Block a user