From 5fb57df616ce6e8e65e548bf6a351a2231f85dbc Mon Sep 17 00:00:00 2001 From: Luigi Ballabio Date: Mon, 2 Dec 2024 10:29:44 +0100 Subject: [PATCH] Pin date in test --- test-suite/hestonmodel.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test-suite/hestonmodel.cpp b/test-suite/hestonmodel.cpp index 53dc4bb056..f7201e2715 100644 --- a/test-suite/hestonmodel.cpp +++ b/test-suite/hestonmodel.cpp @@ -237,9 +237,6 @@ BOOST_AUTO_TEST_CASE(testBlackCalibration) { smile. expected result is a vanishing volatility of the volatility. In addition theta and v0 should be equal to the constant variance */ - Date today = Date::todaysDate(); - Settings::instance().evaluationDate() = today; - DayCounter dayCounter = Actual360(); Calendar calendar = NullCalendar(); @@ -375,8 +372,8 @@ BOOST_AUTO_TEST_CASE(testDAXCalibration) { BOOST_AUTO_TEST_CASE(testAnalyticVsBlack) { BOOST_TEST_MESSAGE("Testing analytic Heston engine against Black formula..."); - Date settlementDate = Date::todaysDate(); - Settings::instance().evaluationDate() = settlementDate; + Date settlementDate = Settings::instance().evaluationDate(); + DayCounter dayCounter = ActualActual(ActualActual::ISDA); Date exerciseDate = settlementDate + 6*Months; @@ -595,7 +592,7 @@ BOOST_AUTO_TEST_CASE(testFdBarrierVsCached, *precondition(if_speed(Fast))) { BOOST_TEST_MESSAGE("Testing FD barrier Heston engine against cached values..."); DayCounter dc = Actual360(); - Date today = Date::todaysDate(); + Date today = Settings::instance().evaluationDate(); Handle s0(ext::make_shared(100.0)); Handle rTS(flatRate(today, 0.08, dc));