Skip to content

Commit fbab550

Browse files
committed
Merge branch 'QPR-13225' into 'master'
QPR-13225 fix bma consistency test Closes QPR-13225 See merge request qs/quantlib!100
2 parents 81b62d7 + e2cd23b commit fbab550

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

test-suite/piecewiseyieldcurve.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ void testBMACurveConsistency(CommonVars& vars,
563563
vars.calendar = JointCalendar(BMAIndex().fixingCalendar(),
564564
USDLibor(3*Months).fixingCalendar(),
565565
JoinHolidays);
566-
vars.today = vars.calendar.adjust(Date::todaysDate());
566+
vars.today = vars.calendar.adjust(Settings::instance().evaluationDate());
567567
Settings::instance().evaluationDate() = vars.today;
568568
vars.settlement =
569569
vars.calendar.advance(vars.today,vars.settlementDays,Days);
@@ -665,7 +665,7 @@ BOOST_AUTO_TEST_CASE(testLogLinearDiscountConsistency) {
665665
BOOST_TEST_MESSAGE(
666666
"Testing consistency of piecewise-log-linear discount curve...");
667667

668-
CommonVars vars;
668+
CommonVars vars(Date(15, April, 2025));
669669

670670
testCurveConsistency<Discount,LogLinear,IterativeBootstrap>(vars);
671671
testBMACurveConsistency<Discount,LogLinear,IterativeBootstrap>(vars);
@@ -676,7 +676,7 @@ BOOST_AUTO_TEST_CASE(testLinearDiscountConsistency) {
676676
BOOST_TEST_MESSAGE(
677677
"Testing consistency of piecewise-linear discount curve...");
678678

679-
CommonVars vars;
679+
CommonVars vars(Date(15, April, 2025));
680680

681681
testCurveConsistency<Discount,Linear,IterativeBootstrap>(vars);
682682
testBMACurveConsistency<Discount,Linear,IterativeBootstrap>(vars);
@@ -687,7 +687,7 @@ BOOST_AUTO_TEST_CASE(testLinearZeroConsistency) {
687687
BOOST_TEST_MESSAGE(
688688
"Testing consistency of piecewise-linear zero-yield curve...");
689689

690-
CommonVars vars;
690+
CommonVars vars(Date(15, April, 2025));
691691

692692
testCurveConsistency<ZeroYield,Linear,IterativeBootstrap>(vars);
693693
testBMACurveConsistency<ZeroYield,Linear,IterativeBootstrap>(vars);
@@ -698,7 +698,7 @@ BOOST_AUTO_TEST_CASE(testSplineZeroConsistency) {
698698
BOOST_TEST_MESSAGE(
699699
"Testing consistency of piecewise-cubic zero-yield curve...");
700700

701-
CommonVars vars;
701+
CommonVars vars(Date(15, April, 2025));
702702

703703
testCurveConsistency<ZeroYield,Cubic,IterativeBootstrap>(
704704
vars,
@@ -717,7 +717,7 @@ BOOST_AUTO_TEST_CASE(testLinearForwardConsistency) {
717717
BOOST_TEST_MESSAGE(
718718
"Testing consistency of piecewise-linear forward-rate curve...");
719719

720-
CommonVars vars;
720+
CommonVars vars(Date(15, April, 2025));
721721

722722
testCurveConsistency<ForwardRate,Linear,IterativeBootstrap>(vars);
723723
testBMACurveConsistency<ForwardRate,Linear,IterativeBootstrap>(vars);
@@ -728,7 +728,7 @@ BOOST_AUTO_TEST_CASE(testFlatForwardConsistency) {
728728
BOOST_TEST_MESSAGE(
729729
"Testing consistency of piecewise-flat forward-rate curve...");
730730

731-
CommonVars vars;
731+
CommonVars vars(Date(15, April, 2025));
732732

733733
testCurveConsistency<ForwardRate,BackwardFlat,IterativeBootstrap>(vars);
734734
testBMACurveConsistency<ForwardRate,BackwardFlat,IterativeBootstrap>(vars);
@@ -760,7 +760,7 @@ BOOST_AUTO_TEST_CASE(testConvexMonotoneForwardConsistency) {
760760
BOOST_TEST_MESSAGE(
761761
"Testing consistency of convex monotone forward-rate curve...");
762762

763-
CommonVars vars;
763+
CommonVars vars(Date(15, April, 2025));
764764
testCurveConsistency<ForwardRate,ConvexMonotone,IterativeBootstrap>(vars);
765765

766766
testBMACurveConsistency<ForwardRate,ConvexMonotone,
@@ -771,9 +771,8 @@ BOOST_AUTO_TEST_CASE(testLocalBootstrapConsistency) {
771771
BOOST_TEST_MESSAGE(
772772
"Testing consistency of local-bootstrap algorithm...");
773773

774-
CommonVars vars;
775-
testCurveConsistency<ForwardRate,ConvexMonotone,LocalBootstrap>(
776-
vars, ConvexMonotone(), 1.0e-6);
774+
CommonVars vars(Date(15, April, 2025));
775+
testCurveConsistency<ForwardRate, ConvexMonotone, LocalBootstrap>(vars, ConvexMonotone(), 1.0e-6);
777776
testBMACurveConsistency<ForwardRate,ConvexMonotone,LocalBootstrap>(
778777
vars, ConvexMonotone(), 1.0e-7);
779778
}

0 commit comments

Comments
 (0)