20#include <boost/test/unit_test.hpp>
21#include <boost/test/data/test_case.hpp>
24#include <oret/toplevelfixture.hpp>
25#include <ql/time/calendars/all.hpp>
45using namespace boost::unit_test_framework;
55 const char* calendarName;
60ostream&
operator<<(ostream& os,
const TestDatum& testDatum) {
61 return os <<
"[" << testDatum.calendarName <<
"," << testDatum.calendar.name() <<
"]";
64TestDatum calendarData[] = {{
"TGT", TARGET()},
69 {
"USD", UnitedStates(UnitedStates::Settlement)},
70 {
"GBP", UnitedKingdom()},
74 {
"ZAR", SouthAfrica()},
81 {
"CZK", CzechRepublic()},
89 {
"NZD", NewZealand()},
93 {
"SAR", SaudiArabia()},
95 {
"KRW", SouthKorea(SouthKorea::Settlement)},
110 {
"ZA", SouthAfrica()},
113 {
"XLON", UnitedKingdom(UnitedKingdom::Exchange)},
120 {
"ICE_FuturesUS",
ICE(ICE::FuturesUS)},
121 {
"ICE_FuturesUS_1",
ICE(ICE::FuturesUS_1)},
122 {
"ICE_FuturesUS_2",
ICE(ICE::FuturesUS_2)},
123 {
"ICE_FuturesEU",
ICE(ICE::FuturesEU)},
124 {
"ICE_FuturesEU_1",
ICE(ICE::FuturesEU_1)},
125 {
"ICE_EndexEnergy",
ICE(ICE::EndexEnergy)},
126 {
"ICE_EndexEquities",
ICE(ICE::EndexEquities)},
127 {
"ICE_SwapTradeUS",
ICE(ICE::SwapTradeUS)},
128 {
"ICE_SwapTradeUK",
ICE(ICE::SwapTradeUK)},
129 {
"ICE_FuturesSingapore",
ICE(ICE::FuturesSingapore)},
133 {
"US,TARGET", JointCalendar(UnitedStates(UnitedStates::Settlement), TARGET())},
134 {
"NYB,TGT", JointCalendar(UnitedStates(UnitedStates::Settlement), TARGET())},
135 {
"NYB,LNB", JointCalendar(UnitedStates(UnitedStates::Settlement), UnitedKingdom())},
137 {
"LNB,NYB,TGT", JointCalendar(UnitedKingdom(), UnitedStates(UnitedStates::Settlement), TARGET())},
138 {
"NYB,ZUB,LNB", JointCalendar(UnitedStates(UnitedStates::Settlement),
QuantExt::Switzerland(), UnitedKingdom())},
139 {
"NYB,TRB,LNB", JointCalendar(UnitedStates(UnitedStates::Settlement), Canada(), UnitedKingdom())},
140 {
"TKB,USD,LNB", JointCalendar(Japan(), UnitedStates(UnitedStates::Settlement), UnitedKingdom())},
141 {
"NYB,SYB", JointCalendar(UnitedStates(UnitedStates::Settlement), Australia())}};
145BOOST_FIXTURE_TEST_SUITE(OREDataTestSuite, ore::test::TopLevelFixture)
147BOOST_AUTO_TEST_SUITE(CalendarTests)
154 BOOST_CHECK_EQUAL(
calendar, calendarDatum.calendar);
156 BOOST_TEST_MESSAGE(
"Parsed " << calendarDatum.calendarName <<
" and got " <<
calendar.name());
159BOOST_AUTO_TEST_SUITE_END()
161BOOST_AUTO_TEST_SUITE_END()
Calendar parseCalendar(const string &s)
Convert text to QuantLib::Calendar.
std::ostream & operator<<(std::ostream &out, EquityReturnType t)
Map text representations to QuantLib/QuantExt types.
BOOST_DATA_TEST_CASE(testMartingaleProperty, bdata::make(driftFreeState) *bdata::make(steps), driftFreeState, steps)