summaryrefslogtreecommitdiffstats
path: root/tools/h5diff
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5diff')
-rw-r--r--tools/h5diff/h5diffgentest.c48
-rwxr-xr-xtools/h5diff/testh5diff.sh17
2 files changed, 40 insertions, 25 deletions
diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c
index 1695a01..1ab61fd 100644
--- a/tools/h5diff/h5diffgentest.c
+++ b/tools/h5diff/h5diffgentest.c
@@ -133,27 +133,33 @@ int test_basic(const char *fname1,
hsize_t dims[2] = { 3,2 };
/* Test */
- double data1[3][2] = {{1,1}, {1,1}, {0,0}};
- double data2[3][2] = {{0,1.1},{1.01,1.001},{0,1}};
- int data5[3][2] = {{100,100},{100,100},{100,100}};
- int data6[3][2] = {{101,102},{103,104},{150,200}};
- unsigned long_long data7[3][2] = {{100,100},{100,100},{100,100}};
- unsigned long_long data8[3][2] = {{101,102},{103,104},{150,200}};
- double data3[3][2] = {{100,100},{100,100},{100,100}};
- double data4[3][2] = {{105,120},{160,95},{80,40}};
- double data9[3][2] = {{100,100},{100,0},{0,100}};
- /* compare divide by zero */
- /* compare both zero */
- double data10[3][2] ={{120,80},{0,100},{0,50}};
- /*
-A B 1-B/A %
-100 120 0.2 20
-100 80 0.2 20
-100 0 1 100
-0 100 #DIV/0! #DIV/0!
-0 0 #DIV/0! #DIV/0!
-100 50 0.5 50
-*/
+ double data1[3][2] = {{1,1}, {1,1}, {0,0}};
+ double data2[3][2] = {{0,1.1},{1.01,1.001},{0,1}};
+ double data3[3][2] = {{100,100},{100,100},{100,100}};
+ double data4[3][2] = {{105,120},{160,95},{80,40}};
+
+/*-------------------------------------------------------------------------
+ * relative error, compare divide by zero, both zero
+ *-------------------------------------------------------------------------
+ */
+
+ int data5[3][2] = {{100,100},{100,0},{0,100}};
+ int data6[3][2] = {{120,80}, {0,100},{0,50}};
+ unsigned long_long data7[3][2] = {{100,100},{100,0},{0,100}};
+ unsigned long_long data8[3][2] = {{120,80}, {0,100},{0,50}};
+ double data9[3][2] = {{100,100},{100,0},{0,100}};
+ double data10[3][2] ={{120,80}, {0,100},{0,50}};
+
+/*-------------------------------------------------------------------------
+ A B 1-B/A %
+ 100 120 0.2 20
+ 100 80 0.2 20
+ 100 0 1 100
+ 0 100 #DIV/0! #DIV/0!
+ 0 0 #DIV/0! #DIV/0!
+ 100 50 0.5 50
+ *-------------------------------------------------------------------------
+ */
/* floating point comparison , epsilon = 0.00001 */
float data11[3][2] ={{0.00000f,0.00001f},{0.00001f, 0.00000f},{0.00001f,0.00001f}};
diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh
index 3dc40ef..5841855 100755
--- a/tools/h5diff/testh5diff.sh
+++ b/tools/h5diff/testh5diff.sh
@@ -286,8 +286,17 @@ TOOLTEST h5diff_14.txt $FILE1 $FILE2 -r g1/dset1 g1/dset2
# 1.5 with -d
TOOLTEST h5diff_15.txt $FILE1 $FILE2 -r -d 5 g1/dset3 g1/dset4
-# 1.6 with -p (test divide by zero case)
-TOOLTEST h5diff_16.txt $FILE1 $FILE1 g1/dset9 g1/dset10 -p 0.01 -v
+# 1.6 with -p (double)
+#TOOLTEST h5diff_16.txt $FILE1 $FILE1 g1/dset9 g1/dset10 -p 0.01 -v
+
+# 1.6.1 with -p (int)
+TOOLTEST h5diff_161.txt $FILE1 $FILE1 -v -p 0.02 g1/dset5 g1/dset6
+
+# 1.6.2 with -p (unsigned long_long)
+TOOLTEST h5diff_162.txt $FILE1 $FILE1 -v -p 0.02 g1/dset7 g1/dset8
+
+# 1.6.3 with -p (double)
+TOOLTEST h5diff_163.txt $FILE1 $FILE1 -v -p 0.02 g1/dset9 g1/dset10
# 1.7 verbose mode
TOOLTEST h5diff_17.txt $FILE1 $FILE2 -v
@@ -296,10 +305,10 @@ TOOLTEST h5diff_17.txt $FILE1 $FILE2 -v
TOOLTEST h5diff_18.txt $FILE1 $FILE2 -q
# 1.9.1 with -p (int)
-TOOLTEST h5diff_191.txt $FILE1 $FILE1 -v -p 0.02 g1/dset5 g1/dset6
+#TOOLTEST h5diff_191.txt $FILE1 $FILE1 -v -p 0.02 g1/dset5 g1/dset6
# 1.9.2 with -p (unsigned long_long)
-TOOLTEST h5diff_192.txt $FILE1 $FILE1 -v -p 0.02 g1/dset7 g1/dset8
+#TOOLTEST h5diff_192.txt $FILE1 $FILE1 -v -p 0.02 g1/dset7 g1/dset8
# ##############################################################################