From 2f943aacd69af8a9135de16d745855d50bc9c402 Mon Sep 17 00:00:00 2001 From: Pedro Vicente Nunes Date: Mon, 26 Feb 2007 16:22:08 -0500 Subject: [svn-r13400] Revision of the percent tests to have all the same data --- tools/h5diff/h5diffgentest.c | 48 ++++++++++++++++++++++----------------- tools/h5diff/testh5diff.sh | 17 ++++++++++---- tools/testfiles/h5diff_16.txt | 16 ------------- tools/testfiles/h5diff_161.txt | 16 +++++++++++++ tools/testfiles/h5diff_162.txt | 16 +++++++++++++ tools/testfiles/h5diff_163.txt | 16 +++++++++++++ tools/testfiles/h5diff_191.txt | 12 ---------- tools/testfiles/h5diff_192.txt | 12 ---------- tools/testfiles/h5diff_attr1.h5 | Bin 19136 -> 19136 bytes tools/testfiles/h5diff_attr2.h5 | Bin 19136 -> 19136 bytes tools/testfiles/h5diff_basic1.h5 | Bin 8008 -> 8008 bytes tools/testfiles/h5diff_basic2.h5 | Bin 4240 -> 4240 bytes tools/testfiles/h5diff_dset1.h5 | Bin 19888 -> 19888 bytes tools/testfiles/h5diff_dset2.h5 | Bin 19888 -> 19888 bytes tools/testfiles/h5diff_dtypes.h5 | Bin 10776 -> 10776 bytes tools/testfiles/h5diff_hyper1.h5 | Bin 1052720 -> 1052720 bytes tools/testfiles/h5diff_hyper2.h5 | Bin 1052720 -> 1052720 bytes tools/testfiles/h5diff_types.h5 | Bin 4016 -> 4874 bytes 18 files changed, 88 insertions(+), 65 deletions(-) delete mode 100644 tools/testfiles/h5diff_16.txt create mode 100644 tools/testfiles/h5diff_161.txt create mode 100644 tools/testfiles/h5diff_162.txt create mode 100644 tools/testfiles/h5diff_163.txt delete mode 100644 tools/testfiles/h5diff_191.txt delete mode 100644 tools/testfiles/h5diff_192.txt 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 # ############################################################################## diff --git a/tools/testfiles/h5diff_16.txt b/tools/testfiles/h5diff_16.txt deleted file mode 100644 index d68cd47..0000000 --- a/tools/testfiles/h5diff_16.txt +++ /dev/null @@ -1,16 +0,0 @@ -############################# -Expected output for 'h5diff h5diff_basic1.h5 h5diff_basic1.h5 g1/dset9 g1/dset10 -p 0.01 -v' -############################# -dataset: and -size: [3x2] [3x2] -position dset9 dset10 difference relative ------------------------------------------------------------------------- -[ 0 0 ] 100 120 20 0.2 -[ 0 1 ] 100 80 20 0.2 -[ 1 0 ] 100 0 100 1 -[ 1 1 ] 0 100 100 not comparable -[ 2 1 ] 100 50 50 0.5 -5 differences found --------------------------------- -Some objects are not comparable --------------------------------- diff --git a/tools/testfiles/h5diff_161.txt b/tools/testfiles/h5diff_161.txt new file mode 100644 index 0000000..b29d93c --- /dev/null +++ b/tools/testfiles/h5diff_161.txt @@ -0,0 +1,16 @@ +############################# +Expected output for 'h5diff h5diff_basic1.h5 h5diff_basic1.h5 -v -p 0.02 g1/dset5 g1/dset6' +############################# +dataset: and +size: [3x2] [3x2] +position dset5 dset6 difference relative +------------------------------------------------------------------------ +[ 0 0 ] 100 120 20 0.200000 +[ 0 1 ] 100 80 20 0.200000 +[ 1 0 ] 100 0 100 1.000000 +[ 1 1 ] 0 100 100 not comparable +[ 2 1 ] 100 50 50 0.500000 +5 differences found +-------------------------------- +Some objects are not comparable +-------------------------------- diff --git a/tools/testfiles/h5diff_162.txt b/tools/testfiles/h5diff_162.txt new file mode 100644 index 0000000..02bc972 --- /dev/null +++ b/tools/testfiles/h5diff_162.txt @@ -0,0 +1,16 @@ +############################# +Expected output for 'h5diff h5diff_basic1.h5 h5diff_basic1.h5 -v -p 0.02 g1/dset7 g1/dset8' +############################# +dataset: and +size: [3x2] [3x2] +position dset7 dset8 difference relative +------------------------------------------------------------------------ +[ 0 0 ] 100 120 20 0.200000 +[ 0 1 ] 100 80 20 0.200000 +[ 1 0 ] 100 0 100 1.000000 +[ 1 1 ] 0 100 100 not comparable +[ 2 1 ] 100 50 50 0.500000 +5 differences found +-------------------------------- +Some objects are not comparable +-------------------------------- diff --git a/tools/testfiles/h5diff_163.txt b/tools/testfiles/h5diff_163.txt new file mode 100644 index 0000000..be5eb1e --- /dev/null +++ b/tools/testfiles/h5diff_163.txt @@ -0,0 +1,16 @@ +############################# +Expected output for 'h5diff h5diff_basic1.h5 h5diff_basic1.h5 -v -p 0.02 g1/dset9 g1/dset10' +############################# +dataset: and +size: [3x2] [3x2] +position dset9 dset10 difference relative +------------------------------------------------------------------------ +[ 0 0 ] 100 120 20 0.2 +[ 0 1 ] 100 80 20 0.2 +[ 1 0 ] 100 0 100 1 +[ 1 1 ] 0 100 100 not comparable +[ 2 1 ] 100 50 50 0.5 +5 differences found +-------------------------------- +Some objects are not comparable +-------------------------------- diff --git a/tools/testfiles/h5diff_191.txt b/tools/testfiles/h5diff_191.txt deleted file mode 100644 index 3fa0834..0000000 --- a/tools/testfiles/h5diff_191.txt +++ /dev/null @@ -1,12 +0,0 @@ -############################# -Expected output for 'h5diff h5diff_basic1.h5 h5diff_basic1.h5 -v -p 0.02 g1/dset5 g1/dset6' -############################# -dataset: and -size: [3x2] [3x2] -position dset5 dset6 difference relative ------------------------------------------------------------------------- -[ 1 0 ] 100 103 3 0.030000 -[ 1 1 ] 100 104 4 0.040000 -[ 2 0 ] 100 150 50 0.500000 -[ 2 1 ] 100 200 100 1.000000 -4 differences found diff --git a/tools/testfiles/h5diff_192.txt b/tools/testfiles/h5diff_192.txt deleted file mode 100644 index 38948a5..0000000 --- a/tools/testfiles/h5diff_192.txt +++ /dev/null @@ -1,12 +0,0 @@ -############################# -Expected output for 'h5diff h5diff_basic1.h5 h5diff_basic1.h5 -v -p 0.02 g1/dset7 g1/dset8' -############################# -dataset: and -size: [3x2] [3x2] -position dset7 dset8 difference relative ------------------------------------------------------------------------- -[ 1 0 ] 100 103 3 0.030000 -[ 1 1 ] 100 104 4 0.040000 -[ 2 0 ] 100 150 50 0.500000 -[ 2 1 ] 100 200 100 1.000000 -4 differences found diff --git a/tools/testfiles/h5diff_attr1.h5 b/tools/testfiles/h5diff_attr1.h5 index 65e2743..e261486 100644 Binary files a/tools/testfiles/h5diff_attr1.h5 and b/tools/testfiles/h5diff_attr1.h5 differ diff --git a/tools/testfiles/h5diff_attr2.h5 b/tools/testfiles/h5diff_attr2.h5 index bcf597b..0a59fc5 100644 Binary files a/tools/testfiles/h5diff_attr2.h5 and b/tools/testfiles/h5diff_attr2.h5 differ diff --git a/tools/testfiles/h5diff_basic1.h5 b/tools/testfiles/h5diff_basic1.h5 index 0ece876..bacf18a 100644 Binary files a/tools/testfiles/h5diff_basic1.h5 and b/tools/testfiles/h5diff_basic1.h5 differ diff --git a/tools/testfiles/h5diff_basic2.h5 b/tools/testfiles/h5diff_basic2.h5 index 908b0b3..209485f 100644 Binary files a/tools/testfiles/h5diff_basic2.h5 and b/tools/testfiles/h5diff_basic2.h5 differ diff --git a/tools/testfiles/h5diff_dset1.h5 b/tools/testfiles/h5diff_dset1.h5 index 749e0ca..3f853be 100644 Binary files a/tools/testfiles/h5diff_dset1.h5 and b/tools/testfiles/h5diff_dset1.h5 differ diff --git a/tools/testfiles/h5diff_dset2.h5 b/tools/testfiles/h5diff_dset2.h5 index d93edcf..1f14d29 100644 Binary files a/tools/testfiles/h5diff_dset2.h5 and b/tools/testfiles/h5diff_dset2.h5 differ diff --git a/tools/testfiles/h5diff_dtypes.h5 b/tools/testfiles/h5diff_dtypes.h5 index 592c28f..7c3cd9d 100644 Binary files a/tools/testfiles/h5diff_dtypes.h5 and b/tools/testfiles/h5diff_dtypes.h5 differ diff --git a/tools/testfiles/h5diff_hyper1.h5 b/tools/testfiles/h5diff_hyper1.h5 index c3de508..ceeff80 100644 Binary files a/tools/testfiles/h5diff_hyper1.h5 and b/tools/testfiles/h5diff_hyper1.h5 differ diff --git a/tools/testfiles/h5diff_hyper2.h5 b/tools/testfiles/h5diff_hyper2.h5 index d2c628a..05a2eb1 100644 Binary files a/tools/testfiles/h5diff_hyper2.h5 and b/tools/testfiles/h5diff_hyper2.h5 differ diff --git a/tools/testfiles/h5diff_types.h5 b/tools/testfiles/h5diff_types.h5 index ecbcc76..805ef5f 100644 Binary files a/tools/testfiles/h5diff_types.h5 and b/tools/testfiles/h5diff_types.h5 differ -- cgit v0.12