summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff_dset.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2006-03-22 20:53:05 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2006-03-22 20:53:05 (GMT)
commitb269dbf0aef643eac98a8d9ee521a99d65a64768 (patch)
treee869d57ee0745f95b3f50850a62bd15d4618f617 /tools/lib/h5diff_dset.c
parent433fdf2bf8f299c686df35bad083b13c8c3d7136 (diff)
downloadhdf5-b269dbf0aef643eac98a8d9ee521a99d65a64768.zip
hdf5-b269dbf0aef643eac98a8d9ee521a99d65a64768.tar.gz
hdf5-b269dbf0aef643eac98a8d9ee521a99d65a64768.tar.bz2
[svn-r12134] Purpose:
bug fix Description: 1) added a more explainative usage message 2) the percent relative error for the integer type (division) was being done using integer arythmetic; use floating point arythmetic instead 3) added a new test for integer percent Solution: Platforms tested: linux (32,64) AIX solaris Misc. update:
Diffstat (limited to 'tools/lib/h5diff_dset.c')
-rw-r--r--tools/lib/h5diff_dset.c58
1 files changed, 54 insertions, 4 deletions
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index 868eedf..8802067 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -17,6 +17,60 @@
#include "H5private.h"
#include "h5tools.h"
+
+/*-------------------------------------------------------------------------
+ * Function: print_sizes
+ *
+ * Purpose: Print datatype sizes
+ *
+ *-------------------------------------------------------------------------
+ */
+#if defined (H5DIFF_DEBUG)
+void print_sizes( const char *obj1, const char *obj2,
+ hid_t f_type1, hid_t f_type2,
+ hid_t m_type1, hid_t m_type2 )
+{
+ size_t f_size1, f_size2; /* size of type in file */
+ size_t m_size1, m_size2; /* size of type in memory */
+
+ f_size1 = H5Tget_size( f_type1 );
+ f_size2 = H5Tget_size( f_type2 );
+ m_size1 = H5Tget_size( m_type1 );
+ m_size2 = H5Tget_size( m_type2 );
+
+ printf("\n");
+ printf("------------------\n");
+ printf("sizeof(char) %u\n", sizeof(char) );
+ printf("sizeof(short) %u\n", sizeof(short) );
+ printf("sizeof(int) %u\n", sizeof(int) );
+ printf("sizeof(long) %u\n", sizeof(long) );
+ printf("<%s> ------------------\n", obj1);
+ printf("type on file ");
+ print_type(f_type1);
+ printf("\n");
+ printf("size on file %u\n", f_size1 );
+
+ printf("type on memory ");
+ print_type(m_type1);
+ printf("\n");
+ printf("size on memory %u\n", m_size1 );
+
+ printf("<%s> ------------------\n", obj2);
+ printf("type on file ");
+ print_type(f_type2);
+ printf("\n");
+ printf("size on file %u\n", f_size2 );
+
+ printf("type on memory ");
+ print_type(m_type2);
+ printf("\n");
+ printf("size on memory %u\n", m_size2 );
+ printf("\n");
+}
+#endif /* H5DIFF_DEBUG */
+
+
+
/*-------------------------------------------------------------------------
* Function: diff_dataset
*
@@ -112,12 +166,8 @@ error:
} H5E_END_TRY;
return nfound;
-
}
-
-
-
/*-------------------------------------------------------------------------
* Function: diff_datasetid
*