From a56b49aaba5f5b6ad15ddf4dfc044a4bf55885a9 Mon Sep 17 00:00:00 2001 From: Peter Cao Date: Wed, 9 Mar 2011 08:07:38 -0500 Subject: [svn-r20206] Updated manifest and source code for fixing h5dump -y -o problem --- MANIFEST | 1 + tools/h5dump/testh5dump.sh.in | 3 +++ tools/lib/h5tools.c | 18 +++++++++--------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/MANIFEST b/MANIFEST index 86cae9f..8576814 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1177,6 +1177,7 @@ ./tools/testfiles/tall-3.ddl ./tools/testfiles/tall-4s.ddl ./tools/testfiles/tall-5s.ddl +./tools/testfiles/tall-6.ddl ./tools/testfiles/tall.h5 ./tools/testfiles/tall-6.ddl ./tools/testfiles/tarray1.ddl diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 96be2b9..37dee72 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -633,6 +633,9 @@ TOOLTEST textlink.ddl textlink.h5 # test for error stack display (BZ2048) TOOLTEST3 filter_fail.ddl -E filter_fail.h5 +# test for -o -y for dataset with attributes +TOOLTEST tall-6.ddl -y -o data -d /g1/g1.1/dset1.1.1 tall.h5 + # Report test results and exit if test $nerrors -eq 0 ; then echo "All $TESTNAME tests passed." diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index e7ba801..00040ad 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -909,19 +909,19 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai h5tools_str_append(&buffer, info->dset_format, ref_name); - dimension_break = h5tools_render_element(stream, info, + dimension_break = h5tools_render_element(stdout, info, ctx, &buffer, &curr_pos, ncols, i, elmt_counter); region_type = H5Sget_select_type(region_space); if(region_type==H5S_SEL_POINTS) /* Print point information */ dimension_break = h5tools_dump_region_data_points( - region_space, region_id, stream, info, ctx, + region_space, region_id, stdout, info, ctx, &buffer, &curr_pos, ncols, i, elmt_counter); else if(region_type==H5S_SEL_HYPERSLABS) /* Print block information */ dimension_break = h5tools_dump_region_data_blocks( - region_space, region_id, stream, info, ctx, + region_space, region_id, stdout, info, ctx, &buffer, &curr_pos, ncols, i, elmt_counter); else HERROR(H5E_tools_g, H5E_tools_min_id_g, "invalid region type"); @@ -950,7 +950,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai if (i + 1 < nelmts || (flags & END_OF_DATA) == 0) h5tools_str_append(&buffer, "%s", OPT(info->elmt_suf1, ",")); - dimension_break = h5tools_render_element(rawdatastream, info, ctx, &buffer, + dimension_break = h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, i, elmt_counter); /* Render the data element end*/ @@ -2310,9 +2310,9 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, hid_t dset /* Terminate the output */ if (ctx.cur_column) { - fputs(OPT(info->line_suf, ""), stream); - putc('\n', stream); - fputs(OPT(info->line_sep, ""), stream); + fputs(OPT(info->line_suf, ""), stdout); + putc('\n', stdout); + fputs(OPT(info->line_sep, ""), stdout); } CATCH @@ -2657,9 +2657,9 @@ h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, hid_t dset, /* Print the data */ if (space_type == H5S_SIMPLE || space_type == H5S_SCALAR) { if(!sset) - status = h5tools_dump_simple_dset(stream, info, dset, p_type, indentlevel); + status = h5tools_dump_simple_dset(rawdatastream, info, dset, p_type, indentlevel); else - status = h5tools_dump_simple_subset(stream, info, dset, p_type, sset, indentlevel); + status = h5tools_dump_simple_subset(rawdatastream, info, dset, p_type, sset, indentlevel); } else /* space is H5S_NULL */ -- cgit v0.12