Skip to content

Commit

Permalink
Merge 73192b6 into 014d08a
Browse files Browse the repository at this point in the history
  • Loading branch information
auto-differentiation-dev committed Mar 1, 2024
2 parents 014d08a + 73192b6 commit 783f981
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion test-suite/cashflows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ BOOST_AUTO_TEST_CASE(testIrregularFirstCouponReferenceDatesAtEndOfCalendarMonth)
BOOST_ERROR("Expected reference start date at end of calendar day of the month, "
"got " << firstCoupon->referencePeriodStart());
// Expect first cashflow to be 0.9375
BOOST_TEST(firstCoupon->amount() == 0.9375, boost::test_tools::tolerance(0.0001));
BOOST_TEST(firstCoupon->amount() == 0.9375, boost::test_tools::tolerance<Real>(0.0001));
}

BOOST_AUTO_TEST_CASE(testIrregularLastCouponReferenceDatesAtEndOfMonth) {
Expand Down
4 changes: 2 additions & 2 deletions test-suite/period.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ BOOST_AUTO_TEST_CASE(testConvertToYears) {
BOOST_TEST(years(Period(1, Years)) == 1);
BOOST_TEST(years(Period(5, Years)) == 5);

const auto tol = boost::test_tools::tolerance(1e-15);
const auto tol = boost::test_tools::tolerance<Real>(1e-15);
BOOST_TEST(years(Period(1, Months)) == 1.0/12.0, tol);
BOOST_TEST(years(Period(8, Months)) == 8.0/12.0, tol);
BOOST_TEST(years(Period(12, Months)) == 1);
Expand All @@ -172,7 +172,7 @@ BOOST_AUTO_TEST_CASE(testConvertToWeeks) {
BOOST_TEST(weeks(Period(1, Weeks)) == 1);
BOOST_TEST(weeks(Period(5, Weeks)) == 5);

const auto tol = boost::test_tools::tolerance(1e-15);
const auto tol = boost::test_tools::tolerance<Real>(1e-15);
BOOST_TEST(weeks(Period(1, Days)) == 1.0/7.0, tol);
BOOST_TEST(weeks(Period(3, Days)) == 3.0/7.0, tol);
BOOST_TEST(weeks(Period(11, Days)) == 11.0/7.0, tol);
Expand Down
10 changes: 5 additions & 5 deletions test-suite/prices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ BOOST_AUTO_TEST_CASE(testMidEquivalent) {

using boost::test_tools::tolerance;

BOOST_TEST(1.5 == midEquivalent(1, 2, 3, 4), tolerance(1e-14));
BOOST_TEST(1.5 == midEquivalent(1, 2, 0, 4), tolerance(1e-14));
BOOST_TEST(1.5 == midEquivalent(1, 2, 3, 0), tolerance(1e-14));
BOOST_TEST(1.5 == midEquivalent(1, 2, 0, 0), tolerance(1e-14));
BOOST_TEST(1.5 == midEquivalent(1, 2, 3, 4), tolerance<Real>(1e-14));
BOOST_TEST(1.5 == midEquivalent(1, 2, 0, 4), tolerance<Real>(1e-14));
BOOST_TEST(1.5 == midEquivalent(1, 2, 3, 0), tolerance<Real>(1e-14));
BOOST_TEST(1.5 == midEquivalent(1, 2, 0, 0), tolerance<Real>(1e-14));

BOOST_TEST(1 == midEquivalent(1, 0, 3, 4));
BOOST_TEST(1 == midEquivalent(1, 0, 0, 4));
Expand All @@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE(testMidSafe) {

using boost::test_tools::tolerance;

BOOST_TEST(1.5 == midSafe(1, 2), tolerance(1e-14));
BOOST_TEST(1.5 == midSafe(1, 2), tolerance<Real>(1e-14));

BOOST_CHECK_THROW(midSafe(0, 0), QuantLib::Error);
BOOST_CHECK_THROW(midSafe(1, 0), QuantLib::Error);
Expand Down

0 comments on commit 783f981

Please sign in to comment.