Repository navigation
Conversation
… tests These tests read the date from the system clock with Date::todaysDate(), so they ignored the evaluation date set by the test suite (and --date) and could fail depending on the day they were run. For instance, with --date=2026-12-25 three American option tests failed because their curves and the global evaluation date were almost two months apart. They now use Settings::instance().evaluationDate(), as suggested in AGENTS.md. In testFdGreeks, the assignment back to the evaluation date became redundant and was removed.
|
Thanks for opening this pull request! It might take a while before we look at it, so don't worry if there seems to be no feedback. We'll get to it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These tests got their date from
Date::todaysDate(), so they ignored the evaluation date set by the test suite (and the--dateoption) and their results depended on the day they were run.This switches 13 of them in
americanoption.cpp,barrieroption.cppandbinaryoption.cpptoSettings::instance().evaluationDate(), as suggested in AGENTS.md. IntestFdGreeksthe line setting the evaluation date back to today became redundant, so I removed it.To check it, I temporarily printed the date each changed test was using and ran the three suites with the default date and with
--dateset to 2024-02-29, 2025-12-31, 2026-10-31 and 2026-12-25. Before the change all of them printed the system date whatever--datesaid; after it, they follow the suite's date. With--date=2026-12-25,testBaroneAdesiWhaleyValues,testJuValuesandtestFdValuesfailed before the change and pass after it.The full test suite passes (1680 test cases).
BarrierOptionTests/testParityfails for some of those--datevalues both before and after this change, so that looks like a separate issue.