mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-19 16:50:46 +08:00
[svn-r13400]
Revision of the percent tests to have all the same data
This commit is contained in:
parent
ce6440cbb2
commit
2f943aacd6
@ -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}};
|
||||
|
@ -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
|
||||
|
||||
|
||||
# ##############################################################################
|
||||
|
16
tools/testfiles/h5diff_161.txt
Normal file
16
tools/testfiles/h5diff_161.txt
Normal file
@ -0,0 +1,16 @@
|
||||
#############################
|
||||
Expected output for 'h5diff h5diff_basic1.h5 h5diff_basic1.h5 -v -p 0.02 g1/dset5 g1/dset6'
|
||||
#############################
|
||||
dataset: </g1/dset5> and </g1/dset6>
|
||||
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
|
||||
--------------------------------
|
16
tools/testfiles/h5diff_162.txt
Normal file
16
tools/testfiles/h5diff_162.txt
Normal file
@ -0,0 +1,16 @@
|
||||
#############################
|
||||
Expected output for 'h5diff h5diff_basic1.h5 h5diff_basic1.h5 -v -p 0.02 g1/dset7 g1/dset8'
|
||||
#############################
|
||||
dataset: </g1/dset7> and </g1/dset8>
|
||||
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
|
||||
--------------------------------
|
@ -1,5 +1,5 @@
|
||||
#############################
|
||||
Expected output for 'h5diff h5diff_basic1.h5 h5diff_basic1.h5 g1/dset9 g1/dset10 -p 0.01 -v'
|
||||
Expected output for 'h5diff h5diff_basic1.h5 h5diff_basic1.h5 -v -p 0.02 g1/dset9 g1/dset10'
|
||||
#############################
|
||||
dataset: </g1/dset9> and </g1/dset10>
|
||||
size: [3x2] [3x2]
|
@ -1,12 +0,0 @@
|
||||
#############################
|
||||
Expected output for 'h5diff h5diff_basic1.h5 h5diff_basic1.h5 -v -p 0.02 g1/dset5 g1/dset6'
|
||||
#############################
|
||||
dataset: </g1/dset5> and </g1/dset6>
|
||||
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
|
@ -1,12 +0,0 @@
|
||||
#############################
|
||||
Expected output for 'h5diff h5diff_basic1.h5 h5diff_basic1.h5 -v -p 0.02 g1/dset7 g1/dset8'
|
||||
#############################
|
||||
dataset: </g1/dset7> and </g1/dset8>
|
||||
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
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user