Skip to content

Commit

Permalink
Fixed epsilon in periodically failing test.
Browse files Browse the repository at this point in the history
  • Loading branch information
gaizkan committed Nov 19, 2015
1 parent a9bb980 commit 10eb790
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Tests/UnitTests/MathTests/MatrixTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ namespace Microsoft

BOOST_AUTO_TEST_CASE(MatrixInitGaussianRand)
{
SingleMatrix a = SingleMatrix::RandomGaussian(640, 230, 0.0f, 2.0f, (unsigned long)-1);
SingleMatrix a = SingleMatrix::RandomGaussian(640, 230, 0.0f, 2.0f, static_cast<unsigned long>(-1));
BOOST_CHECK_EQUAL(a.GetNumRows(), 640);
BOOST_CHECK_EQUAL(a.GetNumCols(), 230);

Expand All @@ -182,8 +182,8 @@ namespace Microsoft
}
std = sqrt (std / (640 * 230));

BOOST_CHECK_LE(fabs(avg), c_epsilonFloatE2);
BOOST_CHECK_LE(fabs(std - 2), c_epsilonFloatE2);
BOOST_CHECK_LE(fabs(avg), c_epsilonFloatE1);
BOOST_CHECK_LE(fabs(std - 2), c_epsilonFloatE1);
}

BOOST_AUTO_TEST_CASE(MatrixInitRandomUniform)
Expand Down
1 change: 1 addition & 0 deletions Tests/UnitTests/MathTests/constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const int c_deviceIdZero = 0;
const float c_epsilonFloatE4 = 0.0001f;
const float c_epsilonFloatE3 = 0.001f;
const float c_epsilonFloatE2 = 0.01f;
const float c_epsilonFloatE1 = 0.1f;
const float c_epsilonFloat5E4 = 0.0005f;
const float c_epsilonFloatE5 = 0.00001f;
const double c_epsilonDoubleE11 = 0.00000000001;
1 change: 1 addition & 0 deletions Tests/UnitTests/MathTests/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ extern const float c_epsilonFloat5E4;
extern const float c_epsilonFloatE5;
extern const float c_epsilonFloatE3;
extern const float c_epsilonFloatE2;
extern const float c_epsilonFloatE1;
extern const double c_epsilonDoubleE11;

0 comments on commit 10eb790

Please sign in to comment.