diff options
author | Jonathan Kim <jkm@hdfgroup.org> | 2011-06-21 18:24:35 (GMT) |
---|---|---|
committer | Jonathan Kim <jkm@hdfgroup.org> | 2011-06-21 18:24:35 (GMT) |
commit | 83b77cb4eb777b8e04ba2bdc71e2c53bc9cfd1b5 (patch) | |
tree | 4b81ee58b585e9354574cc4849e89d080fa7bbc4 /tools | |
parent | 82a2e4ebca4dc595a7337703d6001f2adbe45e31 (diff) | |
download | hdf5-83b77cb4eb777b8e04ba2bdc71e2c53bc9cfd1b5.zip hdf5-83b77cb4eb777b8e04ba2bdc71e2c53bc9cfd1b5.tar.gz hdf5-83b77cb4eb777b8e04ba2bdc71e2c53bc9cfd1b5.tar.bz2 |
[svn-r21014] Purpose:
HDFFV-5878 - GMQS: h5dump - incorrect output format for array type with multiple elements in an index
Description:
Fixed h5dump to display the first line of each element into correct
position for multiple dimention array type.
Before this fix, the first line of each element in array were displayed
after the last line of previous element without moving to the next
line (+indentation)
Tested:
jam (linux32-LE), koala (linux64-LE), heiwa (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE), Windows (32-LE)
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lib/h5tools_str.c | 27 | ||||
-rw-r--r-- | tools/testfiles/tarray3.ddl | 36 | ||||
-rw-r--r-- | tools/testfiles/tarray3.h5.xml | 36 | ||||
-rw-r--r-- | tools/testfiles/tarray5.ddl | 36 | ||||
-rw-r--r-- | tools/testfiles/tarray7.ddl | 20 | ||||
-rw-r--r-- | tools/testfiles/tarray7.h5.xml | 20 |
6 files changed, 128 insertions, 47 deletions
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index af3f7e7..f8597e6 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -1042,6 +1042,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai else if (H5Tget_class(type) == H5T_ARRAY) { int k, ndims; hsize_t i, dims[H5S_MAX_RANK], temp_nelmts; + static int is_next_arry_elmt=0; /* Get the array's base datatype for each element */ memb = H5Tget_super(type); @@ -1077,12 +1078,31 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai for (x = 0; x < ctx->indent_level + 1; x++) h5tools_str_append(str, "%s", OPT(info->line_indent, "")); } /* end if */ - else if (i && info->arr_sep) - h5tools_str_append(str, " "); + else if (i && info->arr_sep) { + /* if next element begin, add next line with indent */ + if (is_next_arry_elmt) { + int x; + is_next_arry_elmt = 0; + + h5tools_str_append(str, "%s", "\n "); + + if (ctx->indent_level >= 0) + if (!info->pindex) + h5tools_str_append(str, "%s", OPT(info->line_pre, "")); + + for (x = 0; x < ctx->indent_level + 1; x++) + h5tools_str_append(str, "%s", OPT(info->line_indent, "")); + } + /* otherwise just add space */ + else + h5tools_str_append(str, " "); + + } /* end else if */ ctx->indent_level++; - /* Dump the array element */ + /* Dump values in an array element */ + is_next_arry_elmt = 0; /* dump all values in the array element, so turn it off */ h5tools_str_sprint(str, info, container, memb, cp_vp + i * size, ctx); ctx->indent_level--; @@ -1090,6 +1110,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai /* Print the closing bracket */ h5tools_str_append(str, "%s", OPT(info->arr_suf, "]")); + is_next_arry_elmt = 1; /* set for begining of next array element */ H5Tclose(memb); } else if (H5Tget_class(type) == H5T_VLEN) { diff --git a/tools/testfiles/tarray3.ddl b/tools/testfiles/tarray3.ddl index 10e067e..63f6d32 100644 --- a/tools/testfiles/tarray3.ddl +++ b/tools/testfiles/tarray3.ddl @@ -9,17 +9,20 @@ GROUP "/" { 20, 21, 22, 30, 31, 32, 40, 41, 42, - 50, 51, 52 ], [ 100, 101, 102, + 50, 51, 52 ], + [ 100, 101, 102, 110, 111, 112, 120, 121, 122, 130, 131, 132, 140, 141, 142, - 150, 151, 152 ], [ 200, 201, 202, + 150, 151, 152 ], + [ 200, 201, 202, 210, 211, 212, 220, 221, 222, 230, 231, 232, 240, 241, 242, - 250, 251, 252 ], [ 300, 301, 302, + 250, 251, 252 ], + [ 300, 301, 302, 310, 311, 312, 320, 321, 322, 330, 331, 332, @@ -30,17 +33,20 @@ GROUP "/" { 1020, 1021, 1022, 1030, 1031, 1032, 1040, 1041, 1042, - 1050, 1051, 1052 ], [ 1100, 1101, 1102, + 1050, 1051, 1052 ], + [ 1100, 1101, 1102, 1110, 1111, 1112, 1120, 1121, 1122, 1130, 1131, 1132, 1140, 1141, 1142, - 1150, 1151, 1152 ], [ 1200, 1201, 1202, + 1150, 1151, 1152 ], + [ 1200, 1201, 1202, 1210, 1211, 1212, 1220, 1221, 1222, 1230, 1231, 1232, 1240, 1241, 1242, - 1250, 1251, 1252 ], [ 1300, 1301, 1302, + 1250, 1251, 1252 ], + [ 1300, 1301, 1302, 1310, 1311, 1312, 1320, 1321, 1322, 1330, 1331, 1332, @@ -51,17 +57,20 @@ GROUP "/" { 2020, 2021, 2022, 2030, 2031, 2032, 2040, 2041, 2042, - 2050, 2051, 2052 ], [ 2100, 2101, 2102, + 2050, 2051, 2052 ], + [ 2100, 2101, 2102, 2110, 2111, 2112, 2120, 2121, 2122, 2130, 2131, 2132, 2140, 2141, 2142, - 2150, 2151, 2152 ], [ 2200, 2201, 2202, + 2150, 2151, 2152 ], + [ 2200, 2201, 2202, 2210, 2211, 2212, 2220, 2221, 2222, 2230, 2231, 2232, 2240, 2241, 2242, - 2250, 2251, 2252 ], [ 2300, 2301, 2302, + 2250, 2251, 2252 ], + [ 2300, 2301, 2302, 2310, 2311, 2312, 2320, 2321, 2322, 2330, 2331, 2332, @@ -72,17 +81,20 @@ GROUP "/" { 3020, 3021, 3022, 3030, 3031, 3032, 3040, 3041, 3042, - 3050, 3051, 3052 ], [ 3100, 3101, 3102, + 3050, 3051, 3052 ], + [ 3100, 3101, 3102, 3110, 3111, 3112, 3120, 3121, 3122, 3130, 3131, 3132, 3140, 3141, 3142, - 3150, 3151, 3152 ], [ 3200, 3201, 3202, + 3150, 3151, 3152 ], + [ 3200, 3201, 3202, 3210, 3211, 3212, 3220, 3221, 3222, 3230, 3231, 3232, 3240, 3241, 3242, - 3250, 3251, 3252 ], [ 3300, 3301, 3302, + 3250, 3251, 3252 ], + [ 3300, 3301, 3302, 3310, 3311, 3312, 3320, 3321, 3322, 3330, 3331, 3332, diff --git a/tools/testfiles/tarray3.h5.xml b/tools/testfiles/tarray3.h5.xml index f470c6c..7280b79 100644 --- a/tools/testfiles/tarray3.h5.xml +++ b/tools/testfiles/tarray3.h5.xml @@ -38,17 +38,20 @@ 20 21 22 30 31 32 40 41 42 - 50 51 52 100 101 102 + 50 51 52 + 100 101 102 110 111 112 120 121 122 130 131 132 140 141 142 - 150 151 152 200 201 202 + 150 151 152 + 200 201 202 210 211 212 220 221 222 230 231 232 240 241 242 - 250 251 252 300 301 302 + 250 251 252 + 300 301 302 310 311 312 320 321 322 330 331 332 @@ -59,17 +62,20 @@ 1020 1021 1022 1030 1031 1032 1040 1041 1042 - 1050 1051 1052 1100 1101 1102 + 1050 1051 1052 + 1100 1101 1102 1110 1111 1112 1120 1121 1122 1130 1131 1132 1140 1141 1142 - 1150 1151 1152 1200 1201 1202 + 1150 1151 1152 + 1200 1201 1202 1210 1211 1212 1220 1221 1222 1230 1231 1232 1240 1241 1242 - 1250 1251 1252 1300 1301 1302 + 1250 1251 1252 + 1300 1301 1302 1310 1311 1312 1320 1321 1322 1330 1331 1332 @@ -80,17 +86,20 @@ 2020 2021 2022 2030 2031 2032 2040 2041 2042 - 2050 2051 2052 2100 2101 2102 + 2050 2051 2052 + 2100 2101 2102 2110 2111 2112 2120 2121 2122 2130 2131 2132 2140 2141 2142 - 2150 2151 2152 2200 2201 2202 + 2150 2151 2152 + 2200 2201 2202 2210 2211 2212 2220 2221 2222 2230 2231 2232 2240 2241 2242 - 2250 2251 2252 2300 2301 2302 + 2250 2251 2252 + 2300 2301 2302 2310 2311 2312 2320 2321 2322 2330 2331 2332 @@ -101,17 +110,20 @@ 3020 3021 3022 3030 3031 3032 3040 3041 3042 - 3050 3051 3052 3100 3101 3102 + 3050 3051 3052 + 3100 3101 3102 3110 3111 3112 3120 3121 3122 3130 3131 3132 3140 3141 3142 - 3150 3151 3152 3200 3201 3202 + 3150 3151 3152 + 3200 3201 3202 3210 3211 3212 3220 3221 3222 3230 3231 3232 3240 3241 3242 - 3250 3251 3252 3300 3301 3302 + 3250 3251 3252 + 3300 3301 3302 3310 3311 3312 3320 3321 3322 3330 3331 3332 diff --git a/tools/testfiles/tarray5.ddl b/tools/testfiles/tarray5.ddl index 5a8a500..883ee09 100644 --- a/tools/testfiles/tarray5.ddl +++ b/tools/testfiles/tarray5.ddl @@ -10,52 +10,64 @@ GROUP "/" { (0): [ { 0, [ 0, 1, 2, 3 ] - }, { + }, + { 1, [ 2.5, 3.5, 4.5, 5.5 ] - }, { + }, + { 2, [ 5, 6, 7, 8 ] - }, { + }, + { 3, [ 7.5, 8.5, 9.5, 10.5 ] } ], (1): [ { 10, [ 10, 11, 12, 13 ] - }, { + }, + { 11, [ 12.5, 13.5, 14.5, 15.5 ] - }, { + }, + { 12, [ 15, 16, 17, 18 ] - }, { + }, + { 13, [ 17.5, 18.5, 19.5, 20.5 ] } ], (2): [ { 20, [ 20, 21, 22, 23 ] - }, { + }, + { 21, [ 22.5, 23.5, 24.5, 25.5 ] - }, { + }, + { 22, [ 25, 26, 27, 28 ] - }, { + }, + { 23, [ 27.5, 28.5, 29.5, 30.5 ] } ], (3): [ { 30, [ 30, 31, 32, 33 ] - }, { + }, + { 31, [ 32.5, 33.5, 34.5, 35.5 ] - }, { + }, + { 32, [ 35, 36, 37, 38 ] - }, { + }, + { 33, [ 37.5, 38.5, 39.5, 40.5 ] } ] diff --git a/tools/testfiles/tarray7.ddl b/tools/testfiles/tarray7.ddl index 2e6eaec..229d719 100644 --- a/tools/testfiles/tarray7.ddl +++ b/tools/testfiles/tarray7.ddl @@ -4,10 +4,22 @@ GROUP "/" { DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_ARRAY { [4] H5T_STD_U32LE }} } DATASPACE SIMPLE { ( 4 ) / ( 4 ) } DATA { - (0): [ ([ 0, 1, 2, 3 ]), ([ 100, 101, 102, 103 ], [ 110, 111, 112, 113 ]), ([ 200, 201, 202, 203 ], [ 210, 211, 212, 213 ], [ 220, 221, 222, 223 ]), ([ 300, 301, 302, 303 ], [ 310, 311, 312, 313 ], [ 320, 321, 322, 323 ], [ 330, 331, 332, 333 ]) ], - (1): [ ([ 1000, 1001, 1002, 1003 ], [ 1010, 1011, 1012, 1013 ]), ([ 1100, 1101, 1102, 1103 ], [ 1110, 1111, 1112, 1113 ], [ 1120, 1121, 1122, 1123 ]), ([ 1200, 1201, 1202, 1203 ], [ 1210, 1211, 1212, 1213 ], [ 1220, 1221, 1222, 1223 ], [ 1230, 1231, 1232, 1233 ]), ([ 1300, 1301, 1302, 1303 ], [ 1310, 1311, 1312, 1313 ], [ 1320, 1321, 1322, 1323 ], [ 1330, 1331, 1332, 1333 ], [ 1340, 1341, 1342, 1343 ]) ], - (2): [ ([ 2000, 2001, 2002, 2003 ], [ 2010, 2011, 2012, 2013 ], [ 2020, 2021, 2022, 2023 ]), ([ 2100, 2101, 2102, 2103 ], [ 2110, 2111, 2112, 2113 ], [ 2120, 2121, 2122, 2123 ], [ 2130, 2131, 2132, 2133 ]), ([ 2200, 2201, 2202, 2203 ], [ 2210, 2211, 2212, 2213 ], [ 2220, 2221, 2222, 2223 ], [ 2230, 2231, 2232, 2233 ], [ 2240, 2241, 2242, 2243 ]), ([ 2300, 2301, 2302, 2303 ], [ 2310, 2311, 2312, 2313 ], [ 2320, 2321, 2322, 2323 ], [ 2330, 2331, 2332, 2333 ], [ 2340, 2341, 2342, 2343 ], [ 2350, 2351, 2352, 2353 ]) ], - (3): [ ([ 3000, 3001, 3002, 3003 ], [ 3010, 3011, 3012, 3013 ], [ 3020, 3021, 3022, 3023 ], [ 3030, 3031, 3032, 3033 ]), ([ 3100, 3101, 3102, 3103 ], [ 3110, 3111, 3112, 3113 ], [ 3120, 3121, 3122, 3123 ], [ 3130, 3131, 3132, 3133 ], [ 3140, 3141, 3142, 3143 ]), ([ 3200, 3201, 3202, 3203 ], [ 3210, 3211, 3212, 3213 ], [ 3220, 3221, 3222, 3223 ], [ 3230, 3231, 3232, 3233 ], [ 3240, 3241, 3242, 3243 ], [ 3250, 3251, 3252, 3253 ]), ([ 3300, 3301, 3302, 3303 ], [ 3310, 3311, 3312, 3313 ], [ 3320, 3321, 3322, 3323 ], [ 3330, 3331, 3332, 3333 ], [ 3340, 3341, 3342, 3343 ], [ 3350, 3351, 3352, 3353 ], [ 3360, 3361, 3362, 3363 ]) ] + (0): [ ([ 0, 1, 2, 3 ]), + ([ 100, 101, 102, 103 ], [ 110, 111, 112, 113 ]), + ([ 200, 201, 202, 203 ], [ 210, 211, 212, 213 ], [ 220, 221, 222, 223 ]), + ([ 300, 301, 302, 303 ], [ 310, 311, 312, 313 ], [ 320, 321, 322, 323 ], [ 330, 331, 332, 333 ]) ], + (1): [ ([ 1000, 1001, 1002, 1003 ], [ 1010, 1011, 1012, 1013 ]), + ([ 1100, 1101, 1102, 1103 ], [ 1110, 1111, 1112, 1113 ], [ 1120, 1121, 1122, 1123 ]), + ([ 1200, 1201, 1202, 1203 ], [ 1210, 1211, 1212, 1213 ], [ 1220, 1221, 1222, 1223 ], [ 1230, 1231, 1232, 1233 ]), + ([ 1300, 1301, 1302, 1303 ], [ 1310, 1311, 1312, 1313 ], [ 1320, 1321, 1322, 1323 ], [ 1330, 1331, 1332, 1333 ], [ 1340, 1341, 1342, 1343 ]) ], + (2): [ ([ 2000, 2001, 2002, 2003 ], [ 2010, 2011, 2012, 2013 ], [ 2020, 2021, 2022, 2023 ]), + ([ 2100, 2101, 2102, 2103 ], [ 2110, 2111, 2112, 2113 ], [ 2120, 2121, 2122, 2123 ], [ 2130, 2131, 2132, 2133 ]), + ([ 2200, 2201, 2202, 2203 ], [ 2210, 2211, 2212, 2213 ], [ 2220, 2221, 2222, 2223 ], [ 2230, 2231, 2232, 2233 ], [ 2240, 2241, 2242, 2243 ]), + ([ 2300, 2301, 2302, 2303 ], [ 2310, 2311, 2312, 2313 ], [ 2320, 2321, 2322, 2323 ], [ 2330, 2331, 2332, 2333 ], [ 2340, 2341, 2342, 2343 ], [ 2350, 2351, 2352, 2353 ]) ], + (3): [ ([ 3000, 3001, 3002, 3003 ], [ 3010, 3011, 3012, 3013 ], [ 3020, 3021, 3022, 3023 ], [ 3030, 3031, 3032, 3033 ]), + ([ 3100, 3101, 3102, 3103 ], [ 3110, 3111, 3112, 3113 ], [ 3120, 3121, 3122, 3123 ], [ 3130, 3131, 3132, 3133 ], [ 3140, 3141, 3142, 3143 ]), + ([ 3200, 3201, 3202, 3203 ], [ 3210, 3211, 3212, 3213 ], [ 3220, 3221, 3222, 3223 ], [ 3230, 3231, 3232, 3233 ], [ 3240, 3241, 3242, 3243 ], [ 3250, 3251, 3252, 3253 ]), + ([ 3300, 3301, 3302, 3303 ], [ 3310, 3311, 3312, 3313 ], [ 3320, 3321, 3322, 3323 ], [ 3330, 3331, 3332, 3333 ], [ 3340, 3341, 3342, 3343 ], [ 3350, 3351, 3352, 3353 ], [ 3360, 3361, 3362, 3363 ]) ] } } } diff --git a/tools/testfiles/tarray7.h5.xml b/tools/testfiles/tarray7.h5.xml index 37c9bf4..67743d1 100644 --- a/tools/testfiles/tarray7.h5.xml +++ b/tools/testfiles/tarray7.h5.xml @@ -36,10 +36,22 @@ </hdf5:DataType> <hdf5:Data> <hdf5:DataFromFile> - 0 1 2 3 100 101 102 103 110 111 112 113 200 201 202 203 210 211 212 213 220 221 222 223 300 301 302 303 310 311 312 313 320 321 322 323 330 331 332 333 - 1000 1001 1002 1003 1010 1011 1012 1013 1100 1101 1102 1103 1110 1111 1112 1113 1120 1121 1122 1123 1200 1201 1202 1203 1210 1211 1212 1213 1220 1221 1222 1223 1230 1231 1232 1233 1300 1301 1302 1303 1310 1311 1312 1313 1320 1321 1322 1323 1330 1331 1332 1333 1340 1341 1342 1343 - 2000 2001 2002 2003 2010 2011 2012 2013 2020 2021 2022 2023 2100 2101 2102 2103 2110 2111 2112 2113 2120 2121 2122 2123 2130 2131 2132 2133 2200 2201 2202 2203 2210 2211 2212 2213 2220 2221 2222 2223 2230 2231 2232 2233 2240 2241 2242 2243 2300 2301 2302 2303 2310 2311 2312 2313 2320 2321 2322 2323 2330 2331 2332 2333 2340 2341 2342 2343 2350 2351 2352 2353 - 3000 3001 3002 3003 3010 3011 3012 3013 3020 3021 3022 3023 3030 3031 3032 3033 3100 3101 3102 3103 3110 3111 3112 3113 3120 3121 3122 3123 3130 3131 3132 3133 3140 3141 3142 3143 3200 3201 3202 3203 3210 3211 3212 3213 3220 3221 3222 3223 3230 3231 3232 3233 3240 3241 3242 3243 3250 3251 3252 3253 3300 3301 3302 3303 3310 3311 3312 3313 3320 3321 3322 3323 3330 3331 3332 3333 3340 3341 3342 3343 3350 3351 3352 3353 3360 3361 3362 3363 + 0 1 2 3 + 100 101 102 103 110 111 112 113 + 200 201 202 203 210 211 212 213 220 221 222 223 + 300 301 302 303 310 311 312 313 320 321 322 323 330 331 332 333 + 1000 1001 1002 1003 1010 1011 1012 1013 + 1100 1101 1102 1103 1110 1111 1112 1113 1120 1121 1122 1123 + 1200 1201 1202 1203 1210 1211 1212 1213 1220 1221 1222 1223 1230 1231 1232 1233 + 1300 1301 1302 1303 1310 1311 1312 1313 1320 1321 1322 1323 1330 1331 1332 1333 1340 1341 1342 1343 + 2000 2001 2002 2003 2010 2011 2012 2013 2020 2021 2022 2023 + 2100 2101 2102 2103 2110 2111 2112 2113 2120 2121 2122 2123 2130 2131 2132 2133 + 2200 2201 2202 2203 2210 2211 2212 2213 2220 2221 2222 2223 2230 2231 2232 2233 2240 2241 2242 2243 + 2300 2301 2302 2303 2310 2311 2312 2313 2320 2321 2322 2323 2330 2331 2332 2333 2340 2341 2342 2343 2350 2351 2352 2353 + 3000 3001 3002 3003 3010 3011 3012 3013 3020 3021 3022 3023 3030 3031 3032 3033 + 3100 3101 3102 3103 3110 3111 3112 3113 3120 3121 3122 3123 3130 3131 3132 3133 3140 3141 3142 3143 + 3200 3201 3202 3203 3210 3211 3212 3213 3220 3221 3222 3223 3230 3231 3232 3233 3240 3241 3242 3243 3250 3251 3252 3253 + 3300 3301 3302 3303 3310 3311 3312 3313 3320 3321 3322 3323 3330 3331 3332 3333 3340 3341 3342 3343 3350 3351 3352 3353 3360 3361 3362 3363 </hdf5:DataFromFile> </hdf5:Data> </hdf5:Dataset> |