16 #define GETTEXT_DOMAIN "wesnoth-test"
19 #include <boost/test/unit_test.hpp>
33 BOOST_CHECK_EQUAL(BW_423.
get_year(), 423);
35 BOOST_CHECK_EQUAL(YW_123.
get_year(), 123);
37 BOOST_CHECK_EQUAL(BF_109.
get_year(), 109);
39 BOOST_CHECK_EQUAL(AF_928.
get_year(), 928);
43 irdya_date first(wesnoth_epoch::type::wesnoth, 12);
44 irdya_date second(wesnoth_epoch::type::wesnoth, 12);
45 BOOST_CHECK_EQUAL(first, second);
49 irdya_date BW_34(wesnoth_epoch::type::before_wesnoth, 34), BW_12(wesnoth_epoch::type::before_wesnoth, 12), YW_40(wesnoth_epoch::type::wesnoth, 40), YW_52(wesnoth_epoch::type::wesnoth, 52);
50 irdya_date BF_29(wesnoth_epoch::type::before_fall, 29), BF_42(wesnoth_epoch::type::before_fall, 42), AF_12(wesnoth_epoch::type::after_fall, 12), AF_102(wesnoth_epoch::type::after_fall, 102), Y0;
52 std::vector<std::pair<irdya_date, irdya_date>> test_cases {
96 for(
const auto& pair : test_cases) {
97 BOOST_CHECK(pair.first < pair.second);
98 BOOST_CHECK(!(pair.second < pair.first));
102 BOOST_AUTO_TEST_SUITE_END()
Calendar for handling and comparing dates using the common epoches of the storyline.
unsigned int get_year() const
static irdya_date read_date(const std::string &date)
wesnoth_epoch::type get_epoch() const
string_enums::enum_base< wesnoth_epoch_defines > wesnoth_epoch
The base template for associating string values with enum values.
static std::string get_string(enum_type key)
Converts a enum to its string equivalent.
BOOST_AUTO_TEST_SUITE(filesystem)
BOOST_AUTO_TEST_CASE(test_irdya_date_parse)
utils::irdya_date irdya_date