[svn-r19752] Purpose:

Fixed Bug# 1979 Output from h5ls -rdlS on nested compound datatypes is 
    difficult to parse.

Description:
    Update to add curly brackets for the nested compound members, when
    S (--simple) option is used with -l (--label), so user can tell 
    which members blong to which compound type.
    Merged from hdf5 trunk r19751.


Tested:
 jam (linux32-LE), amani (linux64-LE)
This commit is contained in:
Jonathan Kim
2010-11-09 16:32:26 -05:00
parent f5c14780ca
commit 3b7a375179
9 changed files with 99 additions and 2 deletions

View File

@@ -1358,6 +1358,9 @@
./tools/testfiles/tgroup.ls
./tools/testfiles/tloop-1.ls
./tools/testfiles/tnestcomp-1.ls
./tools/testfiles/tnestcomp-2.ls
./tools/testfiles/tnestcomp-3.ls
./tools/testfiles/tnestcomp-4.ls
./tools/testfiles/tsaf.ls
./tools/testfiles/tstr-1.ls
./tools/testfiles/tattr2.ls

View File

@@ -106,6 +106,10 @@ Bug Fixes since HDF5-1.8.6
Tools
-----
- Fixed h5ls to display nested compound type with curly bracket
when -S (--simple) option is used with -l (--label), so it shows
which member (in curly bracket) belong to which nested compound type
and make the output make sense. bug#1979 (JKM 2010/11/09)
- Fixed h5diff to handle variable-length strings in a compound dataset
correctly. (also variable-length string array in a compound dataset)
Garbage values were displayed when h5diff compared multiple

View File

@@ -72,6 +72,9 @@ IF (BUILD_TESTING)
thlink-1.ls
tloop-1.ls
tnestcomp-1.ls
tnestcomp-2.ls
tnestcomp-3.ls
tnestcomp-4.ls
tsaf.ls
tslink-1.ls
tstr-1.ls
@@ -240,6 +243,12 @@ IF (BUILD_TESTING)
tloop-1.out.err
tnestcomp-1.out
tnestcomp-1.out.err
tnestcomp-2.out
tnestcomp-2.out.err
tnestcomp-3.out
tnestcomp-3.out.err
tnestcomp-4.out
tnestcomp-4.out.err
tsaf.out
tsaf.out.err
tslink-1.out
@@ -325,6 +334,12 @@ IF (BUILD_TESTING)
#test for the nested compound type
ADD_H5_TEST (tnestcomp-1 0 -w80 -r -d tnestedcomp.h5)
ADD_H5_TEST (tnestcomp-2 0 -w80 -r -d -S tnestedcomp.h5)
ADD_H5_TEST (tnestcomp-3 0 -w80 -r -d -l tnestedcomp.h5)
ADD_H5_TEST (tnestcomp-4 0 -w80 -r -d -l -S tnestedcomp.h5)
# test for loop detection
ADD_H5_TEST (tloop-1 0 -w80 -r -d tloop.h5)

View File

@@ -1263,8 +1263,16 @@ dump_dataset_values(hid_t dset)
info.arr_suf = "";
info.arr_sep = " ";
info.cmpd_pre = "";
info.cmpd_suf = "";
if (label_g)
{
info.cmpd_pre = "{";
info.cmpd_suf = "}";
}
else
{
info.cmpd_pre = "";
info.cmpd_suf = "";
}
info.cmpd_sep = " ";
if (label_g) info.cmpd_name = "%s=";

View File

@@ -188,6 +188,12 @@ TOOLTEST tcomp-1.ls 0 -w80 -r -d tcompound.h5
#test for the nested compound type
TOOLTEST tnestcomp-1.ls 0 -w80 -r -d tnestedcomp.h5
TOOLTEST tnestcomp-2.ls 0 -w80 -r -d -S tnestedcomp.h5
TOOLTEST tnestcomp-3.ls 0 -w80 -r -d -l tnestedcomp.h5
TOOLTEST tnestcomp-4.ls 0 -w80 -r -d -l -S tnestedcomp.h5
# test for loop detection
TOOLTEST tloop-1.ls 0 -w80 -r -d tloop.h5

View File

@@ -0,0 +1,16 @@
#############################
output for 'h5ls -w80 -r -d -S tnestedcomp.h5'
#############################
/ Group
/ArrayOfStructures Dataset {10}
Data:
0 0 1 "A" -100 100
1 1 0.5 "B" -100 100
2 4 0.333333333333333 "C" -100 100
3 9 0.25 "D" -100 100
4 16 0.2 "E" -100 100
5 25 0.166666666666667 "F" -100 100
6 36 0.142857142857143 "G" -100 100
7 49 0.125 "H" -100 100
8 64 0.111111111111111 "I" -100 100
9 81 0.1 "J" -100 100

View File

@@ -0,0 +1,26 @@
#############################
output for 'h5ls -w80 -r -d -l tnestedcomp.h5'
#############################
/ Group
/ArrayOfStructures Dataset {10}
Data:
(0) {a_name=0, b_name=0, c_name=1, d_name={char_name="A",
(0) array_name=[-100,100]}},
(1) {a_name=1, b_name=1, c_name=0.5, d_name={char_name="B",
(1) array_name=[-100,100]}},
(2) {a_name=2, b_name=4, c_name=0.333333333333333,
(2) d_name={char_name="C", array_name=[-100,100]}},
(3) {a_name=3, b_name=9, c_name=0.25, d_name={char_name="D",
(3) array_name=[-100,100]}},
(4) {a_name=4, b_name=16, c_name=0.2, d_name={char_name="E",
(4) array_name=[-100,100]}},
(5) {a_name=5, b_name=25, c_name=0.166666666666667,
(5) d_name={char_name="F", array_name=[-100,100]}},
(6) {a_name=6, b_name=36, c_name=0.142857142857143,
(6) d_name={char_name="G", array_name=[-100,100]}},
(7) {a_name=7, b_name=49, c_name=0.125, d_name={char_name="H",
(7) array_name=[-100,100]}},
(8) {a_name=8, b_name=64, c_name=0.111111111111111,
(8) d_name={char_name="I", array_name=[-100,100]}},
(9) {a_name=9, b_name=81, c_name=0.1, d_name={char_name="J",
(9) array_name=[-100,100]}}

View File

@@ -0,0 +1,16 @@
#############################
output for 'h5ls -w80 -r -d -l -S tnestedcomp.h5'
#############################
/ Group
/ArrayOfStructures Dataset {10}
Data:
{a_name=0 b_name=0 c_name=1 d_name={char_name="A" array_name=-100 100}}
{a_name=1 b_name=1 c_name=0.5 d_name={char_name="B" array_name=-100 100}}
{a_name=2 b_name=4 c_name=0.333333333333333 d_name={char_name="C" array_name=-100 100}}
{a_name=3 b_name=9 c_name=0.25 d_name={char_name="D" array_name=-100 100}}
{a_name=4 b_name=16 c_name=0.2 d_name={char_name="E" array_name=-100 100}}
{a_name=5 b_name=25 c_name=0.166666666666667 d_name={char_name="F" array_name=-100 100}}
{a_name=6 b_name=36 c_name=0.142857142857143 d_name={char_name="G" array_name=-100 100}}
{a_name=7 b_name=49 c_name=0.125 d_name={char_name="H" array_name=-100 100}}
{a_name=8 b_name=64 c_name=0.111111111111111 d_name={char_name="I" array_name=-100 100}}
{a_name=9 b_name=81 c_name=0.1 d_name={char_name="J" array_name=-100 100}}

View File

@@ -218,6 +218,9 @@ rem ############################################################################
rem test for the nested compound type
call :tooltest tnestcomp-1.ls 0 -w80 -r -d tnestedcomp.h5
call :tooltest tnestcomp-2.ls 0 -w80 -r -d -S tnestedcomp.h5
call :tooltest tnestcomp-3.ls 0 -w80 -r -d -l tnestedcomp.h5
call :tooltest tnestcomp-4.ls 0 -w80 -r -d -l -S tnestedcomp.h5
rem test for loop detection
call :tooltest tloop-1.ls 0 -w80 -r -d tloop.h5