From 671d37e6c5777a5e4c67013ffa390d26b6932845 Mon Sep 17 00:00:00 2001 From: Pedro Vicente Nunes Date: Thu, 5 Jun 2008 09:37:21 -0500 Subject: [svn-r15143] Fix for #1169 http://bugzilla.hdfgroup.uiuc.edu/show_bug.cgi?id=1169 don't print attributes to stdout when doing binary output added an attribute to the file run on the binary output test tested: windows, linux --- tools/h5dump/h5dump.c | 19 ++++++++++++------- tools/h5dump/h5dumpgentest.c | 5 ++++- tools/testfiles/tbinary.h5 | Bin 2144 -> 2144 bytes 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index a5ce70c..dffa251 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -2066,13 +2066,18 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) indent += COL; - /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set - in the group for attributes, then, sort by creation order, otherwise by name */ - - if( (sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) - H5Aiterate2(did, sort_by, sort_order, NULL, dump_attr_cb, NULL); - else - H5Aiterate2(did, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL); + if ( !bin_output ) + { + + /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set + in the group for attributes, then, sort by creation order, otherwise by name */ + + if( (sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) + H5Aiterate2(did, sort_by, sort_order, NULL, dump_attr_cb, NULL); + else + H5Aiterate2(did, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL); + + } indent -= COL; diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 63cb1e8..8f48e89 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -5554,7 +5554,7 @@ error: static void gent_binary(void) { - hid_t fid, sid, did; + hid_t fid, sid, did, aid; hsize_t dims[1] = {6}; int ibuf[6] = {1,2,3,4,5,6}; float fbuf[6] = {1,2,3,4,5,6}; @@ -5587,6 +5587,9 @@ gent_binary(void) */ did = H5Dcreate2(fid, "double", H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dbuf); + /* create an attribute */ + aid = H5Acreate2(did, "attr", H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT); + H5Aclose(aid); H5Dclose(did); diff --git a/tools/testfiles/tbinary.h5 b/tools/testfiles/tbinary.h5 index adc5b15..c85aa51 100644 Binary files a/tools/testfiles/tbinary.h5 and b/tools/testfiles/tbinary.h5 differ -- cgit v0.12