summaryrefslogtreecommitdiffstats
path: root/tools/h5diff/h5diffgentest.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5diff/h5diffgentest.c')
-rw-r--r--tools/h5diff/h5diffgentest.c48
1 files changed, 27 insertions, 21 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}};