Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Functions
check Namespace Reference

Functions

void checkDates (const Schedule &s, const std::vector< Date > &expected)
 
void checkDay (const Schedule &s, Weekday w)
 
void checkCalendars (const std::vector< Date > &expectedHolidays, const std::vector< Date > &testHolidays)
 

Function Documentation

◆ checkDates()

void checkDates ( const Schedule &  s,
const std::vector< Date > &  expected 
)

Definition at line 32 of file dategeneration.cpp.

33 {
34 BOOST_CHECK(s.size() == expected.size());
35 for (Size i=0; i<expected.size(); ++i) {
36 if (s[i] != expected[i]) {
37 BOOST_ERROR("expected " << expected[i]
38 << " at index " << i << ", "
39 "found " << s[i]);
40 }
41 }
42 }
+ Here is the caller graph for this function:

◆ checkDay()

void checkDay ( const Schedule &  s,
Weekday  w 
)

Definition at line 43 of file dategeneration.cpp.

44 {
45 //we check all but the first and last dates
46 for (Size i=1; i<s.size() - 1; ++i) {
47 if (s[i].weekday() != w) {
48 BOOST_ERROR("expected " << w
49 << " at index " << i << ", "
50 "found " << s[i].weekday());
51 }
52 }
53 }
+ Here is the caller graph for this function:

◆ checkCalendars()

void checkCalendars ( const std::vector< Date > &  expectedHolidays,
const std::vector< Date > &  testHolidays 
)

Definition at line 46 of file qle_calendars.cpp.

46 {
47
48 for (Size i = 0; i < expectedHolidays.size(); i++) {
49 if (testHolidays[i] != expectedHolidays[i])
50 BOOST_FAIL("expected holiday was " << expectedHolidays[i] << " while calculated holiday is "
51 << testHolidays[i]);
52 }
53}
+ Here is the caller graph for this function: