Closed certik closed 8 years ago
And the 2d tests give 2 warnings:
certik@redhawk:~/repos/r3d/tests(test)$ ./r2d_unit_tests
===========================
Running 8 unit tests...
===========================
split_tri_thru_centroid
[ PASS - 0.0 ms ]
---------------------------
recursive_splitting_nondegenerate
Recursively splitting 100 triangles, maximum splits per tri is 16.
EXPECT_EQ( -8.333e-16 , -8.333e-16 , 1.000e-08 ) failed ( err = 2.184e-08 ):
r2d_unit_tests.c, line 156.
[ WARN - 370.0 ms ]
---------------------------
recursive_splitting_degenerate
Recursively splitting 100 triangles, maximum splits per tri is 16.
[ PASS - 50.0 ms ]
---------------------------
recursive_splitting_degenerate_perturbed
Recursively splitting 100 triangles, maximum splits per tri is 16.
EXPECT_EQ( -4.628e-10 , -4.628e-10 , 1.000e-08 ) failed ( err = 1.591e-08 ):
r2d_unit_tests.c, line 365.
EXPECT_EQ( 8.609e-10 , 8.609e-10 , 1.000e-08 ) failed ( err = 1.020e-08 ):
r2d_unit_tests.c, line 365.
EXPECT_EQ( 1.325e-09 , 1.325e-09 , 1.000e-08 ) failed ( err = 1.095e-08 ):
r2d_unit_tests.c, line 365.
EXPECT_EQ( 6.271e-09 , 6.271e-09 , 1.000e-08 ) failed ( err = 1.114e-08 ):
r2d_unit_tests.c, line 365.
EXPECT_EQ( 3.843e-09 , 3.843e-09 , 1.000e-08 ) failed ( err = 1.131e-08 ):
r2d_unit_tests.c, line 365.
EXPECT_EQ( 6.271e-09 , 6.271e-09 , 1.000e-08 ) failed ( err = 1.033e-08 ):
r2d_unit_tests.c, line 365.
[ WARN - 60.0 ms ]
---------------------------
test_tri_tri_timing
Intersecting 100000 pairs of triangles.
[ PASS - 200.0 ms ]
---------------------------
random_verts
[ PASS - 10.0 ms ]
---------------------------
rasterization
Rasterizing a triangle to a grid with dx = 0.058824 0.058824 and moments of order 3
Minimum index box = 4 0 to 15 16
[ PASS - 0.0 ms ]
---------------------------
moments
[ PASS - 0.0 ms ]
---------------------------
...done.
6 x [ PASS ]
2 x [ WARN ]
0 x [ FAIL ]
===========================
Finally the N unit tests also give a warning:
certik@redhawk:~/repos/r3d/tests(test)$ ./rNd_unit_tests
===========================
Running 3 unit tests...
===========================
split_simplex_thru_centroid
[ PASS - 10.0 ms ]
---------------------------
recursive_splitting_nondegenerate
Recursively splitting 10 simplices, maximum splits per simplex is 6.
EXPECT_EQ( 2.356e-07 , 2.356e-07 , 1.000e-08 ) failed ( err = 1.648e-08 ):
rNd_unit_tests.c, line 200.
EXPECT_EQ( 1.621e-08 , 1.621e-08 , 1.000e-08 ) failed ( err = 3.674e-08 ):
rNd_unit_tests.c, line 200.
EXPECT_EQ( 6.651e-08 , 6.651e-08 , 1.000e-08 ) failed ( err = 2.786e-08 ):
rNd_unit_tests.c, line 200.
EXPECT_EQ( 1.119e-07 , 1.119e-07 , 1.000e-08 ) failed ( err = 2.339e-08 ):
rNd_unit_tests.c, line 200.
EXPECT_EQ( 2.154e-07 , 2.154e-07 , 1.000e-08 ) failed ( err = 1.201e-08 ):
rNd_unit_tests.c, line 200.
EXPECT_EQ( 5.689e-08 , 5.689e-08 , 1.000e-08 ) failed ( err = 2.748e-08 ):
rNd_unit_tests.c, line 200.
EXPECT_EQ( 7.743e-08 , 7.743e-08 , 1.000e-08 ) failed ( err = 1.029e-08 ):
rNd_unit_tests.c, line 200.
^[[BEXPECT_EQ( 5.853e-08 , 5.853e-08 , 1.000e-08 ) failed ( err = 1.978e-08 ):
rNd_unit_tests.c, line 200.
EXPECT_EQ( 3.593e-08 , 3.593e-08 , 1.000e-08 ) failed ( err = 4.504e-08 ):
rNd_unit_tests.c, line 200.
[ WARN - 40090.0 ms ]
---------------------------
moments
Computing moments of order 0, 1000 trials.
[ PASS - 1070.0 ms ]
---------------------------
...done.
2 x [ PASS ]
1 x [ WARN ]
0 x [ FAIL ]
===========================
Don't worry about the warnings here -- All warnings and failures are done via an error tolerance, and the error tolerance for a warning is set to 1.0e-8 here. You'll notice that nothing really failed here - the errors in e.g. EXPECT_EQ( -8.333e-16 , -8.333e-16 , 1.000e-08 ) failed ( err = 2.184e-08 ) are still quite small. You can increase this tolerance if the warning messages bother you by modifying TOL_WARN in rXd_unit_tests.c. The warnings disappearing are because the input for the unit tests are generated randomly. If you want something deterministic, add srand(12345) or whatever at the beginning of the function setup() in rXd_unit_tests.c.
I compiled the latest version (070b3b46f38a7fecc6272184bfdda65856fcd71f) and ran 3D tests. They give 1 warning:
But if I run it again, the warning sometimes disappears.