From 95bee3616116504bcec30bed984bacab356a426c Mon Sep 17 00:00:00 2001 From: "Robert E. McGrath" Date: Fri, 6 Jul 2001 17:19:28 -0500 Subject: [svn-r4141] Purpose: Fix bugs in XML output of dumper Description: Incorrect XML was produced. Solution: Do the right thing. See diffs in test files. Platforms tested: Solaris. --- tools/h5dump/h5dump.c | 36 ++++++++++++++++++++++++++++-------- tools/testfiles/tcompound.h5.xml | 8 ++++++++ tools/testfiles/tcompound2.h5.xml | 8 ++++++++ tools/testfiles/tdatareg.h5.xml | 4 ++-- tools/testfiles/tenum.h5.xml | 2 ++ tools/testfiles/tobjref.h5.xml | 2 ++ 6 files changed, 50 insertions(+), 10 deletions(-) diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 82f3279..dc2f97a 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -4049,10 +4049,16 @@ xml_dump_attr(hid_t attr, const char *attr_name, void UNUSED * op_data) indentation(indent); printf("\n"); indentation(indent); - printf("\n"); - xml_print_refs(attr_id, ATTRIBUTE_DATA); - indentation(indent); - printf("\n"); + if (!H5Tequal(type, H5T_STD_REF_OBJ)) { + printf("\n"); + indentation(indent); + printf("\n"); + } else { + printf("\n"); + xml_print_refs(attr_id, ATTRIBUTE_DATA); + indentation(indent); + printf("\n"); + } indentation(indent); printf("\n"); break; @@ -4163,6 +4169,8 @@ xml_dump_named_datatype(hid_t type, const char *name) nmembers = H5Tget_nmembers(type); indentation(indent); + printf("\n"); + indentation(indent); printf("\n"); indent += COL; @@ -4212,11 +4220,17 @@ xml_dump_named_datatype(hid_t type, const char *name) indent -= COL; indentation(indent); printf("\n"); + indentation(indent); + printf("\n"); } else { /* Other data types: call print_datatype */ + indentation(indent); + printf("\n"); indent += COL; xml_print_datatype(type); indent -= COL; + indentation(indent); + printf("\n"); } indent -= COL; @@ -4740,10 +4754,16 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED *sset) indentation(indent); printf("\n"); indentation(indent); - printf("\n"); - xml_print_refs(did, DATASET_DATA); - indentation(indent); - printf("\n"); + if (!H5Tequal(type, H5T_STD_REF_OBJ)) { + printf("\n"); + indentation(indent); + printf("\n"); + } else { + printf("\n"); + xml_print_refs(did, DATASET_DATA); + indentation(indent); + printf("\n"); + } indentation(indent); printf("\n"); break; diff --git a/tools/testfiles/tcompound.h5.xml b/tools/testfiles/tcompound.h5.xml index 25db6ae..c6f2142 100644 --- a/tools/testfiles/tcompound.h5.xml +++ b/tools/testfiles/tcompound.h5.xml @@ -6,6 +6,7 @@ Expected output for 'h5dump --xml tcompound.h5' + @@ -22,8 +23,10 @@ Expected output for 'h5dump --xml tcompound.h5' + + @@ -40,8 +43,10 @@ Expected output for 'h5dump --xml tcompound.h5' + + @@ -69,6 +74,7 @@ Expected output for 'h5dump --xml tcompound.h5' + @@ -110,6 +116,7 @@ Expected output for 'h5dump --xml tcompound.h5' + @@ -126,6 +133,7 @@ Expected output for 'h5dump --xml tcompound.h5' + diff --git a/tools/testfiles/tcompound2.h5.xml b/tools/testfiles/tcompound2.h5.xml index b19226c..5014c83 100644 --- a/tools/testfiles/tcompound2.h5.xml +++ b/tools/testfiles/tcompound2.h5.xml @@ -6,6 +6,7 @@ Expected output for 'h5dump --xml tcompound2.h5' + @@ -22,8 +23,10 @@ Expected output for 'h5dump --xml tcompound2.h5' + + @@ -40,8 +43,10 @@ Expected output for 'h5dump --xml tcompound2.h5' + + @@ -69,6 +74,7 @@ Expected output for 'h5dump --xml tcompound2.h5' + @@ -115,6 +121,7 @@ Expected output for 'h5dump --xml tcompound2.h5' + @@ -131,6 +138,7 @@ Expected output for 'h5dump --xml tcompound2.h5' + diff --git a/tools/testfiles/tdatareg.h5.xml b/tools/testfiles/tdatareg.h5.xml index ac6a691..e9008bc 100644 --- a/tools/testfiles/tdatareg.h5.xml +++ b/tools/testfiles/tdatareg.h5.xml @@ -19,8 +19,8 @@ Expected output for 'h5dump --xml tdatareg.h5' - - + + diff --git a/tools/testfiles/tenum.h5.xml b/tools/testfiles/tenum.h5.xml index 8fc64a2..126d049 100644 --- a/tools/testfiles/tenum.h5.xml +++ b/tools/testfiles/tenum.h5.xml @@ -6,6 +6,7 @@ Expected output for 'h5dump --xml tenum.h5' + @@ -40,6 +41,7 @@ Expected output for 'h5dump --xml tenum.h5' + diff --git a/tools/testfiles/tobjref.h5.xml b/tools/testfiles/tobjref.h5.xml index 3cfe6f7..d3dacb5 100644 --- a/tools/testfiles/tobjref.h5.xml +++ b/tools/testfiles/tobjref.h5.xml @@ -29,6 +29,7 @@ Expected output for 'h5dump --xml tobjref.h5' + @@ -52,6 +53,7 @@ Expected output for 'h5dump --xml tobjref.h5' + -- cgit v0.12