Skip to content

Commit

Permalink
Pin date in test
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio committed Dec 2, 2024
1 parent e44806f commit 5fb57df
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test-suite/hestonmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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<Quote> s0(ext::make_shared<SimpleQuote>(100.0));
Handle<YieldTermStructure> rTS(flatRate(today, 0.08, dc));
Expand Down

0 comments on commit 5fb57df

Please sign in to comment.