26 double const sqrt2 = std::sqrt(2);
29 double const epsilon = 2.0 - (sqrt2 * sqrt2);
30 BOOST_TEST(
check.zero(epsilon));
31 BOOST_TEST(
check.zero(0.0));
32 BOOST_TEST(
check.zero(1
e-5));
33 BOOST_TEST(
check.zero(-1
e-5));
34 BOOST_TEST(!
check.zero(1.01e-5));
35 BOOST_TEST(!
check.zero(-1.01e-5 * 1.01));
38 BOOST_TEST(!
check.nonZero(epsilon));
39 BOOST_TEST(!
check.nonZero(0.0));
40 BOOST_TEST(!
check.nonZero(1
e-5));
41 BOOST_TEST(!
check.nonZero(-1
e-5));
42 BOOST_TEST(
check.nonZero(1.01e-5));
43 BOOST_TEST(
check.nonZero(-1.01e-5 * 1.01));
46 BOOST_TEST(!
check.equal(sqrt2, 1.4142));
47 BOOST_TEST(
check.nonEqual(sqrt2, 1.4142));
48 BOOST_TEST(
check.equal(sqrt2, 1.414213));
49 BOOST_TEST(!
check.nonEqual(sqrt2, 1.414213));
52 BOOST_TEST(!
check.strictlyNegative(+1
e-5 + 1
e-7));
53 BOOST_TEST(!
check.strictlyNegative(+1
e-5 - 1
e-7));
54 BOOST_TEST(!
check.strictlyNegative(0.0));
55 BOOST_TEST(!
check.strictlyNegative(-1
e-5 + 1
e-7));
56 BOOST_TEST(
check.strictlyNegative(-1
e-5 - 1
e-7));
59 BOOST_TEST(
check.strictlyPositive(+1
e-5 + 1
e-7));
60 BOOST_TEST(!
check.strictlyPositive(+1
e-5 - 1
e-7));
61 BOOST_TEST(!
check.strictlyPositive(0.0));
62 BOOST_TEST(!
check.strictlyPositive(-1
e-5 + 1
e-7));
63 BOOST_TEST(!
check.strictlyPositive(-1
e-5 - 1
e-7));
66 BOOST_TEST(
check.nonNegative(+1
e-5 + 1
e-7));
67 BOOST_TEST(
check.nonNegative(+1
e-5 - 1
e-7));
68 BOOST_TEST(
check.nonNegative(0.0));
69 BOOST_TEST(
check.nonNegative(-1
e-5 + 1
e-7));
70 BOOST_TEST(!
check.nonNegative(-1
e-5 - 1
e-7));
73 BOOST_TEST(!
check.nonPositive(+1
e-5 + 1
e-7));
74 BOOST_TEST(
check.nonPositive(+1
e-5 - 1
e-7));
75 BOOST_TEST(
check.nonPositive(0.0));
76 BOOST_TEST(
check.nonPositive(-1
e-5 + 1
e-7));
77 BOOST_TEST(
check.nonPositive(-1
e-5 - 1
e-7));
80 BOOST_TEST(!
check.strictlySmaller(1.0, 1.0 - 1
e-4));
81 BOOST_TEST(!
check.strictlySmaller(1.0, 1.0 - 1
e-7));
82 BOOST_TEST(!
check.strictlySmaller(1.0, 1.0));
83 BOOST_TEST(!
check.strictlySmaller(1.0, 1.0 + 1
e-7));
84 BOOST_TEST(
check.strictlySmaller(1.0, 1.0 + 1
e-4));
87 BOOST_TEST(
check.nonSmaller(1.0, 1.0 - 1
e-4));
88 BOOST_TEST(
check.nonSmaller(1.0, 1.0 - 1
e-7));
89 BOOST_TEST(
check.nonSmaller(1.0, 1.0));
90 BOOST_TEST(
check.nonSmaller(1.0, 1.0 + 1
e-7));
91 BOOST_TEST(!
check.nonSmaller(1.0, 1.0 + 1
e-4));
94 BOOST_TEST(
check.strictlyGreater(1.0, 1.0 - 1
e-4));
95 BOOST_TEST(!
check.strictlyGreater(1.0, 1.0 - 1
e-7));
96 BOOST_TEST(!
check.strictlyGreater(1.0, 1.0));
97 BOOST_TEST(!
check.strictlyGreater(1.0, 1.0 + 1
e-7));
98 BOOST_TEST(!
check.strictlyGreater(1.0, 1.0 + 1
e-4));
101 BOOST_TEST(!
check.nonGreater(1.0, 1.0 - 1
e-4));
102 BOOST_TEST(
check.nonGreater(1.0, 1.0 - 1
e-7));
103 BOOST_TEST(
check.nonGreater(1.0, 1.0));
104 BOOST_TEST(
check.nonGreater(1.0, 1.0 + 1
e-7));
105 BOOST_TEST(
check.nonGreater(1.0, 1.0 + 1
e-4));
108 BOOST_TEST(!
check.within(sqrt2, 0., 1.41420));
109 BOOST_TEST(
check.within(sqrt2, 0., 1.41421));
110 BOOST_TEST(
check.within(sqrt2, 1.41422, 2.));
111 BOOST_TEST(!
check.within(sqrt2, 1.41423, 2.));
114 BOOST_TEST(!
check.within(sqrt2, 1.41421, 0.));
115 BOOST_TEST(
check.withinSorted(sqrt2, 1.41421, 0.));
Provides simple real number checks.
bool check(const std::vector< std::vector< float > > &outputs)